punkweb-bb 0.4.3__py3-none-any.whl → 0.5.0__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 (83) hide show
  1. punkweb_bb/__pycache__/bbcode.cpython-311.pyc +0 -0
  2. punkweb_bb/__pycache__/context_processors.cpython-311.pyc +0 -0
  3. punkweb_bb/__pycache__/decorators.cpython-311.pyc +0 -0
  4. punkweb_bb/__pycache__/forms.cpython-311.pyc +0 -0
  5. punkweb_bb/__pycache__/middleware.cpython-311.pyc +0 -0
  6. punkweb_bb/__pycache__/models.cpython-311.pyc +0 -0
  7. punkweb_bb/__pycache__/pagination.cpython-311.pyc +0 -0
  8. punkweb_bb/__pycache__/searching.cpython-311.pyc +0 -0
  9. punkweb_bb/__pycache__/settings.cpython-311.pyc +0 -0
  10. punkweb_bb/__pycache__/urls.cpython-311.pyc +0 -0
  11. punkweb_bb/__pycache__/utils.cpython-311.pyc +0 -0
  12. punkweb_bb/__pycache__/views.cpython-311.pyc +0 -0
  13. punkweb_bb/__pycache__/widgets.cpython-311.pyc +0 -0
  14. punkweb_bb/bbcode.py +4 -3
  15. punkweb_bb/decorators.py +17 -0
  16. punkweb_bb/forms.py +47 -10
  17. punkweb_bb/middleware.py +26 -1
  18. punkweb_bb/migrations/0007_boardprofile_bio.py +18 -0
  19. punkweb_bb/migrations/__pycache__/0001_squashed_0006_remove_boardprofile__signature_rendered_and_more.cpython-311.pyc +0 -0
  20. punkweb_bb/migrations/__pycache__/0007_boardprofile_bio.cpython-311.pyc +0 -0
  21. punkweb_bb/models.py +1 -0
  22. punkweb_bb/pagination.py +1 -1
  23. punkweb_bb/searching.py +10 -0
  24. punkweb_bb/settings.py +2 -0
  25. punkweb_bb/static/punkweb_bb/css/bbcode-editor-content.css +108 -0
  26. punkweb_bb/static/punkweb_bb/css/index.css +5 -6
  27. punkweb_bb/static/punkweb_bb/css/members.css +20 -3
  28. punkweb_bb/static/punkweb_bb/css/profile.css +5 -2
  29. punkweb_bb/static/punkweb_bb/css/punkweb.css +25 -687
  30. punkweb_bb/static/punkweb_bb/css/shoutbox.css +1 -9
  31. punkweb_bb/static/punkweb_bb/css/thread.css +4 -28
  32. punkweb_bb/static/punkweb_bb/js/bbcode-editor-tags.js +63 -0
  33. punkweb_bb/static/punkweb_bb/js/bbcode-editor.js +14 -0
  34. punkweb_bb/static/punkweb_bb/js/markdown-editor.js +49 -0
  35. punkweb_bb/static/punkweb_bb/js/punkweb-dialog.js +9 -0
  36. punkweb_bb/static/punkweb_bb/vendor/htmx-2.0.0.min.js +1 -0
  37. punkweb_bb/static/punkweb_bb/vendor/punkweb-ui.min.css +1 -0
  38. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/css/commandbar.css +2 -2
  39. punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/css/editor.css +1 -1
  40. punkweb_bb/templates/punkweb_bb/base.html +19 -21
  41. punkweb_bb/templates/punkweb_bb/base_delete_dialog.html +13 -0
  42. punkweb_bb/templates/punkweb_bb/base_dialog.html +16 -0
  43. punkweb_bb/templates/punkweb_bb/bbcode.html +11 -9
  44. punkweb_bb/templates/punkweb_bb/category_create.html +4 -21
  45. punkweb_bb/templates/punkweb_bb/category_update.html +3 -20
  46. punkweb_bb/templates/punkweb_bb/components/pagination_controls.html +45 -0
  47. punkweb_bb/templates/punkweb_bb/components/profile_image.html +11 -0
  48. punkweb_bb/templates/punkweb_bb/forms/inline_form.html +6 -0
  49. punkweb_bb/templates/punkweb_bb/forms/stacked_form.html +35 -0
  50. punkweb_bb/templates/punkweb_bb/index.html +65 -70
  51. punkweb_bb/templates/punkweb_bb/login.html +5 -11
  52. punkweb_bb/templates/punkweb_bb/members.html +23 -52
  53. punkweb_bb/templates/punkweb_bb/partials/category_delete.html +1 -1
  54. punkweb_bb/templates/punkweb_bb/partials/post_delete.html +1 -1
  55. punkweb_bb/templates/punkweb_bb/partials/post_update.html +4 -11
  56. punkweb_bb/templates/punkweb_bb/partials/shout_delete.html +1 -1
  57. punkweb_bb/templates/punkweb_bb/partials/subcategory_delete.html +1 -1
  58. punkweb_bb/templates/punkweb_bb/partials/thread_delete.html +1 -1
  59. punkweb_bb/templates/punkweb_bb/partials/thread_move.html +5 -13
  60. punkweb_bb/templates/punkweb_bb/profile.html +11 -8
  61. punkweb_bb/templates/punkweb_bb/search.html +27 -0
  62. punkweb_bb/templates/punkweb_bb/settings.html +7 -33
  63. punkweb_bb/templates/punkweb_bb/shoutbox/shout_list.html +2 -2
  64. punkweb_bb/templates/punkweb_bb/shoutbox/shoutbox.html +21 -6
  65. punkweb_bb/templates/punkweb_bb/signup.html +6 -15
  66. punkweb_bb/templates/punkweb_bb/subcategory.html +12 -54
  67. punkweb_bb/templates/punkweb_bb/subcategory_create.html +7 -16
  68. punkweb_bb/templates/punkweb_bb/subcategory_update.html +7 -16
  69. punkweb_bb/templates/punkweb_bb/thread.html +22 -87
  70. punkweb_bb/templates/punkweb_bb/thread_create.html +7 -16
  71. punkweb_bb/templates/punkweb_bb/thread_update.html +7 -16
  72. punkweb_bb/templatetags/__pycache__/can_delete.cpython-311.pyc +0 -0
  73. punkweb_bb/templatetags/__pycache__/punkweb_bb.cpython-311.pyc +0 -0
  74. punkweb_bb/templatetags/__pycache__/settings.cpython-311.pyc +0 -0
  75. punkweb_bb/templatetags/punkweb_bb.py +9 -0
  76. punkweb_bb/urls.py +1 -0
  77. punkweb_bb/views.py +97 -71
  78. punkweb_bb/widgets.py +3 -4
  79. {punkweb_bb-0.4.3.dist-info → punkweb_bb-0.5.0.dist-info}/METADATA +25 -36
  80. {punkweb_bb-0.4.3.dist-info → punkweb_bb-0.5.0.dist-info}/RECORD +83 -59
  81. {punkweb_bb-0.4.3.dist-info → punkweb_bb-0.5.0.dist-info}/LICENSE +0 -0
  82. {punkweb_bb-0.4.3.dist-info → punkweb_bb-0.5.0.dist-info}/WHEEL +0 -0
  83. {punkweb_bb-0.4.3.dist-info → punkweb_bb-0.5.0.dist-info}/top_level.txt +0 -0
