Add doc link to redirect page (#39)

- Tweak redirect list style
- Add rules to v2.0 backup restorations
This commit is contained in:
Daniel J. Summers 2023-07-31 21:28:02 -04:00
parent f43c431278
commit 79c304493c
2 changed files with 16 additions and 7 deletions

View File

@ -384,7 +384,11 @@ module Backup =
// Restore web log data // Restore web log data
printfn "- Restoring web log..." printfn "- Restoring web log..."
do! data.WebLog.Add restore.WebLog // v2.0 backups will not have redirect rules; fix that if restoring to v2.1 or later
let webLog =
if isNull (box restore.WebLog.RedirectRules) then { restore.WebLog with RedirectRules = [] }
else restore.WebLog
do! data.WebLog.Add webLog
printfn "- Restoring users..." printfn "- Restoring users..."
do! data.WebLogUser.Restore restore.Users do! data.WebLogUser.Restore restore.Users

View File

@ -18,9 +18,9 @@
{% if redir_count > 0 -%} {% if redir_count > 0 -%}
<div class="container"> <div class="container">
<div class="row mwl-table-heading"> <div class="row mwl-table-heading">
<div class="col">From</div> <div class="col-5">From</div>
<div class="col">To</div> <div class="col-5">To</div>
<div class="col">RegEx?</div> <div class="col-2 text-center">RegEx?</div>
</div> </div>
</div> </div>
<div class="row mwl-table-detail" id="redir_new"></div> <div class="row mwl-table-detail" id="redir_new"></div>
@ -29,7 +29,7 @@
{% for redir in redirections -%} {% for redir in redirections -%}
{%- assign redir_id = "redir_" | append: forloop.index0 -%} {%- assign redir_id = "redir_" | append: forloop.index0 -%}
<div class="row mwl-table-detail" id="{{ redir_id }}"> <div class="row mwl-table-detail" id="{{ redir_id }}">
<div class="col no-wrap"> <div class="col-5 no-wrap">
{{ redir.from }}<br> {{ redir.from }}<br>
<small> <small>
{%- assign redir_url = "admin/settings/redirect-rules/" | append: forloop.index0 -%} {%- assign redir_url = "admin/settings/redirect-rules/" | append: forloop.index0 -%}
@ -55,8 +55,8 @@
</a> </a>
</small> </small>
</div> </div>
<div class="col">{{ redir.to }}</div> <div class="col-5">{{ redir.to }}</div>
<div class="col">{% if redir.is_regex %}Yes{% else %}No{% endif %}</div> <div class="col-2 text-center">{% if redir.is_regex %}Yes{% else %}No{% endif %}</div>
</div> </div>
{%- endfor %} {%- endfor %}
</form> </form>
@ -68,4 +68,9 @@
</div> </div>
</div> </div>
</div> </div>
<p class="mt-3 text-muted fst-italic text-center">
This is an advanced feature; please
<a href="https://bitbadger.solutions/open-source/myweblog/advanced.html#redirect-rules"
target="_blank">read and understand the documentation on this feature</a> before adding rules.
</p>
</article> </article>