Make title in reply mode clickable to return to the topic page.

This commit is contained in:
flash 2018-12-30 04:07:42 +01:00
parent e3d4d41a9a
commit 28205006c5
3 changed files with 17 additions and 5 deletions

View file

@ -8,6 +8,12 @@
&__title { &__title {
font-size: 2em; font-size: 2em;
line-height: 1.5em; line-height: 1.5em;
color: inherit;
text-decoration: none;
&[href]:hover {
text-decoration: underline;
}
} }
&__input { &__input {

View file

@ -19,7 +19,7 @@
</div> </div>
{% endmacro %} {% endmacro %}
{% macro forum_header(title, breadcrumbs, omit_last_breadcrumb) %} {% macro forum_header(title, breadcrumbs, omit_last_breadcrumb, title_url) %}
<div class="container forum__header"> <div class="container forum__header">
{% if breadcrumbs is iterable and breadcrumbs|length > 0 %} {% if breadcrumbs is iterable and breadcrumbs|length > 0 %}
<div class="forum__header__breadcrumbs"> <div class="forum__header__breadcrumbs">
@ -38,9 +38,15 @@
{% endif %} {% endif %}
{% if title|length > 0 %} {% if title|length > 0 %}
<div class="forum__header__title"> {% if title_url|length > 0 %}
{{ title }} <a class="forum__header__title" href="{{ title_url }}">
</div> {{ title }}
</a>
{% else %}
<div class="forum__header__title">
{{ title }}
</div>
{% endif %}
{% endif %} {% endif %}
</div> </div>
{% endmacro %} {% endmacro %}

View file

@ -10,7 +10,7 @@
{{ input_hidden('post[' ~ (is_reply ? 'topic' : 'forum') ~ ']', is_reply ? posting_topic.topic_id : posting_forum.forum_id) }} {{ input_hidden('post[' ~ (is_reply ? 'topic' : 'forum') ~ ']', is_reply ? posting_topic.topic_id : posting_forum.forum_id) }}
{{ input_hidden('post[mode]', posting_mode) }} {{ input_hidden('post[mode]', posting_mode) }}
{{ input_csrf('forum_post') }} {{ input_csrf('forum_post') }}
{{ forum_header(is_reply ? posting_topic.topic_title : input_text('post[title]', 'forum__header__input', '', 'text', 'Enter your title here...'), posting_breadcrumbs) }} {{ forum_header(is_reply ? posting_topic.topic_title : input_text('post[title]', 'forum__header__input', '', 'text', 'Enter your title here...'), posting_breadcrumbs, false, is_reply ? '/forum/topic.php?t=' ~ posting_topic.topic_id : '') }}
{% if posting_post is defined %} {% if posting_post is defined %}
{{ input_hidden('post[id]', posting_post.post_id) }} {{ input_hidden('post[id]', posting_post.post_id) }}