changed dashoard and added sicherheit und template
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
<a class="nav-link" href="{% url 'admin:index' %}">Administration</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="nav-link" href="{% url 'post_list' %}">Dashboard</a>
|
||||
<a class="nav-link" href="{% url 'tag_list' %}">Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'blog_search_list_view' %}">Suche</a>
|
||||
@@ -49,7 +49,7 @@
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'post_list' %}">Dashboard</a>
|
||||
<a class="nav-link" href="{% url 'tag_list' %}">Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'blog_search_list_view' %}">Suche</a>
|
||||
@@ -62,7 +62,7 @@
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'post_list' %}">{{user.get_username}}'s Dashboard</a>
|
||||
<a class="nav-link" href="{% url 'tag_list' %}">{{user.get_username}}'s Dashboard</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'blog_search_list_view' %}">Suche</a>
|
||||
|
||||
@@ -4,28 +4,17 @@
|
||||
{% include_tagcloud 'application.Post' %}
|
||||
<div class="container-fluid">
|
||||
<div class="modal-body row">
|
||||
<div class="col-md-6">
|
||||
Abonniere deine Tags hier!
|
||||
<form class="post-form" method="post">
|
||||
{% csrf_token %} {{form.as_p}}
|
||||
<button type="submit" class="save btn btn-outline-dark">Save</button>
|
||||
</form>
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
Tag-Suche
|
||||
<div id="custom-search-input">
|
||||
<div class="input-group col-md-12">
|
||||
<form type="get" action="." style="margin: 0">
|
||||
<input id="search_box" type="text" name="search_box" placeholder="Search..."> <span class="input-group-btn">
|
||||
<button id="search_submit" type="submit" class="btn btn-outline-dark">Suchen</button>
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
<form type="get" action="." style="margin: 0" class="post-form">
|
||||
<p>
|
||||
<input id="search_box" type="text" name="search_box" placeholder="Search...">
|
||||
</p>
|
||||
<span>
|
||||
<button id="search_submit" type="submit" class="save btn btn-outline-dark">Suchen</button>
|
||||
</button>
|
||||
</span>
|
||||
</form>
|
||||
<div>
|
||||
{% for post in posts %}
|
||||
@@ -37,7 +26,7 @@
|
||||
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
|
||||
</h1>
|
||||
<p>{{ post.text|linebreaks }}</p>
|
||||
Tags: {% for tag in post.tags.all %}
|
||||
{% for tag in post.tags.all %}
|
||||
<a href="{% url 'post_list_by_tag' tag.slug %}">{{ tag.name }}</a>
|
||||
{% if not forloop.last %}, {% endif %} {% endfor %} <p>
|
||||
{{ post.author }}
|
||||
@@ -47,6 +36,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
Abonniere deine Tags hier!
|
||||
<form class="post-form" method="post">
|
||||
{% csrf_token %} {{form.as_p}}
|
||||
<button type="submit" class="save btn btn-outline-dark">Sichern</button>
|
||||
</form>
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div {% if message.tags %} class="{{ message.tags }}" {% endif %}>{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -4,6 +4,10 @@
|
||||
<div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<a id="search_submit" href="/posts" class="save btn btn-outline-dark">alle Artikel
|
||||
</a>
|
||||
|
||||
{% for post in posts %}
|
||||
<div class="post">
|
||||
<div class="date">
|
||||
@@ -19,7 +23,6 @@
|
||||
{{ post.author }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
+2
-2
@@ -8,9 +8,9 @@ import debug_toolbar
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.post_list, name='post_list'),
|
||||
url(r'^$', views.tag_list, name='tag_list'),
|
||||
url(r'^tag/(?P<slug>[-\w]+)/$', views.post_list, name='post_list_by_tag'),
|
||||
url(r'^taglist/$', views.tag_list, name='tag_list'),
|
||||
url(r'^posts/$', views.post_list, name='post_list'),
|
||||
url(r'^search/', views.blog_search_list_view, name='blog_search_list_view'),
|
||||
url(r'^search/result/$', views.blog_search_list_view, name='post_list_by_search'),
|
||||
url(r'^post/(?P<pk>\d+)/$', views.post_detail, name='post_detail'),
|
||||
|
||||
@@ -52,7 +52,7 @@ def navlogin(request):
|
||||
@login_required
|
||||
def post_list(request, slug=None):
|
||||
log = logging.getLogger('mysite')
|
||||
posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('published_date')
|
||||
posts = Post.objects.filter(published_date__lte=timezone.now()).order_by('-published_date')
|
||||
if slug:
|
||||
tag = get_object_or_404(Tag, slug=slug)
|
||||
posts = posts.filter(tags__in=[tag])
|
||||
|
||||
Reference in New Issue
Block a user