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 = $('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 = $(''); - - for (var i = 0; i < options.length; i++) { - var option = $(''); - option.attr({ - name: 'priv_' + id, - value: values[i], - id: 'priv_' + id + '_' + values[i] - }); - option.text(options[i]); - select.append(option); - }; - select.change(function () { - var priv_data = []; - $('select.priv option:selected').each(function(i, field) { - var priv_id = parseInt(field.getAttribute('name').substring(5), 10); - var result = (parseInt(field.getAttribute('value'), 10) * priv_id); - if (result) { - priv_data[priv_data.length] = result; - } - }); - $.each(selected_forums, function (i, forum_id) { - var name = 'forum_privileges_' + forum_id; - var result = $('input[name=' + name + ']'); - if (result.length === 0) { - result = $(''); - 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 = $(''); - label.text(name); - var selection = $(''); - selection.append( - permission_select([1,0,-1], ['Ja','Nicht gesetzt', 'Nein']) - ); - entry.append(label); - entry.append(selection); - - priv_list.append(entry); - }); - - list.children().first().click(); - }; -})(); 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) { - $('').text(group).appendTo(self.user_joined); - }); - - $.each(not_joined, function (i, group) { - $('').text(group).appendTo(self.user_not_joined); - }); - }, - - move: function (from, to) { - from.find('option:selected').remove().appendTo(to); - } - }); -})(); diff --git a/inyoka_theme_default/static/js/classy.js b/inyoka_theme_default/static/js/classy.js deleted file mode 100644 index a4787c0..0000000 --- a/inyoka_theme_default/static/js/classy.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Classy - classy classes for JavaScript - * - * :copyright: (c) 2010 by Armin Ronacher. - * :license: BSD. - */ - -; -(function (undefined) { - var - CLASSY_VERSION = '1.3', - root = this, - old_class = Class, - disable_constructor = false; - - /* we check if $super is in use by a class if we can. But first we have to - check if the JavaScript interpreter supports that. This also matches - to false positives later, but that does not do any harm besides slightly - slowing calls down. */ - var probe_super = (function () { - $super(); - }).toString().indexOf('$super') > 0; - - function usesSuper(obj) { - return !probe_super || /\B\$super\b/.test(obj.toString()); - } - - /* helper function to set the attribute of something to a value or - removes it if the value is undefined. */ - - function setOrUnset(obj, key, value) { - if (value === undefined) delete obj[key]; - else obj[key] = value; - } - - /* gets the own property of an object */ - - function getOwnProperty(obj, name) { - return Object.prototype.hasOwnProperty.call(obj, name) ? obj[name] : undefined; - } - - /* instanciate a class without calling the constructor */ - - function cheapNew(cls) { - disable_constructor = true; - var rv = new cls; - disable_constructor = false; - return rv; - } - - /* the base class we export */ - var Class = function () {}; - - /* restore the global Class name and pass it to a function. This allows - different versions of the classy library to be used side by side and - in combination with other libraries. */ - Class.$noConflict = function () { - try { - setOrUnset(root, 'Class', old_class); - } catch (e) { - // fix for IE that does not support delete on window - root.Class = old_class; - } - return Class; - }; - - /* what version of classy are we using? */ - Class.$classyVersion = CLASSY_VERSION; - - /* extend functionality */ - Class.$extend = function (properties) { - var super_prototype = this.prototype; - - /* disable constructors and instanciate prototype. Because the - prototype can't raise an exception when created, we are safe - without a try/finally here. */ - var prototype = cheapNew(this); - - /* copy all properties of the includes over if there are any */ - if (properties.__include__) for (var i = 0, n = properties.__include__.length; i != n; ++i) { - var mixin = properties.__include__[i]; - for (var name in mixin) { - var value = getOwnProperty(mixin, name); - if (value !== undefined) prototype[name] = mixin[name]; - } - } - - /* copy all properties over to the new prototype */ - for (var name in properties) { - var value = getOwnProperty(properties, name); - if (name === '__include__' || name === '__classvars__' || value === undefined) continue; - - prototype[name] = typeof value === 'function' && usesSuper(value) ? (function (meth, name) { - return function () { - var old_super = getOwnProperty(this, '$super'); - this.$super = super_prototype[name]; - try { - return meth.apply(this, arguments); - } finally { - setOrUnset(this, '$super', old_super); - } - }; - })(value, name) : value - } - - /* dummy constructor */ - var rv = function () { - if (disable_constructor) return; - var proper_this = root === this ? cheapNew(arguments.callee) : this; - if (proper_this.__init__) proper_this.__init__.apply(proper_this, arguments); - proper_this.$class = rv; - return proper_this; - } - - /* copy all class vars over of any */ - if (properties.__classvars__) for (var key in properties.__classvars__) { - var value = getOwnProperty(properties.__classvars__, key); - if (value !== undefined) rv[key] = value; - } - - /* copy prototype and constructor over, reattach $extend and - return the class */ - rv.prototype = prototype; - rv.constructor = rv; - rv.$extend = Class.$extend; - rv.$withData = Class.$withData; - return rv; - }; - - /* instanciate with data functionality */ - Class.$withData = function (data) { - var rv = cheapNew(this); - for (var key in data) { - var value = getOwnProperty(data, key); - if (value !== undefined) rv[key] = value; - } - return rv; - }; - - /* export the class */ - root.Class = Class; -})(); diff --git a/inyoka_theme_default/static/style/inyoka/portal.less b/inyoka_theme_default/static/style/inyoka/portal.less index 60a4f74..82c8649 100644 --- a/inyoka_theme_default/static/style/inyoka/portal.less +++ b/inyoka_theme_default/static/style/inyoka/portal.less @@ -10,6 +10,23 @@ .portal { + #portal-user-groupselector { + list-style: none; + padding: 0; + max-height: 800px; + overflow-y: auto; + overflow-x: hidden; + } + + &-user-groupsetting-form { + label { + font-weight: normal; + } + > * { + margin-bottom: 1em; + } + } + &-userinfo { &:extend(.table all); &:extend(.table-striped all); @@ -20,18 +37,7 @@ min-width: 33%; } } - &-privilege-list { - &:extend(.list-group all); - - &-item { - &:extend(.list-group-item all); - &.changed:not(.active) { - color: @state-warning-text; - background-color: @state-warning-bg; - } - } - } &-usericon { font-size: 20ex; text-align: center; 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 %}Available groups{% endtrans %} | -- | {% trans %}Membership{% endtrans %} | -
|---|---|---|
| - - | -
-
-
-
-
- |
- - - | -
- {% trans %} - Sorry, you need to enable JavaScript to edit forum privileges. - {% endtrans %} -
-