django-spire 0.16.9__py3-none-any.whl → 0.16.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. django_spire/ai/chat/templates/django_spire/ai/chat/dropdown/ellipsis_dropdown.html +2 -2
  2. django_spire/ai/chat/templates/django_spire/ai/chat/widget/search_chat_widget.html +1 -1
  3. django_spire/auth/group/templates/django_spire/auth/group/element/group_perm_element.html +50 -32
  4. django_spire/auth/group/templates/django_spire/auth/group/element/group_special_role_element.html +51 -34
  5. django_spire/auth/templates/django_spire/auth/page/login_page.html +8 -9
  6. django_spire/auth/templates/django_spire/auth/page/logout_page.html +1 -1
  7. django_spire/auth/templates/django_spire/auth/page/password_set_form_page.html +1 -1
  8. django_spire/comment/templates/django_spire/comment/element/comment_button_element.html +4 -4
  9. django_spire/comment/templates/django_spire/comment/element/comment_textarea_element.html +1 -1
  10. django_spire/comment/templates/django_spire/comment/widget/tagging_widget.html +1 -1
  11. django_spire/consts.py +1 -1
  12. django_spire/contrib/form/templates/django_spire/contrib/form/button/form_submit_button.html +1 -1
  13. django_spire/contrib/help/templates/django_spire/contrib/help/help_modal.html +2 -2
  14. django_spire/core/context_processors.py +0 -3
  15. django_spire/core/management/commands/spire_startapp_pkg/maps.py +18 -11
  16. django_spire/core/management/commands/spire_startapp_pkg/template/templates/card/spirechildapp_detail_card.html +6 -6
  17. django_spire/core/management/commands/spire_startapp_pkg/template/templates/card/spirechildapp_form_card.html +2 -2
  18. django_spire/core/management/commands/spire_startapp_pkg/template/templates/card/spirechildapp_list_card.html +5 -5
  19. django_spire/core/management/commands/spire_startapp_pkg/template/templates/item/spirechildapp_item.html +9 -9
  20. django_spire/core/management/commands/spire_startapp_pkg/template/templates/page/spirechildapp_detail_page.html +2 -2
  21. django_spire/core/static/django_spire/css/app-default.css +1 -0
  22. django_spire/core/static/django_spire/css/bootstrap-extension.css +15 -0
  23. django_spire/core/templates/django_spire/badge/accent_badge.html +1 -1
  24. django_spire/core/templates/django_spire/badge/primary_badge.html +1 -1
  25. django_spire/core/templates/django_spire/badge/secondary_badge.html +1 -1
  26. django_spire/core/templates/django_spire/badge/warning_badge.html +1 -1
  27. django_spire/core/templates/django_spire/card/delete_confirmation_form_card.html +1 -1
  28. django_spire/core/templates/django_spire/card/infinite_scroll_card.html +1 -1
  29. django_spire/core/templates/django_spire/card/title_card.html +1 -2
  30. django_spire/core/templates/django_spire/dropdown/dropdown.html +1 -1
  31. django_spire/core/templates/django_spire/dropdown/element/dropdown_link_element.html +16 -16
  32. django_spire/core/templates/django_spire/dropdown/element/ellipsis_dropdown_modal_link_element.html +11 -8
  33. django_spire/core/templates/django_spire/filtering/form/base_session_filter_form.html +2 -2
  34. django_spire/core/templates/django_spire/modal/content/dispatch_modal_delete_confirmation_content.html +1 -1
  35. django_spire/core/templates/django_spire/modal/content/modal_title_content.html +1 -1
  36. django_spire/core/templates/django_spire/modal/modal.html +1 -1
  37. django_spire/core/templates/django_spire/navigation/accordion/nav_accordion.html +0 -1
  38. django_spire/core/templates/django_spire/navigation/top_navigation.html +13 -0
  39. django_spire/core/templates/django_spire/page/center_card_page.html +1 -1
  40. django_spire/core/templates/django_spire/wizard/wizard.html +4 -4
  41. django_spire/help_desk/apps.py +8 -0
  42. django_spire/help_desk/auth/__init__.py +0 -0
  43. django_spire/help_desk/auth/controller.py +15 -0
  44. django_spire/help_desk/templates/django_spire/help_desk/card/ticket_detail_card.html +3 -9
  45. django_spire/help_desk/templates/django_spire/help_desk/card/ticket_list_card.html +9 -10
  46. django_spire/help_desk/templates/django_spire/help_desk/element/icon.html +3 -0
  47. django_spire/help_desk/templates/django_spire/help_desk/form/ticket_form.html +1 -1
  48. django_spire/help_desk/templates/django_spire/help_desk/item/ticket_item.html +33 -32
  49. django_spire/help_desk/views/form_views.py +3 -3
  50. django_spire/help_desk/views/page_views.py +4 -5
  51. django_spire/knowledge/entry/views/json_views.py +1 -1
  52. django_spire/knowledge/templates/django_spire/knowledge/collection/card/context_menu_card.html +5 -5
  53. django_spire/knowledge/templates/django_spire/knowledge/entry/card/context_menu_card.html +5 -5
  54. django_spire/knowledge/templates/django_spire/knowledge/entry/version/block/dropdown/add_dropdown.html +1 -0
  55. django_spire/notification/app/templates/django_spire/notification/app/dropdown/notification_dropdown.html +1 -1
  56. django_spire/notification/app/templates/django_spire/notification/app/dropdown/notification_dropdown_content.html +6 -3
  57. django_spire/settings.py +1 -0
  58. django_spire/theme/templates/django_spire/theme/card/colors_preview_card.html +9 -9
  59. django_spire/theme/templates/django_spire/theme/card/example_preview_card.html +2 -2
  60. django_spire/theme/templates/django_spire/theme/card/preview_card.html +6 -6
  61. django_spire/theme/templates/django_spire/theme/example/item/example_item.html +2 -2
  62. django_spire/theme/templates/django_spire/theme/section/badge_section.html +4 -4
  63. django_spire/theme/templates/django_spire/theme/section/color_section.html +32 -32
  64. {django_spire-0.16.9.dist-info → django_spire-0.16.11.dist-info}/METADATA +1 -1
  65. {django_spire-0.16.9.dist-info → django_spire-0.16.11.dist-info}/RECORD +68 -65
  66. {django_spire-0.16.9.dist-info → django_spire-0.16.11.dist-info}/WHEEL +0 -0
  67. {django_spire-0.16.9.dist-info → django_spire-0.16.11.dist-info}/licenses/LICENSE.md +0 -0
  68. {django_spire-0.16.9.dist-info → django_spire-0.16.11.dist-info}/top_level.txt +0 -0
