diff --git a/inyoka_theme_default/static/style/inyoka/forum.less b/inyoka_theme_default/static/style/inyoka/forum.less index 1d200e2..a581f0f 100644 --- a/inyoka_theme_default/static/style/inyoka/forum.less +++ b/inyoka_theme_default/static/style/inyoka/forum.less @@ -17,11 +17,15 @@ &:extend(.panel-heading); &:extend(.panel-default > .panel-heading); - & > h3 { + & > h1 { &:extend(.panel-title all); font-size: @font-size-h3; } + + &-category { + padding-right: @font-size-h3; + } } & > ul { &:extend(.list-group all); @@ -31,13 +35,18 @@ &:extend(.list-group-item all); &:extend(.panel > .list-group .list-group-item all); - & > h4 { + & > h2 { &:extend(list-group-item-heading all); + + font-size: @font-size-h4; } & > p { &:extend(list-group-item-text all); } } + &-edit-category { + &:extend(.pull-right); + } } &-topic-list { @@ -48,14 +57,49 @@ &:extend(.panel-heading); &:extend(.panel-default > .panel-heading); - & > h3 { + & > h1 { &:extend(.panel-title); + font-size: @font-size-h3; } } & > ul { &:extend(.list-group); &:extend(.panel > .list-group); } + &-created { + &:extend(.text-muted); + } + &-last-post { + &:extend(.text-muted); + .make-sm-column(4); + .make-xs-column(12); + } + &-link { + .make-sm-column(8); + .make-xs-column(12); + } + + &-post { + .make-sm-column(4); + .make-xs-column(12); + } + &-topic { + .make-sm-column(4); + .make-xs-column(12); + + &-all-posts a { + &:extend(.text-muted); + } + } + &-forum { + .make-sm-column(4); + .make-xs-column(12); + + &-all-posts a { + &:extend(.text-muted); + } + } + &-item { &:extend(.list-group-item); &:extend(.panel > .list-group .list-group-item); @@ -67,6 +111,25 @@ &:extend(.list-group-item:last-child); &:extend(.panel > .list-group:last-child .list-group-item:last-child); } + + &.with-forum { + .forum-topic-list { + &-last-post { + &:extend(.text-muted); + .make-sm-column(3); + .make-xs-column(12); + } + &-location { + &:extend(.text-muted); + .make-sm-column(3); + .make-xs-column(12); + } + &-link { + .make-sm-column(6); + .make-xs-column(12); + } + } + } } } @@ -85,8 +148,18 @@ &:extend(.panel-heading); &:extend(.panel-default > .panel-heading); } - & > &-body { + &:target > &-heading { + background-color: @active-target-bg; + } + &-body { &:extend(.panel-body); + + &-signature { + border-top: 1px solid lighten(@post-signature, 30%); + color: @post-signature; + padding-top: 1em; + margin-top: 2em; + } } & > &-footer { &:extend(.panel-footer); @@ -97,4 +170,25 @@ &:extend(.bg-warning all); padding: 1em; } + + &-reportlist { + .table-responsive(); + + > table { + td { + padding: @table-cell-padding; + } + + tbody tr:nth-of-type(2n) { + border-bottom: 1px solid @table-border-color; + } + + thead { + border-bottom: 2px solid @table-border-color; + } + } + &-content { + white-space: pre-wrap; + } + } } diff --git a/inyoka_theme_default/static/style/inyoka/variables.less b/inyoka_theme_default/static/style/inyoka/variables.less index 8fcb7d4..324f984 100644 --- a/inyoka_theme_default/static/style/inyoka/variables.less +++ b/inyoka_theme_default/static/style/inyoka/variables.less @@ -20,9 +20,8 @@ @diff-removed-line: #fcc; @diff-removed: #e99; @diff-ellipsis: @table-bg-accent; - +@post-signature: @gray-light; @team-member: #008A00; - //** Custom border-radius @border-radius-base: 0; diff --git a/inyoka_theme_default/templates/forum/base.html b/inyoka_theme_default/templates/forum/base.html index 4152264..8303eec 100644 --- a/inyoka_theme_default/templates/forum/base.html +++ b/inyoka_theme_default/templates/forum/base.html @@ -16,10 +16,6 @@ {{ _('Forum') }} - {{ super() }} {% endblock %} -{% block scripts %} - -{% endblock %} - {% block breadcrumb %} {{ macros.breadcrumb_item(_('Forum'), href('forum')) }} {% endblock %} diff --git a/inyoka_theme_default/templates/forum/delete_topic.html b/inyoka_theme_default/templates/forum/delete_topic.html new file mode 100644 index 0000000..c9019b7 --- /dev/null +++ b/inyoka_theme_default/templates/forum/delete_topic.html @@ -0,0 +1,35 @@ +{# + forum/delete_topic.html + ~~~~~~~~~~~~~~~~~~~~~~~ + + This template is flashed to ensure that the user wants to delete the + selected topic. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% import 'macros.html' as macros %} + +{% set submit_label = _('Delete') if action == 'delete' else _('Hide') %} + +{% call macros.outer_form(csrf_token(), action=topic|url(action)|e, submit_label=submit_label) %} +

