From 3ca475c8e10c811633dec531772e18da6e5fa33d Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 10 Oct 2023 15:51:11 +0200 Subject: [PATCH 1/1] Rename publishable to approved, add profile option to approve by default. --- src/documents/locale/pl/LC_MESSAGES/django.mo | Bin 8140 -> 8127 bytes src/documents/locale/pl/LC_MESSAGES/django.po | 151 ++++++++++-------- ..._alter_chunkchange_publishable_and_more.py | 23 +++ src/documents/models/book.py | 2 +- src/documents/models/image.py | 2 +- src/dvcs/locale/pl/LC_MESSAGES/django.mo | Bin 1581 -> 1530 bytes src/dvcs/locale/pl/LC_MESSAGES/django.po | 18 ++- src/dvcs/models.py | 2 +- src/redakcja/static/css/history.css | 18 +++ src/redakcja/static/js/wiki/base.js | 8 +- src/redakcja/static/js/wiki/dialog_pubmark.js | 6 +- src/redakcja/static/js/wiki/view_history.js | 9 +- src/team/admin.py | 20 ++- .../0002_profile_approve_by_default.py | 19 +++ src/team/models.py | 7 + src/wiki/forms.py | 16 +- src/wiki/locale/pl/LC_MESSAGES/django.mo | Bin 4110 -> 3829 bytes src/wiki/locale/pl/LC_MESSAGES/django.po | 121 +++++++------- .../templates/wiki/tabs/history_view.html | 12 +- src/wiki/views.py | 2 +- 20 files changed, 279 insertions(+), 157 deletions(-) create mode 100644 src/documents/migrations/0013_alter_chunkchange_publishable_and_more.py create mode 100644 src/team/migrations/0002_profile_approve_by_default.py diff --git a/src/documents/locale/pl/LC_MESSAGES/django.mo b/src/documents/locale/pl/LC_MESSAGES/django.mo index 453940f330a06bdf1382e8b125b5624fb7f77c91..1ff7cb4febf2cf678c674bd0b0097ca0fa8879c4 100644 GIT binary patch delta 1859 zcmYk+eMpv97{~GJ_T|afCm+*H(|V$)$eM3B!6GTC{L@*3tsr?;Qr4XHI1;mY7iCm1 zbXomTQMCGJqxbudV$21bL2rv9C;}zNf+)s@ZBcU-`~K=c!GoW3&V8NhoO9jh_D0R6 znzI9*Kf}zr!)9agl(Qex>Hms(cpr0c1lM7R;PJQ-$KWnhe6Q;t#&PsdUYH zjd!^5F60jRwu8p+9w)*Q0)39BOL+!$;(MqBf1nn6fqHkZQ5(!83sWr*6<3TZc@?S> zOHpw#nHPHMdR5> zPMeHXI2TpwHdOp>)WP;5hqc3~_zQ0Q4(fnIz8iRmy4`=GO7{;cQ7Xq%WwKF;W~0WJ zIO|dKK1Efo(e*bX*U8#Z^LkJVe(#>2Lw&yf1sZynKce2vbr*04HQ_!g@vwXT6t#g- z)Cm*0S^CT}QI(m9+VD)&tzU?$Oap4cwaykKf4RloK*!qw>q5QTZq(&G;Ksj2CHgLC zPO0*|kNS?KmUz~8JGICAurHQ&+_NA#eP3cqY{Q0l>!zmF!HIA~!n>Xqd6tk>F{iAQ zU$m^Ux}vhUv^)sqbb1LNlm**zS0&}Q#MTXTM>og5Y;SIguio7HMaQbO(e|czTQHh` PG9lx=2eII%!f@jME1bk$ delta 1870 zcmY+@duYvJ9LMqRnavzyJDVAHu|sm3nX|>oB`cOh5s8rIY=&Lz$OscZx&2|H45dU% zk|LKQ`$M^8e@r3#A%&XjAJYoCZ!Yi8_WVJe&g*%e-}m`G&-48~znjJPiZ8YJys>7s zH`y!&FF9{v68(ob2%lp*e#R>F6P$q?F%cV3@r|y33J1_Xi~aCA#$ziE#QW&S*D2;% z9~vDD^vAC_7~=zGLCirVn2uUtF80MGu3v_!^lLGQJ8?EPxqdt9fJp=?|0L{SPa46?ui4{|%M+7pfxhX+0b5hgtLoq2h{A z^CqJzG0&r+iL0E|sK5=V9dB{{eW-~CP!pR_^O{i`yWzZpn%9cT^8^+5-1*u)Z%1v^ z`%XhA)Ug!kN0mB&dPmtv6>TKyRfLg4S_x|5#i)grqvl84_*yr<4wbLYjeBl<4|0b* z+fU=Aj}u`5fx9{0D2$;_{0x=g18Siz)Vqsgwllpx+`Om;@M2h!^Nl#>_S!IAgWSFQ460% zZKT;fzl|eU-&$#m#11URbh7J~FG3|OMQxxOm9QSQzyVZTBl5G8{OQs*qc-*!DVDv( zTU%No-2`Hn(Q1Jh~n%;umDO-^FOGKC32&5!T{1J;0gw}(-e^Ryekh)Q%VR@o=)^I2n)zrZ)C@sa-! z?MUC#z6G&_q$9nO)^94SsjOQYDXXc7H6<^M`){B#@Fgw~$`2Lhhr+>7Xi8ByZ$juw z`Zix|`@r(}jJlS+!8Os1(ajaXRncH~rs_y}?8lJvaf74vwUP4rXl>-*M^%;MW0$j& Gd;JABQOM2! diff --git a/src/documents/locale/pl/LC_MESSAGES/django.po b/src/documents/locale/pl/LC_MESSAGES/django.po index b9c500fd..8edabb4a 100644 --- a/src/documents/locale/pl/LC_MESSAGES/django.po +++ b/src/documents/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Platforma Redakcyjna\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-12-17 11:37+0100\n" +"PO-Revision-Date: 2023-10-10 15:35+0200\n" "Last-Translator: Radek Czajka \n" "Language-Team: Fundacja Nowoczesna Polska \n" @@ -17,101 +17,101 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" -"X-Generator: Poedit 3.0\n" +"X-Generator: Poedit 3.0.1\n" -#: documents/forms.py:41 +#: documents/forms.py:43 msgid "Text file must be UTF-8 encoded." msgstr "Plik powinien mieć kodowanie UTF-8." -#: documents/forms.py:57 +#: documents/forms.py:59 msgid "Title not set" msgstr "Brak tytułu" -#: documents/forms.py:60 +#: documents/forms.py:62 msgid "Slug not set" msgstr "Brak slugu" -#: documents/forms.py:63 +#: documents/forms.py:65 msgid "You must either enter text or upload a file" msgstr "Proszę wpisać tekst albo wybrać plik do załadowania" -#: documents/forms.py:72 +#: documents/forms.py:74 msgid "ZIP file" msgstr "Plik ZIP" -#: documents/forms.py:73 +#: documents/forms.py:75 msgid "Directories are documents in chunks" msgstr "Katalogi zawierają dokumenty w częściach" -#: documents/forms.py:97 documents/forms.py:198 +#: documents/forms.py:99 documents/forms.py:200 msgid "Assigned to" msgstr "Przypisane do" -#: documents/forms.py:118 documents/forms.py:132 +#: documents/forms.py:120 documents/forms.py:134 msgid "Chunk with this slug already exists" msgstr "Część z tym slugiem już istnieje" -#: documents/forms.py:141 +#: documents/forms.py:143 msgid "Append to" msgstr "Dołącz do" -#: documents/models/book.py:27 documents/models/chunk.py:21 +#: documents/models/book.py:32 documents/models/chunk.py:21 #: documents/models/image.py:20 msgid "title" msgstr "tytuł" -#: documents/models/book.py:28 documents/models/chunk.py:22 +#: documents/models/book.py:33 documents/models/chunk.py:22 #: documents/models/image.py:21 msgid "slug" msgstr "slug" -#: documents/models/book.py:29 documents/models/image.py:22 +#: documents/models/book.py:39 documents/models/image.py:22 msgid "public" msgstr "publiczna" -#: documents/models/book.py:30 +#: documents/models/book.py:43 msgid "scan gallery name" msgstr "nazwa galerii skanów" -#: documents/models/book.py:33 +#: documents/models/book.py:48 msgid "parent" msgstr "rodzic" -#: documents/models/book.py:34 +#: documents/models/book.py:49 msgid "parent number" msgstr "numeracja rodzica" -#: documents/models/book.py:60 documents/models/chunk.py:19 +#: documents/models/book.py:82 documents/models/chunk.py:19 #: documents/models/publish_log.py:15 -#: documents/templates/documents/book_detail.html:145 +#: documents/templates/documents/book_detail.html:216 msgid "book" msgstr "książka" -#: documents/models/book.py:61 documents/views.py:627 +#: documents/models/book.py:83 documents/views.py:651 msgid "books" msgstr "książki" -#: documents/models/book.py:271 +#: documents/models/book.py:301 msgid "No chunks in the book." msgstr "Książka nie ma części." -#: documents/models/book.py:275 -msgid "Not all chunks have publishable revisions." -msgstr "Niektóre części nie są gotowe do publikacji." +#: documents/models/book.py:305 +msgid "Not all chunks have approved revisions." +msgstr "Niektóre części nie mają zatwierdzonych wersji." -#: documents/models/book.py:282 documents/models/image.py:83 +#: documents/models/book.py:312 documents/models/image.py:83 msgid "Invalid XML" msgstr "Nieprawidłowy XML" -#: documents/models/book.py:284 documents/models/image.py:85 +#: documents/models/book.py:314 documents/models/image.py:85 msgid "No Dublin Core found." msgstr "Brak sekcji Dublin Core." -#: documents/models/book.py:286 documents/models/image.py:87 +#: documents/models/book.py:316 documents/models/image.py:87 msgid "Invalid Dublin Core" msgstr "Nieprawidłowy Dublin Core" -#: documents/models/book.py:289 documents/models/image.py:91 +#: documents/models/book.py:319 documents/models/image.py:91 msgid "rdf:about is not" msgstr "rdf:about jest różny od" @@ -141,8 +141,8 @@ msgid "images" msgstr "obrazy" #: documents/models/image.py:75 -msgid "There is no publishable revision" -msgstr "Żadna wersja nie została oznaczona do publikacji." +msgid "There is no approved revision" +msgstr "Żadna wersja nie została zatwierdzona" #: documents/models/project.py:11 msgid "name" @@ -213,7 +213,7 @@ msgstr "Użytkownicy aktywni w roku" msgid "Activity" msgstr "Aktywność" -#: documents/templates/documents/base.html:13 +#: documents/templates/documents/base.html:14 msgid "Platforma Redakcyjna" msgstr "Platforma Redakcyjna" @@ -222,99 +222,107 @@ msgstr "Platforma Redakcyjna" msgid "Append book" msgstr "Dołącz książkę" -#: documents/templates/documents/book_detail.html:24 +#: documents/templates/documents/book_detail.html:26 #: documents/templates/documents/book_edit.html:13 #: documents/templates/documents/chunk_edit.html:22 #: documents/templates/documents/image_detail.html:22 msgid "Save" msgstr "Zapisz" -#: documents/templates/documents/book_detail.html:31 +#: documents/templates/documents/book_detail.html:33 msgid "Edit gallery" msgstr "Edytuj galerię" -#: documents/templates/documents/book_detail.html:34 +#: documents/templates/documents/book_detail.html:36 msgid "Append to other book" msgstr "Dołącz do innej książki" -#: documents/templates/documents/book_detail.html:53 +#: documents/templates/documents/book_detail.html:55 msgid "Chunks" msgstr "Części" -#: documents/templates/documents/book_detail.html:71 +#: documents/templates/documents/book_detail.html:73 #: documents/templates/documents/image_detail.html:47 #: documents/templatetags/wall.py:108 documents/templatetags/wall.py:129 msgid "Publication" msgstr "Publikacja" -#: documents/templates/documents/book_detail.html:89 +#: documents/templates/documents/book_detail.html:110 #: documents/templates/documents/image_detail.html:51 msgid "Last published" msgstr "Ostatnio opublikowano" -#: documents/templates/documents/book_detail.html:99 +#: documents/templates/documents/book_detail.html:120 msgid "Full XML" msgstr "Pełny XML" -#: documents/templates/documents/book_detail.html:100 +#: documents/templates/documents/book_detail.html:121 msgid "HTML version" msgstr "Wersja HTML" -#: documents/templates/documents/book_detail.html:101 +#: documents/templates/documents/book_detail.html:122 msgid "TXT version" msgstr "Wersja TXT" -#: documents/templates/documents/book_detail.html:102 +#: documents/templates/documents/book_detail.html:123 msgid "PDF version" msgstr "Wersja PDF" -#: documents/templates/documents/book_detail.html:103 +#: documents/templates/documents/book_detail.html:124 msgid "PDF version for mobiles" msgstr "Wersja PDF na telefony" -#: documents/templates/documents/book_detail.html:104 +#: documents/templates/documents/book_detail.html:125 msgid "EPUB version" msgstr "Wersja EPUB" -#: documents/templates/documents/book_detail.html:105 +#: documents/templates/documents/book_detail.html:126 msgid "MOBI version" msgstr "Wersja MOBI" -#: documents/templates/documents/book_detail.html:119 +#: documents/templates/documents/book_detail.html:142 #: documents/templates/documents/image_detail.html:70 msgid "Publish" msgstr "Opublikuj" -#: documents/templates/documents/book_detail.html:123 +#: documents/templates/documents/book_detail.html:194 #: documents/templates/documents/image_detail.html:74 msgid "Log in to publish." msgstr "Zaloguj się, aby opublikować." -#: documents/templates/documents/book_detail.html:126 +#: documents/templates/documents/book_detail.html:197 #: documents/templates/documents/image_detail.html:77 msgid "This book can't be published yet, because:" msgstr "Ta książka nie może jeszcze zostać opublikowana. Powód:" -#: documents/templates/documents/book_detail.html:138 +#: documents/templates/documents/book_detail.html:209 msgid "Statistics" msgstr "Statystyki" -#: documents/templates/documents/book_detail.html:147 +#: documents/templates/documents/book_detail.html:218 msgid "characters" msgstr "znaki" -#: documents/templates/documents/book_detail.html:148 -msgid "words" -msgstr "słowa" - -#: documents/templates/documents/book_detail.html:149 +#: documents/templates/documents/book_detail.html:219 msgid "characters (with footnotes)" msgstr "znaki (z przypisami)" -#: documents/templates/documents/book_detail.html:150 +#: documents/templates/documents/book_detail.html:220 +msgid "words" +msgstr "słowa" + +#: documents/templates/documents/book_detail.html:221 msgid "words (with footnotes)" msgstr "słowa (z przypisami)" +#: documents/templates/documents/book_detail.html:222 +msgid "wiersze (+ inne znaki)" +msgstr "" + +#: documents/templates/documents/book_detail.html:223 +msgid "wiersze (+ inne znaki, z przypisami)" +msgstr "" + #: documents/templates/documents/book_edit.html:5 msgid "Edit book" msgstr "Edytuj książkę" @@ -348,24 +356,24 @@ msgstr "Ustawienia części" #: documents/templates/documents/book_list/book.html:20 #: documents/templates/documents/book_list/book.html:42 #: documents/templates/documents/image_short.html:17 -#: documents/templatetags/book_list.py:82 -#: documents/templatetags/book_list.py:150 +#: documents/templatetags/book_list.py:92 +#: documents/templatetags/book_list.py:160 msgid "published" msgstr "opublikowane" #: documents/templates/documents/book_list/book.html:23 #: documents/templates/documents/book_list/book.html:45 #: documents/templates/documents/image_short.html:20 -#: documents/templatetags/book_list.py:80 -#: documents/templatetags/book_list.py:148 +#: documents/templatetags/book_list.py:90 +#: documents/templatetags/book_list.py:158 msgid "publishable" msgstr "do publikacji" #: documents/templates/documents/book_list/book.html:26 #: documents/templates/documents/book_list/chunk.html:26 #: documents/templates/documents/image_short.html:23 -#: documents/templatetags/book_list.py:81 -#: documents/templatetags/book_list.py:149 +#: documents/templatetags/book_list.py:91 +#: documents/templatetags/book_list.py:159 msgid "changed" msgstr "zmienione" @@ -382,6 +390,7 @@ msgstr "etap" #: documents/templates/documents/book_list/book_list.html:36 #: documents/templates/documents/book_list/book_list.html:47 #: documents/templates/documents/book_list/book_list.html:68 +#: documents/templates/documents/book_list/book_list.html:120 #: documents/templates/documents/image_table.html:32 #: documents/templates/documents/image_table.html:43 #: documents/templates/documents/image_table.html:62 @@ -549,11 +558,11 @@ msgstr "Nie znaleziono obrazów." msgid "My page" msgstr "Moja strona" -#: documents/templates/documents/my_page.html:27 +#: documents/templates/documents/my_page.html:54 msgid "Your last edited documents" msgstr "Twoje ostatnie edycje" -#: documents/templates/documents/my_page.html:47 +#: documents/templates/documents/my_page.html:74 #: documents/templates/documents/user_page.html:18 msgid "Recent activity for" msgstr "Ostatnia aktywność dla:" @@ -577,13 +586,13 @@ msgstr "nie zalogowany" msgid "No activity recorded." msgstr "Nie zanotowano aktywności." -#: documents/templatetags/book_list.py:83 -#: documents/templatetags/book_list.py:151 +#: documents/templatetags/book_list.py:93 +#: documents/templatetags/book_list.py:161 msgid "unpublished" msgstr "nie opublikowane" -#: documents/templatetags/book_list.py:84 -#: documents/templatetags/book_list.py:152 +#: documents/templatetags/book_list.py:94 +#: documents/templatetags/book_list.py:162 msgid "empty" msgstr "puste" @@ -611,20 +620,20 @@ msgstr "Powiązana zmiana" msgid "Edit" msgstr "Zmiana" -#: documents/views.py:172 +#: documents/views.py:179 #, python-format msgid "Slug already used for %s" msgstr "Slug taki sam jak dla pliku %s" -#: documents/views.py:174 +#: documents/views.py:181 msgid "Slug already used in repository." msgstr "Dokument o tym slugu już istnieje w repozytorium." -#: documents/views.py:180 +#: documents/views.py:187 msgid "File should be UTF-8 encoded." msgstr "Plik powinien mieć kodowanie UTF-8." -#: documents/views.py:629 +#: documents/views.py:653 msgid "scan gallery" msgstr "galeria skanów" diff --git a/src/documents/migrations/0013_alter_chunkchange_publishable_and_more.py b/src/documents/migrations/0013_alter_chunkchange_publishable_and_more.py new file mode 100644 index 00000000..72ae88c5 --- /dev/null +++ b/src/documents/migrations/0013_alter_chunkchange_publishable_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.1.9 on 2023-10-10 15:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("documents", "0012_remove_book_legimi_id_remove_book_woblink_id"), + ] + + operations = [ + migrations.AlterField( + model_name="chunkchange", + name="publishable", + field=models.BooleanField(default=False, verbose_name="approved"), + ), + migrations.AlterField( + model_name="imagechange", + name="publishable", + field=models.BooleanField(default=False, verbose_name="approved"), + ), + ] diff --git a/src/documents/models/book.py b/src/documents/models/book.py index a13c00b2..bede8d09 100644 --- a/src/documents/models/book.py +++ b/src/documents/models/book.py @@ -286,7 +286,7 @@ class Book(models.Model): try: changes = self.get_current_changes(publishable=True) except self.NoTextError: - raise AssertionError(_('Not all chunks have publishable revisions.')) + raise AssertionError(_('Not all chunks have approved revisions.')) from librarian import NoDublinCore, ParseError, ValidationError diff --git a/src/documents/models/image.py b/src/documents/models/image.py index fd3d8c41..c14cca0c 100644 --- a/src/documents/models/image.py +++ b/src/documents/models/image.py @@ -72,7 +72,7 @@ class Image(dvcs_models.Document): return open(self.image.path) publishable = self.publishable() - assert publishable, _("There is no publishable revision") + assert publishable, _("There is no approved revision") picture_xml = publishable.materialize() try: diff --git a/src/dvcs/locale/pl/LC_MESSAGES/django.mo b/src/dvcs/locale/pl/LC_MESSAGES/django.mo index dfd85c2561b22543ce58eefe1f00ddd5cdf4f78a..86acb55fd7eeb9fdfc7de075d9649025912b6200 100644 GIT binary patch delta 693 zcmXxhJ4nM&6b9gHYgnvzC^3KpCl)PREy zE^gv34&vaZ;81Ys(#1g#!NH}A{-+)<_vXtv%{}+gn?S{XJW;3m zPISicCC68g7Px`v;tmhGfd@#1pCR2;5mLPpTZY)Pc;omT(!9?CUT`3R8xq|ZRD?E! zbhXi962G@Yn$*bgKh1cdQwBNF#L@<+wPMh1wP18&(7`$|sL@|h-7#GcwKiwowdTua zEpt~(JLj$gr_VhyDXnT*)3TMtoNlC*=^Z_%teZ($T3J?BwOu1;m>FeOwY8)ikH!;9 zEQ&72hLc011JSti;@)hK7SxQsqw4r1yX~ZE?|a6j4P{QtXqIZ5R#ILuwX|W&iAXdO abG#lskXP+JL$lI(Gow1&o+HQW4gUhfhgJLl delta 754 zcmZ{hKS&#K6vuz&j7<}@wbmL%@I;}7@+-MeQ9>xj|Kh13rrpnaT(3<%$t9f%!P%v7 zlN3Y*aT0NH5eh9`bPR%HhvMeqBBG1mZ}J;leEi<;!+ZCB@88|T_L_gBD@{U(pCKWd z!EG=G?t}CnfsepHiYH(r>?+8(GcW@FSN;pdOOW}ll&xv?xCqF+Z6M#rHBqT07=VL` zB^U;iAdVPT{;%_97T!?Y0w2TP4Oi-g z58z+}hae|9QubeEAA_8z3gU==xH!Q%$i$Z*3tofVSQDJg*Q(eKqGu6Tb`Qw+ecV3= z64;c8L!Uy~0P@s?LF|;$4vj)t=)OFG!RET4&!MeQ3LBubLAfo;3n&}xpaJ2ps7=5% zQJw`ep~YY)^gXs(UMjf$Cu^x-2f8*?$!5l8GgA}#hl$+c%))#$XRmt2lAQA$cUg{> z9be|Xlpf74+{d zmS2+jVz8-Yd(F)J)O$9OHqDWO`^GCe@1mx);*>21g@Rk{S8&?s1k>U5mSs<`jqt_# K_}LAr;a7LLX=DHZ diff --git a/src/dvcs/locale/pl/LC_MESSAGES/django.po b/src/dvcs/locale/pl/LC_MESSAGES/django.po index 79bba132..d73669ba 100644 --- a/src/dvcs/locale/pl/LC_MESSAGES/django.po +++ b/src/dvcs/locale/pl/LC_MESSAGES/django.po @@ -5,17 +5,18 @@ # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2011-12-14 15:27+0100\n" +"PO-Revision-Date: 2023-10-10 15:48+0200\n" "Last-Translator: Radek Czajka \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"Language-Team: \n" +"Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2)\n" +"|| n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 3.0.1\n" #: dvcs/models.py:23 msgid "name" @@ -62,8 +63,8 @@ msgid "description" msgstr "opis" #: dvcs/models.py:89 -msgid "publishable" -msgstr "do publikacji" +msgid "approved" +msgstr "zatwierdzona" #: dvcs/models.py:175 msgid "tag" @@ -116,3 +117,6 @@ msgstr "użytkownik" #: dvcs/models.py:240 msgid "Work assignment." msgstr "Przypisanie pracy użytkownikowi." + +#~ msgid "publishable" +#~ msgstr "do publikacji" diff --git a/src/dvcs/models.py b/src/dvcs/models.py index 5d465caf..5d7d7ff1 100644 --- a/src/dvcs/models.py +++ b/src/dvcs/models.py @@ -86,7 +86,7 @@ class Change(models.Model): description = models.TextField(_('description'), blank=True, default='') created_at = models.DateTimeField(editable=False, db_index=True, default=datetime.now) - publishable = models.BooleanField(_('publishable'), default=False) + publishable = models.BooleanField(_('approved'), default=False) class Meta: abstract = True diff --git a/src/redakcja/static/css/history.css b/src/redakcja/static/css/history.css index 18c606c8..340b878f 100644 --- a/src/redakcja/static/css/history.css +++ b/src/redakcja/static/css/history.css @@ -88,6 +88,24 @@ table#changes-list-container { vertical-align: text-top; } +.can-approve #changes-list .approved:hover { + cursor: pointer; +} +#pubmark-changeset-button {display: none;} +.can-approve #pubmark-changeset-button {display: inline-block;} + +#changes-list *[data-approved = 'false'] .approved:after { + content: '☐'; + color: red; + white-space: pre-line; +} +#changes-list *[data-approved = 'true'] .approved:after { + content: '🗹'; + font-size: .8em; + color: #80ff80; + white-space: pre-line; +} + #changes-list *[data-stub-value = 'description'] { font-size: .8em; color: gray; diff --git a/src/redakcja/static/js/wiki/base.js b/src/redakcja/static/js/wiki/base.js index d9141687..1b031cad 100644 --- a/src/redakcja/static/js/wiki/base.js +++ b/src/redakcja/static/js/wiki/base.js @@ -196,8 +196,7 @@ $elem.removeClass('row-stub'); params.container.append($elem); - $('*[data-stub-value]', $elem).each(function() { - var $this = $(this); + var populate = function($this) { var field = $this.attr('data-stub-value'); var value = params.data[field]; @@ -215,7 +214,9 @@ $this.removeAttr('data-stub-target'); $this.removeAttr('data-stub-value'); } - }); + } + if ($elem.attr('data-stub-value')) populate($elem); + $('*[data-stub-value]', $elem).each(function() {populate($(this))}); $elem.show(); return $elem; @@ -344,6 +345,7 @@ $.ajax("/editor/editor-user-area/", { success: function(d) { $("#user-area")[0].innerHTML = d; + $('#history-view-editor').toggleClass('can-approve', $('#user-area #pubmark_dialog').length > 0); } }); }, false); diff --git a/src/redakcja/static/js/wiki/dialog_pubmark.js b/src/redakcja/static/js/wiki/dialog_pubmark.js index 6d20493c..7d0126e6 100644 --- a/src/redakcja/static/js/wiki/dialog_pubmark.js +++ b/src/redakcja/static/js/wiki/dialog_pubmark.js @@ -19,7 +19,11 @@ $("input[name='pubmark-id']", this.$form).val(CurrentDocument.id); $("input[name='pubmark-revision']", this.$form).val(options.revision); - + if (options.approved) { + $("input[name='pubmark-publishable']", this.$form).prop('checked'); + } else { + $("input[name='pubmark-publishable']", this.$form).removeProp('checked'); + } } cancelAction() { diff --git a/src/redakcja/static/js/wiki/view_history.js b/src/redakcja/static/js/wiki/view_history.js index def2bb6e..9ce518cb 100644 --- a/src/redakcja/static/js/wiki/view_history.js +++ b/src/redakcja/static/js/wiki/view_history.js @@ -53,6 +53,12 @@ attr('disabled', null); }); + $(document).on('click', '#changes-list .entry .approved', function(){ + $("#changes-list .entry.selected").removeClass('selected'); + $(this).closest('.entry').click(); + self.showPubmarkForm(); + return false; + }) $(document).on('click', '#changes-list span.tag', function(event){ return false; }); @@ -138,7 +144,8 @@ } var version = parseInt($("*[data-stub-value='version']", selected[0]).text()); - $.wiki.showDialog('#pubmark_dialog', {'revision': version}); + var approved = selected.attr('data-approved') == 'true'; + $.wiki.showDialog('#pubmark_dialog', {'revision': version, 'approved': !approved}); } makeDiff() { diff --git a/src/team/admin.py b/src/team/admin.py index cff63219..b8c448a1 100644 --- a/src/team/admin.py +++ b/src/team/admin.py @@ -1,10 +1,24 @@ from django.contrib import admin +from django.contrib.auth.admin import UserAdmin +from django.contrib.auth.models import User from . import models -@admin.register(models.Profile) -class ProfileAdmin(admin.ModelAdmin): - list_display = ['user', 'presence'] +class ProfileInline(admin.StackedInline): + model = models.Profile + can_delete = False + + +class CustomUserAdmin(UserAdmin): + inlines = (ProfileInline, ) + + def get_inline_instances(self, request, obj=None): + if not obj: + return list() + return super(CustomUserAdmin, self).get_inline_instances(request, obj) + +admin.site.unregister(User) +admin.site.register(User, CustomUserAdmin) @admin.register(models.Presence) diff --git a/src/team/migrations/0002_profile_approve_by_default.py b/src/team/migrations/0002_profile_approve_by_default.py new file mode 100644 index 00000000..7827fea2 --- /dev/null +++ b/src/team/migrations/0002_profile_approve_by_default.py @@ -0,0 +1,19 @@ +# Generated by Django 4.1.9 on 2023-10-10 15:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("team", "0001_initial"), + ] + + operations = [ + migrations.AddField( + model_name="profile", + name="approve_by_default", + field=models.BooleanField(default=False), + preserve_default=False, + ), + ] diff --git a/src/team/models.py b/src/team/models.py index 05372c46..6e53dd3c 100644 --- a/src/team/models.py +++ b/src/team/models.py @@ -6,6 +6,13 @@ from django.utils.timezone import now class Profile(models.Model): user = models.OneToOneField(settings.AUTH_USER_MODEL, models.CASCADE) presence = models.BooleanField() + approve_by_default = models.BooleanField() + + class Meta: + verbose_name = verbose_name_plural = 'profil' + + def __str__(self): + return self.user.username class Presence(models.Model): diff --git a/src/wiki/forms.py b/src/wiki/forms.py index 46194677..f7827bc1 100644 --- a/src/wiki/forms.py +++ b/src/wiki/forms.py @@ -9,12 +9,12 @@ from documents.models import Chunk class DocumentPubmarkForm(forms.Form): """ - Form for marking revisions for publishing. + Form for approving revisions. """ id = forms.CharField(widget=forms.HiddenInput) publishable = forms.BooleanField(required=False, initial=True, - label=_('Publishable')) + label=_('Approved')) revision = forms.IntegerField(widget=forms.HiddenInput) @@ -58,8 +58,8 @@ class DocumentTextSaveForm(forms.Form): ) publishable = forms.BooleanField(required=False, initial=False, - label=_('Publishable'), - help_text=_(u"Mark this revision as publishable.") + label=_('Approve'), + help_text=_("Approve this revision.") ) def __init__(self, *args, **kwargs): @@ -68,6 +68,14 @@ class DocumentTextSaveForm(forms.Form): if user and user.is_authenticated: self.fields['author_name'].required = False self.fields['author_email'].required = False + try: + user.profile + except: + pass + else: + if user.profile.approve_by_default: + self.fields['publishable'].initial = True + return r diff --git a/src/wiki/locale/pl/LC_MESSAGES/django.mo b/src/wiki/locale/pl/LC_MESSAGES/django.mo index 07d83efd222692d1bd0137addbff0c5d1821b1f5..4ac2575246bba2fb5dea5461b7ac35b9ca30eab9 100644 GIT binary patch delta 1599 zcmZ|PNl27o9LMozY8(_?w*VgB#ud7t;4=lMU&%#i16c4#imdBsp# zi48>F3S$mpsgnz3IL4Sn9Kl$;ff;xkvQg80xT0payt}TB-M_4i-^o;1?>nA zl~6D0Obj4jF~e@wUzJfBn4GzTn$dmaW1ewQhp$kH&7w~EC*)(kana12^sa<*P!lOe zz29hULnXe?KJP%S%*l{#IAa?wqB6XUIy_^jfgYl^WD*N-7BxdB*{Gu=RAT8|^u1hb z6>jBzCn~W%)I`srCKei@q5-ejhP$W^?_qRc)QU`^5|}}bLUdceR1rl)oo*=ge~2Eq zP1Ku+QbMZ~-6Cuxwh^pIDB5`mH(EXwo!q6eok~8TjPnR3n#=iKDEEv0@K>l;|sP2yL~+Y)7snX_w{uy=?Na|4tV^X zecb^bmoGJUgnz`Gy*cD^gg?aY4Y$NCjMv8(IugB=W!_4Ux4OYwH+~|az)^9iJ=ovf y>F=1HF#oEa;8euZ-{}t=pNf?KZ9nDfX%7!4UJci{7sHXH!{hPENse%K%KUF@BASf= delta 1893 zcmY+^Z)hAv7{~FsHh(U?G%<}v+nTzKdbYK>ByF0S8f#;EluFtnwBidDHp#Z#+_4w; zHYv%A92Tm5bs|TQypR?&g2lEi$8fh(pA_^k@c~cRgU@Hy25W(;7Zm!rN&wgfR zcW0iNoy&52(JB10re@Ai(!_(r-WA5Un62SLxmjyW0&ig*{)e}Lo5*H9WE>JJSvfoPy>E!{S1}RWn@nCC2FPLqRz|> zoQ<&yY>V!nCR@G#CTilhQ135bJAQ!o;?dWaYzo+i49hY6Jx#3O_b^8mqO%e(U^s_0Ye{8UR^>(_rbom!PG70TaS)qWyL z=+o$6?jrO#b`Uy1U4#yne!e@2?S#tX1ZU0cR)f-8!90aMwr&Q4AfAid$j=4&(o*fo z=Ap?j^n%El^1?iwi|M*p?8va2j~s8zkGwHwWZDe-LB@%4&M`Ne^}=a$zzs9b(Ol?E zOpavz{Bb`xR_Tk5`*|nyrhE?nu^4mD2Uk)u>h~*8fv`*pIT_;_3LNSfabH zbK6d*r)SrW-o;NFlCe@tVy<~G6HU6=z;#ZL*tlC-Nc>$mlqd7R&ym`6lsn-Do-+~7 zcr%p*$I1zMq3@eRGl4rg979)VKM6D diff --git a/src/wiki/locale/pl/LC_MESSAGES/django.po b/src/wiki/locale/pl/LC_MESSAGES/django.po index 1b2f1b6d..0866257c 100644 --- a/src/wiki/locale/pl/LC_MESSAGES/django.po +++ b/src/wiki/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Platforma Redakcyjna\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2023-06-27 11:54+0200\n" +"PO-Revision-Date: 2023-10-10 15:18+0200\n" "Last-Translator: Radek Czajka \n" "Language-Team: Fundacja Nowoczesna Polska \n" @@ -17,27 +17,27 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 3.0.1\n" -#: wiki/forms.py:17 wiki/forms.py:61 wiki/views.py:303 -msgid "Publishable" -msgstr "Gotowe do publikacji" +#: wiki/forms.py:17 +msgid "Approved" +msgstr "Zatwierdzona" -#: wiki/forms.py:36 wiki/forms.py:87 +#: wiki/forms.py:36 wiki/forms.py:95 msgid "Author" msgstr "Autor" -#: wiki/forms.py:37 wiki/forms.py:88 +#: wiki/forms.py:37 wiki/forms.py:96 msgid "Your name" msgstr "Imię i nazwisko" -#: wiki/forms.py:42 wiki/forms.py:93 +#: wiki/forms.py:42 wiki/forms.py:101 msgid "Author's email" msgstr "E-mail autora" -#: wiki/forms.py:43 wiki/forms.py:94 +#: wiki/forms.py:43 wiki/forms.py:102 msgid "Your email address, so we can show a gravatar :)" msgstr "Adres e-mail, żebyśmy mogli pokazać gravatar :)" -#: wiki/forms.py:49 wiki/forms.py:100 +#: wiki/forms.py:49 wiki/forms.py:108 msgid "Your comments" msgstr "Twój komentarz" @@ -53,11 +53,15 @@ msgstr "Ukończono" msgid "If you completed a life cycle stage, select it." msgstr "Jeśli został ukończony etap prac, wskaż go." +#: wiki/forms.py:61 wiki/templates/wiki/tabs/history_view.html:8 +msgid "Approve" +msgstr "Zatwierdź" + #: wiki/forms.py:62 -msgid "Mark this revision as publishable." -msgstr "Oznacz tę wersję jako gotową do publikacji." +msgid "Approve this revision." +msgstr "Zatwierdź tę wersję." -#: wiki/forms.py:101 +#: wiki/forms.py:109 msgid "Describe the reason for reverting." msgstr "Opisz powód przywrócenia." @@ -85,40 +89,44 @@ msgstr "Stara wersja" msgid "New version" msgstr "Nowa wersja" -#: wiki/templates/wiki/document_details.html:39 +#: wiki/templates/wiki/document_details.html:46 msgid "Click to open/close gallery" msgstr "Kliknij, aby (ro)zwinąć galerię" -#: wiki/templates/wiki/document_details_base.html:51 +#: wiki/templates/wiki/document_details_base.html:56 msgid "Help" msgstr "Pomoc" -#: wiki/templates/wiki/document_details_base.html:62 +#: wiki/templates/wiki/document_details_base.html:67 msgid "Version" msgstr "Wersja" -#: wiki/templates/wiki/document_details_base.html:62 +#: wiki/templates/wiki/document_details_base.html:67 msgid "Unknown" msgstr "Nieznana" -#: wiki/templates/wiki/document_details_base.html:64 +#: wiki/templates/wiki/document_details_base.html:69 #: wiki/templates/wiki/pubmark_dialog.html:16 msgid "Save" msgstr "Zapisz" -#: wiki/templates/wiki/document_details_base.html:65 +#: wiki/templates/wiki/document_details_base.html:70 msgid "Save attempt in progress" msgstr "Trwa zapisywanie" -#: wiki/templates/wiki/document_details_base.html:66 +#: wiki/templates/wiki/document_details_base.html:71 msgid "There is a newer version of this document!" msgstr "Istnieje nowsza wersja tego dokumentu!" +#: wiki/templates/wiki/gallery_dialog.html:8 #: wiki/templates/wiki/media_dialog.html:8 +#: wiki/templates/wiki/meta_chooser.html:8 msgid "Choose" msgstr "Wybierz" +#: wiki/templates/wiki/gallery_dialog.html:9 #: wiki/templates/wiki/media_dialog.html:9 +#: wiki/templates/wiki/meta_chooser.html:9 #: wiki/templates/wiki/pubmark_dialog.html:17 #: wiki/templates/wiki/revert_dialog.html:40 msgid "Cancel" @@ -136,15 +144,15 @@ msgstr "wszystkie" msgid "Annotations" msgstr "Przypisy" -#: wiki/templates/wiki/tabs/gallery_view.html:7 +#: wiki/templates/wiki/tabs/gallery_view.html:8 msgid "Go to first image of this part" msgstr "Przejdź na początek" -#: wiki/templates/wiki/tabs/gallery_view.html:10 +#: wiki/templates/wiki/tabs/gallery_view.html:11 msgid "Previous" msgstr "Poprzednie" -#: wiki/templates/wiki/tabs/gallery_view.html:21 +#: wiki/templates/wiki/tabs/gallery_view.html:22 msgid "Next" msgstr "Następne" @@ -156,15 +164,11 @@ msgstr "Galeria" msgid "Compare versions" msgstr "Porównaj wersje" -#: wiki/templates/wiki/tabs/history_view.html:9 -msgid "Mark for publishing" -msgstr "Oznacz do publikacji" - -#: wiki/templates/wiki/tabs/history_view.html:12 +#: wiki/templates/wiki/tabs/history_view.html:10 msgid "Revert document" msgstr "Przywróć wersję" -#: wiki/templates/wiki/tabs/history_view.html:15 +#: wiki/templates/wiki/tabs/history_view.html:13 msgid "View version" msgstr "Zobacz wersję" @@ -219,49 +223,33 @@ msgstr "Kod źródłowy" msgid "Refresh from working copy" msgstr "Odśwież z edytowanej wersji" -#: wiki/templates/wiki/tabs/summary_view.html:15 -msgid "Title" -msgstr "Tytuł" - -#: wiki/templates/wiki/tabs/summary_view.html:19 +#: wiki/templates/wiki/tabs/summary_view.html:17 msgid "Go to the book's page" msgstr "Przejdź do strony książki" -#: wiki/templates/wiki/tabs/summary_view.html:22 +#: wiki/templates/wiki/tabs/summary_view.html:20 msgid "Document ID" msgstr "ID dokumentu" -#: wiki/templates/wiki/tabs/summary_view.html:26 -msgid "Current version" -msgstr "Aktualna wersja" - -#: wiki/templates/wiki/tabs/summary_view.html:30 -msgid "Last edited by" -msgstr "Ostatnio edytowane przez" - -#: wiki/templates/wiki/tabs/summary_view.html:34 -msgid "Link to gallery" -msgstr "Link do galerii" - -#: wiki/templates/wiki/tabs/summary_view.html:39 +#: wiki/templates/wiki/tabs/summary_view.html:24 msgid "Characters in document" msgstr "Znaków w dokumencie" -#: wiki/templates/wiki/tabs/summary_view.html:41 -#: wiki/templates/wiki/tabs/summary_view.html:42 -#: wiki/templates/wiki/tabs/summary_view.html:45 +#: wiki/templates/wiki/tabs/summary_view.html:26 +#: wiki/templates/wiki/tabs/summary_view.html:27 +#: wiki/templates/wiki/tabs/summary_view.html:30 msgid "pages" msgstr "stron maszynopisu" -#: wiki/templates/wiki/tabs/summary_view.html:41 +#: wiki/templates/wiki/tabs/summary_view.html:26 msgid "without footnotes and themes" msgstr "bez przypisów i motywów" -#: wiki/templates/wiki/tabs/summary_view.html:42 +#: wiki/templates/wiki/tabs/summary_view.html:27 msgid "with footnotes and themes" msgstr "z przypisami i motywami" -#: wiki/templates/wiki/tabs/summary_view.html:45 +#: wiki/templates/wiki/tabs/summary_view.html:30 msgid "untagged" msgstr "nieotagowane" @@ -287,18 +275,39 @@ msgstr "Wstaw referencję" msgid "Visual editor" msgstr "Edytor wizualny" -#: wiki/views.py:305 +#: wiki/views.py:326 msgid "Published" msgstr "Opublikowano" -#: wiki/views.py:326 +#: wiki/views.py:347 msgid "Revision marked" msgstr "Wersja oznaczona" -#: wiki/views.py:328 +#: wiki/views.py:349 msgid "Nothing changed" msgstr "Nic nie uległo zmianie" +#~ msgid "Publishable" +#~ msgstr "Gotowe do publikacji" + +#~ msgid "Mark this revision as publishable." +#~ msgstr "Oznacz tę wersję jako gotową do publikacji." + +#~ msgid "Mark for publishing" +#~ msgstr "Oznacz do publikacji" + +#~ msgid "Title" +#~ msgstr "Tytuł" + +#~ msgid "Current version" +#~ msgstr "Aktualna wersja" + +#~ msgid "Last edited by" +#~ msgstr "Ostatnio edytowane przez" + +#~ msgid "Link to gallery" +#~ msgstr "Link do galerii" + #~ msgid "Zoom in" #~ msgstr "Powiększ" diff --git a/src/wiki/templates/wiki/tabs/history_view.html b/src/wiki/templates/wiki/tabs/history_view.html index 1384fb6b..ba2388e2 100644 --- a/src/wiki/templates/wiki/tabs/history_view.html +++ b/src/wiki/templates/wiki/tabs/history_view.html @@ -1,13 +1,11 @@ {% load i18n %} -