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


{% 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
20
21
22
        {% if object.status == 'PUBLISHED' %}
        <span class="ml-2"><strong>Article ID #{{object.id}} published on {{ object.published_at|date:"DATETIME_FORMAT" }}</strong></span>
        {% else %}
23
        <span class="ml-2"><strong>Article ID #{{object.id}}</strong></span>
cynddl's avatar
cynddl committed
24
        {% endif %}
25
26
27
      </p>
      <div class="ml-auto">
        <span class="btn-group" role="group" aria-label="Actions">
cynddl's avatar
cynddl committed
28
29
30
31
32
33
          {% if object.status == 'PUBLISHED' %}
          <a class="btn btn-outline-danger" href="{% url 'rp:article-edit' object.id %}">Edit</a>
          {% else %}
          <a class="btn btn-outline-primary" href="{% url 'rp:article-edit' object.id %}">Edit</a>
          <a class="btn btn-outline-warning" href="#">Publish</a>
          {% endif %}
34
35
36
37
38
39
40
41
42
43
44
45
        </span>
      </div>
    </div>

    <div class="row">
      <div class="col-sm-3">
        {% if object.screenshot %}
        <img class="img-responsive mb-4"
             src="/media/{{ object.screenshot }}">
        {% endif %}
      </div>
      <div class="col-sm-9 lead">
cynddl's avatar
cynddl committed
46
        <h4><a target="_blank" href="{{object.url}}">{{object.title}}</a></h4>
47
48
49
50
51
52
53
54
55
56
57
58
59
        <p>{{article.created_at.date}}
        {% for t in article.tags.all %}
        <span class="badge badge-default ml-1">{{t}}</span>
        {% endfor %}
        </p>

        <p>{{object.extracts}}</p>
      </div>
    </div>

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