punkweb-bb 0.4.2__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.
- punkweb_bb/__pycache__/bbcode.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/context_processors.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/decorators.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/forms.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/middleware.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/models.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/pagination.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/searching.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/settings.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/urls.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/utils.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/views.cpython-311.pyc +0 -0
- punkweb_bb/__pycache__/widgets.cpython-311.pyc +0 -0
- punkweb_bb/bbcode.py +4 -3
- punkweb_bb/decorators.py +17 -0
- punkweb_bb/forms.py +47 -10
- punkweb_bb/middleware.py +26 -1
- punkweb_bb/migrations/0001_initial.py +4 -25
- punkweb_bb/migrations/0004_groupstyle.py +1 -6
- punkweb_bb/migrations/0006_remove_boardprofile__signature_rendered_and_more.py +0 -20
- punkweb_bb/migrations/0007_boardprofile_bio.py +18 -0
- punkweb_bb/migrations/__pycache__/0001_initial.cpython-311.pyc +0 -0
- punkweb_bb/migrations/__pycache__/0001_squashed_0006_remove_boardprofile__signature_rendered_and_more.cpython-311.pyc +0 -0
- punkweb_bb/migrations/__pycache__/0004_groupstyle.cpython-311.pyc +0 -0
- punkweb_bb/migrations/__pycache__/0006_remove_boardprofile__signature_rendered_and_more.cpython-311.pyc +0 -0
- punkweb_bb/migrations/__pycache__/0007_boardprofile_bio.cpython-311.pyc +0 -0
- punkweb_bb/models.py +1 -0
- punkweb_bb/pagination.py +1 -1
- punkweb_bb/searching.py +10 -0
- punkweb_bb/settings.py +2 -0
- punkweb_bb/static/punkweb_bb/css/bbcode-editor-content.css +108 -0
- punkweb_bb/static/punkweb_bb/css/index.css +5 -6
- punkweb_bb/static/punkweb_bb/css/members.css +20 -3
- punkweb_bb/static/punkweb_bb/css/profile.css +6 -2
- punkweb_bb/static/punkweb_bb/css/punkweb.css +25 -687
- punkweb_bb/static/punkweb_bb/css/shoutbox.css +1 -9
- punkweb_bb/static/punkweb_bb/css/thread.css +4 -28
- punkweb_bb/static/punkweb_bb/js/bbcode-editor-tags.js +63 -0
- punkweb_bb/static/punkweb_bb/js/bbcode-editor.js +14 -0
- punkweb_bb/static/punkweb_bb/js/markdown-editor.js +49 -0
- punkweb_bb/static/punkweb_bb/js/punkweb-dialog.js +9 -0
- punkweb_bb/static/punkweb_bb/vendor/htmx-2.0.0.min.js +1 -0
- punkweb_bb/static/punkweb_bb/vendor/punkweb-ui.min.css +1 -0
- punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/css/commandbar.css +2 -2
- punkweb_bb/static/punkweb_bb/vendor/tiny-markdown-editor/src/css/editor.css +1 -1
- punkweb_bb/templates/punkweb_bb/base.html +19 -21
- punkweb_bb/templates/punkweb_bb/base_delete_dialog.html +13 -0
- punkweb_bb/templates/punkweb_bb/base_delete_modal.html +2 -2
- punkweb_bb/templates/punkweb_bb/base_dialog.html +16 -0
- punkweb_bb/templates/punkweb_bb/bbcode.html +11 -9
- punkweb_bb/templates/punkweb_bb/category_create.html +4 -21
- punkweb_bb/templates/punkweb_bb/category_update.html +3 -20
- punkweb_bb/templates/punkweb_bb/components/pagination_controls.html +45 -0
- punkweb_bb/templates/punkweb_bb/components/profile_image.html +11 -0
- punkweb_bb/templates/punkweb_bb/forms/inline_form.html +6 -0
- punkweb_bb/templates/punkweb_bb/forms/stacked_form.html +35 -0
- punkweb_bb/templates/punkweb_bb/index.html +65 -70
- punkweb_bb/templates/punkweb_bb/login.html +5 -11
- punkweb_bb/templates/punkweb_bb/members.html +23 -52
- punkweb_bb/templates/punkweb_bb/partials/category_delete.html +1 -1
- punkweb_bb/templates/punkweb_bb/partials/post_delete.html +1 -1
- punkweb_bb/templates/punkweb_bb/partials/post_update.html +4 -11
- punkweb_bb/templates/punkweb_bb/partials/shout_delete.html +1 -1
- punkweb_bb/templates/punkweb_bb/partials/subcategory_delete.html +1 -1
- punkweb_bb/templates/punkweb_bb/partials/thread_delete.html +1 -1
- punkweb_bb/templates/punkweb_bb/partials/thread_move.html +5 -13
- punkweb_bb/templates/punkweb_bb/profile.html +14 -11
- punkweb_bb/templates/punkweb_bb/search.html +27 -0
- punkweb_bb/templates/punkweb_bb/settings.html +7 -33
- punkweb_bb/templates/punkweb_bb/shoutbox/shout_list.html +2 -2
- punkweb_bb/templates/punkweb_bb/shoutbox/shoutbox.html +21 -6
- punkweb_bb/templates/punkweb_bb/signup.html +6 -15
- punkweb_bb/templates/punkweb_bb/subcategory.html +12 -54
- punkweb_bb/templates/punkweb_bb/subcategory_create.html +7 -16
- punkweb_bb/templates/punkweb_bb/subcategory_update.html +7 -16
- punkweb_bb/templates/punkweb_bb/thread.html +23 -88
- punkweb_bb/templates/punkweb_bb/thread_create.html +7 -16
- punkweb_bb/templates/punkweb_bb/thread_update.html +7 -16
- punkweb_bb/templatetags/__pycache__/can_delete.cpython-311.pyc +0 -0
- punkweb_bb/templatetags/__pycache__/punkweb_bb.cpython-311.pyc +0 -0
- punkweb_bb/templatetags/__pycache__/render.cpython-311.pyc +0 -0
- punkweb_bb/templatetags/__pycache__/settings.cpython-311.pyc +0 -0
- punkweb_bb/templatetags/punkweb_bb.py +9 -0
- punkweb_bb/urls.py +1 -0
- punkweb_bb/views.py +97 -71
- punkweb_bb/widgets.py +3 -4
- {punkweb_bb-0.4.2.dist-info → punkweb_bb-0.5.0.dist-info}/METADATA +25 -36
- {punkweb_bb-0.4.2.dist-info → punkweb_bb-0.5.0.dist-info}/RECORD +91 -67
- {punkweb_bb-0.4.2.dist-info → punkweb_bb-0.5.0.dist-info}/LICENSE +0 -0
- {punkweb_bb-0.4.2.dist-info → punkweb_bb-0.5.0.dist-info}/WHEEL +0 -0
- {punkweb_bb-0.4.2.dist-info → punkweb_bb-0.5.0.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
punkweb_bb/bbcode.py
CHANGED
|
@@ -56,8 +56,8 @@ def add_url_tag(parser):
|
|
|
56
56
|
def add_quote_tag(parser):
|
|
57
57
|
def _render_quote(name, value, options, parent, context):
|
|
58
58
|
if "quote" in options:
|
|
59
|
-
return f'<blockquote><cite>{options["quote"]} said: </cite>{value}</blockquote>'
|
|
60
|
-
return f
|
|
59
|
+
return f'<blockquote class="pw-blockquote"><cite>{options["quote"]} said: </cite>{value}</blockquote>'
|
|
60
|
+
return f'<blockquote class="pw-blockquote">{value}</blockquote>'
|
|
61
61
|
|
|
62
62
|
parser.add_formatter(
|
|
63
63
|
"quote", _render_quote, strip=True, swallow_trailing_newline=True
|
|
@@ -114,7 +114,8 @@ def add_spoiler_tag(parser):
|
|
|
114
114
|
def _render_spoiler(name, value, options, parent, context):
|
|
115
115
|
if "spoiler" in options:
|
|
116
116
|
summary = options["spoiler"]
|
|
117
|
-
return f
|
|
117
|
+
return f'<details class="pw-details"><summary>{summary}</summary>{value}</details>'
|
|
118
|
+
return f'<details class="pw-details"><summary>Click to reveal</summary>{value}</details>'
|
|
118
119
|
|
|
119
120
|
parser.add_formatter(
|
|
120
121
|
"spoiler", _render_spoiler, strip=True, swallow_trailing_newline=True
|
punkweb_bb/decorators.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from functools import wraps
|
|
2
|
+
|
|
3
|
+
from django.core.exceptions import PermissionDenied
|
|
4
|
+
from django.shortcuts import redirect
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def redirect_if_authenticated(redirect_url="punkweb_bb:index"):
|
|
8
|
+
def decorator(view_func):
|
|
9
|
+
@wraps(view_func)
|
|
10
|
+
def _wrapper_view(request, *args, **kwargs):
|
|
11
|
+
if request.user.is_authenticated:
|
|
12
|
+
return redirect(redirect_url)
|
|
13
|
+
return view_func(request, *args, **kwargs)
|
|
14
|
+
|
|
15
|
+
return _wrapper_view
|
|
16
|
+
|
|
17
|
+
return decorator
|
punkweb_bb/forms.py
CHANGED
|
@@ -6,10 +6,7 @@ from punkweb_bb.utils import get_editor_widget
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class LoginForm(AuthenticationForm):
|
|
9
|
-
""
|
|
10
|
-
Override the default AuthenticationForm to add CSS classes to the
|
|
11
|
-
username and password fields.
|
|
12
|
-
"""
|
|
9
|
+
template_name = "punkweb_bb/forms/stacked_form.html"
|
|
13
10
|
|
|
14
11
|
def __init__(self, *args, **kwargs):
|
|
15
12
|
super().__init__(*args, **kwargs)
|
|
@@ -21,6 +18,8 @@ class LoginForm(AuthenticationForm):
|
|
|
21
18
|
|
|
22
19
|
|
|
23
20
|
class SignUpForm(UserCreationForm):
|
|
21
|
+
template_name = "punkweb_bb/forms/stacked_form.html"
|
|
22
|
+
|
|
24
23
|
def __init__(self, *args, **kwargs):
|
|
25
24
|
super().__init__(*args, **kwargs)
|
|
26
25
|
|
|
@@ -31,19 +30,45 @@ class SignUpForm(UserCreationForm):
|
|
|
31
30
|
self.fields["password2"].widget.attrs.update({"class": "pw-input fluid"})
|
|
32
31
|
|
|
33
32
|
|
|
33
|
+
class FilterUsersForm(forms.Form):
|
|
34
|
+
template_name = "punkweb_bb/forms/inline_form.html"
|
|
35
|
+
|
|
36
|
+
search = forms.CharField(
|
|
37
|
+
required=False,
|
|
38
|
+
widget=forms.TextInput(attrs={"class": "pw-input", "placeholder": "Search"}),
|
|
39
|
+
)
|
|
40
|
+
sort_by = forms.ChoiceField(
|
|
41
|
+
required=False,
|
|
42
|
+
choices=(
|
|
43
|
+
("", "-----------"),
|
|
44
|
+
("username", "Username (A-Z)"),
|
|
45
|
+
("-username", "Username (Z-A)"),
|
|
46
|
+
("date_joined", "Date Joined (Oldest)"),
|
|
47
|
+
("-date_joined", "Date Joined (Newest)"),
|
|
48
|
+
),
|
|
49
|
+
widget=forms.Select(attrs={"class": "pw-input"}),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
34
53
|
class BoardProfileModelForm(forms.ModelForm):
|
|
54
|
+
template_name = "punkweb_bb/forms/stacked_form.html"
|
|
55
|
+
|
|
35
56
|
class Meta:
|
|
36
57
|
model = BoardProfile
|
|
37
58
|
fields = (
|
|
38
59
|
"image",
|
|
60
|
+
"bio",
|
|
39
61
|
"signature",
|
|
40
62
|
)
|
|
41
63
|
widgets = {
|
|
64
|
+
"bio": get_editor_widget(),
|
|
42
65
|
"signature": get_editor_widget(),
|
|
43
66
|
}
|
|
44
67
|
|
|
45
68
|
|
|
46
69
|
class CategoryModelForm(forms.ModelForm):
|
|
70
|
+
template_name = "punkweb_bb/forms/stacked_form.html"
|
|
71
|
+
|
|
47
72
|
class Meta:
|
|
48
73
|
model = Category
|
|
49
74
|
fields = (
|
|
@@ -59,6 +84,8 @@ class CategoryModelForm(forms.ModelForm):
|
|
|
59
84
|
|
|
60
85
|
|
|
61
86
|
class PostModelForm(forms.ModelForm):
|
|
87
|
+
template_name = "punkweb_bb/forms/stacked_form.html"
|
|
88
|
+
|
|
62
89
|
class Meta:
|
|
63
90
|
model = Post
|
|
64
91
|
fields = ("content",)
|
|
@@ -77,24 +104,30 @@ class ShoutModelForm(forms.ModelForm):
|
|
|
77
104
|
|
|
78
105
|
|
|
79
106
|
class SubcategoryModelForm(forms.ModelForm):
|
|
107
|
+
template_name = "punkweb_bb/forms/stacked_form.html"
|
|
108
|
+
|
|
80
109
|
class Meta:
|
|
81
110
|
model = Subcategory
|
|
82
111
|
fields = (
|
|
112
|
+
"category",
|
|
83
113
|
"name",
|
|
84
114
|
"description",
|
|
85
115
|
"order",
|
|
86
116
|
"staff_post_only",
|
|
87
117
|
)
|
|
88
118
|
widgets = {
|
|
89
|
-
"name": forms.TextInput(
|
|
90
|
-
|
|
91
|
-
"order": forms.TextInput(
|
|
92
|
-
attrs={"class": "pw-input", "min": "0", "type": "number"}
|
|
119
|
+
"name": forms.TextInput(
|
|
120
|
+
attrs={"autofocus": True, "class": "pw-input fluid"}
|
|
93
121
|
),
|
|
122
|
+
"category": forms.Select(attrs={"class": "pw-input fluid"}),
|
|
123
|
+
"description": get_editor_widget(),
|
|
124
|
+
"order": forms.NumberInput(attrs={"class": "pw-input", "min": "0"}),
|
|
94
125
|
}
|
|
95
126
|
|
|
96
127
|
|
|
97
128
|
class ThreadModelForm(forms.ModelForm):
|
|
129
|
+
template_name = "punkweb_bb/forms/stacked_form.html"
|
|
130
|
+
|
|
98
131
|
class Meta:
|
|
99
132
|
model = Thread
|
|
100
133
|
fields = (
|
|
@@ -102,14 +135,18 @@ class ThreadModelForm(forms.ModelForm):
|
|
|
102
135
|
"content",
|
|
103
136
|
)
|
|
104
137
|
widgets = {
|
|
105
|
-
"title": forms.TextInput(
|
|
138
|
+
"title": forms.TextInput(
|
|
139
|
+
attrs={"autofocus": True, "class": "pw-input fluid"}
|
|
140
|
+
),
|
|
106
141
|
"content": get_editor_widget(),
|
|
107
142
|
}
|
|
108
143
|
|
|
109
144
|
|
|
110
145
|
class ThreadMoveForm(forms.Form):
|
|
146
|
+
template_name = "punkweb_bb/forms/stacked_form.html"
|
|
147
|
+
|
|
111
148
|
subcategory = forms.ModelChoiceField(
|
|
112
149
|
queryset=Subcategory.objects.all(),
|
|
113
150
|
empty_label="Select a subcategory",
|
|
114
|
-
widget=forms.Select(attrs={"class": "pw-input"}),
|
|
151
|
+
widget=forms.Select(attrs={"class": "pw-input fluid"}),
|
|
115
152
|
)
|
punkweb_bb/middleware.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from django.core.cache import cache
|
|
2
|
+
from django.core.exceptions import ValidationError
|
|
3
|
+
from django.core.validators import validate_ipv46_address
|
|
2
4
|
from django.utils import timezone
|
|
3
5
|
|
|
4
6
|
from punkweb_bb.guests import guest_list
|
|
@@ -14,7 +16,7 @@ class ProfileOnlineCacheMiddleware:
|
|
|
14
16
|
f"profile_online_{request.user.profile.id}", timezone.now(), 60 * 5
|
|
15
17
|
)
|
|
16
18
|
else:
|
|
17
|
-
ip =
|
|
19
|
+
ip = self.get_client_ip(request)
|
|
18
20
|
guest_list.add(ip)
|
|
19
21
|
|
|
20
22
|
guest_list.clear_expired()
|
|
@@ -22,3 +24,26 @@ class ProfileOnlineCacheMiddleware:
|
|
|
22
24
|
response = self.get_response(request)
|
|
23
25
|
|
|
24
26
|
return response
|
|
27
|
+
|
|
28
|
+
def get_client_ip(self, request):
|
|
29
|
+
headers = (
|
|
30
|
+
"HTTP_X_FORWARDED_FOR",
|
|
31
|
+
"HTTP_X_REAL_IP",
|
|
32
|
+
"HTTP_CLIENT_IP",
|
|
33
|
+
"HTTP_X_CLIENT_IP",
|
|
34
|
+
"HTTP_X_CLUSTER_CLIENT_IP",
|
|
35
|
+
"HTTP_FORWARDED_FOR",
|
|
36
|
+
"HTTP_FORWARDED",
|
|
37
|
+
"REMOTE_ADDR",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
for header in headers:
|
|
41
|
+
if request.META.get(header, None):
|
|
42
|
+
ip = request.META[header].split(",")[0].strip()
|
|
43
|
+
try:
|
|
44
|
+
validate_ipv46_address(ip)
|
|
45
|
+
return ip
|
|
46
|
+
except ValidationError:
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
return ""
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
from django.conf import settings
|
|
4
4
|
from django.db import migrations, models
|
|
5
5
|
import django.db.models.deletion
|
|
6
|
-
import precise_bbcode.fields
|
|
7
6
|
import punkweb_bb.models
|
|
8
7
|
import uuid
|
|
9
8
|
|
|
@@ -57,15 +56,9 @@ class Migration(migrations.Migration):
|
|
|
57
56
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
58
57
|
("name", models.CharField(max_length=255)),
|
|
59
58
|
("slug", models.SlugField(max_length=1024, unique=True)),
|
|
60
|
-
(
|
|
61
|
-
"_description_rendered",
|
|
62
|
-
models.TextField(blank=True, editable=False, null=True),
|
|
63
|
-
),
|
|
64
59
|
(
|
|
65
60
|
"description",
|
|
66
|
-
|
|
67
|
-
blank=True, no_rendered_field=True, null=True
|
|
68
|
-
),
|
|
61
|
+
models.TextField(blank=True, null=True),
|
|
69
62
|
),
|
|
70
63
|
("order", models.PositiveIntegerField(default=0)),
|
|
71
64
|
("staff_post_only", models.BooleanField(default=False)),
|
|
@@ -99,13 +92,9 @@ class Migration(migrations.Migration):
|
|
|
99
92
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
100
93
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
101
94
|
("title", models.CharField(max_length=255)),
|
|
102
|
-
(
|
|
103
|
-
"_content_rendered",
|
|
104
|
-
models.TextField(blank=True, editable=False, null=True),
|
|
105
|
-
),
|
|
106
95
|
(
|
|
107
96
|
"content",
|
|
108
|
-
|
|
97
|
+
models.TextField(),
|
|
109
98
|
),
|
|
110
99
|
("is_pinned", models.BooleanField(default=False)),
|
|
111
100
|
("is_closed", models.BooleanField(default=False)),
|
|
@@ -173,13 +162,9 @@ class Migration(migrations.Migration):
|
|
|
173
162
|
),
|
|
174
163
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
175
164
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
176
|
-
(
|
|
177
|
-
"_content_rendered",
|
|
178
|
-
models.TextField(blank=True, editable=False, null=True),
|
|
179
|
-
),
|
|
180
165
|
(
|
|
181
166
|
"content",
|
|
182
|
-
|
|
167
|
+
models.TextField(),
|
|
183
168
|
),
|
|
184
169
|
(
|
|
185
170
|
"thread",
|
|
@@ -224,15 +209,9 @@ class Migration(migrations.Migration):
|
|
|
224
209
|
upload_to=punkweb_bb.models.profile_image_upload_to,
|
|
225
210
|
),
|
|
226
211
|
),
|
|
227
|
-
(
|
|
228
|
-
"_signature_rendered",
|
|
229
|
-
models.TextField(blank=True, editable=False, null=True),
|
|
230
|
-
),
|
|
231
212
|
(
|
|
232
213
|
"signature",
|
|
233
|
-
|
|
234
|
-
blank=True, max_length=1024, no_rendered_field=True, null=True
|
|
235
|
-
),
|
|
214
|
+
models.TextField(blank=True, max_length=1024, null=True),
|
|
236
215
|
),
|
|
237
216
|
(
|
|
238
217
|
"user",
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
from django.db import migrations, models
|
|
4
4
|
import django.db.models.deletion
|
|
5
|
-
import precise_bbcode.fields
|
|
6
5
|
import uuid
|
|
7
6
|
|
|
8
7
|
|
|
@@ -34,13 +33,9 @@ class Migration(migrations.Migration):
|
|
|
34
33
|
default=0, help_text="Highest priority is displayed"
|
|
35
34
|
),
|
|
36
35
|
),
|
|
37
|
-
(
|
|
38
|
-
"_username_style_rendered",
|
|
39
|
-
models.TextField(blank=True, editable=False, null=True),
|
|
40
|
-
),
|
|
41
36
|
(
|
|
42
37
|
"username_style",
|
|
43
|
-
|
|
38
|
+
models.TextField(),
|
|
44
39
|
),
|
|
45
40
|
(
|
|
46
41
|
"group",
|
|
@@ -10,26 +10,6 @@ class Migration(migrations.Migration):
|
|
|
10
10
|
]
|
|
11
11
|
|
|
12
12
|
operations = [
|
|
13
|
-
migrations.RemoveField(
|
|
14
|
-
model_name="boardprofile",
|
|
15
|
-
name="_signature_rendered",
|
|
16
|
-
),
|
|
17
|
-
migrations.RemoveField(
|
|
18
|
-
model_name="groupstyle",
|
|
19
|
-
name="_username_style_rendered",
|
|
20
|
-
),
|
|
21
|
-
migrations.RemoveField(
|
|
22
|
-
model_name="post",
|
|
23
|
-
name="_content_rendered",
|
|
24
|
-
),
|
|
25
|
-
migrations.RemoveField(
|
|
26
|
-
model_name="subcategory",
|
|
27
|
-
name="_description_rendered",
|
|
28
|
-
),
|
|
29
|
-
migrations.RemoveField(
|
|
30
|
-
model_name="thread",
|
|
31
|
-
name="_content_rendered",
|
|
32
|
-
),
|
|
33
13
|
migrations.AlterField(
|
|
34
14
|
model_name="boardprofile",
|
|
35
15
|
name="signature",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generated by Django 4.2.11 on 2024-06-06 02:56
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
("punkweb_bb", "0006_remove_boardprofile__signature_rendered_and_more"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name="boardprofile",
|
|
15
|
+
name="bio",
|
|
16
|
+
field=models.TextField(blank=True, max_length=1024),
|
|
17
|
+
),
|
|
18
|
+
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
punkweb_bb/models.py
CHANGED
|
@@ -23,6 +23,7 @@ def profile_image_upload_to(instance, filename):
|
|
|
23
23
|
class BoardProfile(UUIDPrimaryKeyMixin, TimestampMixin):
|
|
24
24
|
user = models.OneToOneField(User, related_name="profile", on_delete=models.CASCADE)
|
|
25
25
|
image = models.ImageField(upload_to=profile_image_upload_to, blank=True, null=True)
|
|
26
|
+
bio = models.TextField(max_length=1024, blank=True)
|
|
26
27
|
signature = models.TextField(max_length=1024, blank=True)
|
|
27
28
|
|
|
28
29
|
class Meta:
|
punkweb_bb/pagination.py
CHANGED
punkweb_bb/searching.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from django.db.models import Q
|
|
2
|
+
from punkweb_bb.models import Thread
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def search_threads(query):
|
|
6
|
+
query_parts = query.split()
|
|
7
|
+
q_objects = Q()
|
|
8
|
+
for part in query_parts:
|
|
9
|
+
q_objects |= Q(title__icontains=part) | Q(content__icontains=part)
|
|
10
|
+
return Thread.objects.filter(q_objects)
|
punkweb_bb/settings.py
CHANGED
|
@@ -8,6 +8,8 @@ PARSER = PUNKWEB_BB.get("PARSER", "bbcode")
|
|
|
8
8
|
FAVICON = PUNKWEB_BB.get("FAVICON", "punkweb_bb/favicon.ico")
|
|
9
9
|
OG_IMAGE = PUNKWEB_BB.get("OG_IMAGE", None)
|
|
10
10
|
SHOUTBOX_ENABLED = PUNKWEB_BB.get("SHOUTBOX_ENABLED", True)
|
|
11
|
+
SHOUTBOX_POLLING_ENABLED = PUNKWEB_BB.get("SHOUTBOX_POLLING_ENABLED", True)
|
|
12
|
+
SHOUTBOX_POLLING_INTERVAL = PUNKWEB_BB.get("SHOUTBOX_POLLING_INTERVAL", 30)
|
|
11
13
|
DISCORD_WIDGET_ENABLED = PUNKWEB_BB.get("DISCORD_WIDGET_ENABLED", False)
|
|
12
14
|
DISCORD_WIDGET_THEME = PUNKWEB_BB.get("DISCORD_WIDGET_THEME", "dark")
|
|
13
15
|
DISCORD_SERVER_ID = PUNKWEB_BB.get("DISCORD_SERVER_ID", None)
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*! SCEditor | (C) 2011-2013, Sam Clarke | sceditor.com/license */
|
|
2
|
+
html,
|
|
3
|
+
body,
|
|
4
|
+
p,
|
|
5
|
+
code:before,
|
|
6
|
+
table {
|
|
7
|
+
color: #212529;
|
|
8
|
+
font-family: Arial, Helvetica sans-serif;
|
|
9
|
+
font-size: 16px;
|
|
10
|
+
font-weight: 400;
|
|
11
|
+
line-height: 1.5;
|
|
12
|
+
margin: 0;
|
|
13
|
+
overflow: visible;
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
*,
|
|
18
|
+
*:before,
|
|
19
|
+
*:after {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
html {
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ios {
|
|
28
|
+
/* Needed for iOS scrolling bug fix */
|
|
29
|
+
overflow: auto;
|
|
30
|
+
-webkit-overflow-scrolling: touch;
|
|
31
|
+
}
|
|
32
|
+
.ios body {
|
|
33
|
+
/* Needed for iOS scrolling bug fix */
|
|
34
|
+
position: relative;
|
|
35
|
+
overflow: auto;
|
|
36
|
+
}
|
|
37
|
+
body {
|
|
38
|
+
/* Needed to make sure body covers the whole editor and that
|
|
39
|
+
long lines don't cause horizontal scrolling */
|
|
40
|
+
min-height: 100%;
|
|
41
|
+
word-wrap: break-word;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
body.placeholder::before {
|
|
45
|
+
content: attr(placeholder);
|
|
46
|
+
color: #555;
|
|
47
|
+
font-style: italic;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
table,
|
|
51
|
+
td {
|
|
52
|
+
border: 1px dotted #000;
|
|
53
|
+
empty-cells: show;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
table td {
|
|
57
|
+
min-width: 5px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
a {
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
code {
|
|
65
|
+
display: block;
|
|
66
|
+
background: #f5f2f0;
|
|
67
|
+
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
|
|
68
|
+
white-space: pre;
|
|
69
|
+
padding: 1em;
|
|
70
|
+
text-align: left;
|
|
71
|
+
margin: 0.5em 0;
|
|
72
|
+
direction: ltr;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
blockquote {
|
|
76
|
+
background: #f1f3f5;
|
|
77
|
+
margin: 0.25rem 0;
|
|
78
|
+
border-left: 2px solid #ced4da;
|
|
79
|
+
padding: 0.5rem 1rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
blockquote cite {
|
|
83
|
+
font-weight: 700;
|
|
84
|
+
display: block;
|
|
85
|
+
font-size: 1rem;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
hr {
|
|
89
|
+
border: none;
|
|
90
|
+
border-top: 1px solid #ced4da;
|
|
91
|
+
margin: 1rem 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
h1,
|
|
95
|
+
h2,
|
|
96
|
+
h3,
|
|
97
|
+
h4,
|
|
98
|
+
h5,
|
|
99
|
+
h6 {
|
|
100
|
+
padding: 0;
|
|
101
|
+
margin: 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Prevent empty paragraphs from collapsing */
|
|
105
|
+
div,
|
|
106
|
+
p {
|
|
107
|
+
min-height: 1.25em;
|
|
108
|
+
}
|
|
@@ -17,11 +17,10 @@
|
|
|
17
17
|
flex: 0 0 20rem;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.
|
|
20
|
+
.index__recentThreads {
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
gap: 1rem;
|
|
24
|
-
padding: 1rem;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
.index__recentThreads__thread {
|
|
@@ -35,18 +34,18 @@
|
|
|
35
34
|
font-size: 0.75rem;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
.
|
|
37
|
+
.index__recentThreads__thread__title {
|
|
39
38
|
display: block;
|
|
40
39
|
overflow: hidden;
|
|
41
40
|
text-overflow: ellipsis;
|
|
42
41
|
white-space: nowrap;
|
|
42
|
+
max-width: 15rem;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.
|
|
45
|
+
.index__statistics {
|
|
46
46
|
display: flex;
|
|
47
47
|
flex-direction: column;
|
|
48
48
|
gap: 1rem;
|
|
49
|
-
padding: 1rem;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
.index__statistics__list {
|
|
@@ -80,6 +79,7 @@
|
|
|
80
79
|
|
|
81
80
|
.subcategory__latestThread__info__title {
|
|
82
81
|
display: block;
|
|
82
|
+
max-width: 15rem;
|
|
83
83
|
overflow: hidden;
|
|
84
84
|
text-overflow: ellipsis;
|
|
85
85
|
white-space: nowrap;
|
|
@@ -88,6 +88,5 @@
|
|
|
88
88
|
@media screen and (max-width: 1024px) {
|
|
89
89
|
.index__main {
|
|
90
90
|
flex-direction: column;
|
|
91
|
-
gap: 0;
|
|
92
91
|
}
|
|
93
92
|
}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
.members__header {
|
|
2
|
+
align-items: center;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: 1rem;
|
|
6
|
+
margin-bottom: 1rem;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.members__header h1 {
|
|
10
|
+
margin: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
1
13
|
.members__list {
|
|
2
14
|
list-style: none;
|
|
3
|
-
padding: 0
|
|
15
|
+
padding: 0;
|
|
16
|
+
margin: 0;
|
|
4
17
|
}
|
|
5
18
|
|
|
6
19
|
.members__user {
|
|
@@ -10,11 +23,15 @@
|
|
|
10
23
|
}
|
|
11
24
|
|
|
12
25
|
.members__user:not(:last-of-type) {
|
|
13
|
-
border-bottom: 1px solid var(--
|
|
26
|
+
border-bottom: 1px solid var(--oc-gray-4);
|
|
14
27
|
}
|
|
15
28
|
|
|
16
29
|
.members__user__username {
|
|
30
|
+
align-items: center;
|
|
31
|
+
display: flex;
|
|
17
32
|
font-size: 1.25rem;
|
|
33
|
+
gap: 0.25rem;
|
|
34
|
+
position: relative;
|
|
18
35
|
}
|
|
19
36
|
|
|
20
37
|
.members__user__stat {
|
|
@@ -23,5 +40,5 @@
|
|
|
23
40
|
}
|
|
24
41
|
|
|
25
42
|
.members__user__stat__value {
|
|
26
|
-
color: var(--
|
|
43
|
+
color: var(--oc-gray-9);
|
|
27
44
|
}
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.profile__info__username {
|
|
15
|
+
align-items: center;
|
|
16
|
+
display: flex;
|
|
15
17
|
font-size: 1.5rem;
|
|
18
|
+
gap: 0.5rem;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
.profile__info__stat {
|
|
@@ -20,12 +23,13 @@
|
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
.profile__info__stat__value {
|
|
23
|
-
color: var(--
|
|
26
|
+
color: var(--oc-gray-9);
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
.profile__thread__list {
|
|
27
30
|
list-style: none;
|
|
28
31
|
padding: 0;
|
|
32
|
+
margin: 0;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
.profile__thread {
|
|
@@ -51,7 +55,7 @@
|
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
.profile__thread:not(:last-of-type) {
|
|
54
|
-
border-bottom: 1px solid var(--
|
|
58
|
+
border-bottom: 1px solid var(--oc-gray-4);
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
@media screen and (max-width: 768px) {
|