summaryrefslogtreecommitdiff
path: root/src/application/templates/old/base.twig
blob: bbac64327cb8cc15fc4d23de2c325b23bf8284e5 (plain)
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
{%- if title -%}
    {%- set title = title ~ " | " -%}
{%- endif -%}
{%- set title = title ~ (g.env.MYSTIC_FORUM_TITLE|default("Forum")) -%}
{%- set nextParam = "" -%}
{%- if g.globals.action in ["login", "register"] -%}
    {%- set nextParam = g.get.next|default("") -%}
{%- else -%}
    {%- set nextParam = g.server.REQUEST_URI -%}
{%- endif -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="{{ __("en", context: "HTML language") }}">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <meta name="generator" content="mysticBB {{ constant("MYSTICBB_VERSION") }}">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
    <meta http-equiv="imagetoolbar" content="no">
    <meta http-equiv="MSThemeCompatible" content="yes">
    <title>{{ title }}</title>
    <link rel="stylesheet" href="?_action=ctheme&amp;theme={{ currentTheme|url_encode }}" type="text/css">
    <script type="text/javascript" src="/ui/jquery-1.12.4.min.js"></script>
    {% block head_after %}{% endblock %}
</head>
<body bgcolor="white" text="black" link="blue" vlink="blue" alink="red">
<table width="100%">

{% block nav %}
<tr>
<td>
<table width="100%">
<tr>
<td align="right">
<table border="1" cellspacing="0" cellpadding="4" bordercolor="silver" bgcolor="white">
<tr>
{% block navbar %}
    {% if currentUser %}
        <td>{{ __("Welcome, %user%!", {
            user: currentUser.id == constant("mystic\\forum\\orm\\User::SUPERUSER_ID") ? ('<strong class="text-danger">' ~ (currentUser.displayName|e("html")) ~ '</strong>')|raw : ('<strong>' ~ (currentUser.displayName|e("html")) ~ '</strong>')|raw
        }) }}</td>
        <td><img src="/ui/theme-files/old/home.gif" border="0" alt="" width="16" height="16" draggable="false" class="inline-icon">&nbsp;<a href=".">{{ __("Start") }}</a></td>
        <td{{ g.globals.action == "search" ? ' class="active"'|raw : '' }}><img src="/ui/theme-files/old/search.gif" border="0" alt="" width="16" height="16" draggable="false" class="inline-icon">&nbsp;<a href="?_action=search">{{ __("Search") }}</a></td>
        <td{{ (g.globals.action == "viewuser" and g.get.user == currentUser.id) ? ' class="active"'|raw : '' }}><img src="/ui/theme-files/old/user.gif" border="0" alt="" width="16" height="16" draggable="false" class="inline-icon">&nbsp;<a href="?_action=viewuser&amp;user={{ currentUser.id|url_encode }}">{{ __("View profile") }}</a></td>
        <td><img src="/ui/theme-files/old/exit.gif" border="0" alt="" width="16" height="16" draggable="false" class="inline-icon">&nbsp;<a href="?_action=logout&amp;next={{ g.server.REQUEST_URI|url_encode }}">{{ __("Log out") }}</a></td>
    {% else %}
        <td><img src="/ui/theme-files/old/home.gif" border="0" alt="" width="16" height="16" draggable="false" class="inline-icon">&nbsp;<a href=".">{{ __("Start") }}</a></td>
        <td{{ g.globals.action == "search" ? ' class="active"'|raw : '' }}><img src="/ui/theme-files/old/search.gif" border="0" alt="" width="16" height="16" draggable="false" class="inline-icon">&nbsp;<a href="?_action=search">{{ __("Search") }}</a></td>
        <td{{ g.globals.action == "auth" ? ' class="active"'|raw : '' }}><img src="/ui/theme-files/old/user.gif" border="0" alt="" width="16" height="16" draggable="false" class="inline-icon">&nbsp;<a href="?_action=auth&amp;next={{ nextParam|url_encode }}">{{ __("Log in") }}</a></td>
        {% if constant("REGISTRATION_ENABLED") %}
            <td{{ g.globals.action == "register" ? ' class="active"'|raw : '' }}><img src="/ui/theme-files/old/user_add.gif" border="0" alt="" width="16" height="16" draggable="false" class="inline-icon">&nbsp;<a href="?_action=register&amp;next={{ nextParam|url_encode }}">{{ __("Register") }}</a></td>
        {% endif %}
    {% endif %}
{% endblock %}
</tr>
</table>
</tr>
</table>
</td>
</tr>
{% endblock %}

{% block main %}
<tr><td>
    {% block content %}{% endblock %}
</td></tr>
{% endblock %}

{% block footer %}
<tr>
<td>
<table border="1" width="100%" cellpadding="4" cellspacing="0" bordercolor="silver" bgcolor="white" class="footer">
<tr>
    <td align="left">
        &copy; {{ "now"|date("Y") }} {{ g.env.MYSTIC_FORUM_COPYRIGHT|default(g.env.MYSTIC_FORUM_TITLE)|default("Forum") }}.
        Powered by <a href="https://git.jkohl.link/mystic-forum.git/tag/?h=v{{ constant("MYSTICBB_VERSION")|url_encode }}">mysticBB v{{ constant("MYSTICBB_VERSION") }}</a>.
    </td>
    <td align="center">
        {{ __("Page generation took %dur% second(s)", {
            dur: getRunTime()|round(3),
        }) }}<br>
        {{ __("Number of database queries: %count%", {
            count: getQueryCount(),
        }) }}
        {% if constant("DEBUG") == true %}
            <br><font color="red"><b>Debug mode</b></font>
        {% endif %}
    </td>
    <td align="right">
        <table><tr><td>
        <form action="?_action=settheme" method="post">
            <input type="hidden" name="next" value="{{ g.server.REQUEST_URI }}">
            <div class="form-group">
                <label for="theme-select">{{ __("Theme:") }}</label>
                <select id="theme-select" name="theme" onChange="this.form.submit()">
                    {% for themeKey, themeInfo in availableThemes %}
                        <option value="{{ themeKey }}"{{ themeKey == currentTheme ? " selected" : "" }}>{{ themeInfo.name }}</option>
                    {% endfor %}
                </select>
            </div>
        </form>
        </td><td>
            <span>{{ __("Language:") }}</span>
            {% for langKey, langName in availableLangs %}
                <form action="?_action=setlang" method="post" class="inline">
                    <input type="hidden" name="next" value="{{ g.server.REQUEST_URI }}">
                    <input type="hidden" name="lang" value="{{ langKey }}">
                    <button type="submit" class="seamless inline-icon"><img src="/ui/theme-files/old/lang_{{ langKey }}.gif" width="16" height="16" border="0" draggable="false" alt="{{ langName }}"></button>
                </form>
            {% endfor %}
        </td></tr></table>
    </td>
</tr>
</table>
</td>
</tr>
{% endblock %}

{% block scripts %}
<script type="text/javascript">
    $(function() {
        function insertAroundSelection(textarea, before, after) {
            var start = textarea.selectionStart;
            var end = textarea.selectionEnd;
            var text = textarea.value;
            var pre = text.substring(0, start);
            var inner = text.substring(start, end);
            var post = text.substring(end);
            start += before.length;
            end += before.length;
            text = pre + before + inner + after + post;
            textarea.value = text;
            textarea.focus();
            textarea.selectionStart = start;
            textarea.selectionEnd = end;
        }

        function getTextarea(btn) {
            return $($(btn).attr("data-area"))[0];
        }

        var commands = {
            bold: function(textarea) {
                insertAroundSelection(textarea, "[b]", "[/b]");
            },
            italic: function(textarea) {
                insertAroundSelection(textarea, "[i]", "[/i]");
            },
            underline: function(textarea) {
                insertAroundSelection(textarea, "[u]", "[/u]");
            },
            strikethrough: function(textarea) {
                insertAroundSelection(textarea, "[s]", "[/s]");
            },
            sup: function(textarea) {
                insertAroundSelection(textarea, "[^]", "[/^]");
            },
            sub: function(textarea) {
                insertAroundSelection(textarea, "[_]", "[/_]");
            },
            quote: function(textarea) {
                insertAroundSelection(textarea, "> ", "");
            },
            spoiler: function(textarea) {
                insertAroundSelection(textarea, "[spoiler]", "[/spoiler]");
            }
        }

        $("button[data-editor-command]").attr("data-toggle", "tooltip").attr("data-placement", "bottom").click(function() {
            var command = $(this).attr("data-editor-command");
            var textarea = getTextarea(this);
            commands[command](textarea);
        });
    });
</script>
<script type="text/javascript">
    $(function() {
        function parseISODate(str) {
            var matches = str.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})([+-]\d{2}(?::?\d{2}))?$/);
            matches.shift();
            var year = matches[0];
            var month = matches[1];
            var day = matches[2];
            var hours = matches[3];
            var minutes = matches[4];
            var seconds = matches[5];
            var timezone = matches[6];
            if (timezone.indexOf(":") >= 0) {
                var factor = 1;
                if (timezone[0] == "+") {
                    factor = 1;
                    timezone = timezone.substr(1);
                } else if (timezone[0] == "-") {
                    factor = -1;
                    timezone = timezone.substr(1);
                }
                timezone = timezone.split(":");
                var tzHours = timezone[0];
                var tzMinutes = timezone[1];
                tzHours = parseInt(tzHours);
                tzMinutes = parseInt(tzMinutes) / 60;
                timezone = tzHours + tzMinutes;
            } else {
                timezone = parseInt(timezone);
            }

            var date = new Date();
            date.setUTCFullYear(year);
            date.setUTCMonth(month - 1);
            date.setUTCDate(day);
            date.setUTCHours(hours);
            date.setUTCMinutes(minutes);
            date.setUTCSeconds(seconds);

            return date;
        }

        $("._time").each(function(i, e) {
            var date = parseISODate($(e).text());
            $(e).text(date.toLocaleString());
        });
        $("._date").each(function(i, e) {
            var date = parseISODate($(e).text());
            $(e).text(date.toLocaleDateString());
        });
        $("._time-only").each(function(i, e) {
            var date = parseISODate($(e).text());
            $(e).text(date.toLocaleTimeString());
        });
    });
</script>
{% endblock %}

</table>
</body>
</html>