Index: css/Grid.styl =================================================================== diff --git a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/css/Grid.styl b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/css/Grid.styl --- a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/css/Grid.styl (Revision 81201) +++ b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/css/Grid.styl (Arbeitskopie) @@ -4,23 +4,52 @@ overflow-y: scroll overflow-x: hidden -.umc .umcMultiSelect .dojoxGridView - min-width: 100% - max-width: 100% +.umc .umcMultiSelect + .dojoxGridMasterHeader + background-color: white - .dojoxGridContent + .dojoxGridHeader + background-color: @background-color + display: none + + ^[-2].umcMultiSelectWithContent ^[-2..-1] + display: block + + .dojoxGridCell + background-color: @background-color + color: $text-color + + .dijitCheckBox + icon-image(0, -48, "", "-small", 12px, 12px) + + &.dijitCheckBoxChecked + background-position: -48px -48px + + .dojoxGridView min-width: 100% max-width: 100% - div[role="presentation"] + ^[-1].umcMultiSelectWithContent ^[-1..-1] + border-top: 1px solid black + + .dojoxGridContent + min-width: 100% max-width: 100% - .dojoxGridRow + div[role="presentation"] max-width: 100% - .dojoxGridRowTable - width: 100% !important + .dojoxGridRow + max-width: 100% + .dojoxGridRowTable + width: 100% !important + &.umcMultiSelectNoHeader + .dojoxGridMasterHeader .dojoxGridHeader + display: none + .dojoxGridView + border-top: none + .umc .umcGrid background-color: #fff material-shadow(1) Index: js/de.po =================================================================== diff --git a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/de.po b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/de.po --- a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/de.po (Revision 81201) +++ b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/de.po (Arbeitskopie) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: univention-management-console-frontend\n" "Report-Msgid-Bugs-To: packages@univention.de\n" -"POT-Creation-Date: 2017-06-20 18:42+0200\n" +"POT-Creation-Date: 2017-06-27 18:43+0200\n" "PO-Revision-Date: 2013-09-12 11:31+0200\n" "Last-Translator: Univention GmbH \n" "Language-Team: Univention GmbH \n" @@ -357,6 +357,10 @@ msgid "Search term" msgstr "Suchbegriff" +#: widgets/MultiSelect.js:77 +msgid "Select all" +msgstr "Alles auswählen" + #: tools.js:872 msgid "Send as email" msgstr "Als E-Mail senden" Index: js/widgets/MultiObjectSelect.js =================================================================== diff --git a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiObjectSelect.js b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiObjectSelect.js --- a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiObjectSelect.js (Revision 81201) +++ b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiObjectSelect.js (Arbeitskopie) @@ -108,7 +108,8 @@ // for visualizing the search results, use a MultiSelect this._multiSelect = new MultiSelect({ height: '250px', - label: _('Search results:') + label: _('Search results:'), + showHeader: true }); this._container.addChild(new LabelPane({ content: this._multiSelect, @@ -283,7 +284,9 @@ this.inherited(arguments); // add the MultiSelect widget - this._multiSelect = new MultiSelect({}); + this._multiSelect = new MultiSelect({ + showHeader: true + }); this._attachObjectStore(); if ( 'setStore' in this._multiSelect ) { this.own(aspect.after(this._multiSelect, 'setStore', lang.hitch(this, '_attachObjectStore'))); Index: js/widgets/MultiSelect.js =================================================================== diff --git a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiSelect.js b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiSelect.js --- a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiSelect.js (Revision 81201) +++ b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiSelect.js (Arbeitskopie) @@ -33,7 +33,6 @@ "dojo/_base/lang", "dojo/_base/array", "dojo/Deferred", - "dojo/query", "dojo/dom-class", "dojox/grid/EnhancedGrid", "../tools", @@ -41,9 +40,10 @@ "./_FormWidgetMixin", "./StandbyMixin", "./_RegisterOnShowMixin", + "umc/i18n!", "dojox/grid/enhanced/plugins/IndirectSelection", "dojox/grid/cells" -], function(declare, lang, array, Deferred, query, domClass, EnhancedGrid, tools, _SelectMixin, _FormWidgetMixin, StandbyMixin, _RegisterOnShowMixin) { +], function(declare, lang, array, Deferred, domClass, EnhancedGrid, tools, _SelectMixin, _FormWidgetMixin, StandbyMixin, _RegisterOnShowMixin, _) { return declare("umc.widgets.MultiSelect", [ EnhancedGrid, _FormWidgetMixin, _SelectMixin, StandbyMixin, _RegisterOnShowMixin ], { // summary: // This class represents a MultiSelect widget. Essentially, it adapts a DataGrid @@ -61,6 +61,11 @@ // display the labe above the widget labelPosition: 'top', + // bool wether a header to select all entries should be shown + showHeader: false, + // label of select all entries header + headerLabel: _('Select all'), + // we need the plugin for selection via checkboxes plugins : { indirectSelection: { @@ -71,13 +76,6 @@ } }, - // simple grid structure, only one column - structure: [{ - field: 'label', - name: 'Name', - width: '100%' - }], - // the widget's class name as CSS class baseClass: EnhancedGrid.prototype.baseClass + ' umcMultiSelect', @@ -90,6 +88,13 @@ this.inherited(arguments); + // simple grid structure, only one column + this.structure = [{ + field: 'label', + name: lang.replace('{0}', [this.headerLabel]), + width: '100%' + }]; + // in case 'value' is not specified, generate a new array if (!(this.value instanceof Array)) { this.value = []; @@ -99,8 +104,8 @@ postCreate: function() { this.inherited(arguments); - // hide the header - query('.dojoxGridHeader', this.domNode).style('height', '0px'); + // hide header if showHeader is false + domClass.toggle(this.domNode, 'umcMultiSelectNoHeader', !this.showHeader); // send an onChange event when the selection has changed this.on('selectionChanged', lang.hitch(this, function() { @@ -237,7 +242,7 @@ // stop standby animation and re-render this.standby(false); this.render(); - } + }, /*adaptHeight: function() { this.inherited(arguments); @@ -247,6 +252,11 @@ this.scroller.windowHeight = parseInt(this.height, 10); } }*/ + + render: function() { + domClass.toggle(this.domNode, 'umcMultiSelectWithContent', this.get('rowCount')); + this.inherited(arguments); + } }); }); Index: js/widgets/MultiUploader.js =================================================================== diff --git a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiUploader.js b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiUploader.js --- a/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiUploader.js (Revision 81201) +++ b/branches/ucs-4.2/ucs-4.2-1/management/univention-web/js/widgets/MultiUploader.js (Arbeitskopie) @@ -123,7 +123,8 @@ // MultiSelect widget for displaying the file list this._files = new MultiSelect({ - style: 'width: 50em' + style: 'width: 50em', + showHeader: true }); this.addChild(this._files);