article_detail.html 1.89 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 31 32 33 34
          {% 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 %}
35 36 37 38 39
        </span>
      </div>
    </div>

    <div class="row">
40
      <div class="col-sm-4"=>
41
        {% if object.screenshot %}
42
        <img class="img-fluid mb-4"
43 44 45
             src="/media/{{ object.screenshot }}">
        {% endif %}
      </div>
46
      <div class="col-sm-8 lead">
cynddl's avatar
cynddl committed
47
        <h4><a target="_blank" href="{{object.url}}">{{object.title}}</a></h4>
48 49 50 51 52 53
        <p>{{article.created_at.date}}
        {% for t in article.tags.all %}
        <span class="badge badge-default ml-1">{{t}}</span>
        {% endfor %}
        </p>

54
        <p>{{object.extracts |markdown}}</p>
55 56 57 58 59 60
      </div>
    </div>

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