Skip to content

Commit

Permalink
Merge pull request #1890 from digitalfabrik/enhancement/poi-form-icon
Browse files Browse the repository at this point in the history
Add hint about icon aspect ratio to POI form
  • Loading branch information
timobrembeck committed Nov 23, 2022
2 parents cdd47a5 + 5640d90 commit 521be6e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
30 changes: 30 additions & 0 deletions integreat_cms/cms/migrations/0052_alter_poi_icon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Generated by Django 3.2.16 on 2022-11-22 21:31

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
"""
Add help text to POI icon field
"""

dependencies = [
("cms", "0051_rename_farsi_flag"),
]

operations = [
migrations.AlterField(
model_name="poi",
name="icon",
field=models.ForeignKey(
blank=True,
help_text="The best results are achieved with images in 16:9 aspect ratio.",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="pois",
to="cms.mediafile",
verbose_name="icon",
),
),
]
1 change: 1 addition & 0 deletions integreat_cms/cms/models/pois/poi.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class POI(AbstractContentModel):
on_delete=models.SET_NULL,
blank=True,
null=True,
help_text=_("The best results are achieved with images in 16:9 aspect ratio."),
)
archived = models.BooleanField(
default=False,
Expand Down
8 changes: 4 additions & 4 deletions integreat_cms/cms/templates/pois/poi_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ <h3 class="heading font-bold text-black">
{{ poi_form.icon.label }}
</h3>
</div>
<div class="w-full px-4 pb-4 rounded shadow bg-white">
<label for="{{ poi_form.icon.id_for_label }}">
{{ poi_form.icon.label }}
</label>
<div class="w-full p-4 rounded shadow bg-white">
<div class="help-text">
{{ poi_form.icon.help_text }}
</div>
{% render_field poi_form.icon label=poi_form.icon.label %}
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions integreat_cms/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2906,6 +2906,11 @@ msgstr "Diesen Ort auf Karte zeigen"
msgid "Tick if you want to show this location on map"
msgstr "Kreuzen Sie an, wenn dieser Ort auf der Karte gezeigt werden soll."

#: cms/models/pois/poi.py
msgid "The best results are achieved with images in 16:9 aspect ratio."
msgstr ""
"Die besten Ergebnisse erzielen Sie mit Bildern im Seitenverhältnis 16:9."

#: cms/models/pois/poi.py
msgid "Whether or not the location is read-only and hidden in the API."
msgstr "Ob der Ort schreibgeschützt und in der API verborgen ist oder nicht."
Expand Down

0 comments on commit 521be6e

Please sign in to comment.