@@ -1,17 +1,17 @@
1
- <a
2
- class="fs--1 p-0 cursor-pointer text-decoration-none border-bottom text-app-default-text-color"
3
- {% if link_url %}href="{{ link_url }}"{% endif %}
4
- {% if x_link_url %}
5
- x-show="{{ x_link_url }} ? true : false"
6
- :href="{{ x_link_url }}"
7
- {% endif %}
8
- @click="() => {
9
- toggle_dropdown()
10
- {% if x_click %}{{ x_click }}{% endif %}
11
- }"
12
- >
13
- {# Background colours must be applied outside 'a' tag #}
14
- <div class="bg-app-layer-one bg-app-layer-three-hover">
1
+ {# Background colours must be applied outside 'a' tag #}
2
+ <div class="bg-app-layer-one bg-app-layer-three-hover dropdown-item">
3
+ <a
4
+ class="fs--1 p-0 cursor-pointer text-decoration-none text-app-default-text-color"
5
+ {% if link_url %}href="{{ link_url }}"{% endif %}
6
+ {% if x_link_url %}
7
+ x-show="{{ x_link_url }} ? true : false"
8
+ :href="{{ x_link_url }}"
9
+ {% endif %}
10
+ @click="() => {
11
+ toggle_dropdown()
12
+ {% if x_click %}{{ x_click }}{% endif %}
13
+ }"
14
+ >
15
15
  {% block link_content %}
16
16
  <div class="px-3 py-1 text-nowrap {{ link_css }}">
17
17
  {% if link_text %}
@@ -21,5 +21,5 @@
21
21
  {% endif %}
22
22
  </div>
23
23
  {% endblock %}
24
- </div>
25
- </a>
24
+ </a>
25
+ </div>
@@ -1,8 +1,11 @@
1
- <a
2
- @click="dispatch_modal_view('{{ view_url }}'); toggle_dropdown();"
3
- class="border-bottom fs--1 p-0 cursor-pointer text-decoration-none border-bottom bg-app-layer-one bg-app-layer-three-hover text-app-default-text-color"
4
- >
5
- <div class="px-3 py-1 text-nowrap {{ link_css }}">
6
- {{ link_text }}
7
- </div>
8
- </a>
1
+ {# Background colours must be applied outside 'a' tag #}
2
+ <div class="bg-app-layer-one bg-app-layer-three-hover dropdown-item">
3
+ <a
4
+ @click="dispatch_modal_view('{{ view_url }}'); toggle_dropdown();"
5
+ class="border-bottom fs--1 p-0 cursor-pointer text-decoration-none text-app-default-text-color"
6
+ >
7
+ <div class="px-3 py-1 text-nowrap {{ link_css }}">
8
+ {{ link_text }}
9
+ </div>
10
+ </a>
11
+ </div>
@@ -14,14 +14,14 @@
14
14
  type="submit"
15
15
  name="action"
16
16
  value="Filter"
17
- class="btn btn-sm btn-primary float-end"
17
+ class="btn btn-sm btn-app-primary float-end"
18
18
  >
19
19
 
20
20
  <input
21
21
  type="submit"
22
22
  name="action"
23
23
  value="Clear"
24
- class="btn btn-sm btn-secondary me-2 float-end"
24
+ class="btn btn-sm btn-app-secondary me-2 float-end"
25
25
  >
26
26
  </div>
27
27
  {% endblock %}
@@ -21,7 +21,7 @@
21
21
  {% include 'django_glue/form/field/input_field.html' with glue_field='should_delete' %}
22
22
 
23
23
  <div class="d-flex mt-3">
24
- {% include 'django_spire/contrib/form/button/form_submit_button.html' with button_text='Delete' button_class='btn-danger btn-sm shadow-sm' %}
24
+ {% include 'django_spire/contrib/form/button/form_submit_button.html' with button_text='Delete' button_class='btn-app-danger btn-sm shadow-sm' %}
25
25
  <span class="ms-2" @click="close_modal()" >
26
26
  {% include 'django_spire/button/secondary_button.html' with button_text='Cancel' %}
27
27
  </span>
@@ -1,6 +1,6 @@
1
1
  <div class="row justify-content-between align-items-center border-bottom-secondary mb-2 pb-2">
2
2
  <div class="col-auto">
3
- <div class="text-uppercase text-black">
3
+ <div class="text-uppercase">
4
4
  {% block modal_content_title %}
5
5
  {% endblock %}
6
6
  </div>
@@ -54,7 +54,7 @@
54
54
  <div
55
55
  class="bg-app-layer-one card shadow-lg p-3 {% block modal_content_class %}{% endblock %}"
56
56
  {% block modal_content_attributes %}{% endblock %}
57
- @click.outside="close_modal()"
57
+ @mousedown.outside="close_modal()"
58
58
  >
59
59
  {% block modal_content %}
60
60
  {% endblock %}
@@ -3,7 +3,6 @@
3
3
  {% block accordion_toggle %}
4
4
  <div
5
5
  class="d-flex justify-content-center align-items-baseline cursor-pointer text-app-link-side-navigation mb-1 ps-1 pe-0"
6
- :class="{'text-app-primary': show_accordion, 'text-white': !show_accordion}"
7
6
  style="width: 150px"
8
7
  >
9
8
  <i class="fs-6 me-2 {% block nav_icon %}{% endblock %}"></i>
@@ -24,12 +24,25 @@
24
24
 
25
25
  <div class="col-auto d-flex">
26
26
  {% block top_navigation_icons %}
27
+ {% if AuthController.help_desk.can_view %}
28
+ {% block help_desk_icon %}
29
+ {% include 'django_spire/help_desk/element/icon.html' %}
30
+ {% endblock %}
31
+ {% endif %}
32
+
33
+
27
34
  {% block theme_selector %}
28
35
  <div>
29
36
  {% include 'django_spire/theme/element/theme_selector.html' with icon_size='fs-2' %}
30
37
  </div>
31
38
  {% endblock %}
32
39
 
40
+ {% block notification_icon %}
41
+ <div>
42
+ {% include 'django_spire/notification/app/element/notification_bell.html' %}
43
+ </div>
44
+ {% endblock %}
45
+
33
46
  <div class="dropdown">
34
47
  <i
35
48
  class="bi bi-person-circle fs-2 mx-2 cursor-pointer"
@@ -6,7 +6,7 @@
6
6
  <div class="rounded-3 p-3">
7
7
  <div class="row ps-3 mt-5">
8
8
  <div class="col-10 col-md-8 col-lg-6 col-xl-4 mx-auto">
9
- <div class="card bg-dark p-5 shadow-lg">
9
+ <div class="card p-5 shadow-lg">
10
10
  <div class="text-center mb-4">
11
11
  <img height="50px" src="{% static '' %}" alt="">
12
12
  </div>
@@ -30,7 +30,7 @@
30
30
  {% block wizard_pagination %}
31
31
  <div class="wizard-footer d-flex justify-content-between align-items-center pt-4">
32
32
  {% block wizard_back_button %}
33
- <button type="button" class="btn btn-secondary" @click="previous_page()" :disabled="current_page === 1">
33
+ <button type="button" class="btn btn-app-secondary" @click="previous_page()" :disabled="current_page === 1">
34
34
  Back
35
35
  </button>
36
36
  {% endblock %}
@@ -43,13 +43,13 @@
43
43
 
44
44
  {% block wizard_next_button %}
45
45
  <template x-if="current_page < total_pages">
46
- <button type="button" class="btn btn-primary" @click="next_page()">Next</button>
46
+ <button type="button" class="btn btn-app-primary" @click="next_page()">Next</button>
47
47
  </template>
48
48
  {% endblock %}
49
49
 
50
50
  {% block wizard_submit_button %}
51
51
  <template x-if="current_page === total_pages">
52
- <button type="button" class="btn btn-success">Submit</button>
52
+ <button type="button" class="btn btn-app-success">Submit</button>
53
53
  </template>
54
54
  {% endblock %}
55
55
  </div>
@@ -57,7 +57,7 @@
57
57
  {% block wizard_progress_bar %}
58
58
  <div class="progress my-2" style="height: 5px;">
59
59
  <div
60
- class="progress-bar"
60
+ class="progress-bar bg-app-primary"
61
61
  :style="{ width: (current_page / total_pages * 100) + '%' }"
62
62
  ></div>
63
63
  </div>
@@ -7,6 +7,14 @@ class HelpDeskConfig(AppConfig):
7
7
  default_auto_field = 'django.db.models.BigAutoField'
8
8
  label = 'django_spire_help_desk'
9
9
  name = 'django_spire.help_desk'
10
+ MODEL_PERMISSIONS = (
11
+ {
12
+ 'name': 'help_desk',
13
+ 'verbose_name': 'Help Desk',
14
+ 'model_class_path': 'django_spire.help_desk.models.HelpDeskTicket',
15
+ 'is_proxy_model': False,
16
+ },
17
+ )
10
18
 
11
19
  REQUIRED_APPS = ('django_spire_core',)
12
20
  URLPATTERNS_INCLUDE = 'django_spire.help_desk.urls'
File without changes
@@ -0,0 +1,15 @@
1
+ from django_spire.auth.controller.controller import BaseAuthController
2
+
3
+
4
+ class BaseHelpDeskAuthController(BaseAuthController):
5
+ def can_add(self):
6
+ return self.request.user.has_perm('django_spire_help_desk.add_helpdeskticket')
7
+
8
+ def can_change(self):
9
+ return self.request.user.has_perm('django_spire_help_desk.change_helpdeskticket')
10
+
11
+ def can_delete(self):
12
+ return self.request.user.has_perm('django_spire_help_desk.delete_helpdeskticket')
13
+
14
+ def can_view(self):
15
+ return self.request.user.has_perm('django_spire_help_desk.view_helpdeskticket')
@@ -7,15 +7,9 @@
7
7
  {% endblock %}
8
8
 
9
9
  {% block card_button %}
10
- {% if perms.django_spire_help_desk.change_helpdeskticket %}
11
- <div class="pe-3">
12
- {% url 'django_spire:help_desk:form:update' pk=ticket.pk as edit_url %}
13
- {% include 'django_spire/button/primary_button.html' with button_text='Edit' button_href=edit_url button_icon='bi bi-pencil' %}
14
- </div>
15
- {% endif %}
16
- {% if perms.django_spire_help_desk.delete_helpdeskticket %}
17
- {% url 'django_spire:help_desk:page:delete' pk=ticket.pk as delete_url %}
18
- {% include 'django_spire/button/danger_button.html' with button_text='Delete' button_href=delete_url button_icon='bi bi-trash' %}
10
+ {% if AuthController.help_desk.can_change %}
11
+ {% url 'django_spire:help_desk:form:update' pk=ticket.pk as edit_url %}
12
+ {% include 'django_spire/button/primary_button.html' with button_text='Edit' button_href=edit_url button_icon='bi bi-pencil' %}
19
13
  {% endif %}
20
14
  {% endblock %}
21
15
 
@@ -3,17 +3,16 @@
3
3
  {% block card_title_content_style %}{% endblock %}
4
4
 
5
5
  {% block card_title %}
6
- <div class="row justify-content-between">
7
- <div class="col text-start">
8
- Tickets
6
+ Tickets
7
+ {% endblock %}
8
+
9
+ {% block card_button %}
10
+ {% if AuthController.help_desk.can_add %}
11
+ <div class="col text-end mb-1">
12
+ {% url 'django_spire:help_desk:form:create' as create_url %}
13
+ {% include 'django_spire/button/primary_button.html' with button_text='Add' button_href=create_url button_icon="bi bi-plus" %}
9
14
  </div>
10
- {% if perms.django_spire_help_desk.add_helpdeskticket %}
11
- <div class="col text-end mb-1">
12
- {% url 'django_spire:help_desk:form:create' as create_url %}
13
- {% include 'django_spire/button/primary_button.html' with button_text='Add' button_href=create_url button_icon="bi bi-plus" %}
14
- </div>
15
- {% endif %}
16
- </div>
15
+ {% endif %}
17
16
  {% endblock %}
18
17
 
19
18
  {% block card_title_content %}
@@ -0,0 +1,3 @@
1
+ <a href="{% url 'django_spire:help_desk:page:list' %}">
2
+ <i class="bi bi-headset fs-2 mx-2 text-app-default-text-color"></i>
3
+ </a>
@@ -25,7 +25,7 @@
25
25
  <div class="col-12 mb-1 mt-3">
26
26
  {% include 'django_glue/form/field/text_field.html' with glue_model_field='ticket.description' %}
27
27
  </div>
28
- <div class="text-end my-2">
28
+ <div class="my-2">
29
29
  {% include 'django_spire/contrib/form/button/form_submit_button.html' %}
30
30
  </div>
31
31
  </form>
@@ -1,37 +1,38 @@
1
1
  {% extends 'django_spire/item/item.html' %}
2
2
 
3
- {% block item_title_col %}d-none{% endblock %}
3
+ {% block item_title_col %}{% endblock %}
4
4
 
5
5
  {% block item_row_content %}
6
- <a class="col-12 col-sm-4 mb-2 mb-sm-0" href="{% url 'django_spire:help_desk:page:detail' pk=ticket.pk %}">
7
- {% include 'django_spire/element/attribute_element.html' with attribute_title=ticket attribute_value=ticket.description|truncatechars:50 %}
8
- </a>
9
- <div class="col-6 col-sm-2 mb-2 mb-sm-0 text-start">
10
- {% include 'django_spire/element/attribute_element.html' with attribute_value=ticket.created_by.get_full_name attribute_title='Created By' %}
11
- </div>
12
- <div class="col-6 col-sm-2 mb-2 mb-sm-0 text-start">
13
- {% include 'django_spire/element/attribute_element.html' with attribute_value=ticket.created_datetime|date:'M d, Y' attribute_title='Created At' %}
14
- </div>
15
- <div class="col">
16
- {% include 'django_spire/element/attribute_element.html' with attribute_title='Purpose' %}
17
- {% include 'django_spire/help_desk/element/ticket_purpose_badge.html' %}
18
- </div>
19
- <div class="col">
20
- {% include 'django_spire/element/attribute_element.html' with attribute_title='Priority' %}
21
- {% include 'django_spire/help_desk/element/ticket_priority_badge.html' %}
22
- </div>
23
- <div class="col">
24
- {% include 'django_spire/element/attribute_element.html' with attribute_title='Status' %}
25
- {% include 'django_spire/help_desk/element/ticket_status_badge.html' %}
26
- </div>
27
- <div class="col-6 col-sm-1 text-end">
28
- {% url 'django_spire:help_desk:page:detail' pk=ticket.pk as detail_url %}
29
- {% if perms.django_spire_help_desk.change_helpdeskticket %}
30
- {% url 'django_spire:help_desk:form:update' pk=ticket.pk as update_url %}
31
- {% endif %}
32
- {% if perms.django_spire_help_desk.delete_helpdeskticket %}
33
- {% url 'django_spire:help_desk:page:delete' pk=ticket.pk as delete_url %}
34
- {% endif %}
35
- {% include 'django_spire/dropdown/ellipsis_dropdown.html' with view_url=detail_url edit_url=update_url delete_url=delete_url %}
36
- </div>
6
+ <a class="col-12 col-sm-4 mb-2 mb-sm-0" href="{% url 'django_spire:help_desk:page:detail' pk=ticket.pk %}">
7
+ {% include 'django_spire/element/attribute_element.html' with attribute_value=ticket.description|truncatechars:50 %}
8
+ </a>
9
+ <div class="col-6 col-sm-2 mb-2 mb-sm-0 text-start">
10
+ {% include 'django_spire/element/attribute_element.html' with attribute_value=ticket.created_by.get_full_name attribute_title='Created By' %}
11
+ </div>
12
+ <div class="col-6 col-sm-2 mb-2 mb-sm-0 text-start">
13
+ {% include 'django_spire/element/attribute_element.html' with attribute_value=ticket.created_datetime|date:'M d, Y' attribute_title='Created At' %}
14
+ </div>
15
+ <div class="col">
16
+ {% include 'django_spire/element/attribute_element.html' with attribute_title='Purpose' %}
17
+ {% include 'django_spire/help_desk/element/ticket_purpose_badge.html' %}
18
+ </div>
19
+ <div class="col">
20
+ {% include 'django_spire/element/attribute_element.html' with attribute_title='Priority' %}
21
+ {% include 'django_spire/help_desk/element/ticket_priority_badge.html' %}
22
+ </div>
23
+ <div class="col">
24
+ {% include 'django_spire/element/attribute_element.html' with attribute_title='Status' %}
25
+ {% include 'django_spire/help_desk/element/ticket_status_badge.html' %}
26
+ </div>
27
+ {% endblock %}
28
+
29
+ {% block item_button %}
30
+ {% url 'django_spire:help_desk:page:detail' pk=ticket.pk as detail_url %}
31
+ {% if AuthController.help_desk.can_change %}
32
+ {% url 'django_spire:help_desk:form:update' pk=ticket.pk as update_url %}
33
+ {% endif %}
34
+ {% if AuthController.help_desk.can_delete %}
35
+ {% url 'django_spire:help_desk:page:delete' pk=ticket.pk as delete_url %}
36
+ {% endif %}
37
+ {% include 'django_spire/dropdown/ellipsis_dropdown.html' with view_url=detail_url edit_url=update_url delete_url=delete_url %}
37
38
  {% endblock %}
@@ -2,14 +2,14 @@ import django_glue as dg
2
2
  from django.shortcuts import redirect, get_object_or_404
3
3
  from django.urls import reverse
4
4
 
5
- from django_spire.auth.permissions.decorators import permission_required
5
+ from django_spire.auth.controller.controller import AppAuthController
6
6
  from django_spire.contrib.form.utils import show_form_errors
7
7
  from django_spire.contrib.generic_views import portal_views
8
8
  from django_spire.help_desk import forms
9
9
  from django_spire.help_desk.models import HelpDeskTicket
10
10
 
11
11
 
12
- @permission_required('django_spire_help_desk.add_helpdeskticket')
12
+ @AppAuthController('help_desk').permission_required('can_add')
13
13
  def ticket_create_form_view(request):
14
14
  ticket = HelpDeskTicket()
15
15
 
@@ -42,7 +42,7 @@ def ticket_create_form_view(request):
42
42
  )
43
43
 
44
44
 
45
- @permission_required('django_spire_help_desk.change_helpdeskticket')
45
+ @AppAuthController('help_desk').permission_required('can_change')
46
46
  def ticket_update_form_view(request, pk: int):
47
47
  ticket = get_object_or_404(HelpDeskTicket, pk=pk)
48
48
 
@@ -1,13 +1,12 @@
1
- from django.contrib.auth.decorators import login_required
2
1
  from django.shortcuts import get_object_or_404
3
2
  from django.urls import reverse
4
3
 
5
- from django_spire.auth.permissions.decorators import permission_required
4
+ from django_spire.auth.controller.controller import AppAuthController
6
5
  from django_spire.contrib.generic_views import portal_views
7
6
  from django_spire.help_desk.models import HelpDeskTicket
8
7
 
9
8
 
10
- @permission_required('django_spire_help_desk.delete_helpdeskticket')
9
+ @AppAuthController('help_desk').permission_required('can_delete')
11
10
  def ticket_delete_view(request, pk):
12
11
  ticket = get_object_or_404(HelpDeskTicket, pk=pk)
13
12
 
@@ -21,7 +20,7 @@ def ticket_delete_view(request, pk):
21
20
  )
