From 97d12b0fab0de4ffa147028347f192aef68a29a9 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 16 Oct 2022 14:14:53 +0100 Subject: [PATCH] Make hooks/callbacks inherit type --- app/urls.py | 14 +++++--- core/templates/base.html | 2 +- core/templates/modals/add-hook.html | 32 ------------------ core/templates/partials/close-modal.html | 1 + core/templates/partials/close-widget.html | 3 ++ core/templates/partials/close-window.html | 3 ++ core/templates/partials/hook-list.html | 37 +++++++++++++++------ core/templates/window-content/add-hook.html | 31 +++++++++++++++++ core/templates/window-content/hooks.html | 2 +- core/templates/window-content/main.html | 2 +- core/templates/wm/modal.html | 2 +- core/templates/wm/panel.html | 4 +-- core/templates/wm/widget.html | 4 +-- core/views/hooks.py | 29 ++++++++++++---- 14 files changed, 102 insertions(+), 64 deletions(-) delete mode 100644 core/templates/modals/add-hook.html create mode 100644 core/templates/partials/close-modal.html create mode 100644 core/templates/partials/close-widget.html create mode 100644 core/templates/partials/close-window.html create mode 100644 core/templates/window-content/add-hook.html diff --git a/app/urls.py b/app/urls.py index fcca426..583eb68 100644 --- a/app/urls.py +++ b/app/urls.py @@ -47,13 +47,19 @@ urlpatterns = [ path("accounts/", include("django.contrib.auth.urls")), path("accounts/signup/", base.Signup.as_view(), name="signup"), path("hooks//", hooks.Hooks.as_view(), name="hooks"), - path("hooks/modal/add/", hooks.HookAction.as_view(), name="hook_action"), - path("hooks/modal/add//", hooks.HookAction.as_view(), name="hook_action"), + path("hooks//add/", hooks.HookAction.as_view(), name="hook_action"), path( - "hooks/page/del//", hooks.HookAction.as_view(), name="hook_action" + "hooks//add//", + hooks.HookAction.as_view(), + name="hook_action", ), path( - "hooks/modal/edit//", + "hooks//del//", + hooks.HookAction.as_view(), + name="hook_action", + ), + path( + "hooks//edit//", hooks.HookAction.as_view(), name="hook_action", ), diff --git a/core/templates/base.html b/core/templates/base.html index 8a9e106..086dc68 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -297,7 +297,7 @@ {% endblock %}
-
+
diff --git a/core/templates/modals/add-hook.html b/core/templates/modals/add-hook.html deleted file mode 100644 index ee86ad6..0000000 --- a/core/templates/modals/add-hook.html +++ /dev/null @@ -1,32 +0,0 @@ -{% extends 'wm/modal.html' %} -{% load crispy_forms_tags %} - -{% load crispy_forms_bulma_field %} -{% block modal_content %} -
- {% csrf_token %} - {{ form|crispy }} - - -
-{% endblock %} - - - - - - - - diff --git a/core/templates/partials/close-modal.html b/core/templates/partials/close-modal.html new file mode 100644 index 0000000..6c0173c --- /dev/null +++ b/core/templates/partials/close-modal.html @@ -0,0 +1 @@ + diff --git a/core/templates/partials/close-widget.html b/core/templates/partials/close-widget.html new file mode 100644 index 0000000..650b481 --- /dev/null +++ b/core/templates/partials/close-widget.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/core/templates/partials/close-window.html b/core/templates/partials/close-window.html new file mode 100644 index 0000000..f15a41c --- /dev/null +++ b/core/templates/partials/close-window.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/core/templates/partials/hook-list.html b/core/templates/partials/hook-list.html index 14f6f9c..6b32ab5 100644 --- a/core/templates/partials/hook-list.html +++ b/core/templates/partials/hook-list.html @@ -20,9 +20,9 @@
- - + + + {% else %} + + {% endif %}
diff --git a/core/templates/window-content/add-hook.html b/core/templates/window-content/add-hook.html new file mode 100644 index 0000000..290c0b3 --- /dev/null +++ b/core/templates/window-content/add-hook.html @@ -0,0 +1,31 @@ +{% include 'partials/notify.html' %} + +{% load crispy_forms_tags %} + +{% load crispy_forms_bulma_field %} +
+ {% csrf_token %} + {{ form|crispy }} + + +
+ + + + + + + + diff --git a/core/templates/window-content/hooks.html b/core/templates/window-content/hooks.html index f3332c0..ce0dbce 100644 --- a/core/templates/window-content/hooks.html +++ b/core/templates/window-content/hooks.html @@ -1,7 +1,7 @@
+ {% include 'partials/close-modal.html' %}
\ No newline at end of file diff --git a/core/templates/wm/panel.html b/core/templates/wm/panel.html index e57d573..b180b38 100644 --- a/core/templates/wm/panel.html +++ b/core/templates/wm/panel.html @@ -3,9 +3,7 @@

{% block close_button %} - + {% include 'partials/close-window.html' %} {% endblock %} {% block heading %} {% endblock %} diff --git a/core/templates/wm/widget.html b/core/templates/wm/widget.html index d2c8579..9ef8154 100644 --- a/core/templates/wm/widget.html +++ b/core/templates/wm/widget.html @@ -6,9 +6,7 @@

{% block close_button %} - + {% include 'partials/close-widget.html' %} {% endblock %}