@@ -3,16 +3,18 @@
3
3
 
4
4
  {% block content %}
5
5
 
6
- <div class="pw-card fluid padding">
7
- <h1>BBCode Reference</h1>
8
- <div style="display: flex; flex-direction: column; gap: 1rem;">
9
- {% for code in codes %}
10
- <div>
11
- <h4>{{ code.0 }}</h4>
12
- <pre>{{ code.1 }}</pre>
13
- {{ code.1|render }}
6
+ <div class="pw-card fluid">
7
+ <div class="pw-card-header">BBCode Reference</div>
8
+ <div class="pw-card-content">
9
+ <div class="flex flex-column gap-4">
10
+ {% for code in codes %}
11
+ <div>
12
+ <h4>{{ code.0 }}</h4>
13
+ <pre>{{ code.1 }}</pre>
14
+ {{ code.1|render }}
15
+ </div>
16
+ {% endfor %}
14
17
  </div>
15
- {% endfor %}
16
18
  </div>
17
19
  </div>
18
20
 
@@ -3,11 +3,6 @@
3
3
 
4
4
  {% block title_prefix %}Create Category | {% endblock %}
5
5
 
6
- {% block extra_head %}
7
- {{form.media.css}}
8
- <link rel="stylesheet" href="{% static 'punkweb_bb/css/category-form.css' %}" />
9
- {% endblock %}
10
-
11
6
  {% block content %}
