diff options
| author | czaks <marcin@6irc.net> | 2013-08-03 19:05:25 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-08-03 19:05:25 -0400 |
| commit | a0855cdcf5634d64fbb1ba294b05c8365ce37338 (patch) | |
| tree | fa1217beedf487c321405432ea746343ec6afcec /templates | |
| parent | 7d5fef9ace3bba46de40604b04ea2dee1dac7cb3 (diff) | |
| parent | a3fbff225927469e68efc7ab31977736f34c7480 (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')
| -rw-r--r-- | templates/error.html | 18 | ||||
| -rw-r--r-- | templates/generic_page.html | 3 | ||||
| -rw-r--r-- | templates/index.html | 2 | ||||
| -rw-r--r-- | templates/installer/check-requirements.html | 10 | ||||
| -rw-r--r-- | templates/installer/config.html | 95 | ||||
| -rw-r--r-- | templates/mod/config-editor-php.html | 44 | ||||
| -rw-r--r-- | templates/mod/config-editor.html | 29 | ||||
| -rw-r--r-- | templates/post_form.html | 3 | ||||
| -rw-r--r-- | templates/thread.html | 2 |
9 files changed, 178 insertions, 28 deletions
diff --git a/templates/error.html b/templates/error.html new file mode 100644 index 00000000..3b8eb693 --- /dev/null +++ b/templates/error.html @@ -0,0 +1,18 @@ +<div style="text-align:center"> + <h2 style="margin:20px 0">{{ message }}</h2> + {% if board %} + <p> + <a href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.file_index }}"> + {% trans 'Go back' %} + </a> + </p> + {% endif %} +</div> +{% if debug and config.debug %} + <hr> + <h3>{% trans 'Error information' %}</h3> + <pre style="white-space:pre-wrap;font-size: 10px;"> + {{ debug }} + </pre> + <hr> +{% endif %}
\ No newline at end of file diff --git a/templates/generic_page.html b/templates/generic_page.html index 41300f6b..70cb15aa 100644 --- a/templates/generic_page.html +++ b/templates/generic_page.html @@ -22,7 +22,8 @@ {% include 'attention_bar.html' %} {% include 'post_form.html' %} - {% if config.blotter %}<hr /><div class="blotter">{{ config.blotter }}</div>{% endif %} + + {% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %} <hr /> <form name="postcontrols" action="{{ config.post_url }}" method="post"> <input type="hidden" name="board" value="{{ board.uri }}" /> diff --git a/templates/index.html b/templates/index.html index f01d6851..12150d0b 100644 --- a/templates/index.html +++ b/templates/index.html @@ -38,7 +38,7 @@ {% include 'boardlist.html' %} {% endif %} - {% if config.blotter %}<hr /><div class="blotter">{{ config.blotter }}</div>{% endif %} + {% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %} <hr /> <form name="postcontrols" action="{{ config.post_url }}" method="post"> <input type="hidden" name="board" value="{{ board.uri }}" /> diff --git a/templates/installer/check-requirements.html b/templates/installer/check-requirements.html index fea6fed8..b6003f3a 100644 --- a/templates/installer/check-requirements.html +++ b/templates/installer/check-requirements.html @@ -14,14 +14,14 @@ <td>{{ test.name }}</td> <td class="minimal" style="text-align:center"> {% if test.result %} - <i style="color:#090" class="icon-check-sign"></i> + <i style="font-size:11pt;color:#090" class="icon-check-sign"></i> {% else %} {% if test.required %} {% set errors = errors + 1 %} - <i style="color:#d00" class="icon-exclamation-sign"></i> + <i style="font-size:11pt;color:#d00" class="icon-exclamation-sign"></i> {% else %} {% set warnings = warnings + 1 %} - <i style="color:#f80" class="icon-warning-sign"></i> + <i style="font-size:11pt;color:#f80" class="icon-warning-sign"></i> {% endif %} {% endif %} </td> @@ -34,9 +34,9 @@ {% for test in tests if not test.result%} <li style="margin-bottom:5px"> {% if test.required %} - <i style="color:#d00" class="icon-exclamation-sign"></i> <strong>Error:</strong> + <i style="font-size:11pt;color:#d00" class="icon-exclamation-sign"></i> <strong>Error:</strong> {% else %} - <i style="color:#f80" class="icon-warning-sign"></i> <strong>Warning:</strong> + <i style="font-size:11pt;color:#f80" class="icon-warning-sign"></i> <strong>Warning:</strong> {% endif %} {{ test.message }} </li> diff --git a/templates/installer/config.html b/templates/installer/config.html new file mode 100644 index 00000000..193bb98b --- /dev/null +++ b/templates/installer/config.html @@ -0,0 +1,95 @@ +<form action="?step=3" method="post" autocomplete="off"> + <fieldset> + <legend>Database (MySQL)</legend> + <label for="db_server">Server:</label> + <input type="text" id="db_server" name="db[server]" value="{{ config.db.server }}"> + + <label for="db_db">Database:</label> + <input type="text" id="db_db" name="db[database]" value="{{ config.db.database }}"> + + <label for="db_prefix">Table prefix (optional):</label> + <input type="text" id="db_prefix" name="db[prefix]" value="{{ config.db.prefix }}"> + + <label for="db_user">Username:</label> + <input type="text" id="db_user" name="db[user]" value="{{ config.db.user }}"> + + <label for="db_pass">Password:</label> + <input type="password" id="db_pass" name="db[password]" value=""> + </fieldset> + <p style="text-align:center" class="unimportant">The following is all later configurable. For more options, <a href="http://tinyboard.org/docs/?p=Config">edit your configuration files</a> after installing.</p> + <fieldset> + <legend>Cookies</legend> + <label for="cookies_mod">Moderator cookie:</label> + <input type="text" id="cookies_mod" name="cookies[mod]" value="{{ config.cookies.mod }}"> + + <label for="cookies_salt">Secure salt:</label> + <input type="text" id="cookies_salt" name="cookies[salt]" value="{{ config.cookies.salt }}" size="40"> + </fieldset> + + <fieldset> + <legend>Flood control</legend> + <label for="flood_time">Seconds before each post:</label> + <input type="text" id="flood_time" name="flood_time" value="{{ config.flood_time }}"> + + <label for="flood_time_ip">Seconds before you can repost something (post the exact same text):</label> + <input type="text" id="flood_time_ip" name="flood_time_ip" value="{{ config.flood_time_ip }}"> + + <label for="flood_time_same">Same as above, but with a different IP address:</label> + <input type="text" id="flood_time_same" name="flood_time_same" value="{{ config.flood_time_same }}"> + + <label for="max_body">Maximum post body length:</label> + <input type="text" id="max_body" name="max_body" value="{{ config.max_body }}"> + + <label for="reply_limit">Replies in a thread before it can no longer be bumped:</label> + <input type="text" id="reply_limit" name="reply_limit" value="{{ config.reply_limit }}"> + + <label for="max_links">Maximum number of links in a single post:</label> + <input type="text" id="max_links" name="max_links" value="{{ config.max_links }}"> + </fieldset> + + <fieldset> + <legend>Images</legend> + <label for="max_filesize">Maximum image filesize (bytes):</label> + <input type="text" id="max_filesize" name="max_filesize" value="{{ config.max_filesize }}"> + + <label for="thumb_width">Thumbnail width:</label> + <input type="text" id="thumb_width" name="thumb_width" value="{{ config.thumb_width }}"> + + <label for="thumb_height">Thumbnail height:</label> + <input type="text" id="thumb_height" name="thumb_height" value="{{ config.thumb_height }}"> + + <label for="max_width">Maximum image width:</label> + <input type="text" id="max_width" name="max_width" value="{{ config.max_width }}"> + + <label for="max_height">Maximum image height:</label> + <input type="text" id="max_height" name="max_height" value="{{ config.max_height }}"> + </fieldset> + + <fieldset> + <legend>Display</legend> + <label for="threads_per_page">Threads per page:</label> + <input type="text" id="threads_per_page" name="threads_per_page" value="{{ config.threads_per_page }}"> + + <label for="max_pages">Page limit:</label> + <input type="text" id="max_pages" name="max_pages" value="{{ config.max_pages }}"> + + <label for="threads_preview">Number of replies to show per thread on the index page:</label> + <input type="text" id="threads_preview" name="threads_preview" value="{{ config.threads_preview }}"> + </fieldset> + + <fieldset> + <legend>Directories</legend> + <label for="root">Root URI (include trailing slash):</label> + <input type="text" id="root" name="root" value="{{ config.root }}" size="40"> + </fieldset> + + <fieldset> + <legend>Miscellaneous</legend> + <label for="secure_trip_salt">Secure trip (##) salt:</label> + <input type="text" id="secure_trip_salt" name="secure_trip_salt" value="{{ config.secure_trip_salt }}" size="40"> + </fieldset> + + <p style="text-align:center"> + <input type="submit" value="Complete installation"> + </p> +</form> 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 %} diff --git a/templates/post_form.html b/templates/post_form.html index 391f0657..12f1186b 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -4,6 +4,9 @@ {{ antibot.html() }} <input type="hidden" name="board" value="{{ board.uri }}"> {{ antibot.html() }} +{% if current_page %} + <input type="hidden" name="page" value="{{ current_page }}"> +{% endif %} {% if mod %}<input type="hidden" name="mod" value="1">{% endif %} <table> {% if not config.field_disable_name or (mod and post.mod|hasPermission(config.mod.bypass_field_disable, board.uri)) %}<tr> diff --git a/templates/thread.html b/templates/thread.html index 38be37ab..7fe60a39 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -30,7 +30,7 @@ {% include 'post_form.html' %} - {% if config.blotter %}<hr /><div class="blotter">{{ config.blotter }}</div>{% endif %} + {% if config.global_message %}<hr /><div class="blotter">{{ config.global_message }}</div>{% endif %} <hr /> <form name="postcontrols" action="{{ config.post_url }}" method="post"> <input type="hidden" name="board" value="{{ board.uri }}" /> |
