From 99dc5a7385bc6825a43400c7c9a6cf2a0e48b901 Mon Sep 17 00:00:00 2001 From: Christoph Klassen Date: Mon, 25 Sep 2023 20:39:20 +0200 Subject: [PATCH 1/2] Change position and order of submit buttons --- src/moin/static/css/common.css | 7 ++-- src/moin/templates/modify.html | 59 +++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 21 deletions(-) diff --git a/src/moin/static/css/common.css b/src/moin/static/css/common.css index 4421e7fd9..196d483a0 100644 --- a/src/moin/static/css/common.css +++ b/src/moin/static/css/common.css @@ -579,12 +579,12 @@ li.moin-selected-groups { font-size: 1em; font-weight: bold; } .moin-form dt { clear: both; float: left; width: 25%; text-align: right; margin-top: .3em; padding-right: 1em; } .moin-form dt label.required:after { content: '*'; color: var(--primary); } .moin-form button, -.moin-form input[type="submit"] { clear: both; display: block; margin: auto; } +.moin-form input[type="submit"] { clear: both; display: block; } .moin-form dl { margin-bottom: 2em; } .moin-float-fix { clear: both; padding-top: .75em; } .moin-form input[type="submit"].moin-modify-submit, .moin-form .moin-load-draft, -.moin-form .moin-cancel { clear: none; float: left; margin-right: 3em; margin-bottom: 1em; } +.moin-form .moin-cancel { margin-bottom: 1em; } .moin-form .moin-load-draft { border: 1px solid var(--alert); background-color: var(--bg-message); } .moin-watermark { background-image: url("../../../static/img/draft.png"); @@ -593,6 +593,9 @@ li.moin-selected-groups { font-size: 1em; font-weight: bold; } .moin-form dd.moin-radio { line-height: 1.5em} .moin-form .moin-radio input { width: 1em; } +.moin-form .submit-buttons{ display: flex; column-gap: 8pt; justify-content: end; + margin: 8pt 0; } + #options dd { width: 10%; } #options dt { width: 60%; max-width: 40em; } #subscriptions textarea, diff --git a/src/moin/templates/modify.html b/src/moin/templates/modify.html index b7c7f901a..9cf770e05 100644 --- a/src/moin/templates/modify.html +++ b/src/moin/templates/modify.html @@ -45,29 +45,14 @@

{{ title }}

POSTs originate from their respective applets. #} {% if not form['content_form'].is_draw %} -
- {% set warning = "" %} - {% if draft_data %} - - {% set warning = _("Clicking this button will delete draft!") %} - {% endif %} - {{ gen.input(type='submit', id='moin-save-text-button', value=form.submit_label, - class='moin-button moin-modify-submit', title=warning) }} - {{ gen.input(type='submit', id='moin-preview-text-button', name='preview', value=form.preview_label, - class='moin-button moin-modify-submit', onclick="$('#moin-modify').removeClass('moin-changed-input')", - title=warning) }} - {{ gen.input(type='submit', id='moin-cancel-text-button', name='cancel', value=form.cancel_label, - class='moin-button moin-modify-submit', onclick="$('#moin-modify').removeClass('moin-changed-input')", - title=warning) }} -
-
- {{ forms.render(form['comment']) }} -
+ {% if draft_data %} + + {% set warning = _("Clicking this button will delete draft!") %} + {% endif %} {% endif %} {{ utils.help_on_editing(help) }} {{ data_editor(form['content_form'], item_name) }} {% set may_admin = user.may.admin(fqname) %} - {{ meta_editor(form['meta_form'], may_admin) }} {% if item.meta['name'][0].endswith('Group') %}
@@ -85,6 +70,42 @@

{{ title }}

{{ _('Enter "key=value" strings, one per line, no quotes, no blank lines.') }} {% endif %} + + {# + Workaround: + For *Draw content, hide form['comment'], since *Draw + POSTs originate from their respective applets. + #} + {% if not form['content_form'].is_draw %} +
+ {{ forms.render(form['comment']) }} +
+ {% endif %} + + {{ meta_editor(form['meta_form'], may_admin) }} + + {% block moin_flash %} + {% endblock %} + + {# + Workaround: + For *Draw content, hide submit button, since *Draw + POSTs originate from their respective applets. + #} + {% if not form['content_form'].is_draw %} + +
+ {% set warning = "" %} + {{ gen.input(type='submit', id='moin-cancel-text-button', name='cancel', value=form.cancel_label, + class='moin-button moin-modify-submit', onclick="$('#moin-modify').removeClass('moin-changed-input')", + title=warning) }} + {{ gen.input(type='submit', id='moin-preview-text-button', name='preview', value=form.preview_label, + class='moin-button moin-modify-submit', onclick="$('#moin-modify').removeClass('moin-changed-input')", + title=warning) }} + {{ gen.input(type='submit', id='moin-save-text-button', value=form.submit_label, + class='moin-button moin-modify-submit', title=warning) }} +
+ {% endif %} {{ gen.form.close() }} From c25a5d405e37bf8a68547a5e5aaf1f0108e1c349 Mon Sep 17 00:00:00 2001 From: Christoph Klassen Date: Thu, 12 Sep 2024 10:22:01 +0200 Subject: [PATCH 2/2] Remove header "General meta" Not necessary as e.g. comment is also meta data. --- src/moin/templates/modify_meta.html | 1 - src/moin/translations/MoinMoin.pot | 4 ---- src/moin/translations/de/LC_MESSAGES/messages.po | 4 ---- src/moin/translations/pt_BR/LC_MESSAGES/messages.po | 4 ---- src/moin/translations/ru/LC_MESSAGES/messages.po | 4 ---- 5 files changed, 17 deletions(-) diff --git a/src/moin/templates/modify_meta.html b/src/moin/templates/modify_meta.html index b6b8986dd..b0b991d53 100644 --- a/src/moin/templates/modify_meta.html +++ b/src/moin/templates/modify_meta.html @@ -8,7 +8,6 @@ {% import "forms.html" as forms %} {% macro meta_editor(form, may_admin) %} -

{{ _("General meta") }}

{% if may_admin %} {{ forms.render(form['acl']) }} diff --git a/src/moin/translations/MoinMoin.pot b/src/moin/translations/MoinMoin.pot index 6aa723cc6..623323e0b 100644 --- a/src/moin/translations/MoinMoin.pot +++ b/src/moin/translations/MoinMoin.pot @@ -2504,10 +2504,6 @@ msgstr "" msgid "Enter \"key=value\" strings, one per line, no quotes, no blank lines." msgstr "" -#: src/moin/templates/modify_meta.html:11 -msgid "General meta" -msgstr "" - #: src/moin/templates/modify_meta.html:26 msgid "Tags may have embedded blanks, use commas to separate." msgstr "" diff --git a/src/moin/translations/de/LC_MESSAGES/messages.po b/src/moin/translations/de/LC_MESSAGES/messages.po index c213cd0e8..a43500abd 100644 --- a/src/moin/translations/de/LC_MESSAGES/messages.po +++ b/src/moin/translations/de/LC_MESSAGES/messages.po @@ -2540,10 +2540,6 @@ msgstr "Geben Sie die Liste der Benutzer-Namen einzeln pro Zeile ein." msgid "Enter \"key=value\" strings, one per line, no quotes, no blank lines." msgstr "Geben Sie \"Schlüssel=Wert\" Paare ein, einzeln pro Zeile, keine Anführungszeichen, keine leeren Zeilen." -#: src/moin/templates/modify_meta.html:11 -msgid "General meta" -msgstr "Allgemeine Metadaten" - #: src/moin/templates/modify_meta.html:26 msgid "Tags may have embedded blanks, use commas to separate." msgstr "Schlagworte können Leerzeichen enthalten, benutzen Sie Kommas zum trennen." diff --git a/src/moin/translations/pt_BR/LC_MESSAGES/messages.po b/src/moin/translations/pt_BR/LC_MESSAGES/messages.po index 2b76da244..422d27da7 100644 --- a/src/moin/translations/pt_BR/LC_MESSAGES/messages.po +++ b/src/moin/translations/pt_BR/LC_MESSAGES/messages.po @@ -2479,10 +2479,6 @@ msgstr "" msgid "Enter \"key=value\" strings, one per line, no quotes, no blank lines." msgstr "" -#: src/moin/templates/modify_meta.html:11 -msgid "General meta" -msgstr "" - #: src/moin/templates/modify_meta.html:26 msgid "Tags may have embedded blanks, use commas to separate." msgstr "" diff --git a/src/moin/translations/ru/LC_MESSAGES/messages.po b/src/moin/translations/ru/LC_MESSAGES/messages.po index 2669dd95e..27519394d 100644 --- a/src/moin/translations/ru/LC_MESSAGES/messages.po +++ b/src/moin/translations/ru/LC_MESSAGES/messages.po @@ -2470,10 +2470,6 @@ msgstr "" msgid "Enter \"key=value\" strings, one per line, no quotes, no blank lines." msgstr "" -#: src/moin/templates/modify_meta.html:11 -msgid "General meta" -msgstr "" - #: src/moin/templates/modify_meta.html:26 msgid "Tags may have embedded blanks, use commas to separate." msgstr ""