12
7
 
13
8
  <nav>
@@ -21,21 +16,13 @@
21
16
  </ul>
22
17
  </nav>
23
18
 
24
- <div class="pw-card fluid">
19
+ <div class="pw-card">
25
20
  <div class="pw-card-header">Create Category</div>
26
21
  <div class="pw-card-content">
27
- <form class="categoryForm" action="{% url 'punkweb_bb:category_create' %}" method="post">
22
+ <form class="pw-form" action="{% url 'punkweb_bb:category_create' %}" method="post">
28
23
  {% csrf_token %}
29
- {% for field in form %}
30
- <div class="categoryForm__field">
31
- <label class="pw-input-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
32
- {{ field }}
33
- </div>
34
- {% endfor %}
35
- {% if form.non_field_errors %}
36
- {{ form.non_field_errors }}
37
- {% endif %}
38
- <div class="categoryForm__actions">
24
+ {{ form }}
25
+ <div class="pw-form-actions end">
39
26
  <a class="pw-button default" href="{% url 'punkweb_bb:index' %}" type="submit">Cancel</a>
40
27
  <button class="pw-button raised primary" type="submit">Create</button>
41
28
  </div>
@@ -44,7 +31,3 @@
44
31
  </div>
45
32
 
46
33
  {% endblock %}
47
-
48
- {% block extra_script %}
49
- {{form.media.js}}
50
- {% endblock %}
@@ -3,11 +3,6 @@
3
3
 
4
4
  {% block title_prefix %}Edit Category | {% endblock %}
5
5
 
6
- {% block extra_head %}
7
- {{form.media.css}}
8
- <link rel="stylesheet" href="{% static 'punkweb_bb/css/category-form.css' %}" />
9
- {% endblock %}
10
-
11
6
  {% block content %}
12
7
 
13
8
  <nav>
@@ -27,18 +22,10 @@
27
22
  <div class="pw-card fluid">
28
23
  <div class="pw-card-header">Edit Category</div>
29
24
  <div class="pw-card-content">
30
- <form class="categoryForm" action="{% url 'punkweb_bb:category_update' category.slug %}" method="post">
25
+ <form class="pw-form" action="{% url 'punkweb_bb:category_update' category.slug %}" method="post">
31
26
  {% csrf_token %}
32
- {% for field in form %}
33
- <div class="categoryForm__field">
34
- <label class="pw-input-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
35
- {{ field }}
36
- </div>
37
- {% endfor %}
38
- {% if form.non_field_errors %}
39
- {{ form.non_field_errors }}
40
- {% endif %}
41
- <div class="categoryForm__actions">
27
+ {{ form }}
28
+ <div class="pw-form-actions end">
42
29
  <a class="pw-button default" href="{{category.get_absolute_url}}">Cancel</a>
43
30
  <button class="pw-button raised primary" type="submit">Save</button>
44
31
  </div>
@@ -47,7 +34,3 @@
47
34
  </div>
48
35
 
49
36
  {% endblock %}
