From 03140381fcb5ff946822146351ec490d87c4e4ea Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sat, 30 Jul 2016 15:41:54 +0200 Subject: [PATCH 1/4] is_anonymous is now a function instead of a property --- inyoka_theme_default/templates/pastebin/display.html | 2 +- inyoka_theme_default/templates/wiki/base.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inyoka_theme_default/templates/pastebin/display.html b/inyoka_theme_default/templates/pastebin/display.html index 0b764cf..0797cdd 100644 --- a/inyoka_theme_default/templates/pastebin/display.html +++ b/inyoka_theme_default/templates/pastebin/display.html @@ -39,7 +39,7 @@
{% trans %}Title{% endtrans %}
{{ entry.title|e }}
- {% if not entry.author.is_anonymous %} + {% if not entry.author.is_anonymous() %}
{% trans %}Author{% endtrans %}
{{ macros.render_user_link(entry.author) }} diff --git a/inyoka_theme_default/templates/wiki/base.html b/inyoka_theme_default/templates/wiki/base.html index 066c14f..87e6d41 100644 --- a/inyoka_theme_default/templates/wiki/base.html +++ b/inyoka_theme_default/templates/wiki/base.html @@ -40,7 +40,7 @@ {% block sidebar %} {{ super() }} - {% if not USER.is_anonymous %} + {% if not USER.is_anonymous() %} {% call macros.sidebar() %} {{ macros.sidebar_item(_('Create new wikipage'), href('wiki', 'wiki', 'create')) }} {% endcall %} @@ -48,7 +48,7 @@ {% call macros.sidebar(_('Overview')) %} {{ macros.sidebar_item(_('Tag cloud'), href('wiki', 'wiki', 'tagcloud'), 'fa_icon-tags') }} - {% if not USER.is_anonymous %} + {% if not USER.is_anonymous() %} {{ macros.sidebar_item(_('Missing pages'), href('wiki', 'wiki', 'missingpages'), 'fa_icon-puzzle-piece') }} {% endif %} {{ macros.sidebar_item(_('Recent changes'), href('wiki', 'wiki', 'recentchanges'), 'fa_icon-area-chart') }} From b155373c84064c26cabe6dcc00225f54fc935c91 Mon Sep 17 00:00:00 2001 From: Lyra Date: Sun, 31 Jul 2016 01:52:04 +0200 Subject: [PATCH 2/4] Closes #180: Makes the group assignments usable again --- .../static/js/UserGroupBox.js | 62 -------- inyoka_theme_default/static/js/classy.js | 142 ------------------ .../static/style/inyoka/portal.less | 17 +++ .../templates/portal/user_edit_groups.html | 46 +----- 4 files changed, 18 insertions(+), 249 deletions(-) delete mode 100644 inyoka_theme_default/static/js/UserGroupBox.js delete mode 100644 inyoka_theme_default/static/js/classy.js diff --git a/inyoka_theme_default/static/js/UserGroupBox.js b/inyoka_theme_default/static/js/UserGroupBox.js deleted file mode 100644 index 3b40ae1..0000000 --- a/inyoka_theme_default/static/js/UserGroupBox.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * js/UserGroupBox - * ~~~~~~~~~~~~~~~ - * - * A little box to add/remove the user to some groups. - * - * - * :copyright: (c) 2007-2017 by the Inyoka Team, see AUTHORS for more details. - * :license: BSD, see LICENSE for more details. - */ - -(function () { - - GroupBox = Class.$extend({ - __init__: function (container, user_joined, user_not_joined) { - var self = this; - this.container = $(container); - - // Groups the user not joined - this.user_not_joined = $('select[name="user_groups_not_joined"]'); - - // Groups the user joined - this.user_joined = $('select[name="user_groups_joined"]'); - - // add items to the select boxes - this.rebuildBoxes(user_joined, user_not_joined); - - // add needed submit event - $(container).find('input[type="submit"]').first().submit(function () { - $.each([self.user_not_joined, self.user_joined], function () { - this.find('option').each(function () { - this.selected = true; - }); - }); - return true; - }); - - // add add/remove events - $('button.item_add').click(function () { - self.move(self.user_not_joined, self.user_joined); - }); - $('button.item_remove').click(function () { - self.move(self.user_joined, self.user_not_joined); - }); - }, - - rebuildBoxes: function (joined, not_joined) { - var self = this; - $.each(joined, function (i, group) { - $('
- {% call macros.outer_form(csrf_token(), form, manually_rendered=True) %} - - - - - - - - - - - -
{% trans %}Available groups{% endtrans %}{% trans %}Membership{% endtrans %}
- - -
- - -
-
- -
- - {{ macros.input(form.primary_group) }} - - {% endcall %} -{% endblock %} - -{% block scripts %} - - - + {{ macros.outer_form(csrf_token(), form, bootstrap_class="portal-user-groupsetting-form") }} {% endblock %} From a705c4954b7b5cef1368e7c1da1f4e5b03ccff17 Mon Sep 17 00:00:00 2001 From: Lyra Date: Sun, 31 Jul 2016 02:45:43 +0200 Subject: [PATCH 3/4] Closes #178: Remove user based permission settings The feature acl branch removes all user bases permissions. This page is not longer needed. --- .../static/js/PrivilegeBox.js | 147 ------------------ .../static/style/inyoka/portal.less | 11 -- .../templates/portal/user_admin.html | 1 - .../portal/user_edit_privileges.html | 69 -------- 4 files changed, 228 deletions(-) delete mode 100644 inyoka_theme_default/static/js/PrivilegeBox.js delete mode 100644 inyoka_theme_default/templates/portal/user_edit_privileges.html diff --git a/inyoka_theme_default/static/js/PrivilegeBox.js b/inyoka_theme_default/static/js/PrivilegeBox.js deleted file mode 100644 index ca811d0..0000000 --- a/inyoka_theme_default/static/js/PrivilegeBox.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * js.PrivilegeBox - * ~~~~~~~~~~~~~~~ - * - * :copyright: (c) 2007-2017 by the Inyoka Team, see AUTHORS for more details. - * :license: BSD, see LICENSE for more details. - * - * TODO: i18n - */ -(function () { - PrivilegeBox = function (container, forums, privileges) { - this.mapping = {}; - var selected_forums = [], - self = this, - forum_container = $('
'), - list = $('
    '), - content = $('
    '), - selected_forums_info = $('

    '), - priv_list = $('

    '); - - this.container = $(container); - this.container.html(''); - this.container.append(forum_container); - this.container.append(content); - forum_container.append(list); - forum_container.append('

    Auswahl:

    '); - forum_container.append(selected_forums_info); - content.append(priv_list); - this.container.append( - ''+ - 'Halte die Steuerungs-Taste gedrückt, um mehrere Foren auszuwählen.'+ - '' - ); - - $.each(forums, function (i, forum) { - var id = forum[0]; - var name = forum[1]; - var positive = forum[2]; - var negative = forum[3]; - self.mapping[id] = positive.concat($.map(negative, function (o) { - return o * -1; - })); - - var li = $('
  • '); - li.text(name); - li.attr('id', 'forum_' + id); - li.addClass('portal-privilege-list-item'); - if (positive != '' || negative != '') { - li.addClass('changed'); - } - li.click(function (evt) { - if (evt.ctrlKey) { - var pos = $.inArray(id, selected_forums); - if (pos > -1 && selected_forums.length > 1) { - selected_forums.splice(pos, 1); - } - if (pos == -1) { - selected_forums.push(id); - } - } else { - selected_forums = [id]; - } - - $(this).parent().children().removeClass('active'); - $.each(selected_forums, function (i, forum) { - $('#forum_' + forum).addClass('active'); - }); - - if (selected_forums.length == 1) { - var forum = selected_forums[0]; - selected_forums_info.text($('#forum_' + forum).text()); - - $.each(privileges, function (id, name) { - id = parseInt(id, 10); - var value; - if ($.inArray(id, self.mapping[forum]) > -1){ - value = '1'; - } else if ($.inArray(id * -1, self.mapping[forum]) > -1) { - value = '-1'; - } else { - value = '0'; - } - $('select.' + id).val(value); - }); - - } else { - selected_forums_info.text(selected_forums.length + ' Foren'); - $('select.priv', self.container).val('0'); - } - }); - list.append(li); - }); - - $.each(privileges, function (id, name) { - var permission_select = function (values, options) { - var select = $(''); - result.attr('name', name); - result.appendTo(self.container); - } - self.mapping[forum_id] = priv_data; - result.val(priv_data.join(',')); - }); - }); - return select; - }; - - var entry = $('
    '); - var label = $('
  • - {% if USER.has_perm('planet.change_blog') %} + {% if USER.has_perm('planet.hide_entry') %} {% if article.hidden and article.hidden_by %}
  • {% trans user_link=macros.render_user_link(article.hidden_by) %}