From df25a48abd69292af55f3356a48a737da829cd20 Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Wed, 7 Nov 2012 01:27:36 +0100 Subject: Add basic news feature: list, show, add --- templates/news/add.html | 9 +++++++++ templates/news/list.html | 19 +++++++++++++++++++ templates/news/news_detail.html | 41 ----------------------------------------- templates/news/news_list.html | 23 ----------------------- templates/news/post.html | 8 -------- templates/news/show.html | 39 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 72 deletions(-) create mode 100644 templates/news/add.html create mode 100644 templates/news/list.html delete mode 100644 templates/news/news_detail.html delete mode 100644 templates/news/news_list.html delete mode 100644 templates/news/post.html create mode 100644 templates/news/show.html (limited to 'templates') diff --git a/templates/news/add.html b/templates/news/add.html new file mode 100644 index 0000000..c2bc018 --- /dev/null +++ b/templates/news/add.html @@ -0,0 +1,9 @@ +{% extends 'layout.html' %} + +{% block content %} +
+
+ + +
+{% endblock %} diff --git a/templates/news/list.html b/templates/news/list.html new file mode 100644 index 0000000..6ddf85a --- /dev/null +++ b/templates/news/list.html @@ -0,0 +1,19 @@ +{% extends 'layout.html' %} + +{% block content %} +
+ {% for news in news %} +
+

+ {{ news.title }} +

+

Posté par {{ news.name }} le {{ news.date }}

+
+ +
+ {{ news.content }} +
+ {% endfor %} +
+
+{% endblock %} diff --git a/templates/news/news_detail.html b/templates/news/news_detail.html deleted file mode 100644 index f65b91e..0000000 --- a/templates/news/news_detail.html +++ /dev/null @@ -1,41 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -{% with news.comment_set.all as comments %} -
-

Détails

-
- -
-

{{news.title}}

- -
-{{news.text}} -
- -
- -

Commentaires

-{% for comment in comments %} -

Posté par {{comment.author}} le {{comment.date}}

-
-{{comment.text}} -
-{% endfor %} - -

Ajouter un commentaire

- -
- - -

-
- -
-{% endwith %} -{% endblock %} diff --git a/templates/news/news_list.html b/templates/news/news_list.html deleted file mode 100644 index 2119a68..0000000 --- a/templates/news/news_list.html +++ /dev/null @@ -1,23 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} -
- {% for news in news_list %} -
-

{{ news.title }}

- -

Posté par {{ news.author.username }} le {{ news.date }}

-
- -

{% with news.comment__count as comment_count %} - {{ comment_count }} commentaire{{comment_count|pluralize}} | - Ajouter un commentaire -

{% endwith %} - -
- {{ news.text }} -
- {% endfor %} -
-
-{% endblock %} diff --git a/templates/news/post.html b/templates/news/post.html deleted file mode 100644 index 56ad2e4..0000000 --- a/templates/news/post.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} - -{{ form.as_p }} - - -{% endblock %} diff --git a/templates/news/show.html b/templates/news/show.html new file mode 100644 index 0000000..da188fe --- /dev/null +++ b/templates/news/show.html @@ -0,0 +1,39 @@ +{% extends 'layout.html' %} + +{% block content %} +
+

Détails

+
+ +
+

{{news.title}}

+ +
+{{news.content}} +
+ +
+ +
+
+{% endblock %} -- cgit v1.2.3-70-g09d2