article_detail.html 3.57 KB
Newer Older
1
2
3
4
{% extends "base.html" %}
{% load static %}
{% load crispy_forms_tags %}
{% load crispy_forms_field %}
5
{% load md2 %}
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


{% block content-banner %}
{% endblock %}

{% block content %}
<div class="row">
<div class="col-md-12 white-bg">
  <div class="well">

    <div class="d-flex justify-content-start align-items-baseline mb-4">
      <p class="lead">
        <a class="btn btn-outline-primary" href="{% url 'rp:article-list' filter_view='draft' %}">
          <i class="fa fa-chevron-left" aria-hidden="true"></i> Pending articles
        </a>
cynddl's avatar
cynddl committed
21
22
23
        {% if object.status == 'PUBLISHED' %}
        <span class="ml-2"><strong>Article ID #{{object.id}} published on {{ object.published_at|date:"DATETIME_FORMAT" }}</strong></span>
        {% else %}
24
        <span class="ml-2"><strong>Article ID #{{object.id}}</strong></span>
cynddl's avatar
cynddl committed
25
        {% endif %}
26
27
28
      </p>
      <div class="ml-auto">
        <span class="btn-group" role="group" aria-label="Actions">
cynddl's avatar
cynddl committed
29
30
          {% if object.status == 'PUBLISHED' %}
          <a class="btn btn-outline-danger" href="{% url 'rp:article-edit' object.id %}">Edit</a>
31
32
33
34
          {% if perms.rp.can_change_status %}
          <a class="btn btn-outline-default" href="{% url 'api:article-unpublish' object.id %}">UnPublish</a>
          <a class="btn btn-outline-danger" href="{% url 'api:article-reject' object.id %}">Reject</a>
          {% endif %}
cynddl's avatar
cynddl committed
35
36
          {% else %}
          <a class="btn btn-outline-primary" href="{% url 'rp:article-edit' object.id %}">Edit</a>
37
38
39
40
41
          {% if perms.rp.can_change_status %}
          <a class="btn btn-outline-warning" href="{% url 'api:article-publish' object.id %}">Publish</a>
          <a class="btn btn-outline-danger" href="{% url 'api:article-reject' object.id %}">Reject</a>
          <a class="btn btn-outline-default" href="{% url 'api:article-recover' object.id %}">Recover</a>
          {% endif %}
cynddl's avatar
cynddl committed
42
          {% endif %}
43
44
45
46
47
        </span>
      </div>
    </div>

    <div class="row">
48
      <div class="col-sm-4"=>
49
        {% if object.screenshot %}
50
        <img class="img-fluid mb-4"
51
52
53
             src="/media/{{ object.screenshot }}">
        {% endif %}
      </div>
54
      <div class="col-sm-8 lead">
cynddl's avatar
cynddl committed
55
        <h4><a target="_blank" href="{{object.url}}">{{object.title}}</a></h4>
56
57
58
59
60
        <p>{{article.created_at.date}}
        {% for t in article.tags.all %}
        <span class="badge badge-default ml-1">{{t}}</span>
        {% endfor %}
        </p>
61
        {% if article.archive %}
62
        <span class="badge badge-info ml-1"><span class="glyphicon glyphicon-floppy-disk" aria-label="{{ _("Archived") }}"></span>
63
64
        {% endif %}
        {% if article.quote %}
65
        <span class="badge badge-info ml-1"><span class="glyphicon glyphicon-comment" aria-label="{{ _("Quotes us") }}"></span>
66
67
        {% endif %}
        {% if article.speak %}
68
        <span class="badge badge-info ml-1"><span class="glyphicon glyphicon-bullhorn" aria-label="{{ _("Speaks about us") }}"></span>
69
        {% endif %}
70

71
72
73
74
        <h4>{{ _("Article created by:") }}&nbsp;<em>{{ article.created_by }}</em></h4>
        <p>
        <a target="mailto:{{ article.created_by.user.email }}"><span class="glyphicon glyphicon-envelope" aria-label="{{ _("Contact this user by email")}}"></span>
        </p>
75
        <p>{{object.extracts |markdown}}</p>
76
77
        {% if perms.rp.can_vote %}
        <span>
78
79
            <a href="{% url 'api:article-upvote' object.id  %}" class="btn btn-outline-default">+1</a>
            <a href="{% url 'api:article-downvote' object.id  %}" class="btn btn-outline-default">-1</a>
80
81
        </span>
        {% endif %}
82
83
84
85
86
87
      </div>
    </div>

</div>
</div>
{% endblock %}