added post search
This commit is contained in:
@@ -1,32 +1,27 @@
|
||||
{% extends "base.html" %} {% block content %}
|
||||
{% load taggit_templatetags2_tags %}
|
||||
{% get_taglist as tags for 'application.post' %}
|
||||
<div id="">
|
||||
<ul>
|
||||
{% for tag in tags %}
|
||||
<li>{{tag}} ({{tag.num_times}})
|
||||
</li>
|
||||
{{ result }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% include "taggit_templatetags2/tagcanvas_include_js_static.html" %}
|
||||
|
||||
<div id="tag-cloud">
|
||||
</div>
|
||||
|
||||
{% get_tagcloud as tags for 'application' %}
|
||||
{% include_tagcloud 'application.Post' %}
|
||||
<form type="get" action="." style="margin: 0">
|
||||
<input id="search_box" type="text" name="search_box" placeholder="Search..." >
|
||||
<button id="search_submit" type="submit" >Submit</button>
|
||||
<input id="search_box" type="text" name="search_box" placeholder="Search...">
|
||||
<button id="search_submit" type="submit">Submit</button>
|
||||
</form>
|
||||
<div>
|
||||
<ul>
|
||||
{% for tag in tags %}
|
||||
<li>
|
||||
{{tag}}
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
{% for post in posts %}
|
||||
<div class="post">
|
||||
<div class="date">
|
||||
{{ post.published_date }}
|
||||
</div>
|
||||
<h1>
|
||||
<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>
|
||||
</h1>
|
||||
<p>{{ post.text|linebreaks }}</p>
|
||||
Tags: {% 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 }}
|
||||
</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user