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 {
font-size: 2em;
line-height: 1.5em;
color: inherit;
text-decoration: none;
&[href]:hover {
text-decoration: underline;
}
}
&__input {

View file

@ -19,7 +19,7 @@
</div>
{% endmacro %}
{% macro forum_header(title, breadcrumbs, omit_last_breadcrumb) %}
{% macro forum_header(title, breadcrumbs, omit_last_breadcrumb, title_url) %}
<div class="container forum__header">
{% if breadcrumbs is iterable and breadcrumbs|length > 0 %}
<div class="forum__header__breadcrumbs">
@ -38,9 +38,15 @@
{% endif %}
{% if title|length > 0 %}
<div class="forum__header__title">
{{ title }}
</div>
{% if title_url|length > 0 %}
<a class="forum__header__title" href="{{ title_url }}">
{{ title }}
</a>
{% else %}
<div class="forum__header__title">
{{ title }}
</div>
{% endif %}
{% endif %}
</div>
{% 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[mode]', posting_mode) }}
{{ 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 %}
{{ input_hidden('post[id]', posting_post.post_id) }}