From da5918b154e81c2e04d10e34928b7fd9e8c799cd Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Fri, 19 Jan 2024 21:24:55 -0500 Subject: [PATCH] Update admin/default templates --- src/MyWebLog/DotLiquidBespoke.fs | 24 +- src/admin-theme/_edit-common.liquid | 34 +- src/admin-theme/_layout.liquid | 87 +++-- src/admin-theme/admin-dashboard.liquid | 50 ++- src/admin-theme/category-edit.liquid | 46 ++- src/admin-theme/category-list-body.liquid | 30 +- src/admin-theme/category-list.liquid | 4 +- src/admin-theme/custom-feed-edit.liquid | 347 ++++++------------- src/admin-theme/dashboard.liquid | 20 +- src/admin-theme/layout-bare.liquid | 6 +- src/admin-theme/layout-partial.liquid | 10 +- src/admin-theme/layout.liquid | 24 +- src/admin-theme/log-on.liquid | 28 +- src/admin-theme/my-info.liquid | 73 ++-- src/admin-theme/page-edit.liquid | 58 ++-- src/admin-theme/page-list.liquid | 32 +- src/admin-theme/permalinks.liquid | 51 ++- src/admin-theme/post-edit.liquid | 268 +++++++------- src/admin-theme/post-list.liquid | 32 +- src/admin-theme/redirect-edit.liquid | 40 +-- src/admin-theme/redirect-list.liquid | 49 ++- src/admin-theme/revisions.liquid | 43 ++- src/admin-theme/settings.liquid | 180 +++++----- src/admin-theme/tag-mapping-edit.liquid | 29 +- src/admin-theme/tag-mapping-list-body.liquid | 28 +- src/admin-theme/theme-list-body.liquid | 10 +- src/admin-theme/theme-upload.liquid | 26 +- src/admin-theme/upload-list.liquid | 43 ++- src/admin-theme/upload-new.liquid | 32 +- src/admin-theme/user-edit.liquid | 85 +++-- src/admin-theme/user-list-body.liquid | 14 +- src/default-theme/index.liquid | 56 ++- src/default-theme/layout.liquid | 109 +++--- src/default-theme/single-page.liquid | 6 +- src/default-theme/single-post.liquid | 30 +- src/default-theme/version.txt | 2 +- 36 files changed, 914 insertions(+), 1092 deletions(-) diff --git a/src/MyWebLog/DotLiquidBespoke.fs b/src/MyWebLog/DotLiquidBespoke.fs index 73594f1..d5edcca 100644 --- a/src/MyWebLog/DotLiquidBespoke.fs +++ b/src/MyWebLog/DotLiquidBespoke.fs @@ -83,13 +83,13 @@ type NavLinkFilter() = let extraPath = ctx.WebLog.ExtraPath let path = if extraPath = "" then "" else $"{extraPath[1..]}/" seq { - "
  • " text - "
  • " + "" } |> String.concat "" @@ -111,23 +111,23 @@ type PageHeadTag() = let getBool name = defaultArg (context.Environments[0].[name] |> Option.ofObj |> Option.map Convert.ToBoolean) false - result.WriteLine $"""""" + result.WriteLine $"""""" // Theme assets if assetExists "style.css" webLog then - result.WriteLine $"""{s}""" + result.WriteLine $"""{s}""" if assetExists "favicon.ico" webLog then - result.WriteLine $"""{s}""" + result.WriteLine $"""{s}""" // RSS feeds and canonical URLs let feedLink title url = let escTitle = HttpUtility.HtmlAttributeEncode title let relUrl = webLog.RelativeUrl(Permalink url) - $"""{s}""" + $"""{s}""" if webLog.Rss.IsFeedEnabled && getBool "is_home" then result.WriteLine(feedLink webLog.Name webLog.Rss.FeedName) - result.WriteLine $"""{s}""" + result.WriteLine $"""{s}""" if webLog.Rss.IsCategoryEnabled && getBool "is_category_home" then let slug = context.Environments[0].["slug"] :?> string @@ -140,12 +140,12 @@ type PageHeadTag() = if getBool "is_post" then let post = context.Environments[0].["model"] :?> PostDisplay let url = webLog.AbsoluteUrl (Permalink post.Posts[0].Permalink) - result.WriteLine $"""{s}""" + result.WriteLine $"""{s}""" if getBool "is_page" then let page = context.Environments[0].["page"] :?> DisplayPage let url = webLog.AbsoluteUrl (Permalink page.Permalink) - result.WriteLine $"""{s}""" + result.WriteLine $"""{s}""" /// Create various items in the page header based on the state of the page being generated @@ -191,10 +191,10 @@ type UserLinksTag() = """" } |> Seq.iter result.WriteLine diff --git a/src/admin-theme/_edit-common.liquid b/src/admin-theme/_edit-common.liquid index 46f1e81..214de29 100644 --- a/src/admin-theme/_edit-common.liquid +++ b/src/admin-theme/_edit-common.liquid @@ -1,32 +1,32 @@
    - - +
    - - + {%- unless model.is_new %} {%- assign entity_url_base = "admin/" | append: entity | append: "/" | append: entity_id -%} - + Manage Permalinks - + Manage Revisions {%- endunless -%}
    -
    -     -
    - - - - +
    +     +
    + + + +
    -
    - +
    +
    diff --git a/src/admin-theme/_layout.liquid b/src/admin-theme/_layout.liquid index c9df14c..440acea 100644 --- a/src/admin-theme/_layout.liquid +++ b/src/admin-theme/_layout.liquid @@ -1,65 +1,60 @@
    -
    -
    +
    +
    {% for msg in messages %} -
    -

    Loading…

    +

    Loading…

    {{ content }}
    {%- assign version = generator | split: " " -%} v{{ version[1] }} - myWebLog + myWebLog
    diff --git a/src/admin-theme/admin-dashboard.liquid b/src/admin-theme/admin-dashboard.liquid index 7febfc6..baed2f7 100644 --- a/src/admin-theme/admin-dashboard.liquid +++ b/src/admin-theme/admin-dashboard.liquid @@ -1,9 +1,8 @@ -

    {{ page_title }}

    +

    {{ page_title }}

    Themes - + Upload a New Theme
    @@ -21,39 +20,37 @@ {%- assign cache_base_url = "admin/cache/" -%} Caches
    -
    +

    - myWebLog uses a few caches to ensure that it serves pages as fast as possible. - (more information) -

    + myWebLog uses a few caches to ensure that it serves pages as fast as possible. + (more information)
    -
    +
    -
    +
    Web Logs
    These caches include the page list and categories for each web log
    {%- assign web_log_base_url = cache_base_url | append: "web-log/" -%} -
    - -
    -
    Web Log
    +
    Web Log
    {%- for web_log in web_logs %}
    -
    +
    {{ web_log[1] }}
    - {{ web_log[2] }}
    + {{ web_log[2] }}
    {%- assign refresh_url = web_log_base_url | append: web_log[0] | append: "/refresh" | relative_link -%} Refresh
    @@ -65,7 +62,7 @@
    -
    +
    Themes
    @@ -73,29 +70,28 @@ templates will still refresh its asset cache
    {%- assign theme_base_url = cache_base_url | append: "theme/" -%} - - -
    -
    Theme
    -
    Cached
    +
    Theme
    +
    Cached
    {%- for theme in cached_themes %} {% unless theme[0] == "admin" %}
    -
    +
    {{ theme[1] }}
    - {{ theme[0] }} • + {{ theme[0] }} • {%- assign refresh_url = theme_base_url | append: theme[0] | append: "/refresh" | relative_link -%} Refresh
    -
    {{ theme[2] }}
    +
    {{ theme[2] }}
    {% endunless %} {%- endfor %} diff --git a/src/admin-theme/category-edit.liquid b/src/admin-theme/category-edit.liquid index ee13d19..3cb44ef 100644 --- a/src/admin-theme/category-edit.liquid +++ b/src/admin-theme/category-edit.liquid @@ -1,52 +1,50 @@ -
    -
    {{ page_title }}
    - - - -
    +
    +
    {{ page_title }}
    + + + +
    -
    - + - +
    -
    - + - +
    -
    - + {% for cat in categories -%} {%- unless cat.id == model.category_id %} - {% endunless -%} {%- endfor %} - +
    -
    - + - +
    - + Cancel
    diff --git a/src/admin-theme/category-list-body.liquid b/src/admin-theme/category-list-body.liquid index a3e822a..83984a9 100644 --- a/src/admin-theme/category-list-body.liquid +++ b/src/admin-theme/category-list-body.liquid @@ -1,55 +1,55 @@ -
    -
    -
    +
    +
    +
    {%- assign cat_count = categories | size -%} {% if cat_count > 0 %} {%- assign cat_col = "col-12 col-md-6 col-xl-5 col-xxl-4" -%} {%- assign desc_col = "col-12 col-md-6 col-xl-7 col-xxl-8" -%} -
    +
    -
    Category; Description
    +
    Category; Description
    Description
    - - + +
    {% for cat in categories -%}
    {%- if cat.parent_names %} - {% for name in cat.parent_names %}{{ name }} ⟩ {% endfor %} + {% for name in cat.parent_names %}{{ name }} ⟩ {% endfor %} {%- endif %} {{ cat.name }}
    {%- assign cat_url_base = "admin/category/" | append: cat.id -%} {%- if cat.post_count > 0 %} - + View {{ cat.post_count }} Post{% unless cat.post_count == 1 %}s{% endunless -%} - + {%- endif %} Edit - + {%- assign cat_del_link = cat_url_base | append: "/delete" | relative_link -%} - Delete
    - {%- if cat.description %}{{ cat.description.value }}{% else %}none{% endif %} + {%- if cat.description %}{{ cat.description.value }}{% else %}none{% endif %}
    {%- endfor %} {%- else -%} -
    -

    This web log has no categores defined

    +
    +

    This web log has no categories defined

    {%- endif %}
    diff --git a/src/admin-theme/category-list.liquid b/src/admin-theme/category-list.liquid index d6eef09..689c41c 100644 --- a/src/admin-theme/category-list.liquid +++ b/src/admin-theme/category-list.liquid @@ -1,7 +1,7 @@ -

    {{ page_title }}

    +

    {{ page_title }}

    + hx-target=#cat_new> Add a New Category {{ category_list }} diff --git a/src/admin-theme/custom-feed-edit.liquid b/src/admin-theme/custom-feed-edit.liquid index 78e0b85..507e8cf 100644 --- a/src/admin-theme/custom-feed-edit.liquid +++ b/src/admin-theme/custom-feed-edit.liquid @@ -1,18 +1,12 @@ -

    {{ page_title }}

    +

    {{ page_title }}

    -
    - - + + + {%- assign typ = model.source_type -%} -
    +
    - @@ -20,32 +14,22 @@
    Identification -
    -
    -
    - - +
    +
    +
    + + Appended to {{ web_log.url_base }}/
    -
    +
    - - + +
    @@ -57,27 +41,19 @@
    - - + +
    -
    - {% for cat in categories -%} - {%- endfor %} - +
    - +
    -
    - - +
    + +
    @@ -117,254 +84,164 @@
    -
    -
    +
    +
    Podcast Settings -
    +
    -
    - - +
    + +
    -
    - - +
    + +
    -
    - - +
    + +
    -
    +
    -
    - - +
    -
    - - +
    + +
    -
    - + + + - +
    -
    +
    -
    - - +
    + +
    -
    - - +
    + + For iTunes, must match registered e-mail
    -
    - - +
    + + Optional; blank for no default
    -
    - - +
    + + Relative URL will be appended to {{ web_log.url_base }}/
    -
    - - +
    + + Displayed in podcast directories
    -
    - - +
    + + Optional; prepended to episode media file if present
    -
    +
    -
    - - +
    + + Optional; URL describing donation options for this podcast, relative URL supported
    -
    - - +
    + + Optional; text for the funding link
    -
    - - +
    + + Optional; v5 UUID uniquely identifying this podcast; once entered, do not change this value - (documentation) + (documentation)
    -
    - {% for med in medium_values -%} - {%- endfor %} - + Optional; medium of the podcast content - (documentation) + (documentation)
    @@ -374,9 +251,9 @@
    - +
    -
    \ No newline at end of file +
    diff --git a/src/admin-theme/dashboard.liquid b/src/admin-theme/dashboard.liquid index 91e2bc2..782a8c3 100644 --- a/src/admin-theme/dashboard.liquid +++ b/src/admin-theme/dashboard.liquid @@ -1,10 +1,10 @@ -

    {{ web_log.name }} • Dashboard

    -
    -
    +

    {{ web_log.name }} • Dashboard

    +
    +
    -
    +
    Posts
    -
    +
    Published {{ model.posts }}   Drafts {{ model.drafts }} @@ -17,9 +17,9 @@
    -
    +
    Pages
    -
    +
    All {{ model.pages }}   Shown in Page List {{ model.listed_pages }} @@ -32,11 +32,11 @@
    -
    +
    -
    +
    Categories
    -
    +
    All {{ model.categories }}   Top Level {{ model.top_level_categories }} diff --git a/src/admin-theme/layout-bare.liquid b/src/admin-theme/layout-bare.liquid index a343dd8..4335d8d 100644 --- a/src/admin-theme/layout-bare.liquid +++ b/src/admin-theme/layout-bare.liquid @@ -1,5 +1,5 @@ - - -{{ content }} + + +{{ content }} diff --git a/src/admin-theme/layout-partial.liquid b/src/admin-theme/layout-partial.liquid index c47068d..fe06a41 100644 --- a/src/admin-theme/layout-partial.liquid +++ b/src/admin-theme/layout-partial.liquid @@ -1,9 +1,5 @@ - - - {{ page_title | strip_html }} « Admin « {{ web_log.name | strip_html }} - - - {% include_template "_layout" %} - + + {{ page_title | strip_html }} « Admin « {{ web_log.name | strip_html }} + {% include_template "_layout" %} diff --git a/src/admin-theme/layout.liquid b/src/admin-theme/layout.liquid index f5f3c81..264428c 100644 --- a/src/admin-theme/layout.liquid +++ b/src/admin-theme/layout.liquid @@ -1,18 +1,16 @@ - - - - - {{ page_title | strip_html }} « Admin « {{ web_log.name | strip_html }} - - - - + + + + {{ page_title | strip_html }} « Admin « {{ web_log.name | strip_html }} + + + {% include_template "_layout" %} - + {{ htmx_script }} diff --git a/src/admin-theme/log-on.liquid b/src/admin-theme/log-on.liquid index 8bda90f..d6880ac 100644 --- a/src/admin-theme/log-on.liquid +++ b/src/admin-theme/log-on.liquid @@ -1,28 +1,28 @@ -

    Log On to {{ web_log.name }}

    -
    -
    - +

    Log On to {{ web_log.name }}

    +
    + + {% if model.return_to %} - + {% endif %} -
    -
    +
    +
    -
    - - +
    + +
    -
    - - +
    + +
    - +
    diff --git a/src/admin-theme/my-info.liquid b/src/admin-theme/my-info.liquid index b022874..f38e3ad 100644 --- a/src/admin-theme/my-info.liquid +++ b/src/admin-theme/my-info.liquid @@ -1,75 +1,72 @@ -

    {{ page_title }}

    +

    {{ page_title }}

    - - + +
    - Access Level
    {{ access_level }} + Access Level
    {{ access_level }}
    - Created
    {{ created_on | date: "MMMM d, yyyy" }} + Created
    {{ created_on | date: "MMMM d, yyyy" }}
    - Last Log On
    + Last Log On
    {{ last_seen_on | date: "MMMM d, yyyy" }} at {{ last_seen_on | date: "h:mmtt" | downcase }}
    -
    -

    +
    +

    -
    - - +
    + +
    -
    - - +
    + +
    -
    - - +
    + +
    -
    -
    - Change Password -
    -
    -

    Optional; leave blank to keep your current password

    -
    +
    +
    + Change Password +
    +

    Optional; leave blank to keep your current password

    -
    +
    -
    - - +
    + +
    -
    - - +
    + +
    -
    +
    - +
    diff --git a/src/admin-theme/page-edit.liquid b/src/admin-theme/page-edit.liquid index 8e156d3..715ec05 100644 --- a/src/admin-theme/page-edit.liquid +++ b/src/admin-theme/page-edit.liquid @@ -1,75 +1,75 @@ -

    {{ page_title }}

    +

    {{ page_title }}

    - - -
    + + +
    -
    +
    {%- assign entity = "page" -%} {%- assign entity_id = model.page_id -%} {% include_template "_edit-common" %}
    -
    +
    - {% for tmpl in templates -%} - {%- endfor %} - +
    - - + +
    -
    - +
    +
    -
    +
    Metadata - -
    -
    +
    +
    {%- for meta in metadata %}
    -
    -
    -
    - +
    +
    +
    -
    -
    - +
    +
    +
    {% endfor -%}
    - + diff --git a/src/admin-theme/page-list.liquid b/src/admin-theme/page-list.liquid index f22871f..7682f02 100644 --- a/src/admin-theme/page-list.liquid +++ b/src/admin-theme/page-list.liquid @@ -1,4 +1,4 @@ -

    {{ page_title }}

    +

    {{ page_title }}

    Create a New Page {%- assign page_count = pages | size -%} @@ -6,11 +6,11 @@ {%- assign title_col = "col-12 col-md-5" -%} {%- assign link_col = "col-12 col-md-5" -%} {%- assign upd8_col = "col-12 col-md-2" -%} - - + +
    - TitlePage + TitlePage
    Updated
    @@ -23,15 +23,15 @@ {%- if pg.is_in_page_list %}   IN PAGE LIST {% endif -%}
    {%- capture pg_link %}{% unless pg.is_default %}{{ pg.permalink }}{% endunless %}{% endcapture -%} - View Page + View Page {% if is_editor or is_author and user_id == pg.author_id %} - + Edit {% endif %} {% if is_web_log_admin %} - + {%- assign pg_del_link = "admin/page/" | append: pg.id | append: "/delete" | relative_link -%} - Delete @@ -40,7 +40,7 @@
    Updated {{ pg.updated_on | date: "MMMM d, yyyy" }} @@ -54,19 +54,17 @@
    {% if page_nbr > 1 %}

    - - « Previous - -

    + + « Previous + {% endif %}
    {% if has_next %}

    - - Next » - -

    + + Next » + {% endif %}
    diff --git a/src/admin-theme/permalinks.liquid b/src/admin-theme/permalinks.liquid index b296e94..2d4a168 100644 --- a/src/admin-theme/permalinks.liquid +++ b/src/admin-theme/permalinks.liquid @@ -1,43 +1,42 @@ -

    {{ page_title }}

    +

    {{ page_title }}

    {%- assign base_url = "admin/" | append: model.entity | append: "/" -%} - - - -
    -
    -
    + + + +
    +
    +

    - {{ model.current_title }}
    - - {{ model.current_permalink }}
    - - « Back to Edit {{ model.entity | capitalize }} - -
    -

    + {{ model.current_title }}
    + + {{ model.current_permalink }}
    + + « Back to Edit {{ model.entity | capitalize }} + +
    -
    - +
    +
    -
    -
    -
    -
    diff --git a/src/default-theme/version.txt b/src/default-theme/version.txt index ec5e044..32e64f5 100644 --- a/src/default-theme/version.txt +++ b/src/default-theme/version.txt @@ -1,2 +1,2 @@ myWebLog Default Theme -2.0.0 \ No newline at end of file +2.1.0 \ No newline at end of file