Skip to content

Commit 7cce79e

Browse files
authored
Messages (#146)
* Messages * Admin menu * Adverts menu * Faults menu * Redaction menu * Fix of advert test * Article redirect to assets after save * Fault and Advert redirect to assets after save * Translations * Remove message from article asset upload * Article and Fault comment
1 parent e865017 commit 7cce79e

16 files changed

+134
-74
lines changed

svjis/articles/locale/cs/LC_MESSAGES/django.po

+40-27
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-01-12 12:52+0100\n"
11+
"POT-Creation-Date: 2025-01-18 23:50+0100\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -93,7 +93,7 @@ msgstr "Soubor"
9393
#: articles/models.py:69 articles/models.py:85
9494
#: articles/templates/redaction_article.html:15
9595
#: articles/templates/redaction_article_edit.html:9
96-
#: articles/views_redaction.py:164
96+
#: articles/views_redaction.py:165
9797
msgid "Article"
9898
msgstr "Článek"
9999

@@ -289,9 +289,11 @@ msgstr "Editovat"
289289

290290
#: articles/templates/admin_board.html:24
291291
#: articles/templates/admin_building_unit.html:73
292+
#: articles/templates/admin_building_unit_owners_edit.html:23
292293
#: articles/templates/admin_entrance.html:24
293294
#: articles/templates/admin_group.html:25
294295
#: articles/templates/admin_preferences.html:24
296+
#: articles/templates/admin_user_ownes_edit.html:25
295297
#: articles/templates/advert_edit.html:66 articles/templates/fault.html:75
296298
#: articles/templates/redaction_article_edit.html:74
297299
#: articles/templates/redaction_menu.html:27
@@ -526,8 +528,7 @@ msgstr "Vytvořit nový inzerát"
526528
msgid "Author"
527529
msgstr "Autor"
528530

529-
#: articles/templates/article.html:10 articles/templates/article.html:33
530-
#: articles/templates/fault.html:106 articles/templates/main.html:22
531+
#: articles/templates/article.html:33 articles/templates/fault.html:106
531532
msgid "Comments"
532533
msgstr "Komentáře"
533534

@@ -549,13 +550,13 @@ msgstr "Zpět na seznam článků"
549550

550551
#: articles/templates/box-news.html:7
551552
#: articles/templates/redaction_news_edit.html:7 articles/views_redaction.py:32
552-
#: articles/views_redaction.py:331
553+
#: articles/views_redaction.py:335
553554
msgid "News"
554555
msgstr "Novinky"
555556

556557
#: articles/templates/box-survey.html:8
557558
#: articles/templates/redaction_survey_edit.html:7
558-
#: articles/views_redaction.py:578
559+
#: articles/views_redaction.py:585
559560
msgid "Survey"
560561
msgstr "Anketa"
561562

@@ -866,12 +867,12 @@ msgid "Personal settings"
866867
msgstr "Osobní nastavení"
867868

868869
#: articles/utils.py:64 articles/views_redaction.py:91
869-
#: articles/views_redaction.py:108 articles/views_redaction.py:178
870-
#: articles/views_redaction.py:206 articles/views_redaction.py:274
871-
#: articles/views_redaction.py:294 articles/views_redaction.py:344
872-
#: articles/views_redaction.py:364 articles/views_redaction.py:419
873-
#: articles/views_redaction.py:439 articles/views_redaction.py:491
874-
#: articles/views_redaction.py:513 articles/views_redaction.py:581
870+
#: articles/views_redaction.py:108 articles/views_redaction.py:179
871+
#: articles/views_redaction.py:207 articles/views_redaction.py:277
872+
#: articles/views_redaction.py:297 articles/views_redaction.py:348
873+
#: articles/views_redaction.py:368 articles/views_redaction.py:424
874+
#: articles/views_redaction.py:444 articles/views_redaction.py:497
875+
#: articles/views_redaction.py:519 articles/views_redaction.py:588
875876
msgid "Redaction"
876877
msgstr "Redakce"
877878

@@ -882,14 +883,14 @@ msgid "Fault reporting"
882883
msgstr "Hlášení závad"
883884

884885
#: articles/utils.py:88 articles/views_admin.py:99 articles/views_admin.py:128
885-
#: articles/views_admin.py:145 articles/views_admin.py:187
886-
#: articles/views_admin.py:214 articles/views_admin.py:231
887-
#: articles/views_admin.py:284 articles/views_admin.py:305
888-
#: articles/views_admin.py:348 articles/views_admin.py:433
889-
#: articles/views_admin.py:465 articles/views_admin.py:526
890-
#: articles/views_admin.py:621 articles/views_admin.py:648
891-
#: articles/views_admin.py:700 articles/views_admin.py:717
892-
#: articles/views_admin.py:756
886+
#: articles/views_admin.py:145 articles/views_admin.py:188
887+
#: articles/views_admin.py:215 articles/views_admin.py:232
888+
#: articles/views_admin.py:286 articles/views_admin.py:307
889+
#: articles/views_admin.py:351 articles/views_admin.py:436
890+
#: articles/views_admin.py:468 articles/views_admin.py:531
891+
#: articles/views_admin.py:626 articles/views_admin.py:653
892+
#: articles/views_admin.py:706 articles/views_admin.py:723
893+
#: articles/views_admin.py:763
893894
msgid "Administration"
894895
msgstr "Administrace"
895896

@@ -898,18 +899,18 @@ msgid "All articles"
898899
msgstr "Všechny články"
899900

900901
#: articles/views.py:107 articles/views_faults.py:71
901-
#: articles/views_redaction.py:152
902+
#: articles/views_redaction.py:153
902903
msgid "Search: Keyword '{}' is too short. Type at least 3 characters."
903904
msgstr ""
904905
"Vyhledat: Klíčové slovo '{}' je příliš krátké. Zadejte alespoň 3 znaky."
905906

906907
#: articles/views.py:110 articles/views_faults.py:74
907-
#: articles/views_redaction.py:155
908+
#: articles/views_redaction.py:156
908909
msgid "Search: Keyword is too long. Type maximum of 100 characters."
909910
msgstr "Vyhledat: Klíčové slovo je příliš dlouhé. Zadejte maximálně 100 znaků."
910911

911912
#: articles/views.py:115 articles/views_faults.py:78
912-
#: articles/views_redaction.py:161
913+
#: articles/views_redaction.py:162
913914
msgid "Search results"
914915
msgstr "Výsledky hledání"
915916

@@ -935,11 +936,23 @@ msgstr "Uživatelé"
935936
msgid "Groups"
936937
msgstr "Skupiny"
937938

938-
#: articles/views_admin.py:113 articles/views_admin.py:201
939-
#: articles/views_personal_settings.py:70
939+
#: articles/views_admin.py:113 articles/views_admin.py:166
940+
#: articles/views_admin.py:202 articles/views_admin.py:253
941+
#: articles/views_admin.py:328 articles/views_admin.py:521
942+
#: articles/views_admin.py:684 articles/views_admin.py:742
943+
#: articles/views_adverts.py:122 articles/views_adverts.py:144
944+
#: articles/views_faults.py:199 articles/views_faults.py:245
945+
#: articles/views_personal_settings.py:70 articles/views_redaction.py:128
946+
#: articles/views_redaction.py:249 articles/views_redaction.py:314
947+
#: articles/views_redaction.py:391 articles/views_redaction.py:464
948+
#: articles/views_redaction.py:558
940949
msgid "Saved"
941950
msgstr "Uloženo"
942951

952+
#: articles/views_admin.py:503
953+
msgid "Credentials has been sent by e-mail"
954+
msgstr "Přihlašovací údaje byly odeslány e-mailem"
955+
943956
#: articles/views_adverts.py:17 articles/views_adverts.py:59
944957
msgid "All"
945958
msgstr "Vše"
@@ -985,10 +998,10 @@ msgstr "Neplatný e-mail"
985998
msgid "Credentials have been sent to your e-mail"
986999
msgstr "Přihlašovací údaje byly odeslány na Váš e-mail"
9871000

988-
#: articles/views_redaction.py:48 articles/views_redaction.py:478
1001+
#: articles/views_redaction.py:48 articles/views_redaction.py:484
9891002
msgid "Surveys"
9901003
msgstr "Ankety"
9911004

992-
#: articles/views_redaction.py:406
1005+
#: articles/views_redaction.py:411
9931006
msgid "Useful links"
9941007
msgstr "Užitečné odkazy"

svjis/articles/locale/en/LC_MESSAGES/django.po

+40-27
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-01-12 12:52+0100\n"
11+
"POT-Creation-Date: 2025-01-18 23:50+0100\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -92,7 +92,7 @@ msgstr "File"
9292
#: articles/models.py:69 articles/models.py:85
9393
#: articles/templates/redaction_article.html:15
9494
#: articles/templates/redaction_article_edit.html:9
95-
#: articles/views_redaction.py:164
95+
#: articles/views_redaction.py:165
9696
msgid "Article"
9797
msgstr "Article"
9898

@@ -288,9 +288,11 @@ msgstr "Edit"
288288

289289
#: articles/templates/admin_board.html:24
290290
#: articles/templates/admin_building_unit.html:73
291+
#: articles/templates/admin_building_unit_owners_edit.html:23
291292
#: articles/templates/admin_entrance.html:24
292293
#: articles/templates/admin_group.html:25
293294
#: articles/templates/admin_preferences.html:24
295+
#: articles/templates/admin_user_ownes_edit.html:25
294296
#: articles/templates/advert_edit.html:66 articles/templates/fault.html:75
295297
#: articles/templates/redaction_article_edit.html:74
296298
#: articles/templates/redaction_menu.html:27
@@ -525,8 +527,7 @@ msgstr "Create new advert"
525527
msgid "Author"
526528
msgstr "Author"
527529

528-
#: articles/templates/article.html:10 articles/templates/article.html:33
529-
#: articles/templates/fault.html:106 articles/templates/main.html:22
530+
#: articles/templates/article.html:33 articles/templates/fault.html:106
530531
msgid "Comments"
531532
msgstr "Comments"
532533

@@ -548,13 +549,13 @@ msgstr "Back to article list"
548549

549550
#: articles/templates/box-news.html:7
550551
#: articles/templates/redaction_news_edit.html:7 articles/views_redaction.py:32
551-
#: articles/views_redaction.py:331
552+
#: articles/views_redaction.py:335
552553
msgid "News"
553554
msgstr "News"
554555

555556
#: articles/templates/box-survey.html:8
556557
#: articles/templates/redaction_survey_edit.html:7
557-
#: articles/views_redaction.py:578
558+
#: articles/views_redaction.py:585
558559
msgid "Survey"
559560
msgstr "Survey"
560561

@@ -863,12 +864,12 @@ msgid "Personal settings"
863864
msgstr "Personal settings"
864865

865866
#: articles/utils.py:64 articles/views_redaction.py:91
866-
#: articles/views_redaction.py:108 articles/views_redaction.py:178
867-
#: articles/views_redaction.py:206 articles/views_redaction.py:274
868-
#: articles/views_redaction.py:294 articles/views_redaction.py:344
869-
#: articles/views_redaction.py:364 articles/views_redaction.py:419
870-
#: articles/views_redaction.py:439 articles/views_redaction.py:491
871-
#: articles/views_redaction.py:513 articles/views_redaction.py:581
867+
#: articles/views_redaction.py:108 articles/views_redaction.py:179
868+
#: articles/views_redaction.py:207 articles/views_redaction.py:277
869+
#: articles/views_redaction.py:297 articles/views_redaction.py:348
870+
#: articles/views_redaction.py:368 articles/views_redaction.py:424
871+
#: articles/views_redaction.py:444 articles/views_redaction.py:497
872+
#: articles/views_redaction.py:519 articles/views_redaction.py:588
872873
msgid "Redaction"
873874
msgstr "Redaction"
874875

@@ -879,14 +880,14 @@ msgid "Fault reporting"
879880
msgstr "Fault reporting"
880881

881882
#: articles/utils.py:88 articles/views_admin.py:99 articles/views_admin.py:128
882-
#: articles/views_admin.py:145 articles/views_admin.py:187
883-
#: articles/views_admin.py:214 articles/views_admin.py:231
884-
#: articles/views_admin.py:284 articles/views_admin.py:305
885-
#: articles/views_admin.py:348 articles/views_admin.py:433
886-
#: articles/views_admin.py:465 articles/views_admin.py:526
887-
#: articles/views_admin.py:621 articles/views_admin.py:648
888-
#: articles/views_admin.py:700 articles/views_admin.py:717
889-
#: articles/views_admin.py:756
883+
#: articles/views_admin.py:145 articles/views_admin.py:188
884+
#: articles/views_admin.py:215 articles/views_admin.py:232
885+
#: articles/views_admin.py:286 articles/views_admin.py:307
886+
#: articles/views_admin.py:351 articles/views_admin.py:436
887+
#: articles/views_admin.py:468 articles/views_admin.py:531
888+
#: articles/views_admin.py:626 articles/views_admin.py:653
889+
#: articles/views_admin.py:706 articles/views_admin.py:723
890+
#: articles/views_admin.py:763
890891
msgid "Administration"
891892
msgstr "Administration"
892893

@@ -895,17 +896,17 @@ msgid "All articles"
895896
msgstr "All articles"
896897

897898
#: articles/views.py:107 articles/views_faults.py:71
898-
#: articles/views_redaction.py:152
899+
#: articles/views_redaction.py:153
899900
msgid "Search: Keyword '{}' is too short. Type at least 3 characters."
900901
msgstr "Search: Keyword '{}' is too short. Type at least 3 characters."
901902

902903
#: articles/views.py:110 articles/views_faults.py:74
903-
#: articles/views_redaction.py:155
904+
#: articles/views_redaction.py:156
904905
msgid "Search: Keyword is too long. Type maximum of 100 characters."
905906
msgstr "Search: Keyword is too long. Type maximum of 100 characters."
906907

907908
#: articles/views.py:115 articles/views_faults.py:78
908-
#: articles/views_redaction.py:161
909+
#: articles/views_redaction.py:162
909910
msgid "Search results"
910911
msgstr "Search results"
911912

@@ -929,11 +930,23 @@ msgstr "Users"
929930
msgid "Groups"
930931
msgstr "Groups"
931932

932-
#: articles/views_admin.py:113 articles/views_admin.py:201
933-
#: articles/views_personal_settings.py:70
933+
#: articles/views_admin.py:113 articles/views_admin.py:166
934+
#: articles/views_admin.py:202 articles/views_admin.py:253
935+
#: articles/views_admin.py:328 articles/views_admin.py:521
936+
#: articles/views_admin.py:684 articles/views_admin.py:742
937+
#: articles/views_adverts.py:122 articles/views_adverts.py:144
938+
#: articles/views_faults.py:199 articles/views_faults.py:245
939+
#: articles/views_personal_settings.py:70 articles/views_redaction.py:128
940+
#: articles/views_redaction.py:249 articles/views_redaction.py:314
941+
#: articles/views_redaction.py:391 articles/views_redaction.py:464
942+
#: articles/views_redaction.py:558
934943
msgid "Saved"
935944
msgstr "Saved"
936945

946+
#: articles/views_admin.py:503
947+
msgid "Credentials has been sent by e-mail"
948+
msgstr "Credentials has been sent by e-mail"
949+
937950
#: articles/views_adverts.py:17 articles/views_adverts.py:59
938951
msgid "All"
939952
msgstr "All"
@@ -979,10 +992,10 @@ msgstr "E-Mail is not valid"
979992
msgid "Credentials have been sent to your e-mail"
980993
msgstr "Credentials have been sent to your e-mail"
981994

982-
#: articles/views_redaction.py:48 articles/views_redaction.py:478
995+
#: articles/views_redaction.py:48 articles/views_redaction.py:484
983996
msgid "Surveys"
984997
msgstr "Surveys"
985998

986-
#: articles/views_redaction.py:406
999+
#: articles/views_redaction.py:411
9871000
msgid "Useful links"
9881001
msgstr "Useful links"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Generated by Django 5.1.5 on 2025-01-19 11:01
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('articles', '0004_alter_company_name'),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name='articlecomment',
15+
options={'ordering': ['id'], 'permissions': (('svjis_add_article_comment', 'Can add Article comment'),)},
16+
),
17+
]

