comete / giag (http://gerard.geekandfree.org/)

A simple blog made with Django 1.1

Clone this repository (size: 66.1 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/comete/giag/
commit 21: 9c42d0a5e6d6
parent 20: 2ea02b641655
branch: default
Pagination sur la page d'accueil.
Morgan LEFIEUX
17 months ago

Changed (Δ1.1 KB):

raw changeset »

blog/urls.py (3 lines added, 3 lines removed)

templates/blog/entry_archive.html

templates/blog/entry_list.html (31 lines added, 0 lines removed)

Up to file-list blog/urls.py:

@@ -4,8 +4,8 @@ from giag.blog.models import Entry
4
4
from giag.blog.views import list_by_tag
5
5
6
6
blog_dict = {
7
	'queryset': Entry.objects.all(),
8
	'date_field': 'pub_date',
7
	'queryset': Entry.objects.all().order_by("-pub_date"),
8
	'paginate_by': 7,
9
9
	}
10
10
11
11
urlpatterns = patterns('django.views.generic',
@@ -13,6 +13,6 @@ urlpatterns = patterns('django.views.gen
13
13
	url(r'^(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$', 'date_based.archive_day', dict(blog_dict, month_format='%m'), "day_archive"),
14
14
	url(r'^(?P<year>\d{4})/(?P<month>\d{2})/$', 'date_based.archive_month', dict(blog_dict, month_format='%m'), "month_archive"),
15
15
	url(r'^(?P<year>\d{4})/$', 'date_based.archive_year', blog_dict, "year_archive"),
16
	(r'^$', 'date_based.archive_index', blog_dict),
16
	(r'^$', 'list_detail.object_list', blog_dict),
17
17
	(r'^tags/(?P<monslug>[-\w]+)/$', list_by_tag),
18
18
	)

Up to file-list templates/blog/entry_list.html:

1
{% extends "base.html" %}
2
{% load comments %}
3
4
{% block title %}Derniers billets{% endblock %}
5
6
{% block content %}
7
<h1><a class="rss" title="Flux RSS news" href="/feeds/posts"></a>Derniers billets</h1>
8
9
<div class="object-list">
10
		{% for object in object_list %}
11
			{% if object.is_public %}
12
				{% get_comment_count for blog.entry object.id as comment_count %}
13
				<div class="billet">
14
					<h2 class="headerstyle"><a class="title" href="{{ object.get_absolute_url }}">{{ object.title }}</a></h2>
15
					<p class="summary">{{ object.summary }}</p>
16
					<div class="postmetadata">
17
					Posté le {{ object.pub_date|date:"j F Y" }} | ({{ comment_count }} commentaire{{ comment_count|pluralize }})  | <a href="{{ object.get_absolute_url }}" class="lire">Lire ce billet...</a>
18
					</div>
19
				</div>
20
			{% endif %}
21
		{% endfor %}
22
</div>
23
<div class="navigation">
24
	{% if has_next %}
25
	<a class="alignleft" href="?page={{ next }}">« Billets précédents</a>
26
	{% endif %}
27
	{% if has_previous %}
28
	<a class="alignright" href="?page={{ previous }}">Billets suivants »</a>
29
	{% endif %}
30
</div>
31
{% endblock %}