+ {% if action == 'delete' %} + {% trans title=topic.title|e -%} + Do you really want to delete the topic “{{ title }}”? This action cannot be undone! + {% endtrans %} + {% else %} + {% trans title=topic.title|e -%} + Do you really want to hide the topic “{{ title }}”? + {% endtrans %} + {% endif %} +

+ {% if action == 'delete' %} +

+ + +

+ {% endif %} + + +{% endcall%} diff --git a/inyoka_theme_default/templates/forum/forum.html b/inyoka_theme_default/templates/forum/forum.html index 845852a..2024d14 100644 --- a/inyoka_theme_default/templates/forum/forum.html +++ b/inyoka_theme_default/templates/forum/forum.html @@ -20,32 +20,59 @@ {{ forum }} - {{ super() }} {% endblock title %} -{% import 'macros.html' as macros %} -{% set rendered_pagination = macros.render_pagination(pagination) %} - {% block breadcrumb %} {{ super() }} - {% if forum.parent.parent %} - {{ macros.breadcrumb_item(forum.parent, forum.parent|url) }} - {% endif %} - {{ macros.breadcrumb_item(forum) }} + {% for parent in forum.parents|reverse %} + {{ macros.breadcrumb_item(parent.name, parent|url) }} + {% endfor %} + + {{ macros.breadcrumb_item(forum, forum|url) }} {% endblock %} {% block sidebar %} - {% call macros.sidebar() %} - {% if is_subscribed %} - {{ macros.sidebar_item(_('Unsubscribe'), forum|url('unsubscribe')) }} - {% else %} - {{ macros.sidebar_item(_('Subscribe'), forum|url('subscribe')) }} + {% if USER.is_authenticated() %} + {% call macros.sidebar() %} + {% if is_subscribed %} + {{ macros.sidebar_item(_('Unsubscribe'), forum|url('unsubscribe')) }} + {% else %} + {{ macros.sidebar_item(_('Subscribe'), forum|url('subscribe')) }} + {% endif %} + + {% if can_create %} + {{ macros.sidebar_item(_('New topic'), forum|url('newtopic')) }} + {% endif %} + + {{ macros.sidebar_item(_('Mark as read'), forum|url('markread')) }} + {% endcall %} + {% endif %} + + {% call macros.sidebar(_('Filter (just this forum)')) %} + {% if USER.is_authenticated() %} + {{ macros.sidebar_item(_('Involved topics'), href('forum', 'egosearch', forum.slug|e)) }} + {{ macros.sidebar_item(_('My posts'), href('forum', 'author', USER.username|e, 'forum', forum.slug|e)) }} + {{ macros.sidebar_item(_('Created topics'), href('forum', 'topic_author', USER.username)|e, forum.slug|e) }} {% endif %} - {{ macros.sidebar_item(_('New topic'), forum|url('newtopic')) }} - {{ macros.sidebar_item(_('Mark as read'), forum|url('markread')) }} + + {{ macros.sidebar_item(_('New posts'), href('forum', 'newposts', forum.slug|e)) }} + {{ macros.sidebar_item(_('Unanswered topics'), href('forum', 'unanswered', forum.slug|e)) }} + {{ macros.sidebar_item(_('Unsolved topics'), href('forum', 'unsolved', forum.slug|e)) }} + {{ macros.sidebar_item(_('24 hours'), href('forum', 'last24', forum.slug|e)) }} + {{ macros.sidebar_item(_('12 hours'), href('forum', 'last12', forum.slug|e)) }} + {{ macros.sidebar_item(_('6 hours'), href('forum', 'last6', forum.slug|e)) }} {% endcall %} + + {% if USER.has_perm('forum.change_forum') %} + {% call macros.sidebar_admin() %} + {{ macros.sidebar_item(_('Edit forum'), forum|url('edit')) }} + {% endcall %} + {% endif %} {% endblock %} {% block content %} + {% set rendered_pagination = macros.render_pagination(pagination) %} {{ rendered_pagination }} + {% if subforums %}
@@ -55,65 +82,27 @@

