tried to build a tag list of the logged in user
This commit is contained in:
@@ -31,10 +31,20 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'admin:index' %}">Administration</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="nav-link" href="{% url 'post_list' %}">Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'student_page' %}">Studentenansicht</a>
|
||||
</li>
|
||||
{% elif user.is_staff %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'logout' %}">Administration</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'post_list' %}">Dashboard</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'student_page' %}">{{user.get_username}}'s Dashboard</a>
|
||||
@@ -60,8 +70,7 @@
|
||||
<li>
|
||||
<form class="form" role="form" method="post" action="{% url 'login' %}" accept-charset="UTF-8" id="login-nav">
|
||||
{% csrf_token %} {% if next %}
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
{% endif %}
|
||||
<input type="hidden" name="next" value="{{ next }}" /> {% endif %}
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="username">Benutzername</label>
|
||||
<input type="text" class="form-control" id="username" name="username" placeholder="Benutzername" required>
|
||||
@@ -92,7 +101,7 @@
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
||||
<script src="{% static 'bootstrap/js/jquery-1.11.1.js' %} "></script>
|
||||
<script src="{% static 'bootstrap/jsjquery.tagcanvas.min.js' %} " type="text/javascript"></script>
|
||||
<script src="{% static 'js/app.js' %}"></script>
|
||||
<script src="{% static 'js/app.js' %}"></script>
|
||||
<script src="{% static 'bootstrap/js/bootstrap.bundle.js' %}"></script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends 'base.html' %} {% block content %}
|
||||
{% if tag %} Posts tagged with "{{ tag.name }}" {% endif %}
|
||||
{% for post in posts %} {% load taggit_templatetags2_tags %}
|
||||
{% for post in posts %}
|
||||
<div class="post">
|
||||
<div class="date">
|
||||
{{ post.published_date }}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %} {% block content %} {% load taggit_templatetags2_tags %}
|
||||
{% get_taglist as tags for 'application.customuser'%}
|
||||
|
||||
|
||||
<div id="">
|
||||
Your tags:
|
||||
<ul>
|
||||
{% for tag in tags %}
|
||||
<li>
|
||||
<a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
{{ tags }} {{ u }}
|
||||
</div>
|
||||
<div>
|
||||
from List: {% for tag in tags %}
|
||||
|
||||
{% for tag in posts %}
|
||||
<p>{{ tag.name }} </p>{% endfor %}{% endfor %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user