summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-08-13 00:18:13 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-08-13 00:18:13 +1000
commitc5ec20684e77456fe9377a8cbf62c78cfb580b64 (patch)
treee1ab7f489f67685c9ec4be53e71bdce80420d814 /templates
parent32384cb722c4ca7e70939d2cb308fa3b39eebfcf (diff)
themes
Diffstat (limited to 'templates')
-rw-r--r--templates/mod/dashboard.html18
-rw-r--r--templates/mod/theme_config.html27
-rw-r--r--templates/mod/theme_installed.html9
-rw-r--r--templates/mod/theme_rebuilt.html2
-rw-r--r--templates/mod/themes.html40
5 files changed, 82 insertions, 14 deletions
diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html
index 47a25390..30742dc1 100644
--- a/templates/mod/dashboard.html
+++ b/templates/mod/dashboard.html
@@ -10,7 +10,6 @@
{% if board.subtitle %}
<small>&mdash; {{ board.subtitle|e }}</small>
{% endif %}
-
{% if mod|hasPermission(config.mod.manageboards) %}
<a href="?/edit/{{ board.uri }}"><small>[{% trans 'edit' %}]</small></a>
{% endif %}
@@ -78,39 +77,30 @@
{% if reports > 0 %}</strong>{% endif %}
</li>
{% endif %}
-
{% if mod|hasPermission(config.mod.view_banlist) %}
<li><a href="?/bans">{% trans 'Ban list' %}</a></li>
{% endif %}
-
{% if mod|hasPermission(config.mod.manageusers) %}
<li><a href="?/users">{% trans 'Manage users' %}</a></li>
{% elseif mod|hasPermission(config.mod.change_password) %}
<li><a href="?/users/{{ mod.id }}">{% trans 'Change password' %}</a></li>
{% endif %}
-
+ {% if mod|hasPermission(config.mod.themes) %}
+ <li><a href="?/themes">{% trans 'Manage themes' %}</a></li>
+ {% endif %}
{% if mod|hasPermission(config.mod.modlog) %}
<li><a href="?/log">{% trans 'Moderation log' %}</a></li>
{% endif %}
-
{% if mod|hasPermission(config.mod.rebuild) %}
<li><a href="?/rebuild">{% trans 'Rebuild' %}</a></li>
{% endif %}
-
{% if mod|hasPermission(config.mod.show_config) %}
<li><a href="?/config">{% trans 'Configuration' %}</a></li>
{% endif %}
+
</ul>
</fieldset>
-{% if mod|hasPermission(config.mod.themes) %}
- <fieldset>
- <legend>{% trans 'Themes' %}</legend>
-
- {# TODO #}
- </fieldset>
-{% endif %}
-
<fieldset>
<legend>{% trans 'Search' %}</legend>
diff --git a/templates/mod/theme_config.html b/templates/mod/theme_config.html
new file mode 100644
index 00000000..2dbb8397
--- /dev/null
+++ b/templates/mod/theme_config.html
@@ -0,0 +1,27 @@
+<form action="" method="post">
+ {% if not config %}
+ <p style="text-align:center" class="unimportant">(No configuration required.)</p>
+ {% else %}
+ <table>
+ {% for conf in theme.config %}
+ <tr>
+ <th>{{ conf.title }}</th>
+ <td>
+ <input type="text" name="{{ conf.name }}"
+ {% if settings[conf.name] %}value="{{ settings[conf.name] }}"{% else %}{% if conf.default %}value="{{ conf.default }}"{% endif %}{% endif %}
+ {% if conf.size %}
+ size="{{ conf.size }}"
+ {% endif %}
+ />
+ {% if conf.comment %}
+ <span class="unimportant">{{ conf.comment }}</span>
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+ </table>
+ {% endif %}
+ <p style="text-align:center">
+ <input name="install" type="submit" value="{% trans 'Install theme' %}" />
+ </p>
+</form>
diff --git a/templates/mod/theme_installed.html b/templates/mod/theme_installed.html
new file mode 100644
index 00000000..e6beec10
--- /dev/null
+++ b/templates/mod/theme_installed.html
@@ -0,0 +1,9 @@
+{% if message %}
+ <div style="border:1px dashed maroon;padding:20px;margin:auto;max-width:800px">{{ message }}</div>
+{% endif %}
+
+{% if result %}
+ <p style="text-align:center">{% trans 'Successfully installed and built theme.' %}</p>
+{% endif %}
+
+<p style="text-align:center"><a href="?/themes">{% trans 'Go back to themes' %}</a>.</p>
diff --git a/templates/mod/theme_rebuilt.html b/templates/mod/theme_rebuilt.html
new file mode 100644
index 00000000..b366e7a6
--- /dev/null
+++ b/templates/mod/theme_rebuilt.html
@@ -0,0 +1,2 @@
+<p style="text-align:center">{{ 'Successfully rebuilt the <strong>%s</strong> theme.'|trans|sprintf(theme_name) }}</p>
+<p style="text-align:center"><a href="?/themes">{% trans 'Go back to themes' %}</a>.</p>
diff --git a/templates/mod/themes.html b/templates/mod/themes.html
new file mode 100644
index 00000000..b596826d
--- /dev/null
+++ b/templates/mod/themes.html
@@ -0,0 +1,40 @@
+{% if themes|count == 0 %}
+ <p style="text-align:center" class="unimportant">({% trans 'There are no themes available.' %})</p>
+{% else %}
+ <table class="modlog">
+ {% for theme_name, theme in themes %}
+ <tr>
+ <th class="minimal">{% trans 'Name' %}</th>
+ <td>{{ theme.name }}</td>
+ </tr>
+ <tr>
+ <th class="minimal">{% trans 'Version' %}</th>
+ <td>{{ theme.version }}</td>
+ </tr>
+ <tr>
+ <th class="minimal">{% trans 'Description' %}</th>
+ <td>{{ theme.description }}</td>
+ </tr>
+ <tr>
+ <th class="minimal">{% trans 'Thumbnail' %}</th>
+ <td>
+ <img style="float:none;margin:4px{% if theme_name in themes_in_use %};border:2px solid red;padding:4px{% endif %}" src="{{ config.dir.themes_uri }}/{{ theme_name }}/thumb.png" />
+ </td>
+ </tr>
+ <tr>
+ <th class="minimal">{% trans 'Actions' %}</th>
+ <td><ul style="padding:0 20px">
+ <li><a title=" {% trans 'Use theme' %}" href="?/themes/{{ theme_name }}">
+ {% if theme_name in themes_in_use %}{% trans 'Reconfigure' %}{% else %}{% trans 'Install' %}{% endif %}
+ </a></li>
+ {% if theme_name in themes_in_use %}
+ <li><a href="?/themes/{{ theme_name }}/rebuild">{% trans 'Rebuild' %}</a></li>
+ <li><a href="?/themes/{{ theme_name }}/uninstall" onclick="return confirm('Are you sure you want to uninstall this theme?');">{% trans 'Uninstall' %}</a></li>
+ {% endif %}
+ </ul></td>
+ </tr>
+ <tr style="height:40px"><td colspan="2"><hr/></td></tr>
+ </tr>
+ {% endfor %}
+ </table>
+{% endif %}