Add page/post templates for personal theme

- Add images from personal site
This commit is contained in:
2022-04-26 21:04:20 -04:00
parent 08ec7ea653
commit ff87a71c9c
66 changed files with 320 additions and 47 deletions

View File

@@ -8,14 +8,14 @@
<div class="col-6 col-lg-4 pb-3">
<div class="form-floating">
<input type="text" name="name" id="name" class="form-control" placeholder="Name" autofocus required
value="{{ model.name }}">
value="{{ model.name | escape }}">
<label for="name">Name</label>
</div>
</div>
<div class="col-6 col-lg-4 pb-3">
<div class="form-floating">
<input type="text" name="slug" id="slug" class="form-control" placeholder="Slug" required
value="{{ model.slug }}">
value="{{ model.slug | escape }}">
<label for="slug">Slug</label>
</div>
</div>
@@ -41,7 +41,7 @@
<div class="col">
<div class="form-floating">
<input name="description" id="description" class="form-control"
placeholder="A short description of this category" value="{{ model.description }}">
placeholder="A short description of this category" value="{{ model.description | escape }}">
<label for="description">Description</label>
</div>
</div>

View File

@@ -62,6 +62,85 @@
<button type="submit" class="btn btn-primary">Save Changes</button>
</div>
</div>
<div class="row mb-3">
<div class="col">
<fieldset>
<legend>
Metadata
<button type="button" class="btn btn-sm btn-secondary" data-bs-toggle="collapse"
data-bs-target="#metaItemContainer">
show
</button>
</legend>
<div id="metaItemContainer" class="collapse">
<div id="metaItems" class="container">
{%- for meta in model.metadata %}
<div id="meta_{{ meta[0] }}" class="row mb-3">
<div class="col-1 text-center align-self-center">
<button type="button" class="btn btn-sm btn-danger" onclick="Admin.removeMetaItem({{ meta[0] }})">
&minus;
</button>
</div>
<div class="col-3">
<div class="form-floating">
<input type="text" name="metaNames" id="metaNames_{{ meta[0] }}" class="form-control"
placeholder="Name" value="{{ meta[1] }}">
<label for="metaNames_{{ meta[0] }}">Name</label>
</div>
</div>
<div class="col-8">
<div class="form-floating">
<input type="text" name="metaValues" id="metaValues_{{ meta[0] }}" class="form-control"
placeholder="Value" value="{{ meta[2] }}">
<label for="metaValues_{{ meta[0] }}">Value</label>
</div>
</div>
</div>
{% endfor -%}
</div>
<button type="button" class="btn btn-sm btn-secondary" onclick="Admin.addMetaItem()">Add an Item</button>
<script>
document.addEventListener("DOMContentLoaded", () => Admin.setNextMetaIndex({{ model.metadata | size }}))
</script>
</div>
</fieldset>
</div>
</div>
{% if model.status == "Published" %}
<div class="row mb-3">
<div class="col">
<fieldset>
<legend>Maintenance</legend>
<div class="container">
<div class="row">
<div class="col align-self-center">
<div class="form-check pb-2">
<input type="checkbox" name="setPublished" id="setPublished" class="form-check-input"
value="true">
<label for="setPublished" class="form-check-label">Set Published Date</label>
</div>
</div>
<div class="col-3">
<div class="form-floating">
<input type="datetime-local" name="pubOverride" id="pubOverride" class="form-control"
placeholder="Override Date">
<label for="pubOverride" class="form-label">Published On</label>
</div>
</div>
<div class="col-6 align-self-center">
<div class="form-check pb-2">
<input type="checkbox" name="setUpdated" id="setUpdated" class="form-check-input" value="true">
<label for="setUpdated" class="form-check-label">
Purge revisions and set as updated date as well
</label>
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
{% endif %}
</div>
</form>
</article>

View File

@@ -5,7 +5,7 @@
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Title</th>
<th scope="col" style="width:300px;">Title</th>
<th scope="col">Author</th>
<th scope="col">Status</th>
<th scope="col">Tags</th>
@@ -14,7 +14,7 @@
<tbody>
{% for post in model.posts -%}
<tr>
<td>
<td class="no-wrap">
{% if post.published_on.has_value -%}
{{ post.published_on | date: "MMMM d, yyyy" }}
{%- else -%}
@@ -31,9 +31,9 @@
<a href="#" class="text-danger">Delete</a>
</small>
</td>
<td>{{ model.authors | value: post.author_id }}</td>
<td class="no-wrap">{{ model.authors | value: post.author_id }}</td>
<td>{{ post.status }}</td>
<td>{{ post.tags | join: ", " }}</td>
<td><span class="no-wrap">{{ post.tags | join: "</span>, <span class='no-wrap'>" }}</span></td>
</tr>
{%- endfor %}
</tbody>

View File

@@ -4,7 +4,7 @@
<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 offset-xl-2 pb-3">
<div class="col-12 col-md-6 col-xl-4 offset-xl-1 pb-3">
<div class="form-floating">
<input type="text" name="name" id="name" class="form-control" value="{{ model.name }}" required autofocus>
<label for="name">Name</label>
@@ -16,15 +16,25 @@
<label for="subtitle">Subtitle</label>
</div>
</div>
</div>
<div class="row">
<div class="col-12 col-md-4 col-xl-2 offset-xl-2 pb-3">
<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 class="col-12 col-md-4 col-xl-3 offset-xl-1 pb-3">
<div class="form-floating">
<select name="themePath" id="themePath" class="form-control" required>
{% for theme in themes -%}
<option value="{{ theme[0] }}"{% if model.theme_path == theme[0] %} selected="selected"{% endif %}>
{{ theme[1] }}
</option>
{%- endfor %}
</select>
<label for="themePath">Theme</label>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3 pb-3">
<div class="form-floating">
<input type="text" name="timeZone" id="timeZone" class="form-control" required
@@ -32,7 +42,7 @@
<label for="timeZone">Time Zone</label>
</div>
</div>
<div class="col-12 col-md-4 col-xl-3 pb-3">
<div class="col-12 col-md-4 col-xl-4 pb-3">
<div class="form-floating">
<select name="defaultPage" id="defaultPage" class="form-control" required>
{% for pg in pages -%}