From a4f5747875aa0fb598e69d2200ef431c2fb7f1e9 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 30 May 2022 11:29:21 +0200 Subject: [PATCH 1/1] fixes --- src/cover/forms.py | 2 +- src/cover/locale/pl/LC_MESSAGES/django.mo | Bin 1828 -> 1793 bytes src/cover/locale/pl/LC_MESSAGES/django.po | 53 +++++++++--------- .../0005_alter_image_download_url.py | 18 ++++++ src/cover/models.py | 2 +- src/cover/templates/cover/add_image.html | 2 +- src/cover/templates/cover/image_detail.html | 2 - 7 files changed, 49 insertions(+), 30 deletions(-) create mode 100644 src/cover/migrations/0005_alter_image_download_url.py diff --git a/src/cover/forms.py b/src/cover/forms.py index 550e4a5f..ee82a5af 100644 --- a/src/cover/forms.py +++ b/src/cover/forms.py @@ -102,7 +102,7 @@ class ReadonlyImageEditForm(ImageEditForm): class ImportForm(forms.Form): - source_url = forms.URLField(label=_('WikiCommons, MNW or Flickr URL')) + source_url = forms.URLField(label=_('WikiCommons, MNW, Flickr, RawPixel URL')) def clean_source_url(self): url = self.cleaned_data['source_url'] diff --git a/src/cover/locale/pl/LC_MESSAGES/django.mo b/src/cover/locale/pl/LC_MESSAGES/django.mo index 756253c1b2dbceb7c17b71df344b8eb2ecb212b4..319ea257d663ff59e3b671999cb4ccb9460895f6 100644 GIT binary patch delta 588 zcmZY6ze~eF6bJCvrcG*pq_*1PW+p*xq(7)Xij$qiS_=+#3AKgL)JmmTT}l@PQ79ZZ zD2RfigE;FVsJQBXAh@{*PELMbo1tLH-6!{Q@7-N;t#;IIp&cipQzuajzQ8d2fi9>> zL>}me6EFg0xCnhP3;l2f^8BJbHXzs8f;_Kd$4?;VpFuCYlBi8?Jlr7Abr9Xb0LEDa zdBQ5>gd!Y;B{%|GFb$94419z-{I=hZBZ)VZfSQ8Yd|=kUdghQ)(pZXwhg_d7lcA5%da z?uUA-+mF4Kcy;^^3JBd<7q8A`Z%oS@yE(H}wnS7)3RUt9hVs&suVPwdtx|7j%^k5X z9R<>QDy}6GndIzrJSjr1HAOF!jao(%8?H~0a~}vr&T=82F;IM6&ispA$m!s=WmdJ# Py4HNU-z%Ahc$4#gE<;X} delta 575 zcmZ9}-z!657{Kv&=WGXKo8MfpP9!zPwyd$ZaO292thk~>+t_ByN)#nGxU+iWf(t3i z9oI@J_fl^C1Fp%n@6)E_t*6g9&-*^l`=0k4_^da6og3s88U)YLWrc!PU zVLgsw5XaHN1#HA6Y{DGM`fZf@z1sXqZT!7j5tMa{CHPo}<4#uRJ-Q?G#o@wQi0MTFHNzycO5? G*4z(i@Jew2 diff --git a/src/cover/locale/pl/LC_MESSAGES/django.po b/src/cover/locale/pl/LC_MESSAGES/django.po index 5418ccf5..cec2844a 100644 --- a/src/cover/locale/pl/LC_MESSAGES/django.po +++ b/src/cover/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-02-25 14:10+0100\n" +"PO-Revision-Date: 2022-05-30 11:26+0200\n" "Last-Translator: Radek Czajka \n" "Language-Team: \n" "Language: pl\n" @@ -18,57 +18,61 @@ msgstr "" "|| n%100>=20) ? 1 : 2);\n" "X-Generator: Poedit 3.0\n" -#: cover/forms.py:34 cover/forms.py:44 +#: cover/forms.py:39 cover/forms.py:49 #, python-format msgid "Image already in repository." msgstr "Obraz jest już w repozytorium." -#: cover/forms.py:53 +#: cover/forms.py:63 msgid "No image specified" msgstr "Nie wskazano obrazu" -#: cover/forms.py:61 cover/forms.py:78 +#: cover/forms.py:71 cover/forms.py:88 #, python-format msgid "Image too small: %sx%s, minimal dimensions %sx%s" msgstr "Obraz za mały: %sx%s, minimalny rozmiar %sx%s" -#: cover/forms.py:95 -msgid "WikiCommons, MNW or Flickr URL" -msgstr "URL z WikiCommons, MNW albo Flickra" +#: cover/forms.py:105 +msgid "WikiCommons, MNW, Flickr, RawPixel URL" +msgstr "URL z WikiCommons, MNW, Flickra, RawPixel" -#: cover/models.py:23 +#: cover/models.py:25 msgid "title" msgstr "tytuł" -#: cover/models.py:24 +#: cover/models.py:26 msgid "author" msgstr "autor" -#: cover/models.py:25 +#: cover/models.py:27 msgid "license name" msgstr "nazwa licencji" -#: cover/models.py:26 +#: cover/models.py:28 msgid "license URL" msgstr "URL licencji" -#: cover/models.py:27 +#: cover/models.py:29 msgid "source URL" msgstr "URL źródła" -#: cover/models.py:28 +#: cover/models.py:30 msgid "image download URL" msgstr "URL pliku do pobrania" -#: cover/models.py:30 +#: cover/models.py:34 msgid "file" msgstr "plik" -#: cover/models.py:33 +#: cover/models.py:40 +msgid "file for use" +msgstr "plik do użycia" + +#: cover/models.py:48 msgid "cover image" msgstr "obrazek na okładkę" -#: cover/models.py:34 +#: cover/models.py:49 msgid "cover images" msgstr "obrazki na okładki" @@ -79,27 +83,23 @@ msgid "Add image" msgstr "Dodaj obrazek" #: cover/templates/cover/add_image.html:19 -msgid "Load from WikiCommons, MNW, Flickr" -msgstr "Pobierz z WikiCommons, MNW albo Flickra" +msgid "Load from WikiCommons, MNW, Flickr, RawPixel" +msgstr "Pobierz z WikiCommons, MNW, Flickra, RawPixel" #: cover/templates/cover/image_detail.html:6 #: cover/templates/cover/image_detail.html:9 msgid "Cover image" msgstr "Obrazek na okładkę" -#: cover/templates/cover/image_detail.html:25 -msgid "source" -msgstr "źródło" - -#: cover/templates/cover/image_detail.html:36 +#: cover/templates/cover/image_detail.html:30 msgid "Change" msgstr "Zmień" -#: cover/templates/cover/image_detail.html:42 +#: cover/templates/cover/image_detail.html:36 msgid "Used in:" msgstr "Użyte w:" -#: cover/templates/cover/image_detail.html:50 +#: cover/templates/cover/image_detail.html:44 msgid "None" msgstr "Brak" @@ -112,6 +112,9 @@ msgstr "Obrazki na okładki" msgid "Add new" msgstr "Dodaj nowy" +#~ msgid "source" +#~ msgstr "źródło" + #, fuzzy, python-format #~| msgid "Image already in repository." #~ msgid "Image already in repository" diff --git a/src/cover/migrations/0005_alter_image_download_url.py b/src/cover/migrations/0005_alter_image_download_url.py new file mode 100644 index 00000000..f32ae151 --- /dev/null +++ b/src/cover/migrations/0005_alter_image_download_url.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2022-05-30 11:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cover', '0004_populate_use_file'), + ] + + operations = [ + migrations.AlterField( + model_name='image', + name='download_url', + field=models.URLField(blank=True, max_length=4096, null=True, unique=True, verbose_name='image download URL'), + ), + ] diff --git a/src/cover/models.py b/src/cover/models.py index 45b5ff9e..33c5e738 100644 --- a/src/cover/models.py +++ b/src/cover/models.py @@ -27,7 +27,7 @@ class Image(models.Model): license_name = models.CharField(max_length=255, verbose_name=_('license name')) license_url = models.URLField(max_length=255, blank=True, verbose_name=_('license URL')) source_url = models.URLField(verbose_name=_('source URL'), null=True, blank=True) - download_url = models.URLField(unique=True, verbose_name=_('image download URL'), null=True, blank=True) + download_url = models.URLField(max_length=4096, unique=True, verbose_name=_('image download URL'), null=True, blank=True) file = models.ImageField( upload_to='cover/image', storage=OverwriteStorage(), diff --git a/src/cover/templates/cover/add_image.html b/src/cover/templates/cover/add_image.html index 092933e8..8cf5d86b 100644 --- a/src/cover/templates/cover/add_image.html +++ b/src/cover/templates/cover/add_image.html @@ -16,7 +16,7 @@ {% bootstrap_form ff %} {% buttons %} - + {% endbuttons %}
diff --git a/src/cover/templates/cover/image_detail.html b/src/cover/templates/cover/image_detail.html index ca273ed4..4b8f73f7 100644 --- a/src/cover/templates/cover/image_detail.html +++ b/src/cover/templates/cover/image_detail.html @@ -17,8 +17,6 @@ {% if object.license_url %}{% endif %} {{ object.license_name }} {% if object.license_url %}{% endif %} - -
{% trans "source" %}: {{ object.download_url }} -- 2.20.1