aboutsummaryrefslogtreecommitdiffstats
path: root/templates/news/list.html
blob: f03b72008f9de911d4a212c1686ee6e649c9c49e (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
{% extends 'layout.html' %}

{% block content %}
<div class="row">

<div class="col-md-8">

<p class="second_menu text-center">
<a href="/news/add">Ajouter une actualité</a>
</p>



{% for news in news %}

<article>
        <header>
            <h2><a href="{{url_for('show_news', news_id = news.id)}}">{{ news.title }}</a></h2>

            {% if news.user_name==session.user_name %}
            <p class="pull-right">&nbsp;&nbsp;&nbsp;<a href="{{url_for('edit_news', news_id = news.id)}}"><i data-toggle="tooltip" data-placement="bottom" title="Éditer" class="fa fa-pencil"></i></a> </p>
            {% endif %}

            <p class="comments pull-right">
             <a href="{{url_for('show_news', news_id = news.id)}}#add">{{news.ncomments}} <i class="fa fa-comment"></i></a> 
            </p>

            <p>Posté par <a href="{{url_for('view_user', user_id=news.user_id)}}">{{news.user_name}}</a> le {{news.date|format_date}}</p>
        </header>

    <div class="news_content">
        <p>{{ news.content_cache|safe }}</p>
    </div>
</article>
<hr/>

{% endfor %}
</div>

<div class="col-md-4">

    <div class="panel panel-default">
        <div class="panel-heading">Dernières visites</div>
        <div class="panel-body">
            <table class="table table-condensed borderless">
                {% for user in users %}
                <tr>
                    <td><a href="{{url_for('view_user', user_id=user.id)}}">{{user.user_name}}</a></td>
                    <td>{{user.last_seen|format_ago('%a %d %b à %Hh%M')|safe}}</td>
                </tr>
                {% endfor %}
            </table>
        </div>
    </div>


    <div class="panel panel-default">
        <div class="panel-heading">Derniers commentaires</div>
        <div class="panel-body">
            <ul id="last-comments" class="list-unstyled">
                {% for comment in comments %}
                <li><a href="{{url_for('view_user', user_id=comment.user_id)}}">{{comment.user_name}}</a>
                    {{comment.date|format_ago('%a %d %b à %Hh%M')|safe}}<br/>
                    {{comment.content_cache|shortify|safe}} <a href="{{url_for('show_news', news_id=comment.news_id)}}#comments">[…]</a>
                </li>
                {% else %}
                Pas de commentaires.
                {% endfor %}
            </ul>
        </div>
    </div>

</div>

</div>

{% endblock %}