From 266f79f75dff1c770fd8aee33d17b40fbef6793b Mon Sep 17 00:00:00 2001 From: RogerHaase Date: Sat, 7 Jun 2025 07:35:23 -0700 Subject: [PATCH] tweak indentation, EOL per coding-std --- src/moin/templates/utils.html | 60 +++--- .../themes/basic/templates/itemviews.html | 12 +- src/moin/themes/basic/templates/modify.html | 2 +- src/moin/themes/focus/static/js/main.js | 2 +- .../themes/focus/templates/itemviews.html | 200 +++++++++--------- src/moin/themes/focus/templates/layout.html | 56 ++--- 6 files changed, 167 insertions(+), 165 deletions(-) diff --git a/src/moin/templates/utils.html b/src/moin/templates/utils.html index e6c839e3e..67d509e31 100644 --- a/src/moin/templates/utils.html +++ b/src/moin/templates/utils.html @@ -154,50 +154,52 @@ Item Links - {%- if meta['itemlinks'] -%} - {%- for item in meta['itemlinks']|sort -%} - {{ item }} - {%- if not loop.last %}, {% endif -%} - {%- endfor -%} - {%- else -%} - (None) - {%- endif -%} + {%- if meta['itemlinks'] -%} + {%- for item in meta['itemlinks']|sort -%} + {{ item }} + {%- if not loop.last %}, {% endif -%} + {%- endfor -%} + {%- else -%} + (None) + {%- endif -%} Item Transclusions - {%- if meta['itemtransclusions'] -%} - {%- for item in meta['itemtransclusions']|sort -%} - {{ item }} - {%- if not loop.last %}, {% endif -%} - {%- endfor -%} - {%- else -%} - (None) - {%- endif -%} + {%- if meta['itemtransclusions'] -%} + {%- for item in meta['itemtransclusions']|sort -%} + {{ item }} + {%- if not loop.last %}, {% endif -%} + {%- endfor -%} + {%- else -%} + (None) + {%- endif -%} Item Type{{ meta['itemtype'] }} Language{{ meta['language'] }} Modified Time{{ meta['mtime']|time_datetime }} - Name - {%- if meta['name'] -%} - {%- set names = ' '.join(meta['name']) -%} - {{ names|safe }} - {%- else -%} - (None) - {%- endif -%} + + Name + + {%- if meta['name'] -%} + {%- set names = ' '.join(meta['name']) -%} + {{ names|safe }} + {%- else -%} + (None) + {%- endif -%} Old Name - {%- if meta['name_old'] -%} - {%- set names = ' '.join(meta['name_old']) -%} - {{ names|safe }} - {%- else -%} - (None) - {%- endif -%} + {%- if meta['name_old'] -%} + {%- set names = ' '.join(meta['name_old']) -%} + {{ names|safe }} + {%- else -%} + (None) + {%- endif -%} Namespace{{ meta['namespace'] }} diff --git a/src/moin/themes/basic/templates/itemviews.html b/src/moin/themes/basic/templates/itemviews.html index a1912b111..7199ae4a7 100644 --- a/src/moin/themes/basic/templates/itemviews.html +++ b/src/moin/themes/basic/templates/itemviews.html @@ -6,12 +6,12 @@ {% if navtabs %} {% endif %} diff --git a/src/moin/themes/basic/templates/modify.html b/src/moin/themes/basic/templates/modify.html index 630013774..5757267ea 100644 --- a/src/moin/themes/basic/templates/modify.html +++ b/src/moin/themes/basic/templates/modify.html @@ -41,7 +41,7 @@

{{ title }}

