Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve modify layout #1525

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/moin/static/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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,
Expand Down
59 changes: 40 additions & 19 deletions src/moin/templates/modify.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,14 @@ <h1>{{ title }}</h1>
POSTs originate from their respective applets.
#}
{% if not form['content_form'].is_draw %}
<div>
{% set warning = "" %}
{% if draft_data %}
<button class="moin-button moin-load-draft" type="button" >{{ _("Load Draft") }}</button>
{% 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) }}
</div>
<dl>
{{ forms.render(form['comment']) }}
</dl>
{% if draft_data %}
<button class="moin-button moin-load-draft" type="button" >{{ _("Load Draft") }}</button>
{% 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') %}
<dl>
Expand All @@ -85,6 +70,42 @@ <h1>{{ title }}</h1>
{{ _('Enter "key=value" strings, one per line, no quotes, no blank lines.') }}
</div>
{% endif %}

{#
Workaround:
For *Draw content, hide form['comment'], since *Draw
POSTs originate from their respective applets.
#}
{% if not form['content_form'].is_draw %}
<dl>
{{ forms.render(form['comment']) }}
</dl>
{% 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 %}

<div class="submit-buttons">
{% 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) }}
</div>
{% endif %}
{{ gen.form.close() }}
</div>

Expand Down
1 change: 0 additions & 1 deletion src/moin/templates/modify_meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{% import "forms.html" as forms %}

{% macro meta_editor(form, may_admin) %}
<h2>{{ _("General meta") }}</h2>
<dl>
{% if may_admin %}
{{ forms.render(form['acl']) }}
Expand Down
4 changes: 0 additions & 4 deletions src/moin/translations/MoinMoin.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
4 changes: 0 additions & 4 deletions src/moin/translations/de/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
4 changes: 0 additions & 4 deletions src/moin/translations/pt_BR/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
4 changes: 0 additions & 4 deletions src/moin/translations/ru/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down