diff --git a/openslides/assignments/static/js/assignments/site.js b/openslides/assignments/static/js/assignments/site.js index d13f760f7..e856b1d10 100644 --- a/openslides/assignments/static/js/assignments/site.js +++ b/openslides/assignments/static/js/assignments/site.js @@ -43,6 +43,9 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) } ); }, + tags: function(Tag) { + return Tag.findAll(); + }, phases: function(Assignment) { return Assignment.getPhases(); } @@ -59,6 +62,9 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) users: function(User) { return User.findAll(); }, + tags: function(Tag) { + return Tag.findAll(); + }, phases: function(Assignment) { return Assignment.getPhases(); } @@ -99,7 +105,8 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) .factory('AssignmentForm', [ 'gettextCatalog', 'operator', - function (gettextCatalog, operator) { + 'Tag', + function (gettextCatalog, operator, Tag) { return { // ngDialog for assignment form getDialog: function (assignment) { @@ -165,6 +172,25 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) description: gettextCatalog.getString('If deactivated the election appears as internal item on agenda.') }, hide: !operator.hasPerms('assignments.can_manage') + }, + { + key: 'more', + type: 'checkbox', + templateOptions: { + label: gettextCatalog.getString('Show extended fields') + }, + hide: !operator.hasPerms('assignments.can_manage') + }, + { + key: 'tags_id', + type: 'select-multiple', + templateOptions: { + label: gettextCatalog.getString('Tags'), + options: Tag.getAll(), + ngOptions: 'option.id as option.name for option in to.options', + placeholder: gettextCatalog.getString('Select or search a tag ...') + }, + hideExpression: '!model.more' }]; } }; @@ -176,9 +202,11 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) 'ngDialog', 'AssignmentForm', 'Assignment', + 'Tag', 'phases', - function($scope, ngDialog, AssignmentForm, Assignment, phases) { + function($scope, ngDialog, AssignmentForm, Assignment, Tag, phases) { Assignment.bindAll({}, $scope, 'assignments'); + Tag.bindAll({}, $scope, 'tags'); $scope.phases = phases; $scope.alert = {}; @@ -200,7 +228,15 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) assignment.description, $scope.phases[assignment.phase].display_name, _.map(assignment.assignment_related_users, - function (candidate) {return candidate.user.get_short_name();}).join(" "), + function (candidate) { + return candidate.user.get_short_name(); + } + ).join(" "), + _.map(assignment.tags, + function (tag) { + return tag.name; + } + ).join(" "), ].join(" "); }; @@ -545,7 +581,7 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments']) 'no': '' }; } - + if (option.votes.length) { defaultValue.yes = option.votes[0].weight; defaultValue.no = option.votes[1].weight; diff --git a/openslides/assignments/static/templates/assignments/assignment-detail.html b/openslides/assignments/static/templates/assignments/assignment-detail.html index dfd19c96f..05a989261 100644 --- a/openslides/assignments/static/templates/assignments/assignment-detail.html +++ b/openslides/assignments/static/templates/assignments/assignment-detail.html @@ -51,6 +51,11 @@

Number of posts to be elected

{{ assignment.open_posts }}
+ +

Tags

+ + {{ tag.name }}{{$last ? '' : ', '}} +
diff --git a/openslides/assignments/static/templates/assignments/assignment-list.html b/openslides/assignments/static/templates/assignments/assignment-list.html index efb321360..f28912717 100644 --- a/openslides/assignments/static/templates/assignments/assignment-list.html +++ b/openslides/assignments/static/templates/assignments/assignment-list.html @@ -138,6 +138,9 @@ {{ assignment.title }} + + {{ tag.name }} +
Edit | QuickEdit | @@ -184,7 +187,16 @@ ng-model="assignment.phase" class="form-control" id="selectPhase">
-
+
+ + +