50
-
51
- {% block extra_script %}
52
- {{form.media.js}}
53
- {% endblock %}
@@ -0,0 +1,45 @@
1
+ {% if paginator.has_other_pages %}
2
+ <nav>
3
+ <ul class="pw-pagination">
4
+ {% if paginator.has_previous %}
5
+ <li class="pw-pagination-item">
6
+ <a class="pw-pagination-link" href="?page={{paginator.previous_page_number}}">
7
+ Prev
8
+ </a>
9
+ </li>
10
+ {% else %}
11
+ <li class="pw-pagination-item disabled">
12
+ <a class="pw-pagination-link" href="#">
13
+ Prev
14
+ </a>
15
+ </li>
16
+ {% endif %}
17
+ {% for i in paginator.paginator.page_range %}
18
+ {% if paginator.number == i %}
19
+ <li class="pw-pagination-item active">
20
+ <a class="pw-pagination-link" href="#">
21
+ {{i}}
22
+ </a>
23
+ </li>
24
+ {% else %}
25
+ <li class="pw-pagination-item">
26
+ <a class="pw-pagination-link" href="?page={{i}}">
27
+ {{i}}
28
+ </a>
29
+ </li>
30
+ {% endif %}
31
+ {% endfor %}
32
+ {% if paginator.has_next %}
33
+ <li class="pw-pagination-item">
34
+ <a class="pw-pagination-link" href="?page={{paginator.next_page_number}}">
35
+ Next
36
+ </a>
37
+ </li>
38
+ {% else %}
39
+ <li class="pw-pagination-item disabled">
40
+ <a class="pw-pagination-link" href="#">Next</a>
41
+ </li>
42
+ {% endif %}
43
+ </ul>
44
+ </nav>
45
+ {% endif %}
@@ -0,0 +1,11 @@
1
+ {% load static %}
2
+ <div class="pw-avatar {{size|default:"xs"}}">
3
+ {% if user.profile.image %}
4
+ <img
5
+ class="pw-avatar-image"
6
+ src="{{user.profile.image.url}}"
7
+ alt="{{user.username}}" />
8
+ {% else%}
9
+ <div class="pw-avatar-fallback">{{user.username|slice:":1"}}</div>
10
+ {% endif %}
11
+ </div>
@@ -0,0 +1,6 @@
1
+ {% for field in form %}
2
+ <div class="pw-form-group">
3
+ <label class="pw-input-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
4
+ {{ field }}
5
+ </div>
6
+ {% endfor %}
@@ -0,0 +1,35 @@
1
+ {% for field in form %}
2
+ {% if field.widget_type == "clearablefile" %}
3
+ <div class="pw-form-group">
4
+ <label class="pw-input-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
5
+ {% if field.value %}
6
+ <div class="pw-avatar xl">
7
+ <img class="pw-avatar-image" src="{{ field.value.url }}" alt="{{ field.label }}">
8
+ </div>
9
+ <label>
10
+ <input type="checkbox" name="{{ field.name }}-clear" id="{{ field.name }}-clear_id" />
11
+ Remove
12
+ </label>
13
+ {% endif %}
14
+ <input type="file" name="{{ field.name }}" accept="image/*" id="{{ field.id_for_label }}" />
15
+ {{ field.errors }}
16
+ </div>
17
+ {% elif field.widget_type == "checkbox" %}
18
+ <div class="pw-form-group check">
19
+ {{ field }}
20
+ <label class="pw-checkbox-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
21
+ {{ field.errors }}
22
+ </div>
23
+ {% else %}
24
+ <div class="pw-form-group">
25
+ {% if field.label %}
26
+ <label class="pw-input-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
27
+ {% endif %}
28
+ {{ field }}
29
+ {{ field.errors }}
30
+ </div>
31
+ {% endif %}
32
+ {% endfor %}
33
+ {% if form.non_field_errors %}
34
+ {{ form.non_field_errors }}
35
+ {% endif %}
@@ -1,6 +1,6 @@
1
1
  {% extends 'punkweb_bb/base.html' %}
2
2
 
3
- {% load static render styled_username %}
3
+ {% load static punkweb_bb render styled_username %}
4
4
 
5
5
  {% block extra_head %}
6
6
  <link rel="stylesheet" href="{% static 'punkweb_bb/css/index.css' %}" />
@@ -16,11 +16,12 @@
16
16
  <div class="index">
17
17
  <div class="index__main">
18
18
  <div class="index__categories">
19
- {% if punkweb_bb.settings.SHOUTBOX_ENABLED|default:True %}
19
+ {% punkweb_bb "SHOUTBOX_ENABLED" as shoutbox_enabled %}
20
+ {% if shoutbox_enabled %}
20
21
  {% include 'punkweb_bb/shoutbox/shoutbox.html' %}
21
22
  {% endif %}
22
23
  {% for category in categories %}
23
- <div id="{{category.slug}}.{{category.order}}" class="pw-card fluid margin">
24
+ <div id="{{category.slug}}.{{category.order}}" class="pw-card fluid mb-4">
24
25
  <div class="pw-table-container">
25
26
  <table class="pw-table">
26
27
  <colgroup>
@@ -54,10 +55,10 @@
54
55
  {% endif %}
55
56
  {% if perms.punkweb_bb.delete_category %}
56
57
  <a
57
- class="pw-icon-button default danger rounded sm"
58
+ class="pw-icon-button default red rounded sm"
58
59
  title="Delete category"
