Move logos to admin theme

- Fix web log SQLite update
- Fix post SQLite retrieval
- WIP on default theme
This commit is contained in:
Daniel J. Summers 2022-06-20 09:29:09 -04:00
parent 2daf385730
commit a4bdac7b55
9 changed files with 104 additions and 14 deletions

View File

@ -1046,15 +1046,12 @@ type SQLiteData (conn : SqliteConnection) =
cmd.CommandText <- "SELECT * FROM post WHERE id = @id"
cmd.Parameters.AddWithValue ("@id", PostId.toString postId) |> ignore
use! rdr = cmd.ExecuteReaderAsync ()
if rdr.Read () then
match verifyWebLog<Post> webLogId (fun p -> p.webLogId) Map.toPost rdr with
| Some post ->
let! post = appendPostCategoryTagAndMeta post
let! post = appendPostRevisionsAndPermalinks post
return Some post
| None ->
return None
else
match verifyWebLog<Post> webLogId (fun p -> p.webLogId) Map.toPost rdr with
| Some post ->
let! post = appendPostCategoryTagAndMeta post
let! post = appendPostRevisionsAndPermalinks post
return Some post
| None ->
return None
}
@ -1690,7 +1687,7 @@ type SQLiteData (conn : SqliteConnection) =
time_zone = @timeZone,
auto_htmx = @autoHtmx,
feed_enabled = @feedEnabled,
feed_name = @feedName
feed_name = @feedName,
items_in_feed = @itemsInFeed,
category_enabled = @categoryEnabled,
tag_enabled = @tagEnabled,
@ -1705,7 +1702,7 @@ type SQLiteData (conn : SqliteConnection) =
cmd.CommandText <-
"""UPDATE web_log
SET feed_enabled = @feedEnabled,
feed_name = @feedName
feed_name = @feedName,
items_in_feed = @itemsInFeed,
category_enabled = @categoryEnabled,
tag_enabled = @tagEnabled,

View File

@ -52,7 +52,9 @@
<footer class="position-fixed bottom-0 w-100">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-end"><img src="/img/logo-light.png" alt="myWebLog" width="120" height="34"></div>
<div class="col-xs-12 text-end">
<img src="{{ "themes/admin/logo-light.png" | relative_link }}" alt="myWebLog" width="120" height="34">
</div>
</div>
</div>
</footer>

View File

@ -58,7 +58,7 @@
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-end">
<img src="{{ "img/logo-light.png" | relative_link }}" alt="myWebLog" width="120" height="34">
<img src="{{ "themes/admin/logo-light.png" | relative_link }}" alt="myWebLog" width="120" height="34">
</div>
</div>
</div>

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -43,4 +43,16 @@
</div>
</div>
{% endfor %}
<nav aria-label="pagination">
<ul class="pager">
{% if model.newer_link -%}
<li class="previous item"><a href="{{ model.newer_link.value }}">&laquo; Newer Posts</a></li>
{%- else -%}
<li></li>
{% endif %}
{% if model.older_link -%}
<li class="next item"><a href="{{ model.older_link.value }}">Older Posts &raquo;</a></li>
{%- endif -%}
</ul>
</nav>
</section>

View File

@ -53,7 +53,7 @@
<footer>
<hr>
<div class="container-fluid text-end">
<img src="/img/logo-dark.png" alt="myWebLog">
<img src="{{ "themes/admin/logo-dark.png" | relative_link }}" alt="myWebLog">
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"

View File

@ -0,0 +1,77 @@
{%- assign post = model.posts | first -%}
<div class="content single">
<article class="item">
<h1 class="item-heading">{{ post.title }}</h1>
<h4 class="post-meta">
{% if post.published_on -%}
<span title="Published On">
<i class="fa fa-calendar"></i> {{ post.published_on | date: "dddd, MMMM d, yyyy" }}
</span>
<span title="Published At">
<i class="fa fa-clock-o"></i> {{ post.published_on | date: "h:mm tt" | downcase }}
</span>
{%- else -%}
<span>**DRAFT**</span>
{% endif %}
<span title="Author"><i class="fa fa-user"></i> {{ model.authors | value: post.author_id }}</span>
{% if logged_on %}
<span>
<a hx-boost="false" href="{{ post | edit_post_link }}">
<i class="fa fa-pencil-square-o"></i> Edit Post
</a>
</span>
{% endif %}
</h4>
<div>{{ post.text }}</div>
{%- assign cat_count = post.category_ids | size -%}
{% if cat_count > 0 -%}
<h4>
Categorized &nbsp;
{% for cat_id in post.category_ids -%}
{% assign cat = categories | where: "id", cat_id | first %}
<span class="no-wrap">
<i class="fa fa-folder-open-o" title="Category"></i>
<a href="{{ cat | category_link }}" title="Categorized under &ldquo;{{ cat.name | escape }}&rdquo;">
{{ cat.name }}
</a> &nbsp; &nbsp;
</span>
{%- endfor %}
</h4>
{%- endif %}
{%- assign tag_count = post.tags | size -%}
{% if tag_count > 0 -%}
<h4>
Tagged &nbsp;
{% for tag in post.tags %}
<span class="no-wrap">
<a href="{{ tag | tag_link }}" title="Posts tagged &ldquo;{{ tag | escape }}&rdquo;" rel="tag">
<i class="fa fa-tag"></i> {{ tag }}
</a> &nbsp; &nbsp;
</span>
{%- endfor %}
</h4>
{%- endif %}
</article>
<div>
<nav aria-label="pagination">
<ul class="pager">
{% if model.newer_link -%}
<li class="previous item">
<h4 class="item-heading">
<a href="{{ model.newer_link.value | relative_link }}">&laquo;</a> Previous Post
</h4>
<a href="{{ model.newer_link.value | relative_link }}">{{ model.newer_name.value }}</a>
</li>
{%- else -%}
<li></li>
{% endif %}
{% if model.older_link -%}
<li class="next item">
<h4 class="item-heading">Next Post <a href="{{ model.older_link.value | relative_link }}">&raquo;</a></h4>
<a href="{{ model.older_link.value | relative_link }}">{{ model.older_name.value }}</a>
</li>
{%- endif -%}
</ul>
</nav>
</div>
</div>

View File

@ -0,0 +1,2 @@
myWebLog Default Theme
2.0.0-alpha36