Only show backup button in navbar if backups are enabled
This commit is contained in:
parent
82bcd27cdc
commit
567273678e
3 changed files with 60 additions and 10 deletions
|
|
@ -131,6 +131,7 @@ templates.env.filters["encode_url"] = lambda url: urllib.parse.quote(url) if url
|
|||
templates.env.filters["entry_is_whitelisted"] = entry_is_whitelisted
|
||||
templates.env.filters["entry_is_blacklisted"] = entry_is_blacklisted
|
||||
templates.env.filters["discord_markdown"] = markdownify
|
||||
templates.env.globals["get_backup_path"] = get_backup_path
|
||||
|
||||
|
||||
@app.post("/add_webhook")
|
||||
|
|
|
|||
|
|
@ -19,16 +19,18 @@
|
|||
<li class="nav-item">
|
||||
<a class="nav-link" href="/webhooks">Webhooks</a>
|
||||
</li>
|
||||
<li class="nav-item nav-link d-none d-md-block">|</li>
|
||||
<li class="nav-item">
|
||||
<form action="/backup" method="post" class="d-inline">
|
||||
<button type="submit"
|
||||
class="nav-link btn btn-link text-decoration-none"
|
||||
onclick="return confirm('Create a manual git backup of the current state?');">
|
||||
Backup
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
{% if get_backup_path() %}
|
||||
<li class="nav-item nav-link d-none d-md-block">|</li>
|
||||
<li class="nav-item">
|
||||
<form action="/backup" method="post" class="d-inline">
|
||||
<button type="submit"
|
||||
class="nav-link btn btn-link text-decoration-none"
|
||||
onclick="return confirm('Create a manual git backup of the current state?');">
|
||||
Backup
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{# Search #}
|
||||
<form action="/search" method="get" class="ms-auto w-50 input-group">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue