mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-12 01:50:48 +01:00
modularize post templates a little more
This commit is contained in:
parent
c4317cdbf7
commit
59874b8376
3
templates/post/ip.html
Normal file
3
templates/post/ip.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
|
||||||
|
[<a class="ip-link" style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
|
||||||
|
{% endif %}
|
16
templates/post/name.html
Normal file
16
templates/post/name.html
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{% set capcode = post.capcode|capcode %}
|
||||||
|
{% if post.email|length > 0 %}
|
||||||
|
{# start email #}
|
||||||
|
<a class="email" href="mailto:{{ post.email }}">
|
||||||
|
{% endif %}
|
||||||
|
<span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name|bidi_cleanup }}</span>
|
||||||
|
{% if post.trip|length > 0 %}
|
||||||
|
<span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %}class="trip">{{ post.trip }}</span>
|
||||||
|
{% endif %}
|
||||||
|
{% if post.email|length > 0 %}
|
||||||
|
{# end email #}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if capcode %}
|
||||||
|
{{ capcode.cap }}
|
||||||
|
{% endif %}
|
3
templates/post/poster_id.html
Normal file
3
templates/post/poster_id.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% if config.poster_ids %}
|
||||||
|
ID: {{ post.ip|poster_id(post.id) }}
|
||||||
|
{% endif %}
|
5
templates/post/subject.html
Normal file
5
templates/post/subject.html
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{% if post.subject|length > 0 %}
|
||||||
|
{# show subject #}
|
||||||
|
<span class="subject">{{ post.subject|bidi_cleanup }}</span>
|
||||||
|
{% endif %}
|
||||||
|
|
1
templates/post/time.html
Normal file
1
templates/post/time.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<time datetime="{{ post.time|date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }}">{{ post.time|date(config.post_date) }}</time>
|
@ -5,35 +5,14 @@
|
|||||||
<p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}>
|
<p class="intro"{% if not index %} id="{{ post.id }}"{% endif %}>
|
||||||
<input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
|
<input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
|
||||||
<label for="delete_{{ post.id }}">
|
<label for="delete_{{ post.id }}">
|
||||||
{% if post.subject|length > 0 %}
|
{% include 'post/subject.html' %}
|
||||||
{# show subject #}
|
{% include 'post/name.html' %}
|
||||||
<span class="subject">{{ post.subject|bidi_cleanup }}</span>
|
{% include 'post/ip.html' %}
|
||||||
{% endif %}
|
|
||||||
{% if post.email|length > 0 %}
|
|
||||||
{# start email #}
|
|
||||||
<a class="email" href="mailto:{{ post.email }}">
|
|
||||||
{% endif %}
|
|
||||||
{% set capcode = post.capcode|capcode %}
|
|
||||||
<span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name|bidi_cleanup }}</span>
|
|
||||||
{% if post.trip|length > 0 %}
|
|
||||||
<span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %}class="trip">{{ post.trip }}</span>
|
|
||||||
{% endif %}
|
|
||||||
{% if post.email|length > 0 %}
|
|
||||||
{# end email #}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
{% if capcode %}
|
|
||||||
{{ capcode.cap }}
|
|
||||||
{% endif %}
|
|
||||||
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
|
|
||||||
[<a class="ip-link" style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
|
|
||||||
{% endif %}
|
|
||||||
{% include 'post/flag.html' %}
|
{% include 'post/flag.html' %}
|
||||||
<time datetime="{{ post.time|date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }}">{{ post.time|date(config.post_date) }}</time>
|
{% include 'post/time.html' %}
|
||||||
</label>
|
</label>
|
||||||
{% if config.poster_ids %}
|
{% include 'post/poster_id.html' %}
|
||||||
ID: {{ post.ip|poster_id(post.thread) }}
|
|
||||||
{% endif %}
|
|
||||||
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? highlightReply({{ post.id }}) : true;" href="{{ post.link }}">No.</a>
|
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? highlightReply({{ post.id }}) : true;" href="{{ post.link }}">No.</a>
|
||||||
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? citeReply({{ post.id }}) : true;" href="{{ post.link('q') }}">
|
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? citeReply({{ post.id }}) : true;" href="{{ post.link('q') }}">
|
||||||
{{ post.id }}
|
{{ post.id }}
|
||||||
|
@ -36,35 +36,13 @@
|
|||||||
<div class="post op"><p class="intro"{% if not index %} id="{{ post.id }}"{% 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 }}" />
|
<input type="checkbox" class="delete" name="delete_{{ post.id }}" id="delete_{{ post.id }}" />
|
||||||
<label for="delete_{{ post.id }}">
|
<label for="delete_{{ post.id }}">
|
||||||
{% if post.subject|length > 0 %}
|
{% include 'post/subject.html' %}
|
||||||
{# show subject #}
|
{% include 'post/name.html' %}
|
||||||
<span class="subject">{{ post.subject|bidi_cleanup }}</span>
|
{% include 'post/ip.html' %}
|
||||||
{% endif %}
|
|
||||||
{% if post.email|length > 0 %}
|
|
||||||
{# start email #}
|
|
||||||
<a class="email" href="mailto:{{ post.email }}">
|
|
||||||
{% endif %}
|
|
||||||
{% set capcode = post.capcode|capcode %}
|
|
||||||
<span {% if capcode.name %}style="{{ capcode.name }}" {% endif %}class="name">{{ post.name|bidi_cleanup }}</span>
|
|
||||||
{% if post.trip|length > 0 %}
|
|
||||||
<span {% if capcode.trip %}style="{{ capcode.trip }}" {% endif %}class="trip">{{ post.trip }}</span>
|
|
||||||
{% endif %}
|
|
||||||
{% if post.email|length > 0 %}
|
|
||||||
{# end email #}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
{% if capcode %}
|
|
||||||
{{ capcode.cap }}
|
|
||||||
{% endif %}
|
|
||||||
{% if post.mod and post.mod|hasPermission(config.mod.show_ip, board.uri) %}
|
|
||||||
[<a class="ip-link" style="margin:0;" href="?/IP/{{ post.ip }}">{{ post.ip }}</a>]
|
|
||||||
{% endif %}
|
|
||||||
{% include 'post/flag.html' %}
|
{% include 'post/flag.html' %}
|
||||||
<time datetime="{{ post.time|date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }}">{{ post.time|date(config.post_date) }}</time>
|
{% include 'post/time.html' %}
|
||||||
</label>
|
</label>
|
||||||
{% if config.poster_ids %}
|
{% include 'post/poster_id.html' %}
|
||||||
ID: {{ post.ip|poster_id(post.id) }}
|
|
||||||
{% endif %}
|
|
||||||
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? highlightReply({{ post.id }}) : true;" href="{{ post.link }}">No.</a>
|
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? highlightReply({{ post.id }}) : true;" href="{{ post.link }}">No.</a>
|
||||||
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? citeReply({{ post.id }}) : true;" href="{{ post.link('q') }}">
|
<a class="post_no" onclick="return document.querySelectorAll('div.banner').length ? citeReply({{ post.id }}) : true;" href="{{ post.link('q') }}">
|
||||||
{{ post.id }}
|
{{ post.id }}
|
||||||
|
Loading…
Reference in New Issue
Block a user