59
60
  hx-get="{% url 'punkweb_bb:category_delete' category.slug %}"
60
- hx-target="#modal-portal"
61
+ hx-target="#dialog-portal"
61
62
  >
62
63
  <span class="material-symbols-outlined">delete</span>
63
64
  </a>
@@ -84,11 +85,7 @@
84
85
  {% if subcategory.latest_thread %}
85
86
  {% if subcategory.latest_thread.latest_post %}
86
87
  <div class="subcategory__latestThread">
87
- {% if subcategory.latest_thread.latest_post.user.profile.image %}
88
- <img class="pw-avatar xs" src="{{subcategory.latest_thread.latest_post.user.profile.image.url}}" />
89
- {% else%}
90
- <img class="pw-avatar xs" src="{% static 'punkweb_bb/img/default-profile-image.png' %}" />
91
- {% endif %}
88
+ {% include 'punkweb_bb/components/profile_image.html' with user=subcategory.latest_thread.latest_post.user %}
92
89
  <div class="subcategory__latestThread__info">
93
90
  <a class="subcategory__latestThread__info__title"
94
91
  href="{{subcategory.latest_thread.get_absolute_url}}" title="{{subcategory.latest_thread.title}}">
@@ -108,11 +105,7 @@
108
105
  </div>
109
106
  {% else %}
110
107
  <div class="subcategory__latestThread">
111
- {% if subcategory.latest_thread.user.profile.image %}
112
- <img class="pw-avatar xs" src="{{subcategory.latest_thread.user.profile.image.url}}" />
113
- {% else%}
114
- <img class="pw-avatar xs" src="{% static 'punkweb_bb/img/default-profile-image.png' %}" />
115
- {% endif %}
108
+ {% include 'punkweb_bb/components/profile_image.html' with user=subcategory.latest_thread.user %}
116
109
  <div class="subcategory__latestThread__info">
117
110
  <a class="subcategory__latestThread__info__title"
118
111
  href="{{subcategory.latest_thread.get_absolute_url}}" title="{{subcategory.latest_thread.title}}">
@@ -153,75 +146,77 @@
153
146
  {% endif %}
154
147
  </div>
155
148
  <div class="index__sidebar">
156
- <div class="pw-card fluid">
149
+ <div class="pw-card fluid mb-4">
157
150
  <div class="pw-card-header">Recent threads</div>
158
- <div class="index__recentThreads__content">
159
- {% for thread in recent_threads %}
160
- <div class="index__recentThreads__thread">
161
- {% if thread.user.profile.image %}
162
- <img class="pw-avatar xs" src="{{thread.user.profile.image.url}}" />
163
- {% else%}
164
- <img class="pw-avatar xs" src="{% static 'punkweb_bb/img/default-profile-image.png' %}" />
165
- {% endif %}
166
- <div class="index__recentThreads__thread__info">
167
- <a class="index__recentThreads__thread__info__title" href="{{thread.get_absolute_url}}"
168
- title="{{thread.title}}">
169
- {{thread.title}}
170
- </a>
171
- <div>
172
- <time datetime="{{thread.created_at|date:'c'}}">
173
- {{thread.created_at|date:'M j, Y'}} at
174
- {{thread.created_at|date:'g:i A'}}
175
- </time>
176
-
177
- <a href="{% url 'punkweb_bb:profile' thread.user.id %}">
178
- {{thread.user|styled_username}}
151
+ <div class="pw-card-content">
152
+ <div class="index__recentThreads">
153
+ {% for thread in recent_threads %}
154
+ <div class="index__recentThreads__thread">
155
+ {% include 'punkweb_bb/components/profile_image.html' with user=thread.user %}
156
+ <div class="index__recentThreads__thread__info">
157
+ <a class="index__recentThreads__thread__title" href="{{thread.get_absolute_url}}"
158
+ title="{{thread.title}}">
159
+ {{thread.title}}
179
160
  </a>
161
+ <div>
162
+ <time datetime="{{thread.created_at|date:'c'}}">
163
+ {{thread.created_at|date:'M j, Y'}} at
164
+ {{thread.created_at|date:'g:i A'}}
165
+ </time>
166
+
167
+ <a href="{% url 'punkweb_bb:profile' thread.user.id %}">
168
+ {{thread.user|styled_username}}
169
+ </a>
170
+ </div>
180
171
  </div>
