aboutsummaryrefslogtreecommitdiffstats
path: root/dev-random/templates/index.html
blob: ad016083203babd0dad2278ef200089dc5421091 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{% extends "base.html" %}

{%- block content %}
    <section id="page-content">
      <h1 id="page-title">{% block index_title %}Tous les articles{% endblock index_title %}</h1>
     
         {% for article in articles_page.object_list %}        
      <article class="post">
        <header class="post-header">
          <time datetime="{{ article.date.isoformat() }}" pubdate="pubdate">
            {{ article.locale_date }}
          </time>
          <h1>
            <a rel="bookmark"
               href="{{ SITEURL }}/{{ article.url }}"
               title="Lien permanent vers «{{ article.title }}»">
               {{ article.title }}
            </a>
          </h1>
          <div class="meta">
              Dans «<a href="{{ SITEURL }}/category/{{ article.category }}.html">{{ article.category }}</a>» 
              par <a href="{{ SITEURL }}/author/{{article.author}}.html">{{ article.author}}</a>
          </div>
        </header>
        <div class="post-content"> 
          {{ article.summary }}
        </div>
        <footer class="post-footer">
          <a class="readmore" href="{{ SITEURL }}/{{ article.url }}">Lire la suite...</a>
        </footer>
      </article>
        {% endfor %}

      {%- if articles_page %}
      <nav id="pagination">
        {%- if articles_page.has_previous() %}
        <a id="first_page" href="{{ SITEURL }}/{{ page_name }}.html">&#60;&#60;</a>
        <a id="prev_page" href="{{ SITEURL }}/{{ page_name }}{{ articles_page.previous_page_number() if articles_page.previous_page_number() != 1 else "" }}.html">&#60;</a>
        {% else %}
   <!-- <span id="first_page" class="a inactive">&#60;&#60;</span>
        <span id="first_page" class="a inactive">&#60;</span> -->
        {% endif -%}

        {%- for i in range(1,articles_paginator.num_pages+1) %}
          {%- if articles_page.number - 5 < i < articles_page.number + 5 %}
            {%- if i == articles_page.number %}
        <span class="a active">{{loop.index}}</span>
            {% else %}
        <a href="{{SITEURL}}/{{ page_name }}{{ ( i if i != 1 else "" ) }}.html">{{loop.index}}</a>
            {% endif -%} 
          {% endif -%}
        {% endfor -%}

        {%- if articles_page.has_next() %}
        <a id="next_page" href="{{ SITEURL }}/{{ page_name }}{{ articles_page.next_page_number() }}.html">&#62;</a>
        <a id="last_page" href="{{ SITEURL }}/{{ page_name }}{{ articles_paginator.num_pages }}.html">&#62;&#62;</a>
        {% else %}
   <!-- <span id="next_page" class="a inactive">&#62;</span>
        <span id="next_page" class="a inactive">&#62;&#62;</span> -->
        {% endif -%}
      </nav>
      {%- endif%}
    </section>
{% endblock content -%}