From 24527147b33ee9e5a45754cae050e5a2022a1b2d Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 12 Oct 2022 07:22:22 +0100 Subject: [PATCH] Reformat code --- app/urls.py | 1 - core/templates/index.html | 2 +- core/templates/window-content/main.html | 62 ++++++++++++------------- core/views/demo.py | 8 +++- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/app/urls.py b/app/urls.py index f9489ca..ec33900 100644 --- a/app/urls.py +++ b/app/urls.py @@ -44,5 +44,4 @@ urlpatterns = [ path("demo/modal/", demo.DemoModal.as_view(), name="modal"), path("demo/widget/", demo.DemoWidget.as_view(), name="widget"), path("demo/window/", demo.DemoWindow.as_view(), name="window"), - ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/core/templates/index.html b/core/templates/index.html index f73734c..2d0292c 100644 --- a/core/templates/index.html +++ b/core/templates/index.html @@ -68,7 +68,7 @@ var cellheight = grid.opts.cellHeight; var height = Math.ceil((scrollheight + verticalmargin) / (cellheight + verticalmargin)); var opts = { - h: height, + h: height, } grid.update( added_widget, diff --git a/core/templates/window-content/main.html b/core/templates/window-content/main.html index 785fd88..84b385e 100644 --- a/core/templates/window-content/main.html +++ b/core/templates/window-content/main.html @@ -2,43 +2,43 @@
\ No newline at end of file diff --git a/core/views/demo.py b/core/views/demo.py index 5547e0f..cb51657 100644 --- a/core/views/demo.py +++ b/core/views/demo.py @@ -1,6 +1,8 @@ +import uuid + from django.shortcuts import render from django.views import View -import uuid + class DemoModal(View): template_name = "modals/modal.html" @@ -8,6 +10,7 @@ class DemoModal(View): def get(self, request): return render(request, self.template_name) + class DemoWidget(View): template_name = "widgets/widget.html" @@ -15,8 +18,9 @@ class DemoWidget(View): unique = str(uuid.uuid4())[:8] return render(request, self.template_name, {"unique": unique}) + class DemoWindow(View): template_name = "windows/window.html" def get(self, request): - return render(request, self.template_name) \ No newline at end of file + return render(request, self.template_name)