181
172
  </div>
173
+ {% endfor %}
182
174
  </div>
183
- {% endfor %}
184
175
  </div>
185
176
  </div>
186
- <div class="pw-card fluid margin">
177
+ <div class="pw-card fluid">
187
178
  <div class="pw-card-header">Statistics</div>
188
- <div class="index__statistics__content">
189
- <div class="index__statistics__list">
190
- <div class="index__statistics__row">
191
- <div class="index__statistics__label">Total threads:</div>
192
- <div class="index__statistics__value">
193
- {{thread_count}}
179
+ <div class="pw-card-content">
180
+ <div class="index__statistics">
181
+ <div class="index__statistics__list">
182
+ <div class="index__statistics__row">
183
+ <div class="index__statistics__label">Total threads:</div>
184
+ <div class="index__statistics__value">
185
+ {{thread_count}}
186
+ </div>
194
187
  </div>
195
- </div>
196
- <div class="index__statistics__row">
197
- <div class="index__statistics__label">Total posts:</div>
198
- <div class="index__statistics__value">{{post_count}}</div>
199
- </div>
200
- <div class="index__statistics__row">
201
- <div class="index__statistics__label">Total members:</div>
202
- <div class="index__statistics__value">{{users|length}}</div>
203
- </div>
204
- {% if newest_user %}
205
- <div class="index__statistics__row">
206
- <div class="index__statistics__label">Newest member:</div>
207
- <div class="index__statistics__value">
208
- <a href="{% url 'punkweb_bb:profile' newest_user.id %}">
209
- {{newest_user|styled_username}}
210
- </a>
188
+ <div class="index__statistics__row">
189
+ <div class="index__statistics__label">Total posts:</div>
190
+ <div class="index__statistics__value">{{post_count}}</div>
191
+ </div>
192
+ <div class="index__statistics__row">
193
+ <div class="index__statistics__label">Total members:</div>
194
+ <div class="index__statistics__value">{{users|length}}</div>
195
+ </div>
196
+ {% if newest_user %}
197
+ <div class="index__statistics__row">
198
+ <div class="index__statistics__label">Newest member:</div>
199
+ <div class="index__statistics__value">
200
+ <a href="{% url 'punkweb_bb:profile' newest_user.id %}">
201
+ {{newest_user|styled_username}}
202
+ </a>
203
+ </div>
204
+ </div>
205
+ {% endif %}
206
+ <div class="index__statistics__row">
207
+ <div class="index__statistics__label">Users online:</div>
208
+ <div class="index__statistics__value">{{total_online}} ({{members_online|length}} members, {{staff_online|length}} staff, {{guests_online}} guests)</div>
211
209
  </div>
212
- </div>
213
- {% endif %}
214
- <div class="index__statistics__row">
215
- <div class="index__statistics__label">Users online:</div>
216
- <div class="index__statistics__value">{{total_online}} ({{members_online|length}} members, {{staff_online|length}} staff, {{guests_online}} guests)</div>
217
210
  </div>
218
211
  </div>
219
212
  </div>
220
213
  </div>
221
- {% if punkweb_bb.settings.DISCORD_WIDGET_ENABLED %}
222
- {% if punkweb_bb.settings.DISCORD_SERVER_ID %}
214
+ {% punkweb_bb "DISCORD_WIDGET_ENABLED" as discord_widget_enabled %}
215
+ {% punkweb_bb "DISCORD_SERVER_ID" as discord_server_id %}
216
+ {% if discord_widget_enabled %}
217
+ {% if discord_server_id %}
223
218
  <iframe
224
- src="https://discord.com/widget?id={{ punkweb_bb.settings.DISCORD_SERVER_ID }}&theme={{ punkweb_bb.settings.DISCORD_WIDGET_THEME|default:'dark' }}"
219
+ src="https://discord.com/widget?id={{ discord_server_id }}&theme={% punkweb_bb "DISCORD_WIDGET_THEME" %}"
225
220
  width="100%"
226
221
  height="384"
227
222
  allowtransparency="true"
@@ -229,7 +224,7 @@
229
224
  sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts">
230
225
  </iframe>
231
226
  {% else %}
232
- <div class="pw-callout danger">
227
+ <div class="pw-callout red mt-4">
233
228
  <h4>Discord Widget Error</h4>