{% if user.may.admin(fqname) %} - + {% endif %} diff --git a/src/moin/themes/focus/static/js/main.js b/src/moin/themes/focus/static/js/main.js index 3d48779b3..d13291de5 100644 --- a/src/moin/themes/focus/static/js/main.js +++ b/src/moin/themes/focus/static/js/main.js @@ -80,4 +80,4 @@ window.onload = function () { toggleVisibility(navibar, "flex") toggleVisibility(breadcrumb) }) -} \ No newline at end of file +} diff --git a/src/moin/themes/focus/templates/itemviews.html b/src/moin/themes/focus/templates/itemviews.html index 518f444d9..c6e9b1ddf 100644 --- a/src/moin/themes/focus/templates/itemviews.html +++ b/src/moin/themes/focus/templates/itemviews.html @@ -45,117 +45,117 @@
{%- for endpoint, label, title, check_exists in cfg.item_views if not endpoint in cfg.endpoints_excluded %} - {% set icon_class = icon_classes[endpoint] %} - {%- if may.write - and not_trash - and endpoint == 'frontend.modify_item' - and current_path.startswith("/+") - and not current_path.startswith("/+modify/") - %} -
- {{ a_label(icon_class, label) }} -
- {%- endif %} - {%- if endpoint in [ - 'frontend.show_item_meta', - 'frontend.history', - 'frontend.download_item', - ] %} -
- {{ a_label(icon_class, label) }} -
- {%- endif %} + {% set icon_class = icon_classes[endpoint] %} + {%- if may.write + and not_trash + and endpoint == 'frontend.modify_item' + and current_path.startswith("/+") + and not current_path.startswith("/+modify/") + %} +
+ {{ a_label(icon_class, label) }} +
+ {%- endif %} + {%- if endpoint in [ + 'frontend.show_item_meta', + 'frontend.history', + 'frontend.download_item', + ] %} +
+ {{ a_label(icon_class, label) }} +
+ {%- endif %} - {%- if not_trash and endpoint in [ - 'frontend.index', - 'frontend.refs', - 'frontend.sitemap', - 'frontend.similar_names', - 'frontend.copy_item', - ] %} -
- {{ a_label(icon_class, label) }} -
- {%- endif %} + {%- if not_trash and endpoint in [ + 'frontend.index', + 'frontend.refs', + 'frontend.sitemap', + 'frontend.similar_names', + 'frontend.copy_item', + ] %} +
+ {{ a_label(icon_class, label) }} +
+ {%- endif %} - {%- if endpoint == 'frontend.highlight_item' and item and ('text' in item.contenttype or 'docbook' in item.contenttype) %} -
- {{ a_label(icon_class, label) }} -
- {%- endif %} + {%- if endpoint == 'frontend.highlight_item' and item and ('text' in item.contenttype or 'docbook' in item.contenttype) %} +
+ {{ a_label(icon_class, label) }} +
+ {%- endif %} - {%- if endpoint in [ - 'frontend.rename_item', 'frontend.delete_item', - ] and may.write and not_trash %} -
- {{ a_label(icon_class, label) }} -
- {%- endif %} + {%- if endpoint in [ + 'frontend.rename_item', 'frontend.delete_item', + ] and may.write and not_trash %} +
+ {{ a_label(icon_class, label) }} +
+ {%- endif %} - {%- if endpoint in [ - 'frontend.convert_item', - ] and may.write and item and theme_supp.is_markup_or_text(item.contenttype) and not_trash %} -
- {{ a_label(icon_class, label) }} -
- {%- endif %} + {%- if endpoint in [ + 'frontend.convert_item', + ] and may.write and item and theme_supp.is_markup_or_text(item.contenttype) and not_trash %} +
+ {{ a_label(icon_class, label) }} +
+ {%- endif %} - {%- if endpoint == 'frontend.destroy_item' and may.destroy %} -
- {{ a_label(icon_class, label) }} -
- {%- endif %} + {%- if endpoint == 'frontend.destroy_item' and may.destroy %} +
+ {{ a_label(icon_class, label) }} +
+ {%- endif %} - {%- if endpoint == 'frontend.quicklink_item' and user.valid and not_trash %} -
- - {%- if user.is_quicklinked_to([fqname]) %} - {{ a_label(icon_class, _('Remove Link')) }} - {%- else %} - {{ a_label(icon_class, _('Add Link')) }} - {%- endif %} - -
- {%- endif %} + {%- if endpoint == 'frontend.quicklink_item' and user.valid and not_trash %} +
+ + {%- if user.is_quicklinked_to([fqname]) %} + {{ a_label(icon_class, _('Remove Link')) }} + {%- else %} + {{ a_label(icon_class, _('Add Link')) }} + {%- endif %} + +
+ {%- endif %} - {%- if endpoint == 'frontend.subscribe_item' and user.valid and not_trash %} -
- - {%- if user.is_subscribed_to(item) %} - {{ a_label(icon_class, _('Unsubscribe')) }} - {%- else %} - {{ a_label(icon_class, _('Subscribe')) }} - {%- endif %} - -
- {%- endif %} + {%- if endpoint == 'frontend.subscribe_item' and user.valid and not_trash %} +
+ + {%- if user.is_subscribed_to(item) %} + {{ a_label(icon_class, _('Unsubscribe')) }} + {%- else %} + {{ a_label(icon_class, _('Subscribe')) }} + {%- endif %} + +
+ {%- endif %} - {%- if endpoint == 'special.comments' and not_trash %} - - {%- endif %} + {%- if endpoint == 'special.comments' and not_trash %} + + {%- endif %} - {% if endpoint == 'special.transclusions' and not_trash -%} - - {%- endif %} + {% if endpoint == 'special.transclusions' and not_trash -%} + + {%- endif %} - {%- if endpoint == 'special.supplementation' and fqname %} - {%- for sub_item_name in cfg.supplementation_item_names %} - {%- set current_sub = item_name.rsplit('/', 1)[-1] %} - {%- if not current_sub in cfg.supplementation_item_names %} - {%- set supp_name = '%s/%s/%s' % (fqname.namespace, item_name, sub_item_name) %} - {%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %} - {% set title = _('Discuss contents of this item') %} -
- {{ a_label(icon_class, _(sub_item_name)) }} -
+ {%- if endpoint == 'special.supplementation' and fqname %} + {%- for sub_item_name in cfg.supplementation_item_names %} + {%- set current_sub = item_name.rsplit('/', 1)[-1] %} + {%- if not current_sub in cfg.supplementation_item_names %} + {%- set supp_name = '%s/%s/%s' % (fqname.namespace, item_name, sub_item_name) %} + {%- if not_trash and (storage.has_item(supp_name) or user.may.write(supp_name)) %} + {% set title = _('Discuss contents of this item') %} +
+ {{ a_label(icon_class, _(sub_item_name)) }} +
+ {%- endif %} {%- endif %} - {%- endif %} - {%- endfor %} - {%- endif %} + {%- endfor %} + {%- endif %} {%- endfor %}
diff --git a/src/moin/themes/focus/templates/layout.html b/src/moin/themes/focus/templates/layout.html index c208176c1..879951b3c 100644 --- a/src/moin/themes/focus/templates/layout.html +++ b/src/moin/themes/focus/templates/layout.html @@ -98,35 +98,35 @@ {%- set trail_items = theme_supp.path_breadcrumbs() %} {%- if trail_items %} {%- endif %}