Skip to content

Commit

Permalink
Tweaks, show new location for a short moment
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jun 3, 2024
1 parent a2f8bb5 commit e877f0c
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 155 deletions.
19 changes: 11 additions & 8 deletions feincms3/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ class TreeAdmin(ModelAdmin):
<https://github.com/matthiask/django-tree-queries>`_ trees.
Shows the tree's hierarchy and adds a view to move nodes around. To use
this class the two columns ``indented_title`` and ``move_column`` should be
added to subclasses ``list_display``::
this class the three columns ``collapse_column``, ``indented_title`` and
``move_column`` should be added to subclasses ``list_display``::
class NodeAdmin(TreeAdmin):
list_display = ("indented_title", "move_column", ...)
list_display = [*TreeAdmin.list_display, ...]
# This is the default:
# list_display_links = ["indented_title"]
admin.site.register(Node, NodeAdmin)
"""

list_display = ("indented_title", "move_column")
list_display = ["collapse_column", "indented_title", "move_column"]
list_display_links = ["indented_title"]

@csrf_protect_m
def changelist_view(self, request, **kwargs):
Expand Down Expand Up @@ -137,10 +140,10 @@ def move_column(self, instance):
"""\
<div class="move-controls">
<button class="move-cut" type="button" data-pk="{}" title="{}">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M760-120 480-400l-94 94q8 15 11 32t3 34q0 66-47 113T240-80q-66 0-113-47T80-240q0-66 47-113t113-47q17 0 34 3t32 11l94-94-94-94q-15 8-32 11t-34 3q-66 0-113-47T80-720q0-66 47-113t113-47q66 0 113 47t47 113q0 17-3 34t-11 32l494 494v40H760ZM600-520l-80-80 240-240h120v40L600-520ZM240-640q33 0 56.5-23.5T320-720q0-33-23.5-56.5T240-800q-33 0-56.5 23.5T160-720q0 33 23.5 56.5T240-640Zm240 180q8 0 14-6t6-14q0-8-6-14t-14-6q-8 0-14 6t-6 14q0 8 6 14t14 6ZM240-160q33 0 56.5-23.5T320-240q0-33-23.5-56.5T240-320q-33 0-56.5 23.5T160-240q0 33 23.5 56.5T240-160Z"/></svg>
</button>
<select class="move-paste" data-pk="{}">
<option value="">{}</option>
<select class="move-paste" data-pk="{}" title="{}">
<option value=""></option>
<option value="before">{}</option> -->
<option value="first-child">{}</option>
<option value="last-child">{}</option>
Expand All @@ -151,7 +154,7 @@ def move_column(self, instance):
instance.pk,
_("Move '{}' to a new location").format(instance),
instance.pk,
_("move"),
_("Choose new location"),
_("before"),
_("as first child"),
_("as last child"),
Expand Down
Binary file modified feincms3/locale/de/LC_MESSAGES/django.mo
Binary file not shown.
62 changes: 33 additions & 29 deletions feincms3/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: feincms\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-02 19:46+0200\n"
"POT-Creation-Date: 2024-06-03 08:51+0200\n"
"PO-Revision-Date: 2020-12-04 09:43+0000\n"
"Last-Translator: J. Lavoie <j.lavoie@net-c.ca>\n"
"Language-Team: German <https://hosted.weblate.org/projects/feincms3/feincms3/"
Expand All @@ -21,110 +21,114 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.4-dev\n"

#: admin.py:129 pages.py:84
#: admin.py:132 pages.py:84
msgid "title"
msgstr "Titel"

#: admin.py:152
#: admin.py:155
msgid "Move '{}' to a new location"
msgstr "'{}' zu einer neuen Position verschieben"

#: admin.py:154 admin.py:168 admin.py:171
msgid "move"
msgstr "verschieben"
#: admin.py:157
msgid "Choose new location"
msgstr "Neuen Ort auswählen"

#: admin.py:155
#: admin.py:158
msgid "before"
msgstr "vorher"

#: admin.py:156
#: admin.py:159
msgid "as first child"
msgstr "als erstes Unterelement"

#: admin.py:157
#: admin.py:160
msgid "as last child"
msgstr "als letztes Unterelement"

#: admin.py:158
#: admin.py:161
msgid "after"
msgstr "nachher"

#: admin.py:203
#: admin.py:171 admin.py:174
msgid "move"
msgstr "verschieben"

#: admin.py:206
#, python-format
msgid "Move %s"
msgstr "%s verschieben"

#: admin.py:208
#: admin.py:211
#, python-format
msgid "Clone %s"
msgstr "%s klonen"

#: admin.py:273
#: admin.py:276
msgid "Invalid node move request."
msgstr "Ungültige Verschiebungsanfrage."

#: admin.py:296
#: admin.py:301
msgid "Error while validating the new position of '{}'."
msgstr "Fehler beim Validieren der neuen Position von '{}'."

#: admin.py:327
#: admin.py:334
msgid "Node '{}' has been moved to its new position."
msgstr "'{}' wurde zur neuen Position verschoben."

#: admin.py:352
#: admin.py:362
msgid "New location"
msgstr "Neuer Ort"

#: admin.py:360
#: admin.py:370
msgid ""
"Moving isn't possible because there are no valid targets. Maybe you selected "
"the only root node?"
msgstr ""
"Verschieben ist nicht möglich weil es keine gültigen Zielorte gibt. "
"Vielleicht den einzigen Wurzelknoten gewählt?"