234
229
  <p><code>DISCORD_SERVER_ID</code> not configured in settings module.</p>
235
230
  </div>
@@ -21,21 +21,15 @@
21
21
  </ul>
22
22
  </nav>
23
23
 
24
- <div class="pw-card center">
24
+ <div class="pw-card centerPage">
25
25
  <div class="pw-card-header">Login</div>
26
26
  <div class="pw-card-content">
27
- <form class="loginForm" action="{% url 'punkweb_bb:login' %}" method="post">
27
+ <form class="pw-form" action="{% url 'punkweb_bb:login' %}" method="post">
28
28
  {% csrf_token %}
29
- {% for field in form %}
30
- <div class="loginForm__field">
31
- <label class="pw-input-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
32
- {{ field }}
29
+ {{ form }}
30
+ <div class="pw-form-actions">
31
+ <button class="pw-button fluid raised primary" type="submit">Login</button>
33
32
  </div>
34
- {% endfor %}
35
- {% if form.non_field_errors %}
36
- {{ form.non_field_errors }}
37
- {% endif %}
38
- <button class="pw-button fluid raised primary" type="submit">Login</button>
39
33
  </form>
40
34
  </div>
41
35
  </div>
@@ -21,19 +21,31 @@
21
21
  </ul>
22
22
  </nav>
23
23
 
24
- <div class="pw-card fluid">
24
+ <div class="members__header">
25
+ <h1>Members</h1>
26
+ <form class="pw-form inline" action="{% url 'punkweb_bb:members' %}" method="get">
27
+ {{ form }}
28
+ <div class="pw-form-actions">
29
+ <button class="pw-button raised" type="submit">Search</button>
30
+ </div>
31
+ </form>
32
+ </div>
33
+
34
+ {% if users|length > 0 %}
35
+ <div class="pw-card fluid mb-4">
25
36
  <ul class="members__list">
26
37
  {% for user in users %}
27
38
  <li class="members__user">
28
39
  <div class="members__user__avatar">
29
- {% if user.profile.image %}
30
- <img class="pw-avatar sm" src="{{user.profile.image.url}}" />
31
- {% else %}
32
- <img class="pw-avatar sm" src="{% static 'punkweb_bb/img/default-profile-image.png' %}" />
33
- {% endif %}
40
+ {% include 'punkweb_bb/components/profile_image.html' with user=user size="sm" %}
34
41
  </div>
35
42
  <div class="members__user__info">
36
- <div class="members__user__username"><a href="{% url 'punkweb_bb:profile' user.id %}">{{ user|styled_username }}</a></div>
43
+ <div class="members__user__username">
44
+ <a href="{% url 'punkweb_bb:profile' user.id %}">{{ user|styled_username }}</a>
45
+ {% if user.profile.is_online %}
46
+ <div class="onlineIndicator"></div>
47
+ {% endif %}
48
+ </div>
37
49
  <div class="members__user__stats">
38
50
  <div class="members__user__stat">
39
51
  Posts:
@@ -51,51 +63,10 @@
51
63
  {% endfor %}
52
64
  </ul>
53
65
  </div>
54
-
55
- {% if users.has_other_pages %}
56
- <nav>
57
- <ul class="pw-pagination">
58
- {% if users.has_previous %}
59
- <li class="pw-pagination-item">
60
- <a class="pw-pagination-link" href="{% url 'punkweb_bb:members' %}?page={{users.previous_page_number}}">
61
- Prev
62
- </a>
63
- </li>
64
- {% else %}
65
- <li class="pw-pagination-item disabled">
66
- <a class="pw-pagination-link" href="#">
67
- Prev
68
- </a>
69
- </li>
70
- {% endif %}
71
- {% for i in users.paginator.page_range %}
72
- {% if users.number == i %}
73
- <li class="pw-pagination-item active">
74
- <a class="pw-pagination-link" href="#">
75
- {{i}}
76
- </a>
77
- </li>
78
- {% else %}
79
- <li class="pw-pagination-item">
80
- <a class="pw-pagination-link" href="{% url 'punkweb_bb:members' %}?page={{i}}">
81
- {{i}}
82
- </a>
83
- </li>
84
- {% endif %}
85
- {% endfor %}
86
- {% if users.has_next %}
87
- <li class="pw-pagination-item">
88
- <a class="pw-pagination-link" href="{% url 'punkweb_bb:members' %}?page={{users.next_page_number}}">
89
- Next
90
- </a>
91
- </li>
92
- {% else %}
93
- <li class="pw-pagination-item disabled">
94
- <a class="pw-pagination-link" href="#">Next</a>
95
- </li>
96
- {% endif %}
97
- </ul>
98
- </nav>
66
+ {% else %}
67
+ <h3>No results found.</h3>
99
68
  {% endif %}
