Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.
Open

Forum #162

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4afbaef
Added forum_edit.html
chris34 Jan 3, 2016
5d6cb28
forum.html: Added edit-link for forum
chris34 Jan 3, 2016
2ac4240
forum/index.html: Added category edit and new links
chris34 Jan 3, 2016
ffa5052
Added reportlist.html
chris34 Jan 4, 2016
a3c585a
forum_edit: Changes from theme-ubuntuusers/#131
chris34 Jan 6, 2016
2f78b59
Removed explicit link for forum.js
chris34 Aug 9, 2016
d06b96c
forum/index, sidebar: filter & mark all as read
chris34 Aug 12, 2016
a46bfd6
forum/index: permission-check forum_edit
chris34 Aug 12, 2016
dcf4722
forum/index.html: empty category
chris34 Aug 9, 2016
fa64a8d
Added welcome.html
chris34 Aug 9, 2016
e9edaa4
Added delete_topic.html
chris34 Aug 9, 2016
c117424
Added movetopic.html
chris34 Aug 9, 2016
a9e8fc4
Added report.html
chris34 Aug 11, 2016
985213e
reportlist.html: use custom row-styling
chris34 Aug 11, 2016
3595db3
forum.html: Display all parents in breadcrumb
chris34 Aug 11, 2016
4b787a1
forum.html: Permission-checks for actions in sidebar
chris34 Aug 11, 2016
5902e4b
forum.html: Info if forum has no posts
chris34 Aug 11, 2016
d5be76a
index.html: Semantic markup without <a> inside <a>
chris34 Aug 11, 2016
df35196
forum.html, index.html: semantic header-hierachie
chris34 Aug 11, 2016
4d03f47
Missing closing nav for pagination
chris34 Aug 11, 2016
924594e
forum.html: Removed duplicate last post-info
chris34 Aug 11, 2016
4c7f69e
Added topiclist
chris34 Aug 13, 2016
759f54a
index.html: Use fa_icon-pencil-square-o instead of fa_icon-pencil
chris34 Aug 13, 2016
4fe11ef
Added URLs to staff-dropdown
chris34 Aug 13, 2016
58c346d
forum: :target for one post in topic
chris34 Aug 13, 2016
9a2741c
forum.html: Filter for each forum
chris34 Aug 13, 2016
3051472
postlist.html
chris34 Aug 13, 2016
706e938
post_delete.html
chris34 Sep 11, 2016
487f8b4
topic.html: Adde more sidebar-options
chris34 Sep 11, 2016
696e6c6
topic.html: title-seperator
chris34 Sep 11, 2016
ba1b80f
topic.html: Breadcrumb
chris34 Sep 11, 2016
65b62e4
topic.html: signature
chris34 Sep 11, 2016
8183b9b
can_moderate is a bool (not a method)
chris34 Sep 11, 2016
666633c
index.html: Prevent category-edit-icon to overlap
chris34 Sep 11, 2016
5593ad4
topic.html: Render pagination
chris34 Sep 11, 2016
6801e1f
topic.html: Title
chris34 Sep 11, 2016
40ea48f
topic.html: Added info if topic is discussion for wiki-article(s)
chris34 Sep 12, 2016
fabce09
Forum: new ACL, use has_perm instead of can
chris34 Oct 16, 2016
a07fefe
WIP: topic polls
chris34 Oct 16, 2016
5f80000
Merge branch 'staging' into forum
MAH1987 Jun 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 98 additions & 4 deletions inyoka_theme_default/static/style/inyoka/forum.less
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand 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 {
Expand All @@ -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);
Expand All @@ -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);
}
}
}
}
}

Expand All @@ -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);
Expand All @@ -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;
}
}
}
3 changes: 1 addition & 2 deletions inyoka_theme_default/static/style/inyoka/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions inyoka_theme_default/templates/forum/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
{{ _('Forum') }} - {{ super() }}
{% endblock %}

{% block scripts %}
<script src="{{ href('static', 'js', 'forum.js') }}"></script>
{% endblock %}

{% block breadcrumb %}
{{ macros.breadcrumb_item(_('Forum'), href('forum')) }}
{% endblock %}
35 changes: 35 additions & 0 deletions inyoka_theme_default/templates/forum/delete_topic.html
Original file line number Diff line number Diff line change
@@ -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) %}
<p>
{% 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 %}
</p>
{% if action == 'delete' %}
<p>
<label for="delete_topic_reason">{% trans %}Reason:{% endtrans %}</label>
<input name="reason" id="delete_topic_reason" />
</p>
{% endif %}

<input type="submit" name="cancel" value="{% trans %}Cancel{% endtrans %}" />
{% endcall%}
109 changes: 49 additions & 60 deletions inyoka_theme_default/templates/forum/forum.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
<div class="forum-list">
<div class="forum-list-heading">
Expand All @@ -55,65 +82,27 @@ <h1>
</a>
</h1>
</div>

<ul class="collapse in" id="subforums">
{% for forum in subforums %}
<a href="{{ forum|url }}" class="forum-list-item">
<h4>{{ forum }}</h4>
<h2>{{ forum }}</h2>
<p>{{ forum.description }}</p>
</a>
{% endfor %}
</ul>
</div>
{% endif %}

<div class="forum-topic-list">
<div class="forum-topic-list-heading">
<h3>
<h1>
{% trans %}Topics{% endtrans %}
</h3>
</h1>
</div>
<ul>
{% for topic in topics %}
<li class="forum-topic-list-item" title="{{ topic.first_post.text|truncate(500)|e }}" data-toggle="tooltip"
data-trigger="manual">
<div class="row">
<div class="col-sm-8">
{% if topic.sticky %}<strong>{% trans %}Sticky:{% endtrans %}</strong>{% endif %}
{% if topic.has_poll %}<strong>{% trans %}Poll:{% endtrans %}</strong>{% endif %}
<a href="{{ topic|url }}">{{ topic }}</a><br />
<small class="text-muted">
{% trans %}
Created on:
{% endtrans %}
<time
datetime="{{ topic.first_post.pub_date|datetime('c') }}">{{ topic.first_post.pub_date|datetime }}</time>
</small>
</div>
<div class="col-sm-4 hidden-xs">
<a href="{{ topic.last_post|url }}" class="pull-right">
<time
datetime="{{ topic.last_post.pub_date|datetime('c') }}">{{ topic.last_post.pub_date|datetime }}</time>
</a><br />
<small class="text-muted pull-right">
{% trans author=topic.last_post.author|e, link=topic.last_post.author|url %}
Last post by <a href="{{ link }}">{{ author }}</a>
{% endtrans %}
</small>
</div>
<div class="col-sm-4 visible-xs">
<small class="text-muted">
{% trans %}
Last post:
{% endtrans %}
<a href="{{ topic.last_post|url }}">
<time
datetime="{{ topic.last_post.pub_date|datetime('c') }}">{{ topic.last_post.pub_date|datetime }}</time>
</a>
</small>
</div>
</div>
</li>
{% endfor %}
</ul>

{% include 'forum/topiclist-ul-body.html' %}
</div>

{{ rendered_pagination }}
{% endblock %}
Loading