#: admin.py:406 admin.py:417 admin.py:427
#: admin.py:416 admin.py:427 admin.py:437
msgid "move here"
msgstr "hierhin verschieben"

#: admin.py:489
#: admin.py:499
#, python-format
msgid "The node %(node)s has been moved to the new position."
msgstr "%(node)s wurde zur neuen Position verschoben."

#: admin.py:507
#: admin.py:517
msgid "target"
msgstr "Ziel"

#: admin.py:517
#: admin.py:527
msgid "Replace target's content"
msgstr "Inhalt des Ziels ersetzen"

#: admin.py:519
#: admin.py:529
#, python-format
msgid "Affects the following models: %s."
msgstr "Betrifft die folgenden Inhalte: %s."

#: admin.py:541
#: admin.py:551
#, python-format
msgid "Current: \"%s\""
msgstr "Aktuell: „%s“"

#: admin.py:551
#: admin.py:561
msgid "Cannot clone node to itself."
msgstr "Kann Knoten nicht zu sich selbst klonen."

#: admin.py:574
#: admin.py:584
#, python-format
msgid "Updated fields of %(node)s: %(fields)s"
msgstr "Aktualisierte Felder von %(node)s: %(fields)s"

#: admin.py:598
#: admin.py:608
#, python-format
msgid "Replaced the content of %(target)s with the contents of %(source)s."
msgstr "Ersetzte den Inhalt von %(target)s mit dem Inhalt von %(source)s."

#: admin.py:625
#: admin.py:635
msgid "subtree"
msgstr "Unterbaum"

Expand Down Expand Up @@ -244,11 +248,11 @@ msgstr "Seite"
msgid "pages"
msgstr "Seiten"

#: pages.py:167
#: pages.py:171
msgid "Static paths cannot be empty. Did you mean '/'?"
msgstr "Statische Pfade können nicht leer sein. Meinten Sie „/“?"

#: pages.py:189
#: pages.py:193
#, python-format
msgid "The page %(page)s's new path %(path)s would not be unique."
msgstr "Der Pfad %(path)s der Seite %(page)s würde nicht eindeutig sein."
Expand Down
60 changes: 32 additions & 28 deletions feincms3/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-02 19:46+0200\n"
"POT-Creation-Date: 2024-06-03 08:51+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand All @@ -18,108 +18,112 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: admin.py:129 pages.py:84
#: admin.py:132 pages.py:84
msgid "title"
msgstr ""

#: admin.py:152
#: admin.py:155
msgid "Move '{}' to a new location"
msgstr ""

#: admin.py:154 admin.py:168 admin.py:171
msgid "move"
#: admin.py:157
msgid "Choose new location"
msgstr ""

#: admin.py:155
#: admin.py:158
msgid "before"
msgstr ""

#: admin.py:156
#: admin.py:159
msgid "as first child"
msgstr ""

#: admin.py:157
#: admin.py:160
msgid "as last child"
msgstr ""

#: admin.py:158
#: admin.py:161
msgid "after"
msgstr ""

#: admin.py:203
#: admin.py:171 admin.py:174
msgid "move"
msgstr ""

#: admin.py:206
#, python-format
msgid "Move %s"
msgstr ""

#: admin.py:208
#: admin.py:211
#, python-format
msgid "Clone %s"
msgstr ""

#: admin.py:273
#: admin.py:276
msgid "Invalid node move request."
msgstr ""

#: admin.py:296
#: admin.py:301
msgid "Error while validating the new position of '{}'."
msgstr ""

#: admin.py:327
#: admin.py:334
msgid "Node '{}' has been moved to its new position."
msgstr ""

#: admin.py:352
#: admin.py:362
msgid "New location"
msgstr ""

#: admin.py:360
#: admin.py:370
msgid ""
"Moving isn't possible because there are no valid targets. Maybe you selected "
"the only root node?"
msgstr ""

#: admin.py:406 admin.py:417 admin.py:427
#: admin.py:416 admin.py:427 admin.py:437
msgid "move here"
msgstr ""

#: admin.py:489
#: admin.py:499
#, python-format
msgid "The node %(node)s has been moved to the new position."
msgstr ""

#: admin.py:507
#: admin.py:517
msgid "target"
msgstr ""

#: admin.py:517
#: admin.py:527
msgid "Replace target's content"
msgstr ""

#: admin.py:519
#: admin.py:529
#, python-format
msgid "Affects the following models: %s."
msgstr ""

#: admin.py:541
#: admin.py:551
#, python-format
msgid "Current: \"%s\""
msgstr ""

#: admin.py:551
#: admin.py:561
msgid "Cannot clone node to itself."
msgstr ""

#: admin.py:574
#: admin.py:584
#, python-format
msgid "Updated fields of %(node)s: %(fields)s"
msgstr ""

#: admin.py:598
#: admin.py:608
#, python-format
msgid "Replaced the content of %(target)s with the contents of %(source)s."
msgstr ""

#: admin.py:625
#: admin.py:635
msgid "subtree"
msgstr ""

Expand Down Expand Up @@ -228,11 +232,11 @@ msgstr ""
msgid "pages"
msgstr ""

#: pages.py:167
#: pages.py:171
msgid "Static paths cannot be empty. Did you mean '/'?"
msgstr ""

#: pages.py:189
#: pages.py:193
#, python-format
msgid "The page %(page)s's new path %(path)s would not be unique."
msgstr ""
Expand Down
Loading

0 comments on commit e877f0c

Please sign in to comment.