100
69
 
70
+ {% include 'punkweb_bb/components/pagination_controls.html' with paginator=users %}
71
+
101
72
  {% endblock %}
@@ -1,4 +1,4 @@
1
- {% extends 'punkweb_bb/base_delete_modal.html' %}
1
+ {% extends 'punkweb_bb/base_delete_dialog.html' %}
2
2
 
3
3
  {% block title %}Delete Category{% endblock %}
4
4
 
@@ -1,4 +1,4 @@
1
- {% extends 'punkweb_bb/base_delete_modal.html' %}
1
+ {% extends 'punkweb_bb/base_delete_dialog.html' %}
2
2
 
3
3
  {% block title %}Delete Post{% endblock %}
4
4
 
@@ -1,19 +1,12 @@
1
- {% extends 'punkweb_bb/base_modal.html' %}
1
+ {% extends 'punkweb_bb/base_dialog.html' %}
2
2
 
3
3
  {% block title %}Edit Post{% endblock %}
4
4
 
5
5
  {% block content %}
6
- <form class="postForm" action="{% url 'punkweb_bb:post_update' post.id %}" method="post">
6
+ <form class="pw-form" action="{% url 'punkweb_bb:post_update' post.id %}" method="post">
7
7
  {% csrf_token %}
8
- {% for field in form %}
9
- <div class="postForm__field">
10
- {{ field }}
11
- </div>
12
- {% endfor %}
13
- {% if form.non_field_errors %}
14
- {{ form.non_field_errors }}
15
- {% endif %}
16
- <div class="postForm__actions">
8
+ {{ form }}
9
+ <div class="pw-form-actions end">
17
10
  <button class="pw-button raised primary" type="submit">Save</button>
18
11
  </div>
19
12
  </form>
@@ -1,4 +1,4 @@
1
- {% extends 'punkweb_bb/base_delete_modal.html' %}
1
+ {% extends 'punkweb_bb/base_delete_dialog.html' %}
2
2
 
3
3
  {% block title %}Delete Shout{% endblock %}
4
4
 
@@ -1,4 +1,4 @@
1
- {% extends 'punkweb_bb/base_delete_modal.html' %}
1
+ {% extends 'punkweb_bb/base_delete_dialog.html' %}
2
2
 
3
3
  {% block title %}Delete Subcategory{% endblock %}
4
4
 
@@ -1,4 +1,4 @@
1
- {% extends 'punkweb_bb/base_delete_modal.html' %}
1
+ {% extends 'punkweb_bb/base_delete_dialog.html' %}
2
2
 
3
3
  {% block title %}Delete Thread{% endblock %}
4
4
 
@@ -1,21 +1,13 @@
1
- {% extends 'punkweb_bb/base_modal.html' %}
1
+ {% extends 'punkweb_bb/base_dialog.html' %}
2
2
 
3
3
  {% block title %}Move Thread{% endblock %}
4
4
 
5
5
  {% block content %}
6
- <form class="threadMoveForm" action="{% url 'punkweb_bb:thread_move' thread.id %}" method="post">
6
+ <form class="pw-form" action="{% url 'punkweb_bb:thread_move' thread.id %}" method="post">
7
7
  {% csrf_token %}
8
- {% for field in form %}
9
- <div class="threadMoveForm__field">
10
- <label class="pw-input-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
11
- {{ field }}
12
- </div>
13
- {% endfor %}
14
- {% if form.non_field_errors %}
15
- {{ form.non_field_errors }}
16
- {% endif %}
17
- <div class="threadMoveForm__actions">
18
- <button class="modal__cancel pw-button default">Cancel</button>
8
+ {{ form }}
9
+ <div class="pw-form-actions end">
10
+ <button class="pw-dialog-cancel pw-button default">Cancel</button>
19
11
  <button class="pw-button raised primary" type="submit">Move</button>
20
12
  </div>
21
13
  </form>