article_list.html 3.77 KB
Newer Older
luxcem's avatar
luxcem committed
1 2 3 4
{% extends "base.html" %}

{% block content %}

cynddl's avatar
cynddl committed
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
<div class="row">
<div class="col-md-12 white-pure">
  <ul class="nav nav-integrated">
    <li class="nav-item{% if filter_view == 'flux' %} active{% endif %}">
      <a class="nav-link" href="{% url 'article-list' filter_view='flux'%}">
        Flux <img style="width: 2rem; margin-left: 0.5rem;" src="/static/img/cochon-01.png" alt="">
      </a>
    </li>
    <li class="nav-item {% if filter_view == 'draft' %} active{% endif %}">
      <a class="nav-link" href="{% url 'article-list' filter_view='draft'%}">
        En attente <span class="badge badge-default">{{nb_draft}}</span>
      </a>
    </li>
    <li class="nav-item {% if filter_view == 'published' %} active{% endif %}">
      <a class="nav-link" href="{% url 'article-list' filter_view='published'%}">Publiés</a>
    </li>
  </ul>

  <div class="well">
    {% if is_paginated %}
      <div class="pagination">
        <span class="page-links">
          {% if page_obj.has_previous %}
            <a href="?page={{ page_obj.previous_page_number }}"><<</a>
          {% endif %}
          <span class="page-current">
            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}
          </span>
          {% if page_obj.has_next %}
            <a href="?page={{ page_obj.next_page_number }}">>></a>
          {% endif %}
        </span>
      </div>
    {% endif %}

luxcem's avatar
luxcem committed
40 41 42 43 44 45
    {% if filter_view == "rejected" %}
      <div class="alert alert-danger" role="alert">
        {% trans "Rejected articles" %}
      </div>
    {% endif %}

cynddl's avatar
cynddl committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
    <table class="article-table table table-sm my-4">
      <thead>
        <tr>
          <th>Priority</th>
          <th>ID</th>
          <th>Date</th>
          <th>Language</th>
          <th>Title</th>
          <th>Note</th>
          <th>Added&nbsp;by</th>
          <th>Actions</th>
        </tr>
      </thead>
    <tbody>
    {% for article in object_list|slice:":10" %}
      <tr class="empty-row"><td colspan="8"></td></tr>
      <tr>
        <td class="icon-cell"><i class="fa fa-dot-circle-o" aria-hidden="true" style="color:red"></i></td>
        <td>{{article.id}}</td>
        <td>{{article.created_at |date:'d/m/y'}}<br />{{article.created_at |date:'H:i'}}</td>
        <td>{{article.lang}}</td>
        <td class="title-cell"><a target="_blank" href="{{article.url}}"><strong>{{article.title}}</strong></a></td>
        <td>
          <ul class="votes-list">
cynddl's avatar
cynddl committed
70 71
            <li><a href="">+{{article.und_score_up}} <i class="fa fa-thumbs-up" aria-hidden="true" style="color:green"></i></a></li>
            <li><a href="">-{{article.und_score_down}} <i class="fa fa-thumbs-down" aria-hidden="true" style="color:red"></i></a></li>
cynddl's avatar
cynddl committed
72 73 74 75 76
          </ul>
        </td>
        <td>{{article.und_votes.first.username}}</td>
        <td class="actions-cell">
          <ul class="actions-list">
77 78 79 80 81 82 83 84
            {% if filter_view == 'flux' %}
            <li class="actions-item-draft"><a href="#">
              <i class="fa fa-chevron-right" aria-hidden="true"></i> Mettre en attente</a>
            </li>
            <li class="actions-item-reject"><a href="#">
              <i class="fa fa-times" aria-hidden="true"></i> Rejeter</a>
            </li>
            {% else %}
cynddl's avatar
cynddl committed
85 86 87 88 89 90
            <li class="actions-item-edit"><a href="#">
              <i class="fa fa-pencil" aria-hidden="true"></i> Éditer</a>
            </li>
            <li class="actions-item-publish"><a href="#">
              <i class="fa fa-check" aria-hidden="true"></i> Publier</a>
            </li>
91
            {% endif %}
cynddl's avatar
cynddl committed
92 93 94
          </ul>
        </td>
      </tr>
95
      {% if filter_view != 'flux' %}
cynddl's avatar
cynddl committed
96 97 98 99 100
      <tr class="tags-row">
        <td colspan="8">
          <strong>Tags</strong> tags tags
        </td>
      </tr>
101
      {% endif %}
cynddl's avatar
cynddl committed
102 103 104 105 106 107
    {% endfor %}
    </tbody>
    </table>
  </div>
</div>
</div>
luxcem's avatar
luxcem committed
108
{% endblock %}