Reformat code
This commit is contained in:
parent
5b2b77efd3
commit
24527147b3
@ -44,5 +44,4 @@ urlpatterns = [
|
|||||||
path("demo/modal/", demo.DemoModal.as_view(), name="modal"),
|
path("demo/modal/", demo.DemoModal.as_view(), name="modal"),
|
||||||
path("demo/widget/", demo.DemoWidget.as_view(), name="widget"),
|
path("demo/widget/", demo.DemoWidget.as_view(), name="widget"),
|
||||||
path("demo/window/", demo.DemoWindow.as_view(), name="window"),
|
path("demo/window/", demo.DemoWindow.as_view(), name="window"),
|
||||||
|
|
||||||
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
var cellheight = grid.opts.cellHeight;
|
var cellheight = grid.opts.cellHeight;
|
||||||
var height = Math.ceil((scrollheight + verticalmargin) / (cellheight + verticalmargin));
|
var height = Math.ceil((scrollheight + verticalmargin) / (cellheight + verticalmargin));
|
||||||
var opts = {
|
var opts = {
|
||||||
h: height,
|
h: height,
|
||||||
}
|
}
|
||||||
grid.update(
|
grid.update(
|
||||||
added_widget,
|
added_widget,
|
||||||
|
@ -2,43 +2,43 @@
|
|||||||
|
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button
|
<button
|
||||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||||
hx-get="{% url 'modal' %}"
|
hx-get="{% url 'modal' %}"
|
||||||
hx-trigger="click"
|
hx-trigger="click"
|
||||||
hx-target="#modals-here"
|
hx-target="#modals-here"
|
||||||
class="button is-info">
|
class="button is-info">
|
||||||
<span class="icon-text">
|
<span class="icon-text">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<i class="fa-solid fa-list"></i>
|
<i class="fa-solid fa-list"></i>
|
||||||
|
</span>
|
||||||
|
<span>Open modal</span>
|
||||||
</span>
|
</span>
|
||||||
<span>Open modal</span>
|
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||||
hx-get="{% url 'widget' %}"
|
hx-get="{% url 'widget' %}"
|
||||||
hx-trigger="click"
|
hx-trigger="click"
|
||||||
hx-target="#widgets-here"
|
hx-target="#widgets-here"
|
||||||
class="button is-info">
|
class="button is-info">
|
||||||
<span class="icon-text">
|
<span class="icon-text">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<i class="fa-solid fa-list"></i>
|
<i class="fa-solid fa-list"></i>
|
||||||
|
</span>
|
||||||
|
<span>Open widget</span>
|
||||||
</span>
|
</span>
|
||||||
<span>Open widget</span>
|
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||||
hx-get="{% url 'window' %}"
|
hx-get="{% url 'window' %}"
|
||||||
hx-trigger="click"
|
hx-trigger="click"
|
||||||
hx-target="#items-here"
|
hx-target="#items-here"
|
||||||
hx-swap="afterend"
|
hx-swap="afterend"
|
||||||
class="button is-info">
|
class="button is-info">
|
||||||
<span class="icon-text">
|
<span class="icon-text">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<i class="fa-solid fa-list"></i>
|
<i class="fa-solid fa-list"></i>
|
||||||
|
</span>
|
||||||
|
<span>Open window</span>
|
||||||
</span>
|
</span>
|
||||||
<span>Open window</span>
|
|
||||||
</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
@ -1,6 +1,8 @@
|
|||||||
|
import uuid
|
||||||
|
|
||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
from django.views import View
|
from django.views import View
|
||||||
import uuid
|
|
||||||
|
|
||||||
class DemoModal(View):
|
class DemoModal(View):
|
||||||
template_name = "modals/modal.html"
|
template_name = "modals/modal.html"
|
||||||
@ -8,6 +10,7 @@ class DemoModal(View):
|
|||||||
def get(self, request):
|
def get(self, request):
|
||||||
return render(request, self.template_name)
|
return render(request, self.template_name)
|
||||||
|
|
||||||
|
|
||||||
class DemoWidget(View):
|
class DemoWidget(View):
|
||||||
template_name = "widgets/widget.html"
|
template_name = "widgets/widget.html"
|
||||||
|
|
||||||
@ -15,8 +18,9 @@ class DemoWidget(View):
|
|||||||
unique = str(uuid.uuid4())[:8]
|
unique = str(uuid.uuid4())[:8]
|
||||||
return render(request, self.template_name, {"unique": unique})
|
return render(request, self.template_name, {"unique": unique})
|
||||||
|
|
||||||
|
|
||||||
class DemoWindow(View):
|
class DemoWindow(View):
|
||||||
template_name = "windows/window.html"
|
template_name = "windows/window.html"
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
return render(request, self.template_name)
|
return render(request, self.template_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user