Add redirect index page (#39)

- Bump version to 2.1
This commit is contained in:
2023-07-28 22:07:13 -04:00
parent 42d3280f67
commit 3ef4499a90
7 changed files with 85 additions and 9 deletions

View File

@@ -0,0 +1,58 @@
<h2 class="my-3">Redirect Rules</h2>
<article>
<a href="{{ "admin/settings" | relative_link }}">&laquo; Back to Settings</a>
<div class="container">
<div class="row">
<div class="col">
{%- assign redir_count = redirections | size -%}
{% if redir_count > 0 -%}
<div class="container">
<div class="row mwl-table-heading">
<div class="col">From</div>
<div class="col">To</div>
<div class="col">RegEx?</div>
</div>
</div>
<form method="post" class="container">
<input type="hidden" name="{{ csrf.form_field_name }}" value="{{ csrf.request_token }}">
<div class="row mwl-table-detail" id="redir_new"></div>
{% for redir in redirections -%}
{%- assign map_id = mapping_ids | value: map.tag -%}
<div class="row mwl-table-detail" id="redir_{{ forloop.index0 }}">
<div class="col no-wrap">
{{ redir.from }}<br>
<small>
{%- assign redir_url = "admin/settings/redirect-rules/" | append: forloop.index0 -%}
<a href="{{ redir_url | relative_link }}" hx-target="#tag_{{ forloop.index0 }}"
hx-swap="innerHTML show:#redir_{{ forloop.index0 }}:top">
Edit
</a>
{% unless forloop.first %}
<span class="text-muted"> &bull; </span>
{%- assign move_up = redir_url | append: "/up" | relative_link -%}
<a href="{{ move_up }}" hx-post="{{ move_up }}">Move Up</a>
{% endunless %}
{% unless forloop.last %}
<span class="text-muted"> &bull; </span>
{%- assign move_down = redir_url | append: "/down" | relative_link -%}
<a href="{{ move_down }}" hx-post="{{ move_down }}">Move Down</a>
{% endunless %}
<span class="text-muted"> &bull; </span>
{%- assign del_url = redir_url | append: "/delete" | relative_link -%}
<a href="{{ del_url }}" hx-post="{{ del_url }}" class="text-danger">Delete</a>
</small>
</div>
<div class="col">{{ redir.to }}</div>
<div class="col">{% if redir.is_regex %}Yes{% else %}No{% endif %}</div>
</div>
{%- endfor %}
</form>
{%- else -%}
<div id="tag_new">
<p class="text-muted text-center fst-italic">This web log has no redirect rules defined</p>
</div>
{%- endif %}
</div>
</div>
</div>
</article>

View File

@@ -2,7 +2,8 @@
<article>
<p class="text-muted">
Go to: <a href="#users">Users</a> &bull; <a href="#rss-settings">RSS Settings</a> &bull;
<a href="#tag-mappings">Tag Mappings</a>
<a href="#tag-mappings">Tag Mappings</a> &bull;
<a href="{{ "admin/redirect-rules" | relative_link }}">Redirect Rules</a>
</p>
<fieldset class="container mb-3">
<legend>Web Log Settings</legend>

View File

@@ -1,2 +1,2 @@
myWebLog Admin
2.0.0
2.1.0