aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/wiki/preview_inline.html
blob: a01c963a1f1af6dbda4f4ffa4a4ffb3102149fbc (plain) (blame)
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
{% extends "wiki/base.html" %}
{% load sekizai_tags %}
{% load static %}
{% load wiki_tags %}

{# We make these empty so they don't appear in the preview #}
{% block site_navbar %}{% endblock %}
{% block site_footer %}{% endblock %}
{% block wiki_breadcrumbs %}{% endblock %}

{% block wiki_body %}
  {% if revision %}
    <div class="container">
      <div class="message">
        <div class="message-header">
          <p>Previewing Revision</p>
        </div>
        <div class="message-body">
          {% include "wiki/includes/revision_info.html" %}
        </div>
      </div>
    </div>
  {% endif %}

  {% if merge %}
    <div class="alert alert-info">
      <strong>Previewing merge between:</strong>
      {% include "wiki/includes/revision_info.html" with revision=merge1 %}
      <strong>and</strong>
      {% include "wiki/includes/revision_info.html" with revision=merge2 %}
    </div>

    {% if merge1.deleted %}
      <div class="alert alert-danger">
        <strong>You cannot merge with a deleted revision</strong>
      </div>
    {% endif %}
  {% endif %}

  {% if revision and revision.deleted %}
    <div class="warning">
      <strong>This revision has been deleted.</strong>
      <p>Restoring to this revision will mark the article as deleted.</p>
    </div>
  {% else %}
    <section class="section">
      <div class="container">
        <div class="content">
          <h1 class="title">{{ article.current_revision.title }}</h1>

          {% wiki_render article content %}
        </div>
      </div>
    </section>

    {% for plugin in plugins %}
      {% if plugin.RenderMedia.css %}
        {% addtoblock "css" %}
          {% for media, url in plugin.RenderMedia.css.items %}
            <link rel="stylesheet" href="{% static url %}" />
          {% endfor %}
        {% endaddtoblock %}
      {% endif %}
      {% if plugin.RenderMedia.js %}
        {% addtoblock "js" %}
          {% for url in plugin.RenderMedia.js %}
            <script type="text/javascript" src="{% static url %}"></script>
          {% endfor %}
        {% endaddtoblock %}
      {% endif %}
    {% endfor %}
  {% endif %}
{% endblock %}