aa-bulletin-board 1.10.0__py3-none-any.whl → 1.11.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.
- aa_bulletin_board/__init__.py +5 -2
- aa_bulletin_board/apps.py +3 -1
- aa_bulletin_board/auth_hooks.py +15 -8
- aa_bulletin_board/docs/screenshots/weblate/.gitkeep +0 -0
- aa_bulletin_board/docs/screenshots/weblate/aa-bulletin-board-bulletin-created-message.jpg +0 -0
- aa_bulletin_board/docs/screenshots/weblate/aa-bulletin-board-group-restrictions.jpg +0 -0
- aa_bulletin_board/docs/screenshots/weblate/aa-bulletin-board-headline.jpg +0 -0
- aa_bulletin_board/docs/screenshots/weblate/aa-bulletin-board-hint-group-restrictions.jpg +0 -0
- aa_bulletin_board/docs/screenshots/weblate/aa-bulletin-board-menu-item.jpg +0 -0
- aa_bulletin_board/docs/screenshots/weblate/aa-bulletin-board-read-more-button.jpg +0 -0
- aa_bulletin_board/forms.py +8 -6
- aa_bulletin_board/helpers.py +15 -6
- aa_bulletin_board/locale/de/LC_MESSAGES/django.mo +0 -0
- aa_bulletin_board/locale/de/LC_MESSAGES/django.po +69 -25
- aa_bulletin_board/locale/django.pot +61 -19
- aa_bulletin_board/locale/es/LC_MESSAGES/django.po +61 -19
- aa_bulletin_board/locale/fr_FR/LC_MESSAGES/django.po +61 -19
- aa_bulletin_board/locale/it_IT/LC_MESSAGES/django.po +61 -19
- aa_bulletin_board/locale/ja/LC_MESSAGES/django.po +61 -19
- aa_bulletin_board/locale/ko_KR/LC_MESSAGES/django.po +61 -19
- aa_bulletin_board/locale/ru/LC_MESSAGES/django.mo +0 -0
- aa_bulletin_board/locale/ru/LC_MESSAGES/django.po +71 -27
- aa_bulletin_board/locale/uk/LC_MESSAGES/django.mo +0 -0
- aa_bulletin_board/locale/uk/LC_MESSAGES/django.po +75 -28
- aa_bulletin_board/locale/zh_Hans/LC_MESSAGES/django.po +61 -19
- aa_bulletin_board/managers.py +8 -3
- aa_bulletin_board/migrations/0001_initial.py +0 -1
- aa_bulletin_board/migrations/0002_alter_bulletin_slug.py +0 -1
- aa_bulletin_board/migrations/0003_group_restrictions.py +0 -1
- aa_bulletin_board/migrations/0004_model_translation.py +71 -0
- aa_bulletin_board/models.py +34 -8
- aa_bulletin_board/static/aa_bulletin_board/css/aa-bootstrap-fix.css +5 -5
- aa_bulletin_board/static/aa_bulletin_board/css/aa-bootstrap-fix.min.css +1 -1
- aa_bulletin_board/static/aa_bulletin_board/css/aa-bulletin-board.css +11 -0
- aa_bulletin_board/static/aa_bulletin_board/css/aa-bulletin-board.min.css +1 -1
- aa_bulletin_board/templates/aa_bulletin_board/base.html +5 -1
- aa_bulletin_board/templates/aa_bulletin_board/bulletin.html +6 -6
- aa_bulletin_board/templates/aa_bulletin_board/bundles/sumoselect-css.html +1 -1
- aa_bulletin_board/templates/aa_bulletin_board/bundles/sumoselect-js.html +1 -1
- aa_bulletin_board/templates/aa_bulletin_board/dashboard.html +9 -7
- aa_bulletin_board/templates/aa_bulletin_board/edit-bulletin.html +7 -5
- aa_bulletin_board/templates/aa_bulletin_board/partials/footer/app-translation-footer.html +11 -0
- aa_bulletin_board/templatetags/aa_bulletin_board_versioned_static.py +2 -1
- aa_bulletin_board/tests/test_access.py +61 -37
- aa_bulletin_board/tests/test_auth_hooks.py +18 -9
- aa_bulletin_board/tests/test_bulletins.py +102 -41
- aa_bulletin_board/tests/test_templatetags.py +9 -6
- aa_bulletin_board/tests/test_user_interface.py +88 -46
- aa_bulletin_board/tests/utils.py +33 -4
- aa_bulletin_board/urls.py +7 -5
- aa_bulletin_board/views.py +86 -33
- {aa_bulletin_board-1.10.0.dist-info → aa_bulletin_board-1.11.0.dist-info}/METADATA +2 -7
- aa_bulletin_board-1.11.0.dist-info/RECORD +63 -0
- {aa_bulletin_board-1.10.0.dist-info → aa_bulletin_board-1.11.0.dist-info}/WHEEL +1 -1
- aa_bulletin_board-1.10.0.dist-info/RECORD +0 -54
- {aa_bulletin_board-1.10.0.dist-info → aa_bulletin_board-1.11.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,23 +1,38 @@
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3
3
|
# This file is distributed under the same license as the PACKAGE package.
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#, fuzzy
|
4
|
+
# Peter Pfeufer <info@ppfeufer.de>, 2023.
|
5
|
+
# "Andrii M." <elfleg0las88@gmail.com>, 2023.
|
7
6
|
msgid ""
|
8
7
|
msgstr ""
|
9
8
|
"Project-Id-Version: PACKAGE VERSION\n"
|
10
9
|
"Report-Msgid-Bugs-To: \n"
|
11
|
-
"POT-Creation-Date: 2023-
|
12
|
-
"PO-Revision-Date:
|
13
|
-
"Last-Translator:
|
14
|
-
"Language-Team:
|
15
|
-
"
|
10
|
+
"POT-Creation-Date: 2023-08-02 15:50+0200\n"
|
11
|
+
"PO-Revision-Date: 2023-07-26 13:02+0000\n"
|
12
|
+
"Last-Translator: \"Andrii M.\" <elfleg0las88@gmail.com>\n"
|
13
|
+
"Language-Team: Ukrainian <https://weblate.ppfeufer.de/projects/alliance-auth-"
|
14
|
+
"apps/aa-bulletin-board/uk/>\n"
|
15
|
+
"Language: uk\n"
|
16
16
|
"MIME-Version: 1.0\n"
|
17
17
|
"Content-Type: text/plain; charset=UTF-8\n"
|
18
18
|
"Content-Transfer-Encoding: 8bit\n"
|
19
|
-
"Plural-Forms: nplurals=4; plural=
|
20
|
-
"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
19
|
+
"Plural-Forms: nplurals=4; plural=n==1 ? 3 : (n%10==1 && n%100!=11 ? 0 : "
|
20
|
+
"n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
21
|
+
"X-Generator: Weblate 4.18.2\n"
|
22
|
+
|
23
|
+
#: __init__.py:12 templates/aa_bulletin_board/base.html:5
|
24
|
+
#: templates/aa_bulletin_board/bulletin.html:5
|
25
|
+
#: templates/aa_bulletin_board/dashboard.html:6
|
26
|
+
#: templates/aa_bulletin_board/edit-bulletin.html:9
|
27
|
+
#: templates/aa_bulletin_board/edit-bulletin.html:11
|
28
|
+
msgid "Bulletin Board"
|
29
|
+
msgstr "Дошка оголошень"
|
30
|
+
|
31
|
+
#. Translators: This is the app name and version, which will appear in the Django Backend
|
32
|
+
#: apps.py:21
|
33
|
+
#, python-brace-format
|
34
|
+
msgid "Bulletin Board v{__version__}"
|
35
|
+
msgstr "Дошка оголошень v{__version__}"
|
21
36
|
|
22
37
|
#: forms.py:71
|
23
38
|
msgid ""
|
@@ -28,22 +43,40 @@ msgstr ""
|
|
28
43
|
"групових обмежень, кожен, хто має доступ до цього модуля, зможе прочитати "
|
29
44
|
"цей бюлетень."
|
30
45
|
|
31
|
-
#: models.py:
|
46
|
+
#: models.py:81
|
47
|
+
msgid "Title"
|
48
|
+
msgstr "Заголовок"
|
49
|
+
|
50
|
+
#: models.py:83
|
51
|
+
msgid "Content"
|
52
|
+
msgstr "Вміст"
|
53
|
+
|
54
|
+
#. Translators: This is the date and time the bulletin has been created
|
55
|
+
#: models.py:88
|
56
|
+
msgid "Created"
|
57
|
+
msgstr "Створено"
|
58
|
+
|
59
|
+
#. Translators: This is the date and time the bulletin has been updated
|
60
|
+
#: models.py:94
|
61
|
+
msgid "Updated"
|
62
|
+
msgstr ""
|
63
|
+
|
64
|
+
#: models.py:103
|
65
|
+
msgid "User"
|
66
|
+
msgstr ""
|
67
|
+
|
68
|
+
#: models.py:109
|
69
|
+
msgid "Group restrictions"
|
70
|
+
msgstr "Групові обмеження"
|
71
|
+
|
72
|
+
#: models.py:120
|
32
73
|
msgid "Bulletin"
|
33
74
|
msgstr "Інформаційний бюлетень"
|
34
75
|
|
35
|
-
#: models.py:
|
76
|
+
#: models.py:121
|
36
77
|
msgid "Bulletins"
|
37
78
|
msgstr "Інформаційні бюлетені"
|
38
79
|
|
39
|
-
#: templates/aa_bulletin_board/base.html:5
|
40
|
-
#: templates/aa_bulletin_board/bulletin.html:5
|
41
|
-
#: templates/aa_bulletin_board/dashboard.html:6
|
42
|
-
#: templates/aa_bulletin_board/edit-bulletin.html:9
|
43
|
-
#: templates/aa_bulletin_board/edit-bulletin.html:11
|
44
|
-
msgid "Bulletin Board"
|
45
|
-
msgstr "Дошка оголошень"
|
46
|
-
|
47
80
|
#: templates/aa_bulletin_board/bulletin.html:14
|
48
81
|
#: templates/aa_bulletin_board/dashboard.html:13
|
49
82
|
msgid "Add Bulletin"
|
@@ -88,31 +121,45 @@ msgstr "Бюлетень оновлень"
|
|
88
121
|
msgid "Create Bulletin"
|
89
122
|
msgstr "Створити бюлетень"
|
90
123
|
|
91
|
-
#:
|
124
|
+
#: templates/aa_bulletin_board/partials/footer/app-translation-footer.html:5
|
125
|
+
msgid ""
|
126
|
+
"Do you want to help translate this app into your language or improve the "
|
127
|
+
"existing translation?"
|
128
|
+
msgstr ""
|
129
|
+
|
130
|
+
#: templates/aa_bulletin_board/partials/footer/app-translation-footer.html:8
|
131
|
+
msgid "Join our team of translators!"
|
132
|
+
msgstr ""
|
133
|
+
|
134
|
+
#: views.py:80
|
92
135
|
#, python-brace-format
|
93
136
|
msgid "Bulletin \"{bulletin__title}\" created."
|
94
137
|
msgstr "Створено бюлетень \"{bulletin__title}\"."
|
95
138
|
|
96
|
-
#: views.py:
|
139
|
+
#: views.py:123
|
97
140
|
msgid ""
|
98
141
|
"The bulletin you are looking for does not exist, or you don't have access to "
|
99
142
|
"it."
|
100
143
|
msgstr "Бюлетень, який ви шукаєте, не існує, або у вас немає до нього доступу."
|
101
144
|
|
102
|
-
#: views.py:
|
145
|
+
#: views.py:165
|
103
146
|
#, python-brace-format
|
104
147
|
msgid "Bulletin \"{bulletin__title}\" updated."
|
105
148
|
msgstr "Оновлено бюлетень \"{bulletin__title}\"."
|
106
149
|
|
107
|
-
#: views.py:
|
108
|
-
|
150
|
+
#: views.py:184
|
151
|
+
#, fuzzy
|
152
|
+
#| msgid "The bulletin you are trying to edit for does not exist."
|
153
|
+
msgid "The bulletin you are trying to edit does not exist."
|
109
154
|
msgstr "Бюлетень, який ви намагаєтеся відредагувати, не існує."
|
110
155
|
|
111
|
-
#: views.py:
|
156
|
+
#: views.py:208
|
112
157
|
#, python-brace-format
|
113
158
|
msgid "Bulletin \"{bulletin.title}\" deleted."
|
114
159
|
msgstr "Бюлетень \"{bulletin.title}\" вилучено."
|
115
160
|
|
116
|
-
#: views.py:
|
117
|
-
|
161
|
+
#: views.py:215
|
162
|
+
#, fuzzy
|
163
|
+
#| msgid "The bulletin you are trying to delete for does not exist."
|
164
|
+
msgid "The bulletin you are trying to delete does not exist."
|
118
165
|
msgstr "Зведення, яке ви намагаєтеся видалити, не існує."
|
@@ -8,7 +8,7 @@ msgid ""
|
|
8
8
|
msgstr ""
|
9
9
|
"Project-Id-Version: PACKAGE VERSION\n"
|
10
10
|
"Report-Msgid-Bugs-To: \n"
|
11
|
-
"POT-Creation-Date: 2023-
|
11
|
+
"POT-Creation-Date: 2023-08-02 15:50+0200\n"
|
12
12
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13
13
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14
14
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -18,26 +18,58 @@ msgstr ""
|
|
18
18
|
"Content-Transfer-Encoding: 8bit\n"
|
19
19
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
20
20
|
|
21
|
+
#: __init__.py:12 templates/aa_bulletin_board/base.html:5
|
22
|
+
#: templates/aa_bulletin_board/bulletin.html:5
|
23
|
+
#: templates/aa_bulletin_board/dashboard.html:6
|
24
|
+
#: templates/aa_bulletin_board/edit-bulletin.html:9
|
25
|
+
#: templates/aa_bulletin_board/edit-bulletin.html:11
|
26
|
+
msgid "Bulletin Board"
|
27
|
+
msgstr ""
|
28
|
+
|
29
|
+
#. Translators: This is the app name and version, which will appear in the Django Backend
|
30
|
+
#: apps.py:21
|
31
|
+
#, python-brace-format
|
32
|
+
msgid "Bulletin Board v{__version__}"
|
33
|
+
msgstr ""
|
34
|
+
|
21
35
|
#: forms.py:71
|
22
36
|
msgid ""
|
23
37
|
"Restrict this bulletin to certain groups. If no group restrictions are in "
|
24
38
|
"place, everyone who has access to this module can read this bulletin."
|
25
39
|
msgstr ""
|
26
40
|
|
27
|
-
#: models.py:
|
28
|
-
msgid "
|
41
|
+
#: models.py:81
|
42
|
+
msgid "Title"
|
29
43
|
msgstr ""
|
30
44
|
|
31
|
-
#: models.py:
|
32
|
-
msgid "
|
45
|
+
#: models.py:83
|
46
|
+
msgid "Content"
|
33
47
|
msgstr ""
|
34
48
|
|
35
|
-
|
36
|
-
#:
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
49
|
+
#. Translators: This is the date and time the bulletin has been created
|
50
|
+
#: models.py:88
|
51
|
+
msgid "Created"
|
52
|
+
msgstr ""
|
53
|
+
|
54
|
+
#. Translators: This is the date and time the bulletin has been updated
|
55
|
+
#: models.py:94
|
56
|
+
msgid "Updated"
|
57
|
+
msgstr ""
|
58
|
+
|
59
|
+
#: models.py:103
|
60
|
+
msgid "User"
|
61
|
+
msgstr ""
|
62
|
+
|
63
|
+
#: models.py:109
|
64
|
+
msgid "Group restrictions"
|
65
|
+
msgstr ""
|
66
|
+
|
67
|
+
#: models.py:120
|
68
|
+
msgid "Bulletin"
|
69
|
+
msgstr ""
|
70
|
+
|
71
|
+
#: models.py:121
|
72
|
+
msgid "Bulletins"
|
41
73
|
msgstr ""
|
42
74
|
|
43
75
|
#: templates/aa_bulletin_board/bulletin.html:14
|
@@ -84,31 +116,41 @@ msgstr ""
|
|
84
116
|
msgid "Create Bulletin"
|
85
117
|
msgstr ""
|
86
118
|
|
87
|
-
#:
|
119
|
+
#: templates/aa_bulletin_board/partials/footer/app-translation-footer.html:5
|
120
|
+
msgid ""
|
121
|
+
"Do you want to help translate this app into your language or improve the "
|
122
|
+
"existing translation?"
|
123
|
+
msgstr ""
|
124
|
+
|
125
|
+
#: templates/aa_bulletin_board/partials/footer/app-translation-footer.html:8
|
126
|
+
msgid "Join our team of translators!"
|
127
|
+
msgstr ""
|
128
|
+
|
129
|
+
#: views.py:80
|
88
130
|
#, python-brace-format
|
89
131
|
msgid "Bulletin \"{bulletin__title}\" created."
|
90
132
|
msgstr ""
|
91
133
|
|
92
|
-
#: views.py:
|
134
|
+
#: views.py:123
|
93
135
|
msgid ""
|
94
136
|
"The bulletin you are looking for does not exist, or you don't have access to "
|
95
137
|
"it."
|
96
138
|
msgstr ""
|
97
139
|
|
98
|
-
#: views.py:
|
140
|
+
#: views.py:165
|
99
141
|
#, python-brace-format
|
100
142
|
msgid "Bulletin \"{bulletin__title}\" updated."
|
101
143
|
msgstr ""
|
102
144
|
|
103
|
-
#: views.py:
|
104
|
-
msgid "The bulletin you are trying to edit
|
145
|
+
#: views.py:184
|
146
|
+
msgid "The bulletin you are trying to edit does not exist."
|
105
147
|
msgstr ""
|
106
148
|
|
107
|
-
#: views.py:
|
149
|
+
#: views.py:208
|
108
150
|
#, python-brace-format
|
109
151
|
msgid "Bulletin \"{bulletin.title}\" deleted."
|
110
152
|
msgstr ""
|
111
153
|
|
112
|
-
#: views.py:
|
113
|
-
msgid "The bulletin you are trying to delete
|
154
|
+
#: views.py:215
|
155
|
+
msgid "The bulletin you are trying to delete does not exist."
|
114
156
|
msgstr ""
|
aa_bulletin_board/managers.py
CHANGED
@@ -16,10 +16,15 @@ class BulletinQuerySet(models.QuerySet):
|
|
16
16
|
def user_has_access(self, user: User) -> models.QuerySet:
|
17
17
|
"""
|
18
18
|
Filter boards that given user has access to.
|
19
|
+
|
20
|
+
:param user:
|
21
|
+
:type user:
|
22
|
+
:return:
|
23
|
+
:rtype:
|
19
24
|
"""
|
20
25
|
|
21
|
-
# Forum
|
22
|
-
if user.has_perm("aa_bulletin_board.manage_bulletins"):
|
26
|
+
# Forum managers always have access, so assign this permission wisely
|
27
|
+
if user.has_perm(perm="aa_bulletin_board.manage_bulletins"):
|
23
28
|
return self
|
24
29
|
|
25
30
|
# If not a forum manager, check if the user has access to the board
|
@@ -36,4 +41,4 @@ class BulletinManagerBase(models.Manager): # pylint: disable=too-few-public-met
|
|
36
41
|
pass # pylint: disable=unnecessary-pass
|
37
42
|
|
38
43
|
|
39
|
-
BulletinManager = BulletinManagerBase.from_queryset(BulletinQuerySet)
|
44
|
+
BulletinManager = BulletinManagerBase.from_queryset(queryset_class=BulletinQuerySet)
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# Generated by Django 4.0.10 on 2023-06-23 14:38
|
2
|
+
|
3
|
+
# Django
|
4
|
+
from django.conf import settings
|
5
|
+
from django.db import migrations, models
|
6
|
+
|
7
|
+
# ckEditor
|
8
|
+
import ckeditor_uploader.fields
|
9
|
+
|
10
|
+
# AA Bulletin Board
|
11
|
+
import aa_bulletin_board.models
|
12
|
+
|
13
|
+
|
14
|
+
class Migration(migrations.Migration):
|
15
|
+
dependencies = [
|
16
|
+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
17
|
+
("auth", "0012_alter_user_first_name_max_length"),
|
18
|
+
("aa_bulletin_board", "0003_group_restrictions"),
|
19
|
+
]
|
20
|
+
|
21
|
+
operations = [
|
22
|
+
migrations.AlterField(
|
23
|
+
model_name="bulletin",
|
24
|
+
name="content",
|
25
|
+
field=ckeditor_uploader.fields.RichTextUploadingField(
|
26
|
+
blank=True, null=True, verbose_name="Content"
|
27
|
+
),
|
28
|
+
),
|
29
|
+
migrations.AlterField(
|
30
|
+
model_name="bulletin",
|
31
|
+
name="created_by",
|
32
|
+
field=models.ForeignKey(
|
33
|
+
blank=True,
|
34
|
+
default=None,
|
35
|
+
null=True,
|
36
|
+
on_delete=models.SET(aa_bulletin_board.models.get_sentinel_user),
|
37
|
+
related_name="+",
|
38
|
+
to=settings.AUTH_USER_MODEL,
|
39
|
+
verbose_name="User",
|
40
|
+
),
|
41
|
+
),
|
42
|
+
migrations.AlterField(
|
43
|
+
model_name="bulletin",
|
44
|
+
name="created_date",
|
45
|
+
field=models.DateTimeField(
|
46
|
+
auto_now_add=True, db_index=True, verbose_name="Created"
|
47
|
+
),
|
48
|
+
),
|
49
|
+
migrations.AlterField(
|
50
|
+
model_name="bulletin",
|
51
|
+
name="groups",
|
52
|
+
field=models.ManyToManyField(
|
53
|
+
blank=True,
|
54
|
+
related_name="aa_bulletin_board_group_restriction",
|
55
|
+
to="auth.group",
|
56
|
+
verbose_name="Group restrictions",
|
57
|
+
),
|
58
|
+
),
|
59
|
+
migrations.AlterField(
|
60
|
+
model_name="bulletin",
|
61
|
+
name="title",
|
62
|
+
field=models.CharField(max_length=255, verbose_name="Title"),
|
63
|
+
),
|
64
|
+
migrations.AlterField(
|
65
|
+
model_name="bulletin",
|
66
|
+
name="updated_date",
|
67
|
+
field=models.DateTimeField(
|
68
|
+
auto_now=True, null=True, verbose_name="Updated"
|
69
|
+
),
|
70
|
+
),
|
71
|
+
]
|
aa_bulletin_board/models.py
CHANGED
@@ -21,8 +21,10 @@ from aa_bulletin_board.managers import BulletinManager
|
|
21
21
|
|
22
22
|
def get_sentinel_user() -> User:
|
23
23
|
"""
|
24
|
-
Get user or create one
|
24
|
+
Get the sentinel user or create one
|
25
|
+
|
25
26
|
:return:
|
27
|
+
:rtype:
|
26
28
|
"""
|
27
29
|
|
28
30
|
return User.objects.get_or_create(username="deleted")[0]
|
@@ -31,17 +33,22 @@ def get_sentinel_user() -> User:
|
|
31
33
|
def get_bulletin_slug_from_title(bulletin_title: str) -> str:
|
32
34
|
"""
|
33
35
|
Get the slug from the title
|
36
|
+
|
34
37
|
:param bulletin_title:
|
38
|
+
:type bulletin_title:
|
35
39
|
:return:
|
40
|
+
:rtype:
|
36
41
|
"""
|
37
42
|
|
38
43
|
run = 0
|
39
|
-
bulletin_slug = slugify(
|
44
|
+
bulletin_slug = slugify(
|
45
|
+
value=unidecode.unidecode(bulletin_title), allow_unicode=True
|
46
|
+
)
|
40
47
|
|
41
48
|
while Bulletin.objects.filter(slug=bulletin_slug).exists():
|
42
49
|
run += 1
|
43
50
|
bulletin_slug = slugify(
|
44
|
-
unidecode.unidecode(f"{bulletin_title}-{run}"), allow_unicode=True
|
51
|
+
value=unidecode.unidecode(f"{bulletin_title}-{run}"), allow_unicode=True
|
45
52
|
)
|
46
53
|
|
47
54
|
return bulletin_slug
|
@@ -71,11 +78,21 @@ class Bulletin(models.Model):
|
|
71
78
|
Bulletin model
|
72
79
|
"""
|
73
80
|
|
74
|
-
title = models.CharField(max_length=255)
|
81
|
+
title = models.CharField(max_length=255, verbose_name=_("Title"))
|
75
82
|
slug = models.SlugField(max_length=255, unique=True, allow_unicode=True)
|
76
|
-
content = RichTextUploadingField(blank=True, null=True)
|
77
|
-
created_date = models.DateTimeField(
|
78
|
-
|
83
|
+
content = RichTextUploadingField(blank=True, null=True, verbose_name=_("Content"))
|
84
|
+
created_date = models.DateTimeField(
|
85
|
+
auto_now_add=True,
|
86
|
+
db_index=True,
|
87
|
+
# Translators: This is the date and time the bulletin has been created
|
88
|
+
verbose_name=_("Created"),
|
89
|
+
)
|
90
|
+
updated_date = models.DateTimeField(
|
91
|
+
auto_now=True,
|
92
|
+
null=True,
|
93
|
+
# Translators: This is the date and time the bulletin has been updated
|
94
|
+
verbose_name=_("Updated"),
|
95
|
+
)
|
79
96
|
created_by = models.ForeignKey(
|
80
97
|
User,
|
81
98
|
related_name="+",
|
@@ -83,11 +100,13 @@ class Bulletin(models.Model):
|
|
83
100
|
blank=True,
|
84
101
|
default=None,
|
85
102
|
on_delete=models.SET(get_sentinel_user),
|
103
|
+
verbose_name=_("User"),
|
86
104
|
)
|
87
105
|
groups = models.ManyToManyField(
|
88
106
|
Group,
|
89
107
|
blank=True,
|
90
108
|
related_name="aa_bulletin_board_group_restriction",
|
109
|
+
verbose_name=_("Group restrictions"),
|
91
110
|
)
|
92
111
|
|
93
112
|
objects = BulletinManager()
|
@@ -108,9 +127,16 @@ class Bulletin(models.Model):
|
|
108
127
|
def save(self, *args, **kwargs) -> None:
|
109
128
|
"""
|
110
129
|
Add the slug on save
|
130
|
+
|
131
|
+
:param args:
|
132
|
+
:type args:
|
133
|
+
:param kwargs:
|
134
|
+
:type kwargs:
|
135
|
+
:return:
|
136
|
+
:rtype:
|
111
137
|
"""
|
112
138
|
|
113
|
-
self.content = string_cleanup(self.content)
|
139
|
+
self.content = string_cleanup(string=self.content)
|
114
140
|
|
115
141
|
if self.slug == "":
|
116
142
|
bulletin_slug = get_bulletin_slug_from_title(bulletin_title=self.title)
|
@@ -1,13 +1,13 @@
|
|
1
|
-
/*
|
1
|
+
/* Attempting to fix AA's wrong usage of bootstrap classes
|
2
2
|
------------------------------------------------------------------------------------- */
|
3
3
|
@media all {
|
4
|
-
|
5
|
-
margin-left:
|
4
|
+
#site-body-wrapper.row {
|
5
|
+
margin-left: 0;
|
6
6
|
}
|
7
7
|
}
|
8
8
|
|
9
9
|
@media all and (min-width: 768px) {
|
10
|
-
|
11
|
-
margin-left:
|
10
|
+
#site-body-wrapper.row {
|
11
|
+
margin-left: -15px;
|
12
12
|
}
|
13
13
|
}
|
@@ -1 +1 @@
|
|
1
|
-
@media all{
|
1
|
+
@media all{#site-body-wrapper.row{margin-left:0}}@media all and (min-width:768px){#site-body-wrapper.row{margin-left:-15px}}
|
@@ -40,6 +40,17 @@
|
|
40
40
|
height: auto !important; /* to override inline style added by CKeditor */
|
41
41
|
max-width: 100%;
|
42
42
|
}
|
43
|
+
|
44
|
+
.aa-bulletin-board-footer {
|
45
|
+
border-top: 1px solid rgb(236 240 241);
|
46
|
+
font-size: 85%;
|
47
|
+
margin-top: 1rem;
|
48
|
+
padding-top: 1rem;
|
49
|
+
}
|
50
|
+
|
51
|
+
.template-dark-mode .aa-bulletin-board-footer {
|
52
|
+
border-color: rgb(70 69 69);
|
53
|
+
}
|
43
54
|
}
|
44
55
|
|
45
56
|
/* MultiSelect
|
@@ -1 +1 @@
|
|
1
|
-
@media all{.aa-bulletin-board-header-addition{display:block}.aa-bulletin-board .panels-equal-height{display:flex;flex-wrap:wrap}.aa-bulletin-board .panels-equal-height .panel{width:100%}.aa-bulletin-board .panels-equal-height .panel-bulletin-excerpt{margin-bottom:.5rem;width:100%}.aa-bulletin-board .panel-bulletin-excerpt .panel-body{height:200px;mask-image:linear-gradient(180deg,rgb(0 0 0) 60%,transparent);overflow:hidden;padding:1rem}.aa-bulletin-board .panel-bulletin-excerpt .panel-footer-read-more-button{padding:.625rem 1rem}.aa-bulletin-board .django-ckeditor-widget{display:initial!important}.aa-bulletin-board-management{margin-bottom:2rem}.aa-bulletin-board img{height:auto!important;max-width:100%}.aa-bulletin-board .SumoSelect p{height:auto}.template-dark-mode .aa-bulletin-board .SumoSelect{color:rgb(54 54 54)}.template-dark-mode .aa-bulletin-board .SumoSelect>.CaptionCont>span.placeholder{color:rgb(62 68 76)}}@media all and (min-width:768px){.aa-bulletin-board .panels-equal-height .panel-bulletin-excerpt{width:calc(100%/2)}}@media all and (min-width:1200px){.aa-bulletin-board .panels-equal-height .panel-bulletin-excerpt{width:calc(100%/3)}}
|
1
|
+
@media all{.aa-bulletin-board-header-addition{display:block}.aa-bulletin-board .panels-equal-height{display:flex;flex-wrap:wrap}.aa-bulletin-board .panels-equal-height .panel{width:100%}.aa-bulletin-board .panels-equal-height .panel-bulletin-excerpt{margin-bottom:.5rem;width:100%}.aa-bulletin-board .panel-bulletin-excerpt .panel-body{height:200px;mask-image:linear-gradient(180deg,rgb(0 0 0) 60%,transparent);overflow:hidden;padding:1rem}.aa-bulletin-board .panel-bulletin-excerpt .panel-footer-read-more-button{padding:.625rem 1rem}.aa-bulletin-board .django-ckeditor-widget{display:initial!important}.aa-bulletin-board-management{margin-bottom:2rem}.aa-bulletin-board img{height:auto!important;max-width:100%}.aa-bulletin-board-footer{border-top:1px solid rgb(236 240 241);font-size:85%;margin-top:1rem;padding-top:1rem}.template-dark-mode .aa-bulletin-board-footer{border-color:rgb(70 69 69)}.aa-bulletin-board .SumoSelect p{height:auto}.template-dark-mode .aa-bulletin-board .SumoSelect{color:rgb(54 54 54)}.template-dark-mode .aa-bulletin-board .SumoSelect>.CaptionCont>span.placeholder{color:rgb(62 68 76)}}@media all and (min-width:768px){.aa-bulletin-board .panels-equal-height .panel-bulletin-excerpt{width:calc(100%/2)}}@media all and (min-width:1200px){.aa-bulletin-board .panels-equal-height .panel-bulletin-excerpt{width:calc(100%/3)}}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
{% extends
|
1
|
+
{% extends "allianceauth/base.html" %}
|
2
2
|
|
3
3
|
{% load i18n %}
|
4
4
|
|
@@ -13,5 +13,9 @@
|
|
13
13
|
<div class="aa-bulletin-board-body">
|
14
14
|
{% block aabulletinboard_body %}{% endblock %}
|
15
15
|
</div>
|
16
|
+
|
17
|
+
<div class="aa-bulletin-board-footer">
|
18
|
+
{% include "aa_bulletin_board/partials/footer/app-translation-footer.html" %}
|
19
|
+
</div>
|
16
20
|
</div>
|
17
21
|
{% endblock %}
|
@@ -1,17 +1,17 @@
|
|
1
|
-
{% extends
|
1
|
+
{% extends "aa_bulletin_board/base.html" %}
|
2
2
|
|
3
3
|
{% load i18n %}
|
4
4
|
|
5
5
|
{% block page_title %}{{ bulletin.title }} » {% translate "Bulletin Board" %}{% endblock %}
|
6
6
|
|
7
7
|
{% block aabulletinboard_header %}
|
8
|
-
{% include
|
8
|
+
{% include "aa_bulletin_board/partials/header/page-header.html" with header_text=bulletin.title %}
|
9
9
|
{% endblock %}
|
10
10
|
|
11
11
|
{% block aabulletinboard_body %}
|
12
12
|
{% if perms.aa_bulletin_board.manage_bulletins %}
|
13
13
|
<div class="aa-bulletin-board-management text-right">
|
14
|
-
<a class="btn btn-success btn-read-more" href="{% url 'aa_bulletin_board:create_bulletin' %}">{% translate
|
14
|
+
<a class="btn btn-success btn-read-more" href="{% url 'aa_bulletin_board:create_bulletin' %}">{% translate "Add Bulletin" %}</a>
|
15
15
|
</div>
|
16
16
|
{% endif %}
|
17
17
|
|
@@ -19,11 +19,11 @@
|
|
19
19
|
<div class="panel panel-default">
|
20
20
|
<div class="panel-heading">
|
21
21
|
<div class="panel-title">
|
22
|
-
<a class="btn btn-default btn-sm" href="{% url 'aa_bulletin_board:dashboard' %}">{% translate
|
22
|
+
<a class="btn btn-default btn-sm" href="{% url 'aa_bulletin_board:dashboard' %}">{% translate "Back" %}</a>
|
23
23
|
|
24
24
|
{% if perms.aa_bulletin_board.manage_bulletins %}
|
25
|
-
<a class="btn btn-warning btn-sm btn-read-more" href="{% url 'aa_bulletin_board:edit_bulletin' bulletin.slug %}">{% translate
|
26
|
-
<a class="btn btn-danger btn-sm btn-read-more" href="{% url 'aa_bulletin_board:remove_bulletin' bulletin.slug %}">{% translate
|
25
|
+
<a class="btn btn-warning btn-sm btn-read-more" href="{% url 'aa_bulletin_board:edit_bulletin' bulletin.slug %}">{% translate "Edit" %}</a>
|
26
|
+
<a class="btn btn-danger btn-sm btn-read-more" href="{% url 'aa_bulletin_board:remove_bulletin' bulletin.slug %}">{% translate "Delete" %}</a>
|
27
27
|
{% endif %}
|
28
28
|
</div>
|
29
29
|
</div>
|