22
21
 
23
22
 
24
- @login_required()
23
+ @AppAuthController('help_desk').permission_required('can_view')
25
24
  def ticket_detail_view(request, pk):
26
25
  ticket = get_object_or_404(HelpDeskTicket, pk=pk)
27
26
 
@@ -35,7 +34,7 @@ def ticket_detail_view(request, pk):
35
34
  )
36
35
 
37
36
 
38
- @login_required()
37
+ @AppAuthController('help_desk').permission_required('can_view')
39
38
  def ticket_list_view(request):
40
39
  tickets = HelpDeskTicket.objects.order_by('-created_datetime').active()
41
40
 
@@ -41,7 +41,7 @@ def reorder_view(request: WSGIRequest) -> JsonResponse:
41
41
  destination_objects=(
42
42
  collection.entries
43
43
  .has_current_version()
44
- .request_user_has_access(user=request.user)
44
+ .user_has_access(user=request.user)
45
45
  .active()
46
46
  ),
47
47
  position=order,
@@ -7,23 +7,23 @@
7
7
  top: y + 'px',
8
8
  left: x + 'px',
9
9
  }"
10
- class="position-fixed card shadow-lg z-3 vstack cursor-pointer bg-app-layer-one"
10
+ class="position-fixed card shadow-lg z-3 vstack cursor-pointer bg-app-layer-one border"
11
11
  @click.away="hide_menu()"
12
12
  >
13
13
  <span class="px-2 py-1" x-text="title"></span>
14
14
 
15
15
  {% if AuthController.knowledge.can_change %}
16
- <span class="border-top bg-app-layer-one-hover px-3 text-app-default-link-color" @click="edit_collection()">
16
+ <span class="border-top bg-app-layer-three-hover px-3 text-app-default-link-color dropdown-item" @click="edit_collection()">
17
17
  <i class="bi bi-pencil pe-1"></i>
18
18
  Edit Collection
19
19
  </span>
20
20
  {% endif %}
21
21
  {% if AuthController.knowledge.can_add %}
22
- <span class="border-top bg-app-layer-one-hover px-3 text-app-default-link-color" @click="add_entry()">
22
+ <span class="bg-app-layer-three-hover px-3 text-app-default-link-color dropdown-item" @click="add_entry()">
23
23
  <i class="bi bi-plus pe-1"></i>
24
24
  Add Entry
25
25
  </span>
26
- <span class="border-top bg-app-layer-one-hover px-3 text-app-default-link-color" @click="import_entry()">
26
+ <span class="bg-app-layer-three-hover px-3 text-app-default-link-color dropdown-item" @click="import_entry()">
27
27
  <i class="bi bi-upload pe-1">
28
28
  </i>
