summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-10-05 23:53:43 +1100
committerSavetheinternet <savetheinternet@tinyboard.org>2011-10-05 23:53:43 +1100
commit0629bf68f7eee1fd88d9227124b93a984c1868b9 (patch)
treec00a77d2bd4f9fb8b8efb3e42271d517b33579cd /templates
parent5582b5599ef0aefc7114da7890795baf8e6b683f (diff)
use template files instead of hardcoded HTML for generating psots
Diffstat (limited to 'templates')
-rw-r--r--templates/index.html2
-rw-r--r--templates/post_reply.html98
-rw-r--r--templates/post_thread.html128
-rw-r--r--templates/thread.html2
4 files changed, 228 insertions, 2 deletions
diff --git a/templates/index.html b/templates/index.html
index 6e978f2d..8cd21eb0 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -137,7 +137,7 @@
{% if config.blotter %}<hr /><div class="blotter">{{ config.blotter }}</div>{% endif %}
<hr />
- <form name="postcontrols" action="{{ post_url }}" method="post">
+ <form name="postcontrols" action="{{ config.post_url }}" method="post">
<input type="hidden" name="board" value="{{ board.uri }}" />
{% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
{{ body }}
diff --git a/templates/post_reply.html b/templates/post_reply.html
new file mode 100644
index 00000000..a8ed151a
--- /dev/null
+++ b/templates/post_reply.html
@@ -0,0 +1,98 @@
+{% filter remove_whitespace %}
+{# tabs and new lines will be ignored #}
+<div class="post reply" id="reply_{{ post.id }}">
+
+<p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}>
+ <input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
+ <label for="delete_{{ post.id }}">
+ {% if post.subject|length > 0 %}
+ {# show subject #}
+ <span class="subject">{{ post.subject }}</span>
+ {% endif %}
+ {% if post.email|length > 0 %}
+ {# start email #}
+ <a class="email" href="mailto:{{ post.email }}">
+ {% endif %}
+ <span class="name">{{ post.name }}</span>
+ {% if post.trip|length > 0 %}
+ <span class="trip">{{ post.trip }}</span>
+ {% endif %}
+ {% if post.email|length > 0 %}
+ {# end email #}
+ </a>
+ {% endif %}
+ {% if post.capcode|length > 0 %}
+ {# show capcode #}
+ {{ post.capcode|capcode }}
+ {% endif %}
+ {% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
+ [<a style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
+ {% endif %}
+ {{ post.time|date(config.post_date) }}
+ </label>
+ {% if config.poster_ids %}
+ ID: {{ post.ip|poster_id(post.id) }}
+ {% endif %}
+ <a class="post_no" href="{{ post.link }}">No.</a>
+ <a class="post_no"
+ {% if not index %}
+ onclick="citeReply({{ post.id }});"
+ {% endif %}
+ href="{% if index %}
+ {{ post.link('q') }}
+ {% else %}
+ javascript:void(0);
+ {% endif %}">
+ {{ post.id }}
+ </a>
+
+ {% if post.embed %}
+ {{ post.embed }}
+ {% elseif post.file == 'deleted' %}
+ <img src="{{ config.image_deleted }}" alt="" />
+ {% elseif post.file and post.file %}
+ <p class="fileinfo">File: <a href="{{ config.uri_img }}{{ post.file }}">{{ post.file }}</a> <span class="unimportant">
+ (
+ {% if post.thumb == 'spoiler' %}
+ Spoiler Image,
+ {% endif %}
+ {{ post.filesize|filesize }}
+ {% if post.filex and post.filey %}
+ , {{ post.filex}}x{{ post.filey }}
+ {% if config.show_ratio %}
+ , {{ post.ratio }}
+ {% endif %}
+ {% endif %}
+ {% if config.show_filename %}
+ ,
+ {% if post.filename|length > config.max_filename_display %}
+ <span title="{{ post.filename }}">{{ post.filename|truncate(config.max_filename_display) }}</span>
+ {% else %}
+ {{ post.filename }}
+ {% endif %}
+ {% endif %}
+ )
+ </span></p>
+ <a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if this.thumb == 'file' %} class="file"{% endif %}>
+ <img src="
+ {% if post.thumb == 'file' %}
+ {{ config.root }}
+ {% if config.file_icons[post.filename|extension] %}
+ {{ config.file_thumb|sprintf(config.file_icons[post.filename|extension]) }}
+ {% else %}
+ {{ config.file_thumb|sprintf(config.file_icons.default) }}
+ {% endif %}
+ {% elseif post.thumb == 'spoiler' %}
+ {{ config.root }}{{ config.spoiler_image }}
+ {% else %}
+ {{ config.uri_thumb }}{{ post.thumb }}
+ {% endif %}" style="width:{{ post.thumbx }}px;height:{{ post.thumby }}px" alt="" /></a>
+ {% endif %}
+
+ {{ post.postControls }}
+ <p class="body">
+ {% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
+ </p>
+</div>
+<br/>
+{% endfilter %}
diff --git a/templates/post_thread.html b/templates/post_thread.html
new file mode 100644
index 00000000..6caff826
--- /dev/null
+++ b/templates/post_thread.html
@@ -0,0 +1,128 @@
+{% filter remove_whitespace %}
+{# tabs and new lines will be ignored #}
+
+{% if post.embed %}
+ {{ post.embed }}
+{% elseif post.file == 'deleted' %}
+ <img src="{{ config.image_deleted }}" alt="" />
+{% elseif post.file and post.file %}
+ <p class="fileinfo">File: <a href="{{ config.uri_img }}{{ post.file }}">{{ post.file }}</a> <span class="unimportant">
+ (
+ {% if post.thumb == 'spoiler' %}
+ Spoiler Image,
+ {% endif %}
+ {{ post.filesize|filesize }}
+ {% if post.filex and post.filey %}
+ , {{ post.filex}}x{{ post.filey }}
+ {% if config.show_ratio %}
+ , {{ post.ratio }}
+ {% endif %}
+ {% endif %}
+ {% if config.show_filename %}
+ ,
+ {% if post.filename|length > config.max_filename_display %}
+ <span title="{{ post.filename }}">{{ post.filename|truncate(config.max_filename_display) }}</span>
+ {% else %}
+ {{ post.filename }}
+ {% endif %}
+ {% endif %}
+ )
+ </span></p>
+<a href="{{ config.uri_img }}{{ post.file }}" target="_blank"{% if this.thumb == 'file' %} class="file"{% endif %}>
+<img src="
+ {% if post.thumb == 'file' %}
+ {{ config.root }}
+ {% if config.file_icons[post.filename|extension] %}
+ {{ config.file_thumb|sprintf(config.file_icons[post.filename|extension]) }}
+ {% else %}
+ {{ config.file_thumb|sprintf(config.file_icons.default) }}
+ {% endif %}
+ {% elseif post.thumb == 'spoiler' %}
+ {{ config.root }}{{ config.spoiler_image }}
+ {% else %}
+ {{ config.uri_thumb }}{{ post.thumb }}
+ {% endif %}" style="width:{{ post.thumbx }}px;height:{{ post.thumby }}px" alt="" /></a>
+{% endif %}
+<div class="post op"><p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}>
+ <input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
+ <label for="delete_{{ post.id }}">
+ {% if post.subject|length > 0 %}
+ {# show subject #}
+ <span class="subject">{{ post.subject }}</span>
+ {% endif %}
+ {% if post.email|length > 0 %}
+ {# start email #}
+ <a class="email" href="mailto:{{ post.email }}">
+ {% endif %}
+ <span class="name">{{ post.name }}</span>
+ {% if post.trip|length > 0 %}
+ <span class="trip">{{ post.trip }}</span>
+ {% endif %}
+ {% if post.email|length > 0 %}
+ {# end email #}
+ </a>
+ {% endif %}
+ {% if post.capcode|length > 0 %}
+ {# show capcode #}
+ {{ post.capcode|capcode }}
+ {% endif %}
+ {% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
+ [<a style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
+ {% endif %}
+ {{ post.time|date(config.post_date) }}
+ </label>
+ {% if config.poster_ids %}
+ ID: {{ post.ip|poster_id(post.id) }}
+ {% endif %}
+ <a class="post_no" href="{{ post.link }}">No.</a>
+ <a class="post_no"
+ {% if not index %}
+ onclick="citeReply({{ post.id }});"
+ {% endif %}
+ href="{% if index %}
+ {{ post.link('q') }}
+ {% else %}
+ javascript:void(0);
+ {% endif %}">
+ {{ post.id }}
+ </a>
+ {% if post.sticky %}
+ <img class="icon" title="Sticky" src="{{ config.image_sticky }}" alt="Sticky" />
+ {% endif %}
+ {% if post.locked %}
+ <img class="icon" title="Locked" src="{{ config.image_locked }}" alt="Locked" />
+ {% endif %}
+ {% if index %}
+ <a href="{{ post.root }}{{ board.dir }}{{ config.dir.res }}{{ config.file_page|sprintf(post.id) }}">[Reply]</a>
+ {% endif %}
+ {{ post.postControls }}
+ <p class="body">
+ {% endfilter %}{% if index %}{{ post.body|truncate_body(post.link) }}{% else %}{{ post.body }}{% endif %}{% filter remove_whitespace %}
+ </p>
+ {% if post.omitted or post.omitted_images %}
+ <span class="omitted">
+ {% if post.omitted %}
+ {{ post.omitted }} post
+ {% if post.omitted != 1 %}
+ s
+ {% endif %}
+ {% if post.omitted_images %}
+ and
+ {% endif %}
+ {% endif %}
+ {% if post.omitted_images %}
+ {{ post.omitted_images }} image repl
+ {% if post.omitted_images == 1 %}
+ y
+ {% else %}
+ ies
+ {% endif %}
+ {% endif %} omitted. Click reply to view.
+ </span>
+ {% endif %}
+</div>{% endfilter %}
+{% for post in post.posts %}
+ {% include 'post_reply.html' %}
+{% endfor %}
+<br class="clear"/>{% if post.hr %}<hr/>{% endif %}
+
diff --git a/templates/thread.html b/templates/thread.html
index 047cd201..6884d817 100644
--- a/templates/thread.html
+++ b/templates/thread.html
@@ -130,7 +130,7 @@
{% if config.blotter %}<hr /><div class="blotter">{{ config.blotter }}</div>{% endif %}
<hr />
- <form name="postcontrols" action="{{ post_url }}" method="post">
+ <form name="postcontrols" action="{{ config.post_url }}" method="post">
<input type="hidden" name="board" value="{{ board.uri }}" />
{% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
{{ body }}