Add tags support

Set slugify to be global
Update modification date only if text has been changed
Fix a bug in preview (post_id was passed instead of blog_id)
Add Home, Category and Tag links in blog area instead of global area (dynastie template)
Fix a bug in Have_I_right
This commit is contained in:
2012-11-08 21:23:30 +01:00
parent a2f091a0f5
commit 85488e0838
24 changed files with 289 additions and 67 deletions

View File

@@ -12,6 +12,6 @@
<form id="previewForm" action="/post/add/{{ blog_id }}" method="post">{% csrf_token %}
{{ form.as_p }}
<textarea name="content" class="mceAdvanced"></textarea><br/><br/>
<input type="submit" name="add" value="Add" /><input type="button" name="preview" value="Preview" onClick="previewPost();"/><input type="submit" name="cancel" value="Cancel" />
<input type="submit" name="add" value="Add" /><input type="button" name="preview" value="Preview" onClick="previewPost({{ blog_id }});"/><input type="submit" name="cancel" value="Cancel" />
</form>
{% endblock %}

View File

@@ -1,7 +1,6 @@
{% extends "templates/base.html" %}
{% block content %}
<table>
{% if categories|length == 0 %}
<b>Any category available</b><br/><br/>
{% else %}
@@ -12,5 +11,4 @@
</table>
{% endif %}
<li><a href="/category/add">Add a category</a></li>
</table>
{% endblock %}

View File

@@ -12,7 +12,7 @@
<form id="previewForm" action="/post/edit/{{ post_id }}" method="post">{% csrf_token %}
{{ form.as_p }}
<textarea name="content" class="mceAdvanced">{{ content }}</textarea>
<input type="submit" name="edit" value="Edit" /><input type="button" name="preview" value="Preview" onClick="previewPost();"/><input type="submit" name="cancel" value="Cancel" />
<input type="submit" name="edit" value="Edit" /><input type="button" name="preview" value="Preview" onClick="previewPost({{ blog_id }});"/><input type="submit" name="cancel" value="Cancel" />
</form>
<div class="comments">
{% for comment in comments %}

9
templates/edit_tag.html Normal file
View File

@@ -0,0 +1,9 @@
{% extends "templates/base.html" %}
{% block content %}
<form action="/tag/edit/{{ tag.id }}" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" name="edit" value="Edit" /> <input type="submit" name="cancel" value="Cancel" />
</form>
{% endblock %}

View File

@@ -1,7 +1,7 @@
{% extends "templates/base.html" %}
{% block content %}
<a href="/category/{{ blog.id }}">Categories</a>
<a href="/blog/{{ blog.id }}">Home</a> <a href="/category/{{ blog.id }}">Categories</a> <a href="/tag/{{ blog.id }}">Tags</a>
{% if user.is_superuser %}
<form action="/blog/edit/{{ blog.id }}" method="post">
{% csrf_token %}

13
templates/tag.html Normal file
View File

@@ -0,0 +1,13 @@
{% extends "templates/base.html" %}
{% block content %}
{% if tags|length == 0 %}
<b>Any tag available</b><br/><br/>
{% else %}
<table>
{% for tag in tags %}
<tr><td>{{ tag.id }}</td><td>{{ tag.name }}</td><td><a href="/tag/edit/{{ tag.id }}">Edit</a></td><td><a href="/tag/delete/{{ tag.id }}">Delete</a></td></tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}

View File

@@ -1,7 +1,7 @@
{% extends "templates/base.html" %}
{% block content %}
<a href="/category/{{ blog.id }}">Categories</a>
<a href="/blog/{{ blog.id }}">Home</a> <a href="/category/{{ blog.id }}">Categories</a> <a href="/tag/{{ blog.id }}">Tags</a>
{% if user.is_superuser %}
<form action="/blog/edit/{{ blog.id }}" method="post">
{% csrf_token %}