diff options
author | Vitaly Takmazov | 2017-07-28 11:49:44 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-07-28 11:49:44 +0300 |
commit | f071e05f3af563d799ddf6b89f7ad36e891f8f71 (patch) | |
tree | 0847eee33d21bb6c4281e7ad2f752c479411e152 | |
parent | 2c8f52596181397755e371605a2533d9ee70925d (diff) |
www: refactor templates
-rw-r--r-- | juick-www/src/main/webapp/WEB-INF/views/blog.html | 57 | ||||
-rw-r--r-- | juick-www/src/main/webapp/WEB-INF/views/index.html | 57 | ||||
-rw-r--r-- | juick-www/src/main/webapp/WEB-INF/views/partial/message.html | 56 |
3 files changed, 58 insertions, 112 deletions
diff --git a/juick-www/src/main/webapp/WEB-INF/views/blog.html b/juick-www/src/main/webapp/WEB-INF/views/blog.html index 3b4bf6c4..8d241c82 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/blog.html +++ b/juick-www/src/main/webapp/WEB-INF/views/blog.html @@ -8,62 +8,7 @@ <p class="page"><a href="/tag/{{ paramTag.name | urlencode }}">← Все записи с тегом <b>{{ paramTag.name | escape }}</b></a></p> {% endif %} {% for msg in msgs %} -<article data-mid="{{ msg.mid }}"> - <header class="h">@<a href="/{{ msg.user.name }}/">{{ msg.user.name }}</a>: - <div class="msg-avatar"><a href="/{{ msg.user.name }}/"> - <img src="//i.juick.com/a/{{ msg.user.uid }}.png" alt="{{ msg.user.name }}"/></a></div> - <div class="msg-menu"><a href="#"></a></div> - <div class="msg-ts"> - <a href="/{{ msg.user.name }}/{{ msg.mid }}"> - <time datetime="{{ msg.date | date('yyyy-MM-dd HH:mm:ss') }}Z" - title="{{ msg.date | date('yyyy-MM-dd HH:mm:ss') }} GMT"> - {{ msg.date | prettyTime }} - </time> - </a> - </div> - <div class="msg-tags"> - {{ tags(msg.user.name, msg.tags | tagsList) }} - </div> - </header> - <p>{{ msg | formatMessage }}</p> - {% if msg.AttachmentType is not empty %} - <p class="ir"><a href="//i.juick.com/p/{{ msg.mid }}.{{ msg.AttachmentType }}" data-fname="{{ msg.mid }}.{{ msg.AttachmentType }}"> - <img src="//i.juick.com/photos-512/{{ msg.mid }}.{{ msg.AttachmentType }}" alt=""/></a> - </p> - {% endif %} - <nav class="l"> - {% if visitor.uid != msg.user.uid %} - {% if visitor.uid > 0 %} - <a href="/post?body=!+%23{{ msg.mid }}" class="a-like">{{ i18n("messages","message.recommend") }}</a> - {% else %} - <a href="/login" class="a-login">{{ i18n("messages","message.recommend") }}</a> - {% endif %} - {% endif %} - {% if (visitor.uid > 0 and not msg.ReadOnly) or (visitor.uid == msg.user.uid) %} - <a href="/{{ msg.mid }}" class="a-comment">{{ i18n("messages","message.comment") }}</a> - {% elseif visitor.uid == 0 and not msg.ReadOnly %} - <a href="/login" class="a-login">{{ i18n("messages","message.comment") }}</a> - {% endif %} - {% if msg.FriendsOnly %} - <a href="#" class="a-privacy">Открыть доступ</a> - {% endif %} - {% if isModerator %} - <a href="#" class="a-popular-plus">+</a> - <a href="#" class="a-popular-minus">-</a> - <a href="#" class="a-popular-delete">x</a> - {% endif %} - </nav> - <nav class="s"> - {% if msg.Likes > 0 %} - <a href="/{{ msg.user.name }}/{{ msg.mid }}" class="likes"> - <i data-icon="ei-heart" data-size="s"></i> {{ msg.Likes }}</a> - {% endif %} - {% if msg.Replies > 0 %} - <a href="/{{ msg.user.name }}/{{ msg.mid }}" class="replies"> - <i data-icon="ei-comment" data-size="s"></i> {{ msg.Replies }}</a> - {% endif %} - </nav> -</article> +{% include "views/partial/message" %} {% endfor %} {% if (next | default('')) is not empty %} {{ next | raw }} diff --git a/juick-www/src/main/webapp/WEB-INF/views/index.html b/juick-www/src/main/webapp/WEB-INF/views/index.html index 5d2ee553..6bf81cac 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/index.html +++ b/juick-www/src/main/webapp/WEB-INF/views/index.html @@ -8,62 +8,7 @@ {% include "views/partial/newmessage" %} {% endif %} {% for msg in msgs %} -<article data-mid="{{ msg.mid }}"> - <header class="h">@<a href="/{{ msg.user.name }}/">{{ msg.user.name }}</a>: - <div class="msg-avatar"><a href="/{{ msg.user.name }}/"> - <img src="//i.juick.com/a/{{ msg.user.uid }}.png" alt="{{ msg.user.name }}"/></a></div> - <div class="msg-menu"><a href="#"></a></div> - <div class="msg-ts"> - <a href="/{{ msg.user.name }}/{{ msg.mid }}"> - <time datetime="{{ msg.date | date('yyyy-MM-dd HH:mm:ss')}}Z" - title="{{msg.date | date('yyyy-MM-dd HH:mm:ss')}} GMT"> - {{ msg.date | prettyTime }} - </time> - </a> - </div> - <div class="msg-tags"> - {{ tags(msg.user.name, msg.tags | tagsList ) }} - </div> - </header> - <p>{{ msg | formatMessage }}</p> - {% if msg.AttachmentType is not empty %} - <p class="ir"><a href="//i.juick.com/p/{{ msg.mid }}.{{ msg.AttachmentType }}" data-fname="{{ msg.mid }}.{{ msg.AttachmentType }}"> - <img src="//i.juick.com/photos-512/{{ msg.mid }}.{{ msg.AttachmentType }}" alt=""/></a> - </p> - {% endif %} - <nav class="l"> - {% if visitor.uid != msg.user.uid %} - {% if visitor.uid > 0 %} - <a href="/post?body=!+%23{{ msg.mid }}" class="a-like">{{ i18n("messages","message.recommend") }}</a> - {% else %} - <a href="/login" class="a-login">{{ i18n("messages","message.recommend") }}</a> - {% endif %} - {% endif %} - {% if (visitor.uid > 0 and not msg.ReadOnly) or (visitor.uid == msg.user.uid) %} - <a href="/{{ msg.mid }}" class="a-comment">{{ i18n("messages","message.comment") }}</a> - {% elseif visitor.uid == 0 and not msg.ReadOnly %} - <a href="/login" class="a-login">{{ i18n("messages","message.comment") }}</a> - {% endif %} - {% if msg.FriendsOnly %} - <a href="#" class="a-privacy">Открыть доступ</a> - {% endif %} - {% if isModerator %} - <a href="#" class="a-popular-plus">+</a> - <a href="#" class="a-popular-minus">-</a> - <a href="#" class="a-popular-delete">x</a> - {% endif %} - </nav> - <nav class="s"> - {% if msg.Likes > 0 %} - <a href="/{{ msg.user.name }}/{{ msg.mid }}" class="likes"> - <i data-icon="ei-heart" data-size="s"></i> {{ msg.Likes }}</a> - {% endif %} - {% if msg.Replies > 0 %} - <a href="/{{ msg.user.name }}/{{ msg.mid }}" class="replies"> - <i data-icon="ei-comment" data-size="s"></i> {{ msg.Replies }}</a> - {% endif %} - </nav> -</article> +{% include "views/partial/message" %} {% endfor %} {{ next | default ('') | raw }} {% endblock %} diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/message.html b/juick-www/src/main/webapp/WEB-INF/views/partial/message.html new file mode 100644 index 00000000..cdfad6b6 --- /dev/null +++ b/juick-www/src/main/webapp/WEB-INF/views/partial/message.html @@ -0,0 +1,56 @@ +<article data-mid="{{ msg.mid }}"> + <header class="h">@<a href="/{{ msg.user.name }}/">{{ msg.user.name }}</a>: + <div class="msg-avatar"><a href="/{{ msg.user.name }}/"> + <img src="//i.juick.com/a/{{ msg.user.uid }}.png" alt="{{ msg.user.name }}"/></a></div> + <div class="msg-menu"><a href="#"></a></div> + <div class="msg-ts"> + <a href="/{{ msg.user.name }}/{{ msg.mid }}"> + <time datetime="{{ msg.date | date('yyyy-MM-dd HH:mm:ss') }}Z" + title="{{ msg.date | date('yyyy-MM-dd HH:mm:ss') }} GMT"> + {{ msg.date | prettyTime }} + </time> + </a> + </div> + <div class="msg-tags"> + {{ tags(msg.user.name, msg.tags | tagsList) }} + </div> + </header> + <p>{{ msg | formatMessage }}</p> + {% if msg.AttachmentType is not empty %} + <p class="ir"><a href="//i.juick.com/p/{{ msg.mid }}.{{ msg.AttachmentType }}" data-fname="{{ msg.mid }}.{{ msg.AttachmentType }}"> + <img src="//i.juick.com/photos-512/{{ msg.mid }}.{{ msg.AttachmentType }}" alt=""/></a> + </p> + {% endif %} + <nav class="l"> + {% if visitor.uid != msg.user.uid %} + {% if visitor.uid > 0 %} + <a href="/post?body=!+%23{{ msg.mid }}" class="a-like">{{ i18n("messages","message.recommend") }}</a> + {% else %} + <a href="/login" class="a-login">{{ i18n("messages","message.recommend") }}</a> + {% endif %} + {% endif %} + {% if (visitor.uid > 0 and not msg.ReadOnly) or (visitor.uid == msg.user.uid) %} + <a href="/{{ msg.mid }}" class="a-comment">{{ i18n("messages","message.comment") }}</a> + {% elseif visitor.uid == 0 and not msg.ReadOnly %} + <a href="/login" class="a-login">{{ i18n("messages","message.comment") }}</a> + {% endif %} + {% if msg.FriendsOnly %} + <a href="#" class="a-privacy">Открыть доступ</a> + {% endif %} + {% if isModerator %} + <a href="#" class="a-popular-plus">+</a> + <a href="#" class="a-popular-minus">-</a> + <a href="#" class="a-popular-delete">x</a> + {% endif %} + </nav> + <nav class="s"> + {% if msg.Likes > 0 %} + <a href="/{{ msg.user.name }}/{{ msg.mid }}" class="likes"> + <i data-icon="ei-heart" data-size="s"></i> {{ msg.Likes }}</a> + {% endif %} + {% if msg.Replies > 0 %} + <a href="/{{ msg.user.name }}/{{ msg.mid }}" class="replies"> + <i data-icon="ei-comment" data-size="s"></i> {{ msg.Replies }}</a> + {% endif %} + </nav> +</article>
\ No newline at end of file |