added help page linking

This commit is contained in:
vabene1111 2021-01-22 21:32:29 +01:00
parent f1b7ed7d7a
commit 00875c0d8e
3 changed files with 24 additions and 1 deletions

View File

@ -95,7 +95,7 @@
class="fas fa-edit fa-fw"></i> {% trans 'Batch Edit' %}</a>
</div>
</li>
<li class="nav-item dropdown {% if request.resolver_match.url_name in 'list_storage,data_sync,list_recipe_import,list_sync_log,data_stats,edit_food' %}active{% endif %}">
<li class="nav-item dropdown {% if request.resolver_match.url_name in 'list_storage,data_sync,list_recipe_import,list_sync_log,data_stats,edit_food,edit_storage' %}active{% endif %}">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false"><i class="fas fa-database"></i> {% trans 'Storage Data' %}
</a>
@ -121,6 +121,9 @@
<ul class="navbar-nav ml-auto">
{% if user.is_authenticated %}
{% page_help request.resolver_match.url_name as help_button %}
{% if help_button %}{{ help_button|safe }}{% endif %}
<li class="nav-item dropdown {% if request.resolver_match.url_name in 'view_settings,view_history,view_system,docs_markdown' %}active{% endif %}">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false"><i

View File

@ -8,6 +8,7 @@ from django import template
from django.db.models import Avg
from django.urls import NoReverseMatch, reverse
from recipes import settings
from gettext import gettext as _
register = template.Library()
@ -80,6 +81,20 @@ def recipe_last(recipe, user):
return ''
@register.simple_tag
def page_help(page_name):
help_pages = {
'edit_storage': 'https://vabene1111.github.io/recipes/features/external_recipes/',
}
link = help_pages.get(page_name, '')
if link != '':
return f'<li class="nav-item"><a class="nav-link" target="_blank" rel="nofollow noreferrer" href="{link}"><i class="far fa-question-circle"></i>&zwnj;<span class="d-lg-none"> {_("Help")}</span></a></li>'
else:
return None
@register.simple_tag
def message_of_the_day():
return Space.objects.first().message

View File

@ -15,6 +15,11 @@ Lastly you will need to sync with the external path and import recipes you desir
!!! success
Currently only Nextcloud and Dropbox are supported. There are plans to add more provider
!!! danger
In order for this application to retrieve data from external providers it needs to store authentication information.
Please use read only/separate accounts or app passwords wherever possible.
There are better ways to do this but they are currently not implemented
A `Storage Backend` is a remote storage location where files are **read** from.
To add a new backend click on `Storage Data` and then on `Storage Backends`.
There click the plus button.