+
{% endif %} +
-

+

{% trans %}Topics{% endtrans %} -

+
- + + {% include 'forum/topiclist-ul-body.html' %}
+ {{ rendered_pagination }} {% endblock %} diff --git a/inyoka_theme_default/templates/forum/forum_edit.html b/inyoka_theme_default/templates/forum/forum_edit.html new file mode 100644 index 0000000..8bf1630 --- /dev/null +++ b/inyoka_theme_default/templates/forum/forum_edit.html @@ -0,0 +1,39 @@ +{# + templates.admin.forum_edit + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Admin template for editing forums. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'forum/base.html' %} + +{% block title %} + {% if not forum %} + {% trans %}Create forum{% endtrans %} + {% else %} + {% trans forum=forum.name|e %}Edit “{{ forum }}”{% endtrans %} + {% endif %} + – {{ super() }} +{% endblock %} + +{% block breadcrumb %} + {{ super() }} + + {% if not forum %} + {{ macros.breadcrumb_item(_('Create forum'), href('forum', 'forum', 'new')) }} + {% else %} + {{ macros.breadcrumb_item(forum.name|e, forum|url()) }} + {{ macros.breadcrumb_item(_('Edit'), forum|url('edit')) }} + {% endif %} +{% endblock %} + +{% block content %} + {% call macros.outer_form(csrf_token(), form, manually_rendered=True) %} + {{ macros.inner_form(form, ['name', 'slug','description', 'parent', 'position', + 'newtopic_default_text', 'force_version', 'user_count_posts', 'support_group']) }} +

{% trans %}Welcome message{% endtrans %}

+ {{ macros.inner_form(form, ['welcome_title', 'welcome_text']) }} + {% endcall %} +{% endblock %} diff --git a/inyoka_theme_default/templates/forum/index.html b/inyoka_theme_default/templates/forum/index.html index 780d50d..fe685d3 100644 --- a/inyoka_theme_default/templates/forum/index.html +++ b/inyoka_theme_default/templates/forum/index.html @@ -17,22 +17,58 @@ (_('Forum - Full post'), href('forum', 'feeds/full/20')) ] %} +{% block sidebar %} + {% call macros.sidebar() %} + {{ macros.sidebar_item(_('Mark all forums as read'), href('forum', 'markread')) }} + {% endcall %} + + {% call macros.sidebar(_('Filter')) %} + {% if USER.is_authenticated() %} + {{ macros.sidebar_item(_('Involved topics'), href('forum', 'egosearch')) }} + {{ macros.sidebar_item(_('My posts'), href('forum', 'author', USER.username|e)) }} + {{ macros.sidebar_item(_('Created topics'), href('forum', 'topic_author', USER.username)|e) }} + {% endif %} + + {{ macros.sidebar_item(_('New posts'), href('forum', 'newposts')) }} + {{ macros.sidebar_item(_('Unanswered topics'), href('forum', 'unanswered')) }} + {{ macros.sidebar_item(_('Unsolved topics'), href('forum', 'unsolved')) }} + {{ macros.sidebar_item(_('24 hours'), href('forum', 'last24')) }} + {{ macros.sidebar_item(_('12 hours'), href('forum', 'last12')) }} + {{ macros.sidebar_item(_('6 hours'), href('forum', 'last6')) }} + {% endcall %} + + {% if USER.has_perm('forum.change_forum') %} + {% call macros.sidebar_admin() %} + {{ macros.sidebar_item(_('New Category'), href('forum', 'forum', 'new')) }} + {% endcall %} + {% endif %} +{% endblock %} + {% block content %} {% for category, forums in forum_hierarchy %}
-

