Extract navigation into snippet
This commit is contained in:
parent
766255f5ae
commit
40d6dc4e46
2 changed files with 18 additions and 17 deletions
|
@ -17,23 +17,7 @@
|
|||
<header>
|
||||
<h1>{{ blog_title }}</h1>
|
||||
<p>{{ blog_description }}</p>
|
||||
<nav>
|
||||
<a href="{% url 'articles-list' %}">Home</a>
|
||||
·
|
||||
<a href="{% url 'complete-feed' %}">RSS</a>
|
||||
·
|
||||
{% if user.is_authenticated %}
|
||||
<a href="{% url 'admin:articles_article_add' %}">Write</a>
|
||||
·
|
||||
<a href="{% url 'drafts-list' %}">View drafts <span class="pill">{{ drafts_count }}</span></a>
|
||||
·
|
||||
<a href="{% url 'admin:index' %}">Admin</a>
|
||||
·
|
||||
<a href="{% url 'admin:logout' %}?next={{ request.get_full_path }}">Log out</a>
|
||||
{% else %}
|
||||
<a href="{% url 'admin:login' %}?next={{ request.get_full_path }}">Log in</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% include "articles/snippets/navigation.html" %}
|
||||
</header>
|
||||
|
||||
{% block content %}
|
||||
|
|
17
articles/templates/articles/snippets/navigation.html
Normal file
17
articles/templates/articles/snippets/navigation.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<nav>
|
||||
<a href="{% url 'articles-list' %}">Home</a>
|
||||
·
|
||||
<a href="{% url 'complete-feed' %}">RSS</a>
|
||||
·
|
||||
{% if user.is_authenticated %}
|
||||
<a href="{% url 'admin:articles_article_add' %}">Write</a>
|
||||
·
|
||||
<a href="{% url 'drafts-list' %}">View drafts <span class="pill">{{ drafts_count }}</span></a>
|
||||
·
|
||||
<a href="{% url 'admin:index' %}">Admin</a>
|
||||
·
|
||||
<a href="{% url 'admin:logout' %}?next={{ request.get_full_path }}">Log out</a>
|
||||
{% else %}
|
||||
<a href="{% url 'admin:login' %}?next={{ request.get_full_path }}">Log in</a>
|
||||
{% endif %}
|
||||
</nav>
|
Reference in a new issue