29
29
  Import Entry
@@ -31,7 +31,7 @@
31
31
  {% endif %}
32
32
 
33
33
  {% if AuthController.knowledge.can_delete %}
34
- <span class="border-top bg-app-layer-one-hover px-3 text-app-danger" @click="delete_collection()">
34
+ <span class="bg-app-layer-three-hover px-3 text-app-danger dropdown-item" @click="delete_collection()">
35
35
  <i class="bi bi-trash3 pe-1"></i>
36
36
  <span>Delete Collection</span>
37
37
  </span>
@@ -7,31 +7,31 @@
7
7
  top: y + 'px',
8
8
  left: x + 'px',
9
9
  }"
10
- class="position-fixed card shadow-lg z-3 vstack cursor-pointer bg-app-layer-one"
10
+ class="position-fixed card shadow-lg z-3 vstack cursor-pointer bg-app-layer-one border"
11
11
  @click.away="hide_menu()"
12
12
  >
13
13
  <span class="px-2 py-1" x-text="title"></span>
14
14
 
15
15
  {% if AuthController.knowledge.can_view %}
16
- <span class="border-top bg-app-layer-three-hover px-3 text-app-default-link-color" @click="view_entry()">
16
+ <span class="border-top bg-app-layer-three-hover px-3 text-app-default-link-color dropdown-item" @click="view_entry()">
17
17
  <i class="bi bi-eye pe-1"></i>
