aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/wiki/includes/breadcrumbs.html
blob: 47da9bc25a4c28f5ae02b6611ef5809a4defde20 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{% load wiki_tags %}

{% if urlpath and article and article|can_write:user %}
  <section class="breadcrumb-section section">
    <div class="container">
      <nav class="breadcrumb is-pulled-left" aria-label="breadcrumbs">
        <ul>
          {% for ancestor in urlpath.cached_ancestors %}
            <li>
              <a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title|truncatechars:25 }}</a>
            </li>
          {% endfor %}

          <li class="is-active">
            <a href="{% url 'wiki:get' path=article.path %}">{{ article.current_revision.title|truncatechars:25 }}</a>
          </li>
        </ul>
      </nav>

      <div class="dropdown is-pulled-right is-right">
        <div class="dropdown-trigger">
          <a aria-haspopup="true" aria-controls="sub-article-dropdown">
            <span>Sub-Articles</span>
            <span class="icon">
              <i class="fas fa-angle-down"></i>
            </span>
          </a>
        </div>
        <div class="dropdown-menu" id="sub-article-dropdown" role="menu">
          <div class="dropdown-content">
            {% if children_slice %}
              {% for child in children_slice %}
                <a class="dropdown-item" href="{% url 'wiki:get' path=child.path %}">
                  {{ child.article.current_revision.title }}
                </a>
              {% endfor %}

              {% if children_slice_more %}
                <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}">
                  ...and more.
                </a>
              {% endif %}

              <hr class="dropdown-divider">
            {% endif %}

            <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}">
              Browse other articles
            </a>
          </div>
        </div>
      </div>

      {% if request.user.is_authenticated %}
        <div class="dropdown is-pulled-right is-right">
          <div class="dropdown-trigger">
            <a aria-haspopup="true" aria-controls="sub-article-dropdown">
              <span>Create Article</span>
              <span class="icon">
                <i class="fas fa-angle-down"></i>
              </span>
              &nbsp;
            </a>
          </div>
          <div class="dropdown-menu" id="sub-article-dropdown" role="menu">
            <div class="dropdown-content">
              {% if urlpath.parent %}
                <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.parent.path %}">
                  <span class="icon">
                    <i class="fas fa-arrow-right"></i>
                  </span>
                  <span>At current level</span>
                </a>
              {% endif %}

              <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.path %}">
                <span class="icon">
                  <i class="fas fa-arrow-down"></i>
                </span>
                <span>Below current level</span>
              </a>
            </div>
          </div>
        </div>
      {% endif %}

    </div>
  </section>
{% endif %}