space switcher

This commit is contained in:
vabene1111
2022-05-31 17:48:43 +02:00
parent 151461508f
commit b3fcfdfc96
3 changed files with 26 additions and 1 deletions

View File

@@ -304,6 +304,20 @@
<a class="dropdown-item" href="{% url 'admin:index' %}"><i
class="fas fa-user-shield fa-fw"></i> {% trans 'Admin' %}</a>
{% endif %}
{% if request.user.is_authenticated and request.user.userspace_set.all|length > 1 %}
<div class="dropdown-divider"></div>
<h6 class="dropdown-header">{% trans 'Your Spaces' %}</h6>
{% for us in request.user.userspace_set.all %}
<a class="dropdown-item" href="{% url 'view_switch_space' us.space.id %}">
{% if us.active %}
<i class="far fa-dot-circle fa-fw"></i>
{% else %}
<i class="far fa-circle fa-fw"></i>
{% endif %}
{{ us.space.name }}</a>
{% endfor %}
{% endif %}
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{% url 'docs_markdown' %}"><i
class="fab fa-markdown fa-fw"></i> {% trans 'Markdown Guide' %}</a>
@@ -339,7 +353,8 @@
{% if HOSTED and request.space.max_recipes == 10 %}
<div class="bg-warning" style=" width: 100%; text-align: center!important; color: #ffffff; padding: 8px">
{% trans 'You are using the free version of Tandor' %} <a class="btn-success btn-sm" href="https://tandoor.dev/manage">{% trans 'Upgrade Now' %}</a>
{% trans 'You are using the free version of Tandor' %} <a class="btn-success btn-sm"
href="https://tandoor.dev/manage">{% trans 'Upgrade Now' %}</a>
</div>
{% endif %}