aboutsummaryrefslogtreecommitdiffstats
path: root/templates/wiki/base.html
blob: 9fa07e9bc7493daca2a99616fe3122b08f555942 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html>
<html lang="en">
    <head>
        {% block head %}
            <title>Python Discord | {% block title %}{% endblock %}</title>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1">

            <!-- Prevent Flash of Unstyled Content -->
            <script src="{{ static_file('js/fouc.js') }}"></script>

            <!-- Other JS loads -->
            <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.39/js/uikit.min.js"></script>

            <!-- Static stuff -->
            <link rel="shortcut icon" href="{{ static_file('favicon.ico') }}">
            <link rel="stylesheet" href="{{ static_file('uikit_blurple.css') }}"/>
            <link rel="stylesheet" href="{{ static_file('style.css') }}"/>
            <link rel="stylesheet" href="{{ static_file('css/pygments-monokai.css') }}"/>

            <!-- OpenGraph metadata -->
            <meta property="og:title" content="Python Discord | {% block og_title %}{% endblock %}">
            <meta property="og:description" content="{% block og_description %}We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.{% endblock %}">
            <meta content="/static/logos/logo_discord.png" property="og:image">
        {% endblock %}
        {% block extra_head %}

        {% endblock %}
    </head>
    <body class="page-{{ current_page.replace(".", "-") }}">
        <div class="uk-offcanvas-content uk-flex uk-flex-column">
            {% include "main/navigation.html" %}
            <div class="uk-flex uk-flex-row uk-flex-1">
                <div class="uk-card uk-card-body uk-flex-left uk-flex uk-card-primary">
                    <ul class="uk-nav-default uk-nav-parent-icon" uk-nav id="wiki-nav">
                        {% if data is defined %}
                            {% if "headers" in data and data.headers %}
                                <li class="uk-nav-header">Contents</li>
                                {% for header in data.headers %}
                                    {%  if "sub_headers" in header %}
                                        <li class="uk-parent">
                                            <a href="{{ header.id }}">
                                                {{ header.title | safe }}
                                            </a>
                                            <ul class="uk-nav-sub">
                                                {% for sub in header.sub_headers %}
                                                    <li><a href="{{ sub.id }}">
                                                        {{ sub.title | safe }}
                                                    </a></li>
                                                {% endfor %}
                                            </ul>
                                        </li>
                                    {% else %}
                                        <li><a href="{{ header.id }}">{{ header.title | safe }}</a></li>
                                    {% endif %}
                                {% endfor %}
                                <li class="uk-nav-divider"></li>
                            {% endif %}
                        {% endif %}
                        <li><a href="{{ url_for("wiki.page", page="home") }}">
                            <i class="uk-icon fas fa-fw fa-home"></i> &nbsp;Home
                        </a></li>
                        <li><a href="{{ url_for("wiki.page", page="jams") }}">
                            <i class="uk-icon fas fa-fw fa-star-exclamation"></i> &nbsp;Code Jams</a>
                        </li>
                        <li><a href="{{ url_for("wiki.page", page="contributing") }}">
                            <i class="uk-icon fas fa-fw fa-code-branch"></i> &nbsp;Contributing
                        </a></li>
                        <li><a href="{{ url_for("wiki.page", page="minecraft") }}">
                            <i class="uk-icon fas fa-fw fa-cube"></i> &nbsp;Minecraft
                        </a></li>

                        {% set ACTIONABLE_PAGES = [
                                "wiki.page", "wiki.edit", "wiki.history.show",
                                "wiki.history.compare", "wiki.source", "wiki.delete",
                                "wiki.move"
                        ] %}
                        {% set actionable = current_page in ACTIONABLE_PAGES %}

                        {% if actionable %}
                            <li class="uk-nav-divider"></li>

                            {% if current_page == "wiki.edit" %}
                                <li>
                                    <a href="{{ url_for("wiki.page", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
                                    </a>
                                </li>
                            {% else %}
                                <li>
                                    <a href="{{ url_for("wiki.edit", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-pencil-alt"></i> &nbsp;Edit
                                    </a>
                                </li>
                            {% endif %}

                            {% if current_page == "wiki.delete" %}
                                <li>
                                    <a href="{{ url_for("wiki.page", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
                                    </a>
                                </li>
                            {% else %}
                                <li>
                                    <a href="{{ url_for("wiki.delete", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-trash"></i> &nbsp;Delete
                                    </a>
                                </li>
                            {% endif %}

                            {% if current_page == "wiki.move" %}
                                <li>
                                    <a href="{{ url_for("wiki.page", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
                                    </a>
                                </li>
                            {% else %}
                                <li>
                                    <a href="{{ url_for("wiki.move", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-arrow-right"></i> &nbsp;Move
                                    </a>
                                </li>
                            {% endif %}

                            {% if current_page == "wiki.history.show" %}
                                <li>
                                    <a href="{{ url_for("wiki.page", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
                                    </a>
                                </li>
                            {% elif current_page == "wiki.history.compare" %}
                                <li>
                                    <a href="{{ url_for("wiki.history.show", page=slug) }}">
                                        <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
                                    </a>
                                </li>
                            {% else %}
                                <li>
                                    <a href="{{ url_for("wiki.history.show", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-history"></i> &nbsp;Revisions
                                    </a>
                                </li>
                            {% endif %}

                            {% if current_page == "wiki.source" %}
                                <li>
                                    <a href="{{ url_for("wiki.page", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-arrow-left"></i> &nbsp;Back
                                    </a>
                                </li>
                            {% else %}
                                <li>
                                    <a href="{{ url_for("wiki.source", page=page) }}">
                                        <i class="uk-icon fas fa-fw fa-code"></i> &nbsp;Source
                                    </a>
                                </li>
                            {% endif %}
                        {% endif %}

                        <li class="uk-nav-divider"></li>
{#                        <li><a href="{{ url_for("wiki.search") }}">#}
{#                            <i class="uk-icon fas fa-fw fa-search"></i> &nbsp;Search#}
{#                        </a></li>#}
                        <li><a href="{{ url_for("wiki.special") }}">
                            <i class="uk-icon fas fa-fw fa-ellipsis-h"></i> &nbsp;Special Pages
                        </a></li>
                        <li><a href="{{ url_for("wiki.page", page="help") }}">
                            <i class="uk-icon fas fa-fw fa-question-circle"></i> &nbsp;Help
                        </a></li>

                        <li>
                            <form action="{{ url_for("wiki.search") }}" method="post">
                                {% if query is undefined %}
                                <input type="text" class="uk-input" placeholder="Search (BETA)" id="query" name="query" style="padding-right: 0; margin-top: 5px; border-left: 0; border-right: 0;" required>
                                {% else %}
                                <input type="text" class="uk-input" placeholder="Search (BETA)" id="query" name="query" value="{{ query }}" style="padding-right: 0; margin-top: 5px; border-left: 0; border-right: 0;" required>
                                {% endif %}
                                <br />
                                <button class="uk-button uk-button-darkish uk-button-small" type="submit" id="search" title="Search" style="width: 100%; border: 0;">
                                    <i class="uk-icon fas fa-fw fa-search"></i>
                                </button>

                                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
                            </form>
                        </li>
                    </ul>
                </div>
                <div class="uk-section" style="flex-grow: 1; margin: 0 1rem 1rem;">
                    {% block content %}{% endblock %}
                </div>
            </div>
        </div>

        <footer>
            <div class="uk-section uk-section-secondary uk-container-medium uk-text-meta">
                <div class="uk-text-center">
                    <p>
                        This website uses <a href="https://python.org">Python</a> and
                        <a href="http://flask.pocoo.org/">Flask</a>, and was developed collaboratively on
                        <a href="https://github.com/discord-python/site">GitHub</a>.
                    </p>
                </div>
            </div>
        </footer>

        <script src='{{ static_file('js/countdown.js') }}'></script>
    </body>
</html>