summaryrefslogtreecommitdiff
path: root/templates/mod
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-03 19:05:25 -0400
committerczaks <marcin@6irc.net>2013-08-03 19:05:25 -0400
commita0855cdcf5634d64fbb1ba294b05c8365ce37338 (patch)
treefa1217beedf487c321405432ea746343ec6afcec /templates/mod
parent7d5fef9ace3bba46de40604b04ea2dee1dac7cb3 (diff)
parenta3fbff225927469e68efc7ab31977736f34c7480 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: inc/config.php inc/functions.php templates/generic_page.html templates/index.html
Diffstat (limited to 'templates/mod')
-rw-r--r--templates/mod/config-editor-php.html44
-rw-r--r--templates/mod/config-editor.html29
2 files changed, 53 insertions, 20 deletions
diff --git a/templates/mod/config-editor-php.html b/templates/mod/config-editor-php.html
index 54c398e4..4f76b5dd 100644
--- a/templates/mod/config-editor-php.html
+++ b/templates/mod/config-editor-php.html
@@ -1,17 +1,35 @@
-{% if readonly %}
- <p style="text-align:center;max-width:800px;margin:20px auto">Tinyboard does not have the required permissions to edit <strong>inc/instance-config.php</strong>. To make changes, you will need to change the file's permissions first or manually edit the code.</p>
-{% endif %}
-
-
-{% if not readonly %}<form method="post" action="">{% endif %}
- <textarea name="code" id="code" style="display:block; margin:auto;width:100%;max-width:800px;height:500px{% if readonly %};background:#eee" readonly{% else %}"{% endif %}>
- {{ php }}
- </textarea>
+<div style="max-width:800px;margin:auto">
+ <p>
+ Any changes you make here will simply be appended to <code>{{ file }}</code>. If you wish to make the most of Tinyboard's customizability, you can instead edit the file directly. This page is intended for making quick changes and for those who don't have a basic understanding of PHP code.
+ </p>
+ {% if boards|count %}
+ <ul>
+ {% if board %}
+ <li><a href="?/config">Edit site-wide config</a></li>
+ {% endif %}
+ {% for _board in boards if _board.uri != board %}
+ <li>
+ <a href="?/config/{{ _board.uri }}">Edit config for {{ config.board_abbreviation|sprintf(_board.uri) }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
+ {% if readonly %}
+ <p>Tinyboard does not have the required permissions to edit <code>{{ file }}</code>. To make changes, you will need to change the file's permissions first or manually edit the code.</p>
+ {% endif %}
+
- <ul style="padding:0;text-align:center;list-style:none">
- <li><input name="save" type="submit" value="{% trans 'Save changes' %}"{% if readonly %} disabled{% endif %}></li>
- </ul>
-{% if not readonly %}</form>{% endif %}
+ {% if not readonly %}<form method="post" action="">{% endif %}
+ <textarea name="code" id="code" style="margin:auto;width:100%;height:500px{% if readonly %};background:#eee" readonly{% else %}"{% endif %}>
+ {{ php }}
+ </textarea>
+
+ <ul style="padding:0;text-align:center;list-style:none">
+ <li><input name="save" type="submit" value="{% trans 'Save changes' %}"{% if readonly %} disabled{% endif %}></li>
+ </ul>
+ {% if not readonly %}</form>{% endif %}
+</div>
<script type="text/javascript">
var observe;
diff --git a/templates/mod/config-editor.html b/templates/mod/config-editor.html
index 41e01dad..a43f8cf7 100644
--- a/templates/mod/config-editor.html
+++ b/templates/mod/config-editor.html
@@ -1,10 +1,25 @@
+<p>
+ Any changes you make here will simply be appended to <code>{{ file }}</code>. If you wish to make the most of Tinyboard's customizability, you can instead edit the file directly. This page is intended for making quick changes and for those who don't have a basic understanding of PHP code.
+</p>
+{% if boards|count %}
+ <ul>
+ {% if board %}
+ <li><a href="?/config">Edit site-wide config</a></li>
+ {% endif %}
+ {% for _board in boards if _board.uri != board %}
+ <li>
+ <a href="?/config/{{ _board.uri }}">Edit config for {{ config.board_abbreviation|sprintf(_board.uri) }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+{% endif %}
<form method="post" action="">
<table class="mod config-editor">
<tr>
- <th class="minimal">Name</th>
- <th>Value</th>
- <th class="minimal">Type</th>
- <th>Description</th>
+ <th class="minimal">{% trans 'Name' %}</th>
+ <th>{% trans 'Value' %}</th>
+ <th class="minimal">{% trans 'Type' %}</th>
+ <th>{% trans 'Description' %}</th>
</tr>
{% for var in conf if var.type != 'array' %}
{% if var.name|count == 1 %}
@@ -25,7 +40,7 @@
<td>
{% if var.type == 'string' %}
<input name="{{ name }}" type="text" value="{{ var.value|e }}">
- {% elseif var.type == 'integer' and var.name.0 == 'mod' and (var.default in ['JANITOR', 'MOD', 'ADMIN', 'DISABLED'] or var.default|slice(0, 14) == "$config['mod']") and var.value <= constant('DISABLED') %}
+ {% elseif var.permissions %}
<select name="{{ name }}">
<option value="{{ constant('JANITOR') }}"{% if var.value == constant('JANITOR')%} selected{% endif %}>JANITOR</option>
<option value="{{ constant('MOD') }}"{% if var.value == constant('MOD')%} selected{% endif %}>MOD</option>
@@ -49,8 +64,8 @@
{{ var.type|e }}
</td>
- <td>
- {{ var.comment|join('<br>') }}
+ <td style="word-wrap:break-word;width:50%">
+ {{ var.comment|join(' ') }}
</td>
</tr>
{% endfor %}