18
18
  <span>View</span>
19
19
  </span>
20
20
  {% endif %}
21
21
 
22
22
  {% if AuthController.knowledge.can_change %}
23
- <span class="border-top bg-app-layer-three-hover px-3 text-app-default-link-color" @click="edit_entry()">
23
+ <span class="bg-app-layer-three-hover px-3 text-app-default-link-color dropdown-item" @click="edit_entry()">
24
24
  <i class="bi bi-input-cursor-text pe-1"></i>
25
25
  <span>Rename</span>
26
26
  </span>
27
- <span class="border-top bg-app-layer-three-hover px-3 text-app-default-link-color" @click="edit_entry_version()">
27
+ <span class="bg-app-layer-three-hover px-3 text-app-default-link-color dropdown-item" @click="edit_entry_version()">
28
28
  <i class="bi bi-pencil pe-1"></i>
29
29
  <span>Edit</span>
30
30
  </span>
31
31
  {% endif %}
32
32
 
33
33
  {% if AuthController.knowledge.can_delete %}
34
- <span class="border-top bg-app-layer-three-hover px-3 text-app-danger" @click="delete_entry()">
34
+ <span class="bg-app-layer-three-hover px-3 text-app-danger dropdown-item" @click="delete_entry()">
35
35
  <i class="bi bi-trash3 pe-1"></i>
