- Upgrade to Bootstrap 5.1.3 - Move RSS settings and tag mappings to web log settings (#25) - Fix parameters in 2 SQLite queries
269 lines
13 KiB
Plaintext
269 lines
13 KiB
Plaintext
<h2 class="my-3">{{ web_log.name }} Settings</h2>
|
|
<article>
|
|
<p class="text-muted">
|
|
Go to: <a href="#users">Users</a> • <a href="#rss-settings">RSS Settings</a> •
|
|
<a href="#tag-mappings">Tag Mappings</a>
|
|
</p>
|
|
<fieldset class="container mb-3">
|
|
<legend>Web Log Settings</legend>
|
|
<div class="row">
|
|
<div class="col">
|
|
<form action="{{ "admin/settings" | relative_link }}" method="post">
|
|
<input type="hidden" name="{{ csrf.form_field_name }}" value="{{ csrf.request_token }}">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-12 col-md-6 col-xl-4 pb-3">
|
|
<div class="form-floating">
|
|
<input type="text" name="Name" id="name" class="form-control" placeholder="Name" required autofocus
|
|
value="{{ model.name }}">
|
|
<label for="name">Name</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-md-6 col-xl-4 pb-3">
|
|
<div class="form-floating">
|
|
<input type="text" name="Slug" id="slug" class="form-control" placeholder="Slug" required
|
|
value="{{ model.slug }}">
|
|
<label for="slug">Slug</label>
|
|
<span class="form-text">
|
|
<span class="badge rounded-pill bg-warning text-dark">WARNING</span> changing this value may break
|
|
links
|
|
(<a href="https://bitbadger.solutions/open-source/myweblog/configuring.html#blog-settings"
|
|
target="_blank">more</a>)
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-md-6 col-xl-4 pb-3">
|
|
<div class="form-floating">
|
|
<input type="text" name="Subtitle" id="subtitle" class="form-control" placeholder="Subtitle"
|
|
value="{{ model.subtitle }}">
|
|
<label for="subtitle">Subtitle</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-md-6 col-xl-4 offset-xl-1 pb-3">
|
|
<div class="form-floating">
|
|
<select name="ThemeId" id="themeId" class="form-control" required>
|
|
{% for theme in themes -%}
|
|
<option value="{{ theme[0] }}"{% if model.theme_id == theme[0] %} selected="selected"{% endif %}>
|
|
{{ theme[1] }}
|
|
</option>
|
|
{%- endfor %}
|
|
</select>
|
|
<label for="themeId">Theme</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-md-6 offset-md-1 col-xl-4 offset-xl-0 pb-3">
|
|
<div class="form-floating">
|
|
<select name="DefaultPage" id="defaultPage" class="form-control" required>
|
|
{% for pg in pages -%}
|
|
<option value="{{ pg[0] }}"
|
|
{%- if pg[0] == model.default_page %} selected="selected"{% endif %}>
|
|
{{ pg[1] }}
|
|
</option>
|
|
{%- endfor %}
|
|
</select>
|
|
<label for="defaultPage">Default Page</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-md-4 col-xl-2 pb-3">
|
|
<div class="form-floating">
|
|
<input type="number" name="PostsPerPage" id="postsPerPage" class="form-control" min="0" max="50"
|
|
required value="{{ model.posts_per_page }}">
|
|
<label for="postsPerPage">Posts per Page</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-12 col-md-4 col-xl-3 offset-xl-2 pb-3">
|
|
<div class="form-floating">
|
|
<input type="text" name="TimeZone" id="timeZone" class="form-control" placeholder="Time Zone" required
|
|
value="{{ model.time_zone }}">
|
|
<label for="timeZone">Time Zone</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-md-4 col-xl-2">
|
|
<div class="form-check form-switch">
|
|
<input type="checkbox" name="AutoHtmx" id="autoHtmx" class="form-check-input" value="true"
|
|
{%- if model.auto_htmx %} checked="checked"{% endif %}>
|
|
<label for="autoHtmx" class="form-check-label">Auto-Load htmx</label>
|
|
</div>
|
|
<span class="form-text fst-italic">
|
|
<a href="https://htmx.org" target="_blank" rel="noopener">What is this?</a>
|
|
</span>
|
|
</div>
|
|
<div class="col-12 col-md-4 col-xl-3 pb-3">
|
|
<div class="form-floating">
|
|
<select name="Uploads" id="uploads" class="form-control">
|
|
{%- for it in upload_values %}
|
|
<option value="{{ it[0] }}"
|
|
{%- if model.uploads == it[0] %} selected{% endif %}>{{ it[1] }}</option>
|
|
{%- endfor %}
|
|
</select>
|
|
<label for="uploads">Default Upload Destination</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row pb-3">
|
|
<div class="col text-center">
|
|
<button type="submit" class="btn btn-primary">Save Changes</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
<fieldset id="users" class="container mb-3 pb-0">
|
|
<legend>Users</legend>
|
|
<div class="row">
|
|
<div class="col">
|
|
{% include_template "_user-list-columns" %}
|
|
<a href="{{ "admin/settings/user/new/edit" | relative_link }}" class="btn btn-primary btn-sm mb-3"
|
|
hx-target="#user_new">
|
|
Add a New User
|
|
</a>
|
|
<div class="container g-0">
|
|
<div class="row mwl-table-heading">
|
|
<div class="{{ user_col }}">User<span class="d-md-none">; Full Name / E-mail; Last Log On</span></div>
|
|
<div class="{{ email_col }} d-none d-md-inline-block">Full Name / E-mail</div>
|
|
<div class="{{ cre8_col }}">Created</div>
|
|
<div class="{{ last_col }} d-none d-md-block">Last Log On</div>
|
|
</div>
|
|
</div>
|
|
{{ user_list }}
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
<fieldset id="rss-settings" class="container mb-3 pb-0">
|
|
<legend>RSS Settings</legend>
|
|
<div class="row">
|
|
<div class="col">
|
|
<form action="{{ "admin/settings/rss" | relative_link }}" method="post">
|
|
<input type="hidden" name="{{ csrf.form_field_name }}" value="{{ csrf.request_token }}">
|
|
<div class="container">
|
|
<div class="row pb-3">
|
|
<div class="col col-xl-8 offset-xl-2">
|
|
<fieldset class="d-flex justify-content-evenly flex-row">
|
|
<legend>Feeds Enabled</legend>
|
|
<div class="form-check form-switch pb-2">
|
|
<input type="checkbox" name="IsFeedEnabled" id="feedEnabled" class="form-check-input" value="true"
|
|
{%- if rss_model.is_feed_enabled %} checked="checked"{% endif %}>
|
|
<label for="feedEnabled" class="form-check-label">All Posts</label>
|
|
</div>
|
|
<div class="form-check form-switch pb-2">
|
|
<input type="checkbox" name="IsCategoryEnabled" id="categoryEnabled" class="form-check-input"
|
|
value="true" {%- if rss_model.is_category_enabled %} checked="checked"{% endif %}>
|
|
<label for="categoryEnabled" class="form-check-label">Posts by Category</label>
|
|
</div>
|
|
<div class="form-check form-switch pb-2">
|
|
<input type="checkbox" name="IsTagEnabled" id="tagEnabled" class="form-check-input" value="true"
|
|
{%- if rss_model.tag_enabled %} checked="checked"{% endif %}>
|
|
<label for="tagEnabled" class="form-check-label">Posts by Tag</label>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-12 col-sm-6 col-md-3 col-xl-2 offset-xl-2 pb-3">
|
|
<div class="form-floating">
|
|
<input type="text" name="FeedName" id="feedName" class="form-control" placeholder="Feed File Name"
|
|
value="{{ rss_model.feed_name }}">
|
|
<label for="feedName">Feed File Name</label>
|
|
<span class="form-text">Default is <code>feed.xml</code></span>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-md-4 col-xl-2 pb-3">
|
|
<div class="form-floating">
|
|
<input type="number" name="ItemsInFeed" id="itemsInFeed" class="form-control" min="0"
|
|
placeholder="Items in Feed" required value="{{ rss_model.items_in_feed }}">
|
|
<label for="itemsInFeed">Items in Feed</label>
|
|
<span class="form-text">Set to “0” to use “Posts per Page” setting ({{ web_log.posts_per_page }})</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-md-5 col-xl-4 pb-3">
|
|
<div class="form-floating">
|
|
<input type="text" name="Copyright" id="copyright" class="form-control" placeholder="Copyright String"
|
|
value="{{ rss_model.copyright }}">
|
|
<label for="copyright">Copyright String</label>
|
|
<span class="form-text">
|
|
Can be a
|
|
<a href="https://creativecommons.org/share-your-work/" target="_blank" rel="noopener">
|
|
Creative Commons license string
|
|
</a>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row pb-3">
|
|
<div class="col text-center">
|
|
<button type="submit" class="btn btn-primary">Save Changes</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<fieldset class="container mb-3 pb-0">
|
|
<legend>Custom Feeds</legend>
|
|
<div class="row">
|
|
<div class="col">
|
|
<a class="btn btn-sm btn-secondary" href="{{ 'admin/settings/rss/new/edit' | relative_link }}">
|
|
Add a New Custom Feed
|
|
</a>
|
|
{%- assign feed_count = custom_feeds | size -%}
|
|
{% if feed_count > 0 %}
|
|
<form method="post" class="container g-0" hx-target="body">
|
|
{%- assign source_col = "col-12 col-md-6" -%}
|
|
{%- assign path_col = "col-12 col-md-6" -%}
|
|
<input type="hidden" name="{{ csrf.form_field_name }}" value="{{ csrf.request_token }}">
|
|
<div class="row mwl-table-heading">
|
|
<div class="{{ source_col }}">
|
|
<span class="d-md-none">Feed</span><span class="d-none d-md-inline">Source</span>
|
|
</div>
|
|
<div class="{{ path_col }} d-none d-md-inline-block">Relative Path</div>
|
|
</div>
|
|
{% for feed in custom_feeds %}
|
|
<div class="row mwl-table-detail">
|
|
<div class="{{ source_col }}">
|
|
{{ feed.source }}
|
|
{%- if feed.is_podcast %} <span class="badge bg-primary">PODCAST</span>{% endif %}<br>
|
|
<small>
|
|
{%- assign feed_url = "admin/settings/rss/" | append: feed.id -%}
|
|
<a href="{{ feed.path | relative_link }}" target="_blank">View Feed</a>
|
|
<span class="text-muted"> • </span>
|
|
<a href="{{ feed_url | append: "/edit" | relative_link }}">Edit</a>
|
|
<span class="text-muted"> • </span>
|
|
{%- assign feed_del_link = feed_url | append: "/delete" | relative_link -%}
|
|
<a href="{{ feed_del_link }}" hx-post="{{ feed_del_link }}" class="text-danger"
|
|
hx-confirm="Are you sure you want to delete the custom RSS feed based on {{ feed.source | strip_html | escape }}? This action cannot be undone.">
|
|
Delete
|
|
</a>
|
|
</small>
|
|
</div>
|
|
<div class="{{ path_col }}">
|
|
<small class="d-md-none">Served at {{ feed.path }}</small>
|
|
<span class="d-none d-md-inline">{{ feed.path }}</span>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</form>
|
|
{% else %}
|
|
<p class="text-muted fst-italic text-center">No custom feeds defined</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
<fieldset id="tag-mappings" class="container mb-3 pb-0">
|
|
<legend>Tag Mappings</legend>
|
|
<div class="row">
|
|
<div class="col">
|
|
<a href="{{ "admin/settings/tag-mapping/new/edit" | relative_link }}" class="btn btn-primary btn-sm mb-3"
|
|
hx-target="#tag_new">
|
|
Add a New Tag Mapping
|
|
</a>
|
|
{{ tag_mapping_list }}
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</article>
|