svjis/articles/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __str__(self):
9191
return f"ArticleComment: {self.description}"
9292

9393
class Meta:
94-
ordering = ['-id']
94+
ordering = ['id']
9595
permissions = (("svjis_add_article_comment", "Can add Article comment"),)
9696

9797

svjis/articles/templates/admin_building_unit_owners_edit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h1 class="page-title" id="tbl-desc">{{ bu.type.description }} - {{ bu.registrat
2020
<td class="list">{{ forloop.counter }}</td>
2121
<td class="list">{{ obj.first_name }}</td>
2222
<td class="list">{{ obj.last_name }}</td>
23-
<td class="list"><a href="{% url 'admin_building_unit_owners_delete' pk=pk owner=obj.pk %}"><img src="/static/gfx/delete.png" class="led" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
23+
<td class="list"><a onclick="if (!confirm('{% translate 'Do you want to delete' %} {{ obj.first_name }}&nbsp;{{ obj.last_name }} ?')) return false;" href="{% url 'admin_building_unit_owners_delete' pk=pk owner=obj.pk %}"><img src="/static/gfx/delete.png" class="led" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
2424
</tr>
2525
{% endfor %}
2626
{% endif %}

svjis/articles/templates/admin_user_ownes_edit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h1 class="page-title" id="tbl-desc">{{ u.first_name }} {{ u.last_name }}</h1>
2222
<td class="list">{{ obj.type.description }}</td>
2323
<td class="list">{{ obj.registration_id }}</td>
2424
<td class="list">{{ obj.description }}</td>
25-
<td class="list"><a href="{% url 'admin_user_owns_delete' pk=pk owner=obj.pk %}"><img src="/static/gfx/delete.png" class="led" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
25+
<td class="list"><a onclick="if (!confirm('{% translate 'Do you want to delete' %} {{ obj.type.description }}&nbsp;{{ obj.registration_id }} ?')) return false;" href="{% url 'admin_user_owns_delete' pk=pk owner=obj.pk %}"><img src="/static/gfx/delete.png" class="led" title="{% translate 'Delete' %}" alt="{% translate 'Delete' %}"></a></td>
2626
</tr>
2727
{% endfor %}
2828
{% endif %}

svjis/articles/templates/advert_edit.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1 class="page-title">{% translate 'Adverts' %}</h1>
4343
</form>
4444

4545
{% if pk != 0 %}
46-
<h2>{% translate 'Assets' %}</h2>
46+
<h2 id="assets">{% translate 'Assets' %}</h2>
4747
<form action="{% url 'adverts_asset_save' %}" method="post" enctype="multipart/form-data">
4848
{% csrf_token %}
4949
<input type="hidden" name="advert_pk" value="{{ form.instance.pk }}">

svjis/articles/templates/article.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ <h2 class="comment-title">{% translate 'Assets' %}:</h2>
3030
{% endif %}
3131

3232
{% if obj.comments or obj.allow_comments %}
33-
<h2 class="comment-title">{% translate 'Comments' %}:</h2>
33+
<h2 id="comments" class="comment-title">{% translate 'Comments' %}:</h2>
3434
{% for comment in obj.comments %}
3535
<div class="comment-box"><strong>{{ comment.author.first_name }}&nbsp;{{ comment.author.last_name }} {{ comment.created_date|date:"d.m.Y H:i" }}</strong>
3636
<br>{{ comment.body|replace_url_to_link|linebreaks }}

svjis/articles/templates/fault.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h1 class="page-title" {% if obj.closed %}style="text-decoration: line-through;
5353

5454

5555
{% if pk != 0 %}
56-
<h2 class="comment-title">{% translate 'Assets' %}:</h2>
56+
<h2 class="comment-title" id="assets">{% translate 'Assets' %}:</h2>
5757
{% if assets %}
5858
<table class="list full-width" aria-describedby="tbl-desc">
5959
<tr>
@@ -103,7 +103,7 @@ <h2 class="comment-title">{% translate 'Assets' %}:</h2>
103103
{% endif %}
104104
{% endif %}
105105

106-
<h2 class="comment-title">{% translate 'Comments' %}:</h2>
106+
<h2 id="comments" class="comment-title">{% translate 'Comments' %}:</h2>
107107
{% for comment in obj.comments %}
108108
<div class="comment-box"><strong>{{ comment.author.first_name }}&nbsp;{{ comment.author.last_name }} {{ comment.created_date|date:"d.m.Y H:i" }}</strong>
109109
<br>{{ comment.body|replace_url_to_link|linebreaks }}

0 commit comments

Comments
 (0)