36
36
  <span>Delete</span>
37
37
  </span>
@@ -12,6 +12,7 @@
12
12
  {% block dropdown_content %}
13
13
  {% for block_type in block_types %}
14
14
  <div
15
+ class="bg-app-layer-one bg-app-layer-three-hover dropdown-item"
15
16
  x-data="{
16
17
  create_block() {
17
18
  create_blank_block({block_type: '{{ block_type.value }}', order: version_block.order + 1})
@@ -32,7 +32,7 @@
32
32
  class="position-relative">
33
33
  <span @click='await render_dropdown()'>
34
34
  {% block notification_dropdown_trigger %}
35
- <i x-bind='trigger' class="bi bi-bell-fill text-white fs-4 cursor-pointer position-absolute"></i>
35
+ <i x-bind='trigger' class="bi bi-bell-fill fs-4 cursor-pointer position-absolute"></i>
36
36
  <span x-show="new_notification" x-cloak style="width: 10px; height: 10px; top: -1px; right: -24px;" class="bg-danger rounded-circle position-absolute"></span>
37
37
  {% endblock %}
38
38
  </span>
@@ -2,14 +2,17 @@
2
2
  :style="window.innerWidth < 768
3
3
  ? 'width: 350px; position: fixed; top: 5%; left: 50%; transform: translateX(-50%);'
4
4
  : 'width: 350px'"
5
- class="container border rounded-2"
5
+ class="container border rounded-2 bg-app-layer-two"
6
6
  >
7
7
  <div class="col-12 w-100">
8
- <h6 class="mt-2 ms-2 text-app-secondary text-center">Notifications</h6>
8
+ <h6 class="mt-2 ms-2 text-center">Notifications</h6>
9
9
  <hr class="m-0">
10
10
  </div>
11
11
 
12
- <div style="max-height: 300px !important; overflow-x: hidden !important; overflow-y: scroll !important;" class="text-start">
12
+ <div
13
+ style="max-height: 300px !important;"
14
+ class="text-start overflow-y-scroll overflow-x-hidden"
15
+ >
13
16
  {% for app_notification in app_notification_list %}
14
17
  <div class="col-12">
15
18
  {% include app_notification.template %}
django_spire/settings.py CHANGED
@@ -1,5 +1,6 @@
1
1
  DJANGO_SPIRE_AUTH_CONTROLLERS = {
2
2
  'ai_chat': 'django_spire.ai.chat.auth.controller.BaseAiChatAuthController',
3
+ 'help_desk': 'django_spire.help_desk.auth.controller.BaseHelpDeskAuthController',
3
4
  'knowledge': 'django_spire.knowledge.auth.controller.BaseKnowledgeAuthController',
4
5
  }
5
6
 
@@ -22,19 +22,19 @@
22
22
  <div class="preview-sample">
23
23
  <div class="d-flex flex-wrap">
24
24
  <!-- Primary colors -->
25
- <div class="p-2 m-1 bg-app-primary text-white" style="width: 40px; height: 40px;"></div>
26
- <div class="p-2 m-1 bg-app-primary-soft text-dark" style="width: 40px; height: 40px;"></div>
27
- <div class="p-2 m-1 bg-app-primary-dark text-white" style="width: 40px; height: 40px;"></div>
25
+ <div class="p-2 m-1 bg-app-primary" style="width: 40px; height: 40px;"></div>
26
+ <div class="p-2 m-1 bg-app-primary-soft" style="width: 40px; height: 40px;"></div>
27
+ <div class="p-2 m-1 bg-app-primary-dark" style="width: 40px; height: 40px;"></div>
28
28
 
29
29
  <!-- Secondary colors -->
30
- <div class="p-2 m-1 bg-app-secondary text-white" style="width: 40px; height: 40px;"></div>
31
- <div class="p-2 m-1 bg-app-secondary-soft text-dark" style="width: 40px; height: 40px;"></div>
32
- <div class="p-2 m-1 bg-app-secondary-dark text-white" style="width: 40px; height: 40px;"></div>
30
+ <div class="p-2 m-1 bg-app-secondary" style="width: 40px; height: 40px;"></div>
31
+ <div class="p-2 m-1 bg-app-secondary-soft" style="width: 40px; height: 40px;"></div>
32
+ <div class="p-2 m-1 bg-app-secondary-dark" style="width: 40px; height: 40px;"></div>
33
33
 
34
34
  <!-- Accent colors -->
35
- <div class="p-2 m-1 bg-app-accent text-white" style="width: 40px; height: 40px;"></div>
36
- <div class="p-2 m-1 bg-app-accent-soft text-dark" style="width: 40px; height: 40px;"></div>
37
- <div class="p-2 m-1 bg-app-accent-dark text-white" style="width: 40px; height: 40px;"></div>
35
+ <div class="p-2 m-1 bg-app-accent" style="width: 40px; height: 40px;"></div>
36
+ <div class="p-2 m-1 bg-app-accent-soft" style="width: 40px; height: 40px;"></div>
37
+ <div class="p-2 m-1 bg-app-accent-dark" style="width: 40px; height: 40px;"></div>
38
38
  </div>
39
39
  </div>
40
40
  {% endblock %}
@@ -24,11 +24,11 @@
24
24
  </div>
25
25
  <div class="col text-center">
26
26
  {% include 'django_spire/element/attribute_element.html' with attribute_title='Dropdown' %}
27
- {% include 'django_spire/dropdown/ellipsis_dropdown.html' with view_url='#' edit_url='#' delete_url='#' %}
27
+ {% include 'django_spire/dropdown/ellipsis_dropdown.html' with view_url='#' edit_url='#' delete_url='#' link_css='text-start' %}
28
28
  </div>
29
29
  <div class="col text-center">
30
30
  {% include 'django_spire/element/attribute_element.html' with attribute_title='Modal' %}
31
- {% include 'django_spire/dropdown/ellipsis_modal_dropdown.html' with view_url='#' edit_url='#' delete_url='#' %}
31
+ {% include 'django_spire/dropdown/ellipsis_modal_dropdown.html' with view_url='#' edit_url='#' delete_url='#' link_css='text-start' %}
32
32
  </div>
33
33
  </div>
34
34
  {% endblock %}