- +

+ {{ category }} -

+ + {% if USER.has_perm('forum.change_forum') %} + + + + {% endif %} +

+
diff --git a/inyoka_theme_default/templates/forum/movetopic.html b/inyoka_theme_default/templates/forum/movetopic.html new file mode 100644 index 0000000..1674042 --- /dev/null +++ b/inyoka_theme_default/templates/forum/movetopic.html @@ -0,0 +1,30 @@ +{# + forum/movetopic.html + ~~~~~~~~~~~~~~~~~~~~ + + This page gives the user the ability to move a topic into a new forum. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'forum/base.html' %} + +{% block title %} + {% trans %}Move{% endtrans %} – {{ topic.title }} – {{ super() }} +{% endblock %} + +{% block breadcrumb %} + {{ super() }} + + {% for parent in topic.forum.parents|reverse %} + {{ macros.breadcrumb_item(parent.name, parent|url) }} + {% endfor %} + {{ macros.breadcrumb_item(topic.forum.name, topic.forum|url) }} + {{ macros.breadcrumb_item(topic.title, topic|url) }} + {{ macros.breadcrumb_item(_('Move'), topic|url('move')) }} +{% endblock %} + +{% block content %} +

{% trans topic=topic.title|e %}Move “{{ topic }}”{% endtrans %}

+ {{ macros.outer_form(csrf_token(), form, submit_label=_('Move')) }} +{% endblock %} diff --git a/inyoka_theme_default/templates/forum/post_delete.html b/inyoka_theme_default/templates/forum/post_delete.html new file mode 100644 index 0000000..e0c0da9 --- /dev/null +++ b/inyoka_theme_default/templates/forum/post_delete.html @@ -0,0 +1,27 @@ +{# + forum/post_delete.html + ~~~~~~~~~~~~~~~~~~~~~~ + + This template is flashed to ensure that the user wants to delete the selected post. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} + +{% import macros.html as macros %} + +{% set submit_label = _('Delete') if action=='delete' else _('Hide') %} + +{% call macros.outer_form(csrf_token(), action=post|url(action)|e, submit_label=submit_label) %} + {% if action == 'delete' %} + {% trans link=post|url('show')|e, author=post.author.username|e %} + Do you want to delete the post from {{ author }}? + {% endtrans %} + {% else %} + {% trans link=post|url('show')|e, author=post.author.username|e %} + Do you want to hide the post from {{ author }}? + {% endtrans %} + {% endif %} + + +{% endcall %} diff --git a/inyoka_theme_default/templates/forum/postlist.html b/inyoka_theme_default/templates/forum/postlist.html new file mode 100644 index 0000000..655bcf0 --- /dev/null +++ b/inyoka_theme_default/templates/forum/postlist.html @@ -0,0 +1,89 @@ +{# + forum/postlist.html + ~~~~~~~~~~~~~~~~~~~ + + Show a list of all posts for a given user. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'forum/base.html' %} + +{% block title %} + {{ title }} – {{ super() }} +{% endblock %} + +{% block breadcrumb %} + {{ super() }} + + {% if forum %} + {{ macros.breadcrumb_item(forum.name, href('forum', 'author', username|e, 'forum', forum.slug)) }} + {% elif topic %} + {{ macros.breadcrumb_item(topic.title, href('forum', 'author', username|e, 'topic', topic.slug)) }} + {% endif %} + {{ macros.breadcrumb_item(_('Posts by') + ' ' + username, href('forum', 'author', username|e)) }} +{% endblock %} + + +{% block content %} + {% set rendered_pagination = macros.render_pagination(pagination) %} + {{ rendered_pagination }} + +
+
+

+ {{ title }} +

+
+ + +
+ + {{ rendered_pagination }} +{% endblock %} diff --git a/inyoka_theme_default/templates/forum/report.html b/inyoka_theme_default/templates/forum/report.html new file mode 100644 index 0000000..644efd3 --- /dev/null +++ b/inyoka_theme_default/templates/forum/report.html @@ -0,0 +1,35 @@ +{# + forum/report.html + ~~~~~~~~~~~~~~~~~ + + The user can report a topic to the moderators on this page. + It shows a text field where the user can describe the problem. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'forum/base.html' %} + +{% block title %} + {% trans %}Report{% endtrans %} – {{ super() }} +{% endblock %} + +{% block breadcrumb %} + {{ super() }} + + {{ macros.breadcrumb_item(_('Report'), topic|url('report')) }} + {{ macros.breadcrumb_item(topic.title, topic|url) }} + {{ macros.breadcrumb_item(topic.forum.name, topic.forum|url) }} +{% endblock %} + +{% block content %} +

{% trans topic=topic.title|e %}Report topic “{{ topic }}”{% endtrans %}

+

+ {% trans link=href('wiki', 'ubuntuusers/Moderatoren/Forenregeln') %} + Here you can report a topic to the moderators if it is against our + rules. + {% endtrans %} +

+ + {{ macros.outer_form(csrf_token(), form, submit_label=_('Report topic')) }} +{% endblock %} diff --git a/inyoka_theme_default/templates/forum/reportlist.html b/inyoka_theme_default/templates/forum/reportlist.html new file mode 100644 index 0000000..b1385f7 --- /dev/null +++ b/inyoka_theme_default/templates/forum/reportlist.html @@ -0,0 +1,93 @@ +{# + forum/reportlist.html + ~~~~~~~~~~~~~~~~~~~~~ + + The moderators can see all reported topics on this page. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} + +{% extends 'forum/base.html' %} + +{% block title %} + {% trans %}Reported topics{% endtrans %} – {{ super() }} +{% endblock %} + +{% block breadcrumb %} + {{ super() }} + + {{ macros.breadcrumb_item(_('Reported topics'), href('forum', 'reported_topics')) }} +{% endblock %} + +{% block sidebar %} + {{ super() }} + + {% call macros.sidebar() %} + {% if subscribed %} + {{ macros.sidebar_item(_('Unsubscribe from topic reports'), href('forum', 'reported_topics', 'unsubscribe'), 'fa_icon-bell-slash') }} + {% else %} + {{ macros.sidebar_item(_('Subscribe to topic reports'), href('forum', 'reported_topics', 'subscribe'), 'fa_icon-bell') }} + {% endif %} + {% endcall %} +{% endblock %} + +{% block content %} + {% call macros.outer_form(csrf_token(), form, submit_label=_('Close selected tickets'), manually_rendered=True) %} +
+ + + + + + + + + + + + {% for topic in topics %} + + + + + + + + + + + {% else %} + + {% endfor %} + +
{% trans %}#{% endtrans %}{% trans %}Topic{% endtrans %}{% trans %}Reported by{% endtrans %}{% trans %}Assigned to{% endtrans %}
+ + + {{ topic.title|e }} ({{ topic.forum.name|e}}) + + {{ topic.reporter.username }} + + {% if topic.report_claimed_by %} + {% if topic.report_claimed_by.username == USER.username %} + + {% trans %}Unassign me{% endtrans %} + + {% else %} + + {{ topic.report_claimed_by.username }} + + {% endif %} + {% else %} + + {% trans %}Assign to me{% endtrans %} + + {% endif %} +
+ {{ topic.reported_rendered }} +
+ {% trans %}Currently there are no reported topics.{% endtrans %} +
+
+ {% endcall %} +{% endblock %} diff --git a/inyoka_theme_default/templates/forum/revisions.html b/inyoka_theme_default/templates/forum/revisions.html new file mode 100644 index 0000000..74aee6e --- /dev/null +++ b/inyoka_theme_default/templates/forum/revisions.html @@ -0,0 +1,55 @@ +{# + forum/revisions.html + ~~~~~~~~~~~~~~~~~~~~ + + This page shows all old revisions of a post and gives the moderator the + possibility to restore it. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'forum/base.html' %} + +{% block title %} + {{ post.topic.title }} – {% trans %}Old revisions{% endtrans %} + – {{ super() }} +{% endblock %} + +{% block breadcrumb %} + {{ super() }} + + {{ macros.breadcrumb_item(post.topic.title, post.topic|url) }} + {{ macros.breadcrumb_item(_('Old revisions'), post|url('revisions')) }} +{% endblock %} + + +{% block content %} + {% for rev in revisions %} +
+
+ + + + {% if loop.first %} + {% trans %}(Current revision){% endtrans %} + {% endif %} + +
+ +
+ {{ rev.text_rendered }} +
+ +
+ +
+
+ {% endfor %} + +{% endblock %} diff --git a/inyoka_theme_default/templates/forum/splittopic.html b/inyoka_theme_default/templates/forum/splittopic.html new file mode 100644 index 0000000..1197637 --- /dev/null +++ b/inyoka_theme_default/templates/forum/splittopic.html @@ -0,0 +1,134 @@ +{# + forum/splittopic.html + ~~~~~~~~~~~~~~~~~~~~~ + + This page shows the "splittopic" form. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'forum/base.html' %} + +{% block title %} + {# TODO #} +{% endblock %} + +{% block breadcrumb %} + {{ super() }} + + {{ macros.breadcrumb_item(_('Split topic'), topic|url('split')) }} + {{ macros.breadcrumb_item(topic.title, topic|url) }} + {{ macros.breadcrumb_item(topic.forum.name, topic.forum|url) }} +{% endblock %} + +{% block content %} + {{ macros.outer_form(csrf_token(), form) }} + + {# +
+ {{ csrf_token() }} +

{% trans topic=topic.title|e %}Split topic “{{ topic }}”{% endtrans %}

+

+ {% trans %}The chosen posts can form a new topic or be attached to an existing topic.{% endtrans %} +

+
+
+ + +
+
+ {% trans %}Forum of the new topic:{% endtrans %} {{ form.forum }}{{ form.errors.forum }} +
+
+ {% trans %}Title of the new topic:{% endtrans %} {{ form.title }}{{ form.errors.title }} +
+
+ Version des neuen Topics: + {{ form.ubuntu_distro }}{{ form.errors.ubuntu_distro }} + {{ form.ubuntu_version }}{{ form.errors.ubuntu_version }} +
+
+ + +
+
+ {% trans %}Slug of the topic:{% endtrans %} {{ form.topic }}{{ form.errors.topic }} +
+
+ +

{% trans %}Preview{% endtrans %}

+

{% trans %}The following posts will be split off:{% endtrans %}

+ + + + {%- for post in posts %} + + + + + {%- endfor %} + + + +
+ #} +{% endblock %} diff --git a/inyoka_theme_default/templates/forum/topic.html b/inyoka_theme_default/templates/forum/topic.html index 9308a7b..df72a1d 100644 --- a/inyoka_theme_default/templates/forum/topic.html +++ b/inyoka_theme_default/templates/forum/topic.html @@ -20,41 +20,96 @@ ] %} {% block title %} - {{ topic }} - {{ topic.forum }} - {{ super() }} + {{ topic }} – {{ topic.forum }} – {{ super() }} {% endblock %} {% block breadcrumb %} {{ super() }} - {% if topic.forum.parent.parent %} - {{ macros.breadcrumb_item('…') }} - {% endif %} + {% for parent in forum.parents|reverse %} + {{ macros.breadcrumb_item(parent.name, parent|url) }} + {% endfor %} {{ macros.breadcrumb_item(topic.forum, topic.forum|url) }} {{ macros.breadcrumb_item(topic, topic|url) }} {% endblock %} {% block sidebar %} - {% call macros.sidebar() %} - {{ macros.sidebar_item(_('Reply'), topic|url('reply'), 'fa_icon-comments-o') }} - - {% if is_subscribed %} - {{ macros.sidebar_item(_('Unsubscribe'), topic|url('unsubscribe')) }} - {% else %} - {{ macros.sidebar_item(_('Subscribe'), topic|url('subscribe')) }} - {% endif %} - - {% if topic.solved %} - {{ macros.sidebar_item(_('Mark as unsolved'), topic|url('unsolve'), 'fa_icon-remove') }} - {% else %} - {{ macros.sidebar_item(_('Mark as solved'), topic|url('solve'), 'fa_icon-check') }} - {% endif %} - - {{ macros.sidebar_item(_('Report'), topic|url('report'), 'fa_icon-exclamation-triangle') }} - {% endcall %} + {{ super() }} + + {% if USER.is_authenticated() %} + {% call macros.sidebar() %} + {% if (can_reply and not topic.locked) or can_moderate %} + {{ macros.sidebar_item(_('Reply'), topic|url('reply'), 'fa_icon-comments-o') }} + {% endif %} + + {% if is_subscribed %} + {{ macros.sidebar_item(_('Unsubscribe'), topic|url('unsubscribe'), 'fa_icon-bell-slash') }} + {% else %} + {{ macros.sidebar_item(_('Subscribe'), topic|url('subscribe'), 'fa_icon-bell') }} + {% endif %} + + {% if topic.solved %} + {{ macros.sidebar_item(_('Mark as unsolved'), topic|url('unsolve'), 'fa_icon-remove') }} + {% else %} + {{ macros.sidebar_item(_('Mark as solved'), topic|url('solve'), 'fa_icon-check') }} + {% endif %} + + {{ macros.sidebar_item(_('Report'), topic|url('report'), 'fa_icon-exclamation-triangle') }} + {% endcall %} + {% endif %} + + {% if can_moderate %} + {% call macros.sidebar_admin() %} + {{ macros.sidebar_item(_('Move'), topic|url('move'), 'fa_icon-arrow-circle-right') }} + + {{ macros.sidebar_item(_('Split'), topic|url('split'), 'fa_icon-scissors') }} + + {% if topic.locked %} + {{ macros.sidebar_item(_('Unlock'), topic|url('unlock'), 'fa_icon-unlock') }} + {% else %} + {{ macros.sidebar_item(_('Lock'), topic|url('lock'), 'fa_icon-lock') }} + {% endif %} + + {% if topic.hidden %} + {{ macros.sidebar_item(_('Restore'), topic|url('restore'), 'fa_icon-eye') }} + {{ macros.sidebar_item(_('Delete'), topic|url('delete'), 'fa_icon-trash') }} + {{ macros.sidebar_item(_('Mark ham'), topic.first_post|url('ham'), 'fa_icon-recycle') }} + {% else %} + {{ macros.sidebar_item(_('Hide'), topic|url('hide'), 'fa_icon-eye-slash') }} + {{ macros.sidebar_item(_('Mark spam'), topic.first_post|url('spam'), 'fa_icon-fire') }} + {% endif %} + {% endcall %} + {% endif %} {% endblock %} {% block content %} + {% set rendered_pagination = macros.render_pagination(pagination) %} + +

{{ topic.title|e }}

+ + {% if discussions %} + {% macro render_article_list(discussions) %} + {% for article in discussions %} + {{ article.name|e }} + {% if not loop.last %},{% endif %} + {% endfor %} + {% endmacro %} + + {% call macros.render_message('info') %} + {% trans count=discussions|count, article_list=render_article_list(discussions) %} + This topic is the discussion of the article {{ article_list }}. + {% pluralize %} + This topic is the discussion of the articles {{ article_list }}. + {% endtrans %} + {% endcall %} + {% endif %} + {{ rendered_pagination }} + + {% if polls %} + {% include 'forum/topic__polls.html' %} + {% endif %} + {% for post in posts %}
@@ -64,12 +119,18 @@ {{ post.author }} - -
+
{{ post.get_text() }} + + {% if post.author.signature and not USER.settings['hide_signatures'] %} +
+ {{ post.author.signature_rendered }} +
+ {% endif %}
+
@@ -88,11 +149,11 @@
{% endfor %} + {{ rendered_pagination }} {% endblock %} diff --git a/inyoka_theme_default/templates/forum/topic__polls.html b/inyoka_theme_default/templates/forum/topic__polls.html new file mode 100644 index 0000000..35aa015 --- /dev/null +++ b/inyoka_theme_default/templates/forum/topic__polls.html @@ -0,0 +1,71 @@ +{% call macros.outer_form(csrf_token(), manually_rendered=True, button_visible=False) %} + {% for poll in polls %} +

{% trans %}Poll: {% endtrans %}{{ poll.question|e }}

+ + + {% for option in poll.options.all() %} + + + {% if not (poll.can_vote and can_vote) or show_vote_results %} + + {% set bc, ac = (option.percentage|string).split('.') %} + + + {% endif %} + + {% endfor %} +
+ {% if poll.can_vote and can_vote and not show_vote_results %} + + + {% else %} + {{ option.name|e }} + {% endif %} + + {{ option.percentage }} + + {{ bc }}{% if ac|int %}.{{ ac[:2] }}{% endif %}% + + [ {{ option.votes }} ] +
+ +
+ {% if poll.ended %} + {% trans start_date=poll.start_time|datetime, end_date=poll.end_time|datetime %} + The poll was started on {{ start_date }} and it ended on {{ end_date }}. + {% endtrans %} + {% elif poll.end_time %} + {% trans start_date=poll.start_time|datetime, end_date=poll.end_time|datetime %} + The poll was started on {{ start_date }} and it will end on {{ end_date }}. + {% endtrans %} + {% endif %} +
+ + {% trans count=poll.votes %} + {{ count }} vote + {% pluralize %} + {{ count }} votes + {% endtrans %} + + {% if poll.multiple_votes %}, + {% trans count=poll.votings.count() %} + {{ count }} voter + {% pluralize %} + {{ count }} voters + {% endtrans %} + {% endif %} + {% endfor %} + + {% if can_vote and not voted_all %} +

+ {% if show_vote_results %} + {% trans %}Hide results{% endtrans %} + {% else %} + + {% trans %}Show results{% endtrans %} + {% endif %} +

+ {% endif %} +{% endcall %} diff --git a/inyoka_theme_default/templates/forum/topiclist-ul-body.html b/inyoka_theme_default/templates/forum/topiclist-ul-body.html new file mode 100644 index 0000000..cc4eedc --- /dev/null +++ b/inyoka_theme_default/templates/forum/topiclist-ul-body.html @@ -0,0 +1,59 @@ + diff --git a/inyoka_theme_default/templates/forum/topiclist.html b/inyoka_theme_default/templates/forum/topiclist.html new file mode 100644 index 0000000..d49fc95 --- /dev/null +++ b/inyoka_theme_default/templates/forum/topiclist.html @@ -0,0 +1,39 @@ +{# + forum/topiclist.html + ~~~~~~~~~~~~~~~~~~~ + + Show a list of all recent posts. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'forum/base.html' %} + +{% block title %} + {{ title }} – {{ super() }} +{% endblock %} + +{% block breadcrumb %} + {{ super() }} + + {{ macros.breadcrumb_item(title) }} + +{% endblock %} + +{% block content %} + {% set rendered_pagination = macros.render_pagination(pagination) %} + {{ rendered_pagination }} + +
+
+

+ {{ title }} +

+
+ + {% set show_forum = True %} + {% include 'forum/topiclist-ul-body.html' %} +
+ + {{ rendered_pagination }} +{% endblock %} diff --git a/inyoka_theme_default/templates/forum/welcome.html b/inyoka_theme_default/templates/forum/welcome.html new file mode 100644 index 0000000..5877455 --- /dev/null +++ b/inyoka_theme_default/templates/forum/welcome.html @@ -0,0 +1,20 @@ +{# + forum/welcome.html + ~~~~~~~~~~~~~~~~~~ + + Show the rules for the community area. + + :copyright: (c) 2013-2016 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'forum/base.html' %} + +{% block content %} +

{{ forum.welcome_title|e }}

+ {{ forum.welcome_text_rendered }} + + {% call macros.outer_form(csrf_token(), action=forum|url('welcome'), button_visible=False) %} + + + {% endcall %} +{% endblock %} diff --git a/inyoka_theme_default/templates/macros.html b/inyoka_theme_default/templates/macros.html index b2b990b..5ab177f 100644 --- a/inyoka_theme_default/templates/macros.html +++ b/inyoka_theme_default/templates/macros.html @@ -112,7 +112,7 @@

{% trans %}Staff{% endtrans %}

{% endif %} {% endif %} - {% endmacro %} @@ -248,10 +248,16 @@

{% trans %}Staff{% endtrans %}

{% endmacro %} {% macro render_message(type, content) %} +{# instead of passing the content via the parameter, a caller can be used #} {% endmacro %}