diff --git a/THANKS b/THANKS index 804a8fb18..847d02a42 100644 --- a/THANKS +++ b/THANKS @@ -31,6 +31,9 @@ OpenSlides uses parts of the following projects: - jQuery Templating Plugin License: MIT/GPLv2 + - jQuery bsmSelect + + License: MIT/GPLv2 * jQuery UI diff --git a/openslides/motion/static/styles/motion.css b/openslides/motion/static/styles/motion.css index 92f28f76a..5bba51dbb 100644 --- a/openslides/motion/static/styles/motion.css +++ b/openslides/motion/static/styles/motion.css @@ -5,11 +5,6 @@ * :license: GNU GPL, see LICENSE for more details. */ -/* motion create/update form fields */ -#id_submitter, #id_supporter { - height: 110px; - width: auto; -} /* motion version diff table */ table.diff, .diff_row { font-size: 12px; diff --git a/openslides/motion/templates/motion/motion_form.html b/openslides/motion/templates/motion/motion_form.html index 45919ec1e..aa8beff40 100644 --- a/openslides/motion/templates/motion/motion_form.html +++ b/openslides/motion/templates/motion/motion_form.html @@ -2,17 +2,29 @@ {% load tags %} {% load i18n %} - {% load staticfiles %} {% block header %} + {% endblock %} {% block javascript %} + + {% endblock %} {% block title %} diff --git a/openslides/participant/forms.py b/openslides/participant/forms.py index 6f494b989..96862079a 100644 --- a/openslides/participant/forms.py +++ b/openslides/participant/forms.py @@ -26,8 +26,7 @@ class UserCreateForm(CssClassMixin, forms.ModelForm): groups = LocalizedModelMultipleChoiceField( # Hide the built-in groups 'Anonymous' (pk=1) and 'Registered' (pk=2) queryset=Group.objects.exclude(pk=1).exclude(pk=2), - label=ugettext_lazy('Groups'), required=False, - help_text=ugettext_lazy('Hold down "Control", or "Command" on a Mac, to select more than one.')) + label=ugettext_lazy('Groups'), required=False) class Meta: model = User diff --git a/openslides/participant/templates/participant/edit.html b/openslides/participant/templates/participant/edit.html index 79162fe2a..a50a8d0f2 100644 --- a/openslides/participant/templates/participant/edit.html +++ b/openslides/participant/templates/participant/edit.html @@ -1,6 +1,26 @@ {% extends "base.html" %} {% load i18n %} +{% load staticfiles %} + +{% block header %} + +{% endblock %} + +{% block javascript %} + + +{% endblock %} {% block title %} {% if edit_user %} diff --git a/openslides/static/javascript/jquery.bsmselect.js b/openslides/static/javascript/jquery.bsmselect.js new file mode 100755 index 000000000..bee749b25 --- /dev/null +++ b/openslides/static/javascript/jquery.bsmselect.js @@ -0,0 +1,382 @@ +/* + * Better Select Multiple - jQuery Plugin + * + * based on Alternate Select Multiple (asmSelect) 1.0.4a beta (http://www.ryancramer.com/projects/asmselect/) + * + * Copyright (c) 2009 by Ryan Cramer - http://www.ryancramer.com + * Copyright (c) 2010-2013 by Victor Berchet - http://www.github.com/vicb + * + * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. + * + * bsmSelect version: v1.4.6 - 2013-03-02 + */ + +(function($) { + + + function BsmSelect(target, options) + { + this.$original = $(target); // the original select multiple + this.buildingSelect = false; // is the new select being constructed right now? + this.ieClick = false; // in IE, has a click event occurred? ignore if not + this.ignoreOriginalChangeEvent = false; // originalChangeEvent bypassed when this is true + this.options = options; + this.buildDom(); + } + + BsmSelect.prototype = { + /** + * Generate an UID + */ + generateUid: function(index) { + return (this.uid = this.options.containerClass + index); + }, + + /** + * Build the DOM for bsmSelect + */ + buildDom: function() { + var self = this, o = this.options; + + if (o.addItemTarget === 'original') { + $('option', this.$original).each(function(i, o) { + if ($(o).data('bsm-order') === undefined) { $(o).data('bsm-order', i); } + }); + } + + for (var index = 0; $('#' + this.generateUid(index)).size(); index++) {} + + this.$select = $(' + optionDisabledClass: 'bsmOptionDisabled', // Class for items that are already selected / disabled + listClass: 'bsmList', // Class for the list ($list) + listItemClass: 'bsmListItem', // Class for the
  • list items + listItemLabelClass: 'bsmListItemLabel', // Class for the label text that appears in list items + removeClass: 'bsmListItemRemove', // Class given to the 'remove' link + highlightClass: 'bsmHighlight' // Class given to the highlight + }; + +})(jQuery); diff --git a/openslides/static/styles/jquery.bsmselect.css b/openslides/static/styles/jquery.bsmselect.css new file mode 100755 index 000000000..8b1129255 --- /dev/null +++ b/openslides/static/styles/jquery.bsmselect.css @@ -0,0 +1,118 @@ +.bsmContainer { + /* container that surrounds entire bsmSelect widget */ +} + +.bsmSelect { + /* the newly created regular 'select' */ + display: inline; +} + +.bsmOptionDisabled { + /* disabled options in new select */ + color: #999; +} + +.bsmHighlight { + /* the highlight span */ + float: right; + padding: 0; + margin: 0 0 0 1em; +} + +.bsmList { + /* html list that contains selected items */ + margin: 0.25em 0 1em 0; + position: relative; + display: block; + padding-left: 0; + list-style: none; +} + +.bsmListItem { + /* li item from the html list above */ + position: relative; + margin-left: 0; + padding-left: 0; + list-style: none; + background: #ddd; + border: 1px solid #bbb; + width: auto; + margin: 0 0 -1px 0; + line-height: 1em; +} + +.bsmListItem:hover { + background-color: #e5e5e5; +} + +.bsmListItemLabel { + /* this is a span that surrounds the text in the item, except for the remove link */ + padding: 5px; + display: block; +} + +.bsmListSortable .bsmListItemLabel { + cursor: move; +} + +.bsmListItemRemove { + /* the remove link in each list item */ + position: absolute; + right: 0; + top: 0; + padding: 5px; +} + +.bsmScrollWorkaround { + /* Fix a bug when the 'html' element has an overflow set to either 'scroll' or 'auto' on FF. */ + padding-bottom: 1px; + overflow: auto; +} + + +/* + * Custom styles + */ +.bsmList-custom { + /* html list that contains selected items */ + margin: 0; + display: block; + padding-left: 0; + list-style: none; +} + +.bsmListItem-custom { + /* li item from the html list above */ + margin: 0 5px 5px 0; + padding: 4px; + list-style: none; + background: #ddd; + border: 1px solid #bbb; + line-height: 1em; + float: left; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +.bsmListItem-custom:hover { + background-color: #e5e5e5; + box-shadow: 0 0 3px #aaa; + -webkit-box-shadow: 0 0 3px #aaa; + -moz-box-shadow: 0 0 3px #aaa; +} + +.bsmListItemLabel-custom { + padding-right: 5px; +} + +.bsmListItemRemove-custom { + text-decoration: none; +} +.bsmContainer:after { + content: ""; + display: block; + height: 0; + clear: both; + visibility: hidden; +}