Merge pull request #1875 from emanuelschuetze/template-fixes
Template fixes
This commit is contained in:
commit
48781b95ba
@ -52,11 +52,11 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
|
|||||||
// in the DS store.
|
// in the DS store.
|
||||||
title = this.title;
|
title = this.title;
|
||||||
}
|
}
|
||||||
if (this.getContentResource().verboseName) {
|
if (this.getContentResource().agendaSupplement) {
|
||||||
title = gettextCatalog.getString(this.getContentResource().verboseName) + ' ' + title;
|
title = gettextCatalog.getString(this.getContentResource().agendaSupplement) + ' ' + title;
|
||||||
}
|
}
|
||||||
if (this.item_number) {
|
if (this.item_number) {
|
||||||
title = this.item_number + ' ' + title;
|
title = this.item_number + ' · ' + title;
|
||||||
}
|
}
|
||||||
return title;
|
return title;
|
||||||
},
|
},
|
||||||
|
@ -126,9 +126,9 @@
|
|||||||
|
|
||||||
<!-- Select speakers form -->
|
<!-- Select speakers form -->
|
||||||
<div class="form-group spacer">
|
<div class="form-group spacer">
|
||||||
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
</alert>
|
</uib-alert>
|
||||||
<div os-perms="agenda.can_manage" class="input-group">
|
<div os-perms="agenda.can_manage" class="input-group">
|
||||||
<ui-select ng-model="speakerSelectBox.selected" ng-change="addSpeaker(speakerSelectBox.selected.id)">
|
<ui-select ng-model="speakerSelectBox.selected" ng-change="addSpeaker(speakerSelectBox.selected.id)">
|
||||||
<ui-select-match placeholder="{{ 'Select or search a participant ...' | translate }}">
|
<ui-select-match placeholder="{{ 'Select or search a participant ...' | translate }}">
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
<!-- delete mode -->
|
<!-- delete mode -->
|
||||||
<button os-perms="agenda.can_manage" class="btn btn-default"
|
<button os-perms="agenda.can_manage" class="btn"
|
||||||
|
ng-class="$parent.isDeleteMode ? 'btn-primary' : 'btn-default'"
|
||||||
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
||||||
<i class="fa fa-check-square-o"></i>
|
<i class="fa fa-check-square-o"></i>
|
||||||
<translate>Select ...</translate>
|
<translate>Select ...</translate>
|
||||||
@ -65,7 +66,8 @@
|
|||||||
placeholder="{{ 'Search' | translate}}">
|
placeholder="{{ 'Search' | translate}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen">
|
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen"
|
||||||
|
ng-class="isFilterOpen ? 'btn-primary' : 'btn-default'">
|
||||||
<i class="fa fa-filter"></i>
|
<i class="fa fa-filter"></i>
|
||||||
<translate>Filter ...</translate>
|
<translate>Filter ...</translate>
|
||||||
</button>
|
</button>
|
||||||
@ -95,6 +97,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer-top-lg italic">
|
<div class="spacer-top-lg italic">
|
||||||
|
<span os-perms="agenda.can_see_hidden_items">{{ itemsFiltered.length }} /</span>
|
||||||
{{ items.length }} {{ "items" | translate }}<span ng-if="(items|filter:{selected:true}).length > 0">,
|
{{ items.length }} {{ "items" | translate }}<span ng-if="(items|filter:{selected:true}).length > 0">,
|
||||||
{{(items|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
{{(items|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -115,8 +118,8 @@
|
|||||||
<th class="minimum">
|
<th class="minimum">
|
||||||
<translate>Done</translate>
|
<translate>Done</translate>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="item in items | filter: filter.search | filter: {is_hidden: filter.showHiddenItems}
|
<tr ng-repeat="item in itemsFiltered = (items | filter: filter.search |
|
||||||
| filter: {closed: filter.showClosedItems}"
|
filter: {is_hidden: filter.showHiddenItems} | filter: {closed: filter.showClosedItems})"
|
||||||
class="animate-item"
|
class="animate-item"
|
||||||
ng-class="{ 'activeline': item.isProjected(), 'selected': item.selected, 'hiddenrow': item.is_hidden}">
|
ng-class="{ 'activeline': item.isProjected(), 'selected': item.selected, 'hiddenrow': item.is_hidden}">
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
@ -131,8 +134,8 @@
|
|||||||
<td ng-show="isDeleteMode" os-perms="agenda.can_manage" class="deleteColumn">
|
<td ng-show="isDeleteMode" os-perms="agenda.can_manage" class="deleteColumn">
|
||||||
<input type="checkbox" ng-model="item.selected">
|
<input type="checkbox" ng-model="item.selected">
|
||||||
<!-- agenda data columns -->
|
<!-- agenda data columns -->
|
||||||
<td ng-if="!item.quickEdit" ng-mouseover="item.hover=true" ng-mouseleave="item.hover=false">
|
<td ng-if="!item.quickEdit" ng-mouseover="item.hover=true" ng-mouseleave="item.hover=false"
|
||||||
<span ng-repeat="n in [].constructor(item.parentCount) track by $index">–</span>
|
style="padding-left: calc(8px + {{ item.parentCount }}*15px)">
|
||||||
<strong>
|
<strong>
|
||||||
<a href="" ng-click="open(item)">
|
<a href="" ng-click="open(item)">
|
||||||
{{ item.getTitle() }}
|
{{ item.getTitle() }}
|
||||||
@ -144,8 +147,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div os-perms="agenda.can_manage" class="hoverActions" ng-class="{'hiddenDiv': !item.hover}">
|
<div os-perms="agenda.can_manage" class="hoverActions" ng-class="{'hiddenDiv': !item.hover}">
|
||||||
<a ui-sref="agenda.item.detail({id: item.id})" translate>List of speakers</a> |
|
<a ui-sref="agenda.item.detail({id: item.id})" translate>List of speakers</a> |
|
||||||
<a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a> |
|
<a href="" ng-click="editDialog(item)" translate>Edit</a> |
|
||||||
<a href="" ng-click="editDialog(item)" translate>Edit</a>
|
<a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a>
|
||||||
<span ng-if="item.content_object.collection == 'core/customslide'"> |
|
<span ng-if="item.content_object.collection == 'core/customslide'"> |
|
||||||
<a href="" class="text-danger"
|
<a href="" class="text-danger"
|
||||||
ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br>
|
ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br>
|
||||||
@ -162,9 +165,9 @@
|
|||||||
<td ng-show="item.quickEdit" os-perms="agenda.can_manage" colspan="3">
|
<td ng-show="item.quickEdit" os-perms="agenda.can_manage" colspan="3">
|
||||||
<form ng-submit="save(item)">
|
<form ng-submit="save(item)">
|
||||||
<h4>{{ item.getTitle() }} <span class="text-muted">– QuickEdit</span></h4>
|
<h4>{{ item.getTitle() }} <span class="text-muted">– QuickEdit</span></h4>
|
||||||
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
</alert>
|
</uib-alert>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="inputTitle" translate>Title</label>
|
<label for="inputTitle" translate>Title</label>
|
||||||
|
@ -80,6 +80,7 @@ angular.module('OpenSlidesApp.assignments', [])
|
|||||||
name: name,
|
name: name,
|
||||||
useClass: jsDataModel,
|
useClass: jsDataModel,
|
||||||
verboseName: gettext('Election'),
|
verboseName: gettext('Election'),
|
||||||
|
agendaSupplement: gettext('Election'),
|
||||||
phases: phases,
|
phases: phases,
|
||||||
getPhases: function () {
|
getPhases: function () {
|
||||||
if (!this.phases) {
|
if (!this.phases) {
|
||||||
|
@ -4,19 +4,29 @@
|
|||||||
|
|
||||||
angular.module('OpenSlidesApp.assignments.projector', ['OpenSlidesApp.assignments'])
|
angular.module('OpenSlidesApp.assignments.projector', ['OpenSlidesApp.assignments'])
|
||||||
|
|
||||||
.config(function(slidesProvider) {
|
.config([
|
||||||
|
'slidesProvider',
|
||||||
|
function(slidesProvider) {
|
||||||
slidesProvider.registerSlide('assignments/assignment', {
|
slidesProvider.registerSlide('assignments/assignment', {
|
||||||
template: 'static/templates/assignments/slide_assignment.html',
|
template: 'static/templates/assignments/slide_assignment.html',
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('SlideAssignmentCtrl', function($scope, Assignment) {
|
.controller('SlideAssignmentCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'Assignment',
|
||||||
|
'User',
|
||||||
|
function($scope, Assignment, User) {
|
||||||
// Attention! Each object that is used here has to be dealt on server side.
|
// Attention! Each object that is used here has to be dealt on server side.
|
||||||
// Add it to the coresponding get_requirements method of the ProjectorElement
|
// Add it to the coresponding get_requirements method of the ProjectorElement
|
||||||
// class.
|
// class.
|
||||||
var id = $scope.element.id;
|
var id = $scope.element.id;
|
||||||
Assignment.find(id);
|
Assignment.find(id);
|
||||||
Assignment.bindOne(id, $scope, 'assignment');
|
Assignment.bindOne(id, $scope, 'assignment');
|
||||||
});
|
User.findAll();
|
||||||
|
User.bindAll({}, $scope, 'users');
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
@ -18,7 +18,9 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.config(function($stateProvider) {
|
.config([
|
||||||
|
'$stateProvider',
|
||||||
|
function($stateProvider) {
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('assignments', {
|
.state('assignments', {
|
||||||
url: '/assignments',
|
url: '/assignments',
|
||||||
@ -36,7 +38,10 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
},
|
},
|
||||||
phases: function(Assignment) {
|
phases: function(Assignment) {
|
||||||
return Assignment.getPhases();
|
return Assignment.getPhases();
|
||||||
}
|
},
|
||||||
|
users: function(User) {
|
||||||
|
return User.findAll();
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('assignments.assignment.detail', {
|
.state('assignments.assignment.detail', {
|
||||||
@ -47,6 +52,9 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
},
|
},
|
||||||
users: function(User) {
|
users: function(User) {
|
||||||
return User.findAll();
|
return User.findAll();
|
||||||
|
},
|
||||||
|
phases: function(Assignment) {
|
||||||
|
return Assignment.getPhases();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -74,7 +82,8 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
// Service for generic assignment form (create and update)
|
// Service for generic assignment form (create and update)
|
||||||
.factory('AssignmentForm', [
|
.factory('AssignmentForm', [
|
||||||
@ -119,7 +128,7 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
key: 'open_posts',
|
key: 'open_posts',
|
||||||
type: 'input',
|
type: 'input',
|
||||||
templateOptions: {
|
templateOptions: {
|
||||||
label: gettextCatalog.getString('Number of members to be elected'),
|
label: gettextCatalog.getString('Number of posts to be elected'),
|
||||||
type: 'number',
|
type: 'number',
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
@ -159,6 +168,16 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
}
|
}
|
||||||
$scope.sortColumn = column;
|
$scope.sortColumn = column;
|
||||||
};
|
};
|
||||||
|
// define custom search filter string
|
||||||
|
$scope.getFilterString = function (assignment) {
|
||||||
|
return [
|
||||||
|
assignment.title,
|
||||||
|
assignment.description,
|
||||||
|
$scope.phases[assignment.phase].display_name,
|
||||||
|
_.map(assignment.assignment_related_users,
|
||||||
|
function (candidate) {return candidate.user.get_short_name()}).join(" "),
|
||||||
|
].join(" ");
|
||||||
|
}
|
||||||
|
|
||||||
// open new/edit dialog
|
// open new/edit dialog
|
||||||
$scope.openDialog = function (assignment) {
|
$scope.openDialog = function (assignment) {
|
||||||
@ -222,11 +241,14 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
'Assignment',
|
'Assignment',
|
||||||
'User',
|
'User',
|
||||||
'assignment',
|
'assignment',
|
||||||
function($scope, $http, gettext, ngDialog, AssignmentForm, operator, Assignment, User, assignment) {
|
'phases',
|
||||||
|
function($scope, $http, gettext, ngDialog, AssignmentForm, operator, Assignment, User, assignment, phases) {
|
||||||
User.bindAll({}, $scope, 'users');
|
User.bindAll({}, $scope, 'users');
|
||||||
Assignment.bindOne(assignment.id, $scope, 'assignment');
|
Assignment.bindOne(assignment.id, $scope, 'assignment');
|
||||||
Assignment.loadRelations(assignment, 'agenda_item');
|
Assignment.loadRelations(assignment, 'agenda_item');
|
||||||
$scope.candidateSelectBox = {};
|
$scope.candidateSelectBox = {};
|
||||||
|
// get all item types via OPTIONS request
|
||||||
|
$scope.phases = phases.data.actions.POST.phase.choices;
|
||||||
$scope.alert = {};
|
$scope.alert = {};
|
||||||
|
|
||||||
// open edit dialog
|
// open edit dialog
|
||||||
@ -286,6 +308,11 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
// update phase
|
||||||
|
$scope.updatePhase = function (phase_id) {
|
||||||
|
assignment.phase = phase_id;
|
||||||
|
Assignment.save(assignment);
|
||||||
|
}
|
||||||
// create new ballot
|
// create new ballot
|
||||||
$scope.createBallot = function () {
|
$scope.createBallot = function () {
|
||||||
$http.post('/rest/assignments/assignment/' + assignment.id + '/create_poll/')
|
$http.post('/rest/assignments/assignment/' + assignment.id + '/create_poll/')
|
||||||
@ -383,16 +410,31 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
'AssignmentForm',
|
'AssignmentForm',
|
||||||
'assignment',
|
'assignment',
|
||||||
function($scope, $state, Assignment, AssignmentForm, assignment) {
|
function($scope, $state, Assignment, AssignmentForm, assignment) {
|
||||||
// set initial values for form model
|
$scope.alert = {};
|
||||||
$scope.model = assignment;
|
// set initial values for form model by create deep copy of assignment object
|
||||||
|
// so list/detail view is not updated while editing
|
||||||
|
$scope.model = angular.copy(assignment);
|
||||||
// get all form fields
|
// get all form fields
|
||||||
$scope.formFields = AssignmentForm.getFormFields();
|
$scope.formFields = AssignmentForm.getFormFields();
|
||||||
|
|
||||||
// save assignment
|
// save assignment
|
||||||
$scope.save = function (assignment) {
|
$scope.save = function (assignment) {
|
||||||
|
// inject the changed assignment (copy) object back into DS store
|
||||||
|
Assignment.inject(assignment);
|
||||||
|
// save change motion object on server
|
||||||
Assignment.save(assignment).then(
|
Assignment.save(assignment).then(
|
||||||
function(success) {
|
function(success) {
|
||||||
$scope.closeThisDialog();
|
$scope.closeThisDialog();
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
// save error: revert all changes by restore
|
||||||
|
// (refresh) original assignment object from server
|
||||||
|
Assignment.refresh(assignment);
|
||||||
|
var message = '';
|
||||||
|
for (var e in error.data) {
|
||||||
|
message += e + ': ' + error.data[e] + ' ';
|
||||||
|
}
|
||||||
|
$scope.alert = {type: 'danger', msg: message, show: true};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -39,6 +39,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="meta">
|
||||||
|
<div class="title" ng-click="isMeta = !isMeta">
|
||||||
|
<div class="name">
|
||||||
|
<i class="fa fa-info-circle"></i>
|
||||||
|
<translate>Meta information</translate>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="fa fa-lg" ng-class="isMeta ? 'fa-angle-down' : 'fa-angle-up'"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="detail" uib-collapse="isMeta">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<!-- posts -->
|
||||||
|
<h3 translate>Number of posts to be elected</h3>
|
||||||
|
{{ assignment.open_posts }}<br>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<!-- phase -->
|
||||||
|
<h3 translate>Phase</h3>
|
||||||
|
<span class="label" ng-class="{'label-primary': assignment.phase == 0,
|
||||||
|
'label-warning': assignment.phase == 1,
|
||||||
|
'label-success': assignment.phase == 2 }">
|
||||||
|
{{ phases[assignment.phase].display_name | translate }}
|
||||||
|
</span>
|
||||||
|
<div os-perms="assignments.can_manage" class="spacer">
|
||||||
|
<select ng-model="phaseSelect" class="form-control" ng-change="updatePhase(phaseSelect)">
|
||||||
|
<option value="" translate>--- Set phase ---</option>
|
||||||
|
<option ng-repeat="phase in phases" value="{{ phase.value }}">{{ phase.display_name }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="details">
|
<div class="details">
|
||||||
<h3 translate>Description</h3>
|
<h3 translate>Description</h3>
|
||||||
<div class="white-space-pre-line">{{ assignment.description }}</div>
|
<div class="white-space-pre-line">{{ assignment.description }}</div>
|
||||||
@ -55,9 +91,9 @@
|
|||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
</alert>
|
</uib-alert>
|
||||||
<div os-perms="assignments.can_nominate_other" class="input-group">
|
<div os-perms="assignments.can_nominate_other" class="input-group">
|
||||||
<ui-select ng-model="candidateSelectBox.selected" ng-change="addCandidate(candidateSelectBox.selected.id)">
|
<ui-select ng-model="candidateSelectBox.selected" ng-change="addCandidate(candidateSelectBox.selected.id)">
|
||||||
<ui-select-match placeholder="{{ 'Select or search a participant ...' | translate }}">
|
<ui-select-match placeholder="{{ 'Select or search a participant ...' | translate }}">
|
||||||
@ -91,7 +127,8 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<uib-tabset class="spacer">
|
<uib-tabset class="spacer">
|
||||||
<uib-tab ng-repeat="poll in assignment.polls | orderBy:'-id'" heading="Ballot {{ assignment.polls.length - $index }}">
|
<uib-tab ng-repeat="poll in assignment.polls | orderBy:'-id'"
|
||||||
|
heading="{{ 'Ballot' | translate }} {{ assignment.polls.length - $index }}">
|
||||||
<div os-perms="assignments.can_manage" class="spacer">
|
<div os-perms="assignments.can_manage" class="spacer">
|
||||||
<!-- angular requires to open the link in new tab with "target='_blank'".
|
<!-- angular requires to open the link in new tab with "target='_blank'".
|
||||||
Otherwise the pdf url can't be open in same window; angular redirects to "/". -->
|
Otherwise the pdf url can't be open in same window; angular redirects to "/". -->
|
||||||
@ -107,17 +144,17 @@
|
|||||||
2. <translate>Enter votes</translate>
|
2. <translate>Enter votes</translate>
|
||||||
</button>
|
</button>
|
||||||
<i class="fa fa-arrow-right"></i>
|
<i class="fa fa-arrow-right"></i>
|
||||||
<button os-perms-lite="assignments.can_manage" ng-if="!poll.published" ng-click="publishBallot(poll, true)"
|
<button ng-if="!poll.published" ng-click="publishBallot(poll, true)"
|
||||||
class="btn btn-default btn-sm">
|
class="btn btn-default btn-sm">
|
||||||
<i class="fa fa-toggle-off"></i>
|
<i class="fa fa-toggle-off"></i>
|
||||||
3. <translate>Publish ballot</translate>
|
3. <translate>Publish ballot</translate>
|
||||||
</button>
|
</button>
|
||||||
<button os-perms-lite="assignments.can_manage" ng-if="poll.published" ng-click="publishBallot(poll, false)"
|
<button ng-if="poll.published" ng-click="publishBallot(poll, false)"
|
||||||
class="btn btn-default btn-sm">
|
class="btn btn-default btn-sm">
|
||||||
<i class="fa fa-toggle-on"></i>
|
<i class="fa fa-toggle-on"></i>
|
||||||
<translate>Published</translate>
|
<translate>Published</translate>
|
||||||
</button>
|
</button>
|
||||||
<a ng-click="deleteBallot(poll)" class="btn btn-default btn-sm">
|
<a ng-click="deleteBallot(poll)" class="btn btn-danger btn-sm">
|
||||||
<i class="fa fa-times"></i>
|
<i class="fa fa-times"></i>
|
||||||
<translate>Delete</translate>
|
<translate>Delete</translate>
|
||||||
</a>
|
</a>
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<h1 ng-if="model.id" translate>Edit election</h1>
|
<h1 ng-if="model.id" translate>Edit election</h1>
|
||||||
<h1 ng-if="!model.id" translate>New election</h1>
|
<h1 ng-if="!model.id" translate>New election</h1>
|
||||||
|
|
||||||
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
|
{{ alert.msg }}
|
||||||
|
</uib-alert>
|
||||||
|
|
||||||
<form name="assignmentForm" ng-submit="save(model)">
|
<form name="assignmentForm" ng-submit="save(model)">
|
||||||
<formly-form model="model" fields="formFields">
|
<formly-form model="model" fields="formFields">
|
||||||
<button type="submit" ng-disabled="assignmentForm.$invalid" class="btn btn-primary" translate>
|
<button type="submit" ng-disabled="assignmentForm.$invalid" class="btn btn-primary" translate>
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
<!-- delete mode -->
|
<!-- delete mode -->
|
||||||
<button os-perms="assignments.can_manage" class="btn btn-default"
|
<button os-perms="assignments.can_manage" class="btn"
|
||||||
|
ng-class="$parent.isDeleteMode ? 'btn-primary' : 'btn-default'"
|
||||||
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
||||||
<i class="fa fa-check-square-o"></i>
|
<i class="fa fa-check-square-o"></i>
|
||||||
<translate>Select ...</translate>
|
<translate>Select ...</translate>
|
||||||
@ -39,7 +40,8 @@
|
|||||||
placeholder="{{ 'Search' | translate}}">
|
placeholder="{{ 'Search' | translate}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen">
|
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen"
|
||||||
|
ng-class="isFilterOpen ? 'btn-primary' : 'btn-default'">
|
||||||
<i class="fa fa-filter"></i>
|
<i class="fa fa-filter"></i>
|
||||||
<translate>Filter ...</translate>
|
<translate>Filter ...</translate>
|
||||||
</button>
|
</button>
|
||||||
@ -69,6 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer-top-lg italic">
|
<div class="spacer-top-lg italic">
|
||||||
|
{{ assignmentsFiltered.length }} /
|
||||||
{{ assignments.length }} {{ "elections" | translate }}<span ng-if="(assignments|filter:{selected:true}).length > 0">,
|
{{ assignments.length }} {{ "elections" | translate }}<span ng-if="(assignments|filter:{selected:true}).length > 0">,
|
||||||
{{(assignments|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
{{(assignments|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -96,8 +99,8 @@
|
|||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="assignment in assignments | filter: filter.search | filter: {phase: phaseFilter} |
|
<tr ng-repeat="assignment in assignmentsFiltered = (assignments | osFilter: filter.search : getFilterString |
|
||||||
orderBy: sortColumn:reverse"
|
filter: {phase: phaseFilter} | orderBy: sortColumn:reverse)"
|
||||||
class="animate-item"
|
class="animate-item"
|
||||||
ng-class="{ 'activeline': assignment.isProjected(), 'selected': assignment.selected }">
|
ng-class="{ 'activeline': assignment.isProjected(), 'selected': assignment.selected }">
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
@ -135,9 +138,9 @@
|
|||||||
<!-- quickEdit columns -->
|
<!-- quickEdit columns -->
|
||||||
<td ng-if="assignment.quickEdit" colspan="3">
|
<td ng-if="assignment.quickEdit" colspan="3">
|
||||||
<h4>{{ assignment.title }} <span class="text-muted">– Quick Edit</span></h4>
|
<h4>{{ assignment.title }} <span class="text-muted">– Quick Edit</span></h4>
|
||||||
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
</alert>
|
</uib-alert>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="inputTitle" translate>Title</label>
|
<label for="inputTitle" translate>Title</label>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<h1><translate>Ballot</translate> {{ ballot }}</h1>
|
<h1><translate>Ballot</translate> {{ ballot }}</h1>
|
||||||
|
|
||||||
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
</alert>
|
</uib-alert>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<translate>Special values</translate>:
|
<translate>Special values</translate>:
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
<div ng-controller="SlideAssignmentCtrl" class="content scrollcontent">
|
<div ng-controller="SlideAssignmentCtrl" class="content scrollcontent">
|
||||||
<h1>{{ assignment.title }}</h1>
|
<h1>{{ assignment.title }}</h1>
|
||||||
<div class="white-space-pre-line">{{ assignment.description }}</div>
|
<div class="white-space-pre-line">{{ assignment.description }}</div>
|
||||||
|
|
||||||
|
<!-- candidates -->
|
||||||
|
<h2 translate>Candidates</h2>
|
||||||
|
<ol>
|
||||||
|
<li ng-repeat="related_user in assignment.assignment_related_users">
|
||||||
|
{{ related_user.user.get_full_name() }}
|
||||||
|
<i ng-if="related_user.elected" class="fa fa-star" title="{{ 'is elected' | translate }}"></i>
|
||||||
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
@ -172,7 +172,7 @@ class AssignmentViewSet(ModelViewSet):
|
|||||||
if not request.user.has_perm('assignments.can_manage'):
|
if not request.user.has_perm('assignments.can_manage'):
|
||||||
self.permission_denied(request)
|
self.permission_denied(request)
|
||||||
if assignment.phase == assignment.PHASE_FINISHED:
|
if assignment.phase == assignment.PHASE_FINISHED:
|
||||||
detail = _('You can not delete someones candidature to this election because it is finished.')
|
detail = _("You can not delete someone's candidature to this election because it is finished.")
|
||||||
raise ValidationError({'detail': detail})
|
raise ValidationError({'detail': detail})
|
||||||
if not assignment.is_candidate(user) and not assignment.is_elected(user):
|
if not assignment.is_candidate(user) and not assignment.is_elected(user):
|
||||||
raise ValidationError({'detail': _('User %s has no status in this election.') % user})
|
raise ValidationError({'detail': _('User %s has no status in this election.') % user})
|
||||||
|
@ -458,6 +458,10 @@ img {
|
|||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.col2 .countdown_timer.negative {
|
||||||
|
color: #CC0000;
|
||||||
|
}
|
||||||
|
|
||||||
.col2 .notNull {
|
.col2 .notNull {
|
||||||
color: red;
|
color: red;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@ -589,6 +593,10 @@ img {
|
|||||||
width: 250px;
|
width: 250px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loginForm .input-group-addon i {
|
||||||
|
width: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
.modal-header {
|
.modal-header {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
@ -648,23 +656,21 @@ img {
|
|||||||
|
|
||||||
/* ngAnimate classes */
|
/* ngAnimate classes */
|
||||||
.animate-item.ng-enter {
|
.animate-item.ng-enter {
|
||||||
-webkit-animation: fade-in 1s linear;
|
-webkit-animation: fade-in 0.5s linear;
|
||||||
animation: fade-in 1.5s linear;
|
animation: fade-in 0.5s linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
.animate-item.ng-leave {
|
.animate-item.ng-leave {
|
||||||
-webkit-animation: fade-out 1s linear;
|
-webkit-animation: fade-out 0.25s linear;
|
||||||
animation: fade-out 1.5s linear;
|
animation: fade-out 0.25s linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fade-out {
|
@keyframes fade-out {
|
||||||
0% { opacity: 1; background: none; }
|
0% { opacity: 1; background: none; }
|
||||||
25% { opacity: 1; background: #f8efc0; }
|
|
||||||
100% { opacity: 0; background: none; }
|
100% { opacity: 0; background: none; }
|
||||||
}
|
}
|
||||||
@keyframes fade-in {
|
@keyframes fade-in {
|
||||||
0% { opacity: 0; background: none; }
|
0% { opacity: 0; background: none; }
|
||||||
25% { opacity: 1; background: #dff0d8; }
|
|
||||||
100% { opacity: 1; background: none; }
|
100% { opacity: 1; background: none; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,10 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
'ui.tree',
|
'ui.tree',
|
||||||
])
|
])
|
||||||
|
|
||||||
.config(['DSProvider', 'DSHttpAdapterProvider', function(DSProvider, DSHttpAdapterProvider) {
|
.config([
|
||||||
|
'DSProvider',
|
||||||
|
'DSHttpAdapterProvider',
|
||||||
|
function(DSProvider, DSHttpAdapterProvider) {
|
||||||
// Reloads everything after 5 minutes.
|
// Reloads everything after 5 minutes.
|
||||||
// TODO: * find a way only to reload things that are still needed
|
// TODO: * find a way only to reload things that are still needed
|
||||||
DSProvider.defaults.maxAge = 5 * 60 * 1000; // 5 minutes
|
DSProvider.defaults.maxAge = 5 * 60 * 1000; // 5 minutes
|
||||||
@ -28,7 +31,8 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
DSHttpAdapterProvider.defaults.forceTrailingSlash = true;
|
DSHttpAdapterProvider.defaults.forceTrailingSlash = true;
|
||||||
}])
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.factory('autoupdate', [
|
.factory('autoupdate', [
|
||||||
'DS',
|
'DS',
|
||||||
@ -129,7 +133,10 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.run(['DS', 'autoupdate', function(DS, autoupdate) {
|
.run([
|
||||||
|
'DS',
|
||||||
|
'autoupdate',
|
||||||
|
function(DS, autoupdate) {
|
||||||
autoupdate.on_message(function(data) {
|
autoupdate.on_message(function(data) {
|
||||||
// TODO: when MODEL.find() is called after this
|
// TODO: when MODEL.find() is called after this
|
||||||
// a new request is fired. This could be a bug in DS
|
// a new request is fired. This could be a bug in DS
|
||||||
@ -145,7 +152,8 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
}
|
}
|
||||||
// TODO: handle other statuscodes
|
// TODO: handle other statuscodes
|
||||||
});
|
});
|
||||||
}])
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.factory('loadGlobalData', [
|
.factory('loadGlobalData', [
|
||||||
'$rootScope',
|
'$rootScope',
|
||||||
@ -310,20 +318,23 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
* be removed. See http://www.js-data.io/docs/dsdefaults#onconflict for
|
* be removed. See http://www.js-data.io/docs/dsdefaults#onconflict for
|
||||||
* more information.
|
* more information.
|
||||||
*/
|
*/
|
||||||
.factory('Projector', ['DS', function(DS) {
|
.factory('Projector', [
|
||||||
|
'DS',
|
||||||
|
function(DS) {
|
||||||
return DS.defineResource({
|
return DS.defineResource({
|
||||||
name: 'core/projector',
|
name: 'core/projector',
|
||||||
onConflict: 'replace',
|
onConflict: 'replace',
|
||||||
});
|
});
|
||||||
}])
|
}
|
||||||
|
])
|
||||||
|
|
||||||
/* Converts number of seconds into string "hh:mm:ss" or "mm:ss" */
|
/* Converts number of seconds into string "hh:mm:ss" or "mm:ss" */
|
||||||
.filter('osSecondsToTime', [
|
.filter('osSecondsToTime', [
|
||||||
function () {
|
function () {
|
||||||
return function (totalseconds) {
|
return function (totalseconds) {
|
||||||
var time;
|
var time;
|
||||||
var total = Math.abs(totalseconds);
|
// floor returns the largest integer of the absolut value of totalseconds
|
||||||
if (parseInt(totalseconds)) {
|
var total = Math.floor(Math.abs(totalseconds));
|
||||||
var hh = Math.floor(total / 3600);
|
var hh = Math.floor(total / 3600);
|
||||||
var mm = Math.floor(total % 3600 / 60);
|
var mm = Math.floor(total % 3600 / 60);
|
||||||
var ss = Math.floor(total % 60);
|
var ss = Math.floor(total % 60);
|
||||||
@ -338,9 +349,6 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
time = hh + ":" + mm + ":" + ss;
|
time = hh + ":" + mm + ":" + ss;
|
||||||
if (totalseconds < 0)
|
if (totalseconds < 0)
|
||||||
time = "-"+time;
|
time = "-"+time;
|
||||||
} else {
|
|
||||||
time = "--:--";
|
|
||||||
}
|
|
||||||
return time;
|
return time;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core'])
|
angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core'])
|
||||||
|
|
||||||
// Provider to register slides in a .config() statement.
|
// Provider to register slides in a .config() statement.
|
||||||
.provider('slides', function() {
|
.provider('slides', [
|
||||||
|
function() {
|
||||||
var slidesMap = {};
|
var slidesMap = {};
|
||||||
|
|
||||||
this.registerSlide = function(name, config) {
|
this.registerSlide = function(name, config) {
|
||||||
@ -32,9 +33,12 @@ angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core'])
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.config(function(slidesProvider) {
|
.config([
|
||||||
|
'slidesProvider',
|
||||||
|
function(slidesProvider) {
|
||||||
slidesProvider.registerSlide('core/customslide', {
|
slidesProvider.registerSlide('core/customslide', {
|
||||||
template: 'static/templates/core/slide_customslide.html',
|
template: 'static/templates/core/slide_customslide.html',
|
||||||
});
|
});
|
||||||
@ -50,9 +54,14 @@ angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core'])
|
|||||||
slidesProvider.registerSlide('core/message', {
|
slidesProvider.registerSlide('core/message', {
|
||||||
template: 'static/templates/core/slide_message.html',
|
template: 'static/templates/core/slide_message.html',
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('ProjectorCtrl', function($scope, Projector, slides) {
|
.controller('ProjectorCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'Projector',
|
||||||
|
'slides',
|
||||||
|
function($scope, Projector, slides) {
|
||||||
Projector.find(1).then(function() {
|
Projector.find(1).then(function() {
|
||||||
$scope.$watch(function () {
|
$scope.$watch(function () {
|
||||||
return Projector.lastModified(1);
|
return Projector.lastModified(1);
|
||||||
@ -69,7 +78,8 @@ angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core'])
|
|||||||
$scope.scale = 100 + 20 * Projector.get(1).scale;
|
$scope.scale = 100 + 20 * Projector.get(1).scale;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('SlideCustomSlideCtrl', [
|
.controller('SlideCustomSlideCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
|
@ -84,23 +84,36 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.config(function($urlRouterProvider, $locationProvider) {
|
.config([
|
||||||
|
'$urlRouterProvider',
|
||||||
|
'$locationProvider',
|
||||||
|
function($urlRouterProvider, $locationProvider) {
|
||||||
// define fallback url and html5Mode
|
// define fallback url and html5Mode
|
||||||
$urlRouterProvider.otherwise('/');
|
$urlRouterProvider.otherwise('/');
|
||||||
$locationProvider.html5Mode(true);
|
$locationProvider.html5Mode(true);
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.config(function($httpProvider) {
|
.config([
|
||||||
|
'$httpProvider',
|
||||||
|
function($httpProvider) {
|
||||||
// Combine the django csrf system with the angular csrf system
|
// Combine the django csrf system with the angular csrf system
|
||||||
$httpProvider.defaults.xsrfCookieName = 'csrftoken';
|
$httpProvider.defaults.xsrfCookieName = 'csrftoken';
|
||||||
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
|
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.config(function(uiSelectConfig) {
|
.config([
|
||||||
|
'uiSelectConfig',
|
||||||
|
function(uiSelectConfig) {
|
||||||
uiSelectConfig.theme = 'bootstrap';
|
uiSelectConfig.theme = 'bootstrap';
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.config(function($stateProvider, $urlMatcherFactoryProvider) {
|
.config([
|
||||||
|
'$stateProvider',
|
||||||
|
'$urlMatcherFactoryProvider',
|
||||||
|
function($stateProvider, $urlMatcherFactoryProvider) {
|
||||||
// Make the trailing slash optional
|
// Make the trailing slash optional
|
||||||
$urlMatcherFactoryProvider.strictMode(false);
|
$urlMatcherFactoryProvider.strictMode(false);
|
||||||
|
|
||||||
@ -171,9 +184,13 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
state.url = state.url || defaultUrl;
|
state.url = state.url || defaultUrl;
|
||||||
return parent(state);
|
return parent(state);
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.config(function($stateProvider, $locationProvider) {
|
.config([
|
||||||
|
'$stateProvider',
|
||||||
|
'$locationProvider',
|
||||||
|
function($stateProvider, $locationProvider) {
|
||||||
// Core urls
|
// Core urls
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('dashboard', {
|
.state('dashboard', {
|
||||||
@ -220,14 +237,24 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// redirects to customslide detail and opens customslide edit form dialog, uses edit url,
|
||||||
|
// used by ui-sref links from agenda only
|
||||||
|
// (from customslide controller use CustomSlideForm factory instead to open dialog in front
|
||||||
|
// of current view without redirect)
|
||||||
.state('core.customslide.detail.update', {
|
.state('core.customslide.detail.update', {
|
||||||
onEnter: ['$stateParams', 'ngDialog', 'Customslide', function($stateParams, ngDialog, Customslide) {
|
onEnter: ['$stateParams', '$state', 'ngDialog', 'Customslide',
|
||||||
|
function($stateParams, $state, ngDialog, Customslide) {
|
||||||
ngDialog.open({
|
ngDialog.open({
|
||||||
template: 'static/templates/core/customslide-form.html',
|
template: 'static/templates/core/customslide-form.html',
|
||||||
controller: 'CustomslideUpdateCtrl',
|
controller: 'CustomslideUpdateCtrl',
|
||||||
className: 'ngdialog-theme-default wide-form',
|
className: 'ngdialog-theme-default wide-form',
|
||||||
resolve: { customslide: function() {
|
resolve: {
|
||||||
return Customslide.find($stateParams.id) }}
|
customslide: function() {return Customslide.find($stateParams.id) }
|
||||||
|
},
|
||||||
|
preCloseCallback: function() {
|
||||||
|
$state.go('core.customslide.detail', {customslide: $stateParams.id});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
@ -259,11 +286,14 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
});
|
});
|
||||||
|
|
||||||
$locationProvider.html5Mode(true);
|
$locationProvider.html5Mode(true);
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
// Helper to add ui.router states at runtime.
|
// Helper to add ui.router states at runtime.
|
||||||
// Needed for the django url_patterns.
|
// Needed for the django url_patterns.
|
||||||
.provider('runtimeStates', function($stateProvider) {
|
.provider('runtimeStates', [
|
||||||
|
'$stateProvider',
|
||||||
|
function($stateProvider) {
|
||||||
this.$get = function($q, $timeout, $state) {
|
this.$get = function($q, $timeout, $state) {
|
||||||
return {
|
return {
|
||||||
addState: function(name, state) {
|
addState: function(name, state) {
|
||||||
@ -271,10 +301,14 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
// Load the django url patterns
|
// Load the django url patterns
|
||||||
.run(function(runtimeStates, $http) {
|
.run([
|
||||||
|
'runtimeStates',
|
||||||
|
'$http',
|
||||||
|
function(runtimeStates, $http) {
|
||||||
$http.get('/core/url_patterns/').then(function(data) {
|
$http.get('/core/url_patterns/').then(function(data) {
|
||||||
for (var pattern in data.data) {
|
for (var pattern in data.data) {
|
||||||
runtimeStates.addState(pattern, {
|
runtimeStates.addState(pattern, {
|
||||||
@ -286,7 +320,8 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
// angular formly config options
|
// angular formly config options
|
||||||
.run([
|
.run([
|
||||||
@ -311,7 +346,10 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
|
|
||||||
// html-tag os-form-field to generate generic from fields
|
// html-tag os-form-field to generate generic from fields
|
||||||
// TODO: make it possible to use other fields then config fields
|
// TODO: make it possible to use other fields then config fields
|
||||||
.directive('osFormField', function($parse, Config) {
|
.directive('osFormField', [
|
||||||
|
'$parse',
|
||||||
|
'Config',
|
||||||
|
function($parse, Config) {
|
||||||
function getHtmlType(type) {
|
function getHtmlType(type) {
|
||||||
return {
|
return {
|
||||||
string: 'text',
|
string: 'text',
|
||||||
@ -344,9 +382,10 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller("MainMenuCtrl", [
|
.controller('MainMenuCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'mainMenu',
|
'mainMenu',
|
||||||
function ($scope, mainMenu) {
|
function ($scope, mainMenu) {
|
||||||
@ -354,7 +393,12 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.controller("LanguageCtrl", function ($scope, gettextCatalog, Languages, filterFilter) {
|
.controller('LanguageCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'gettextCatalog',
|
||||||
|
'Languages',
|
||||||
|
'filterFilter',
|
||||||
|
function ($scope, gettextCatalog, Languages, filterFilter) {
|
||||||
$scope.languages = Languages.getLanguages();
|
$scope.languages = Languages.getLanguages();
|
||||||
$scope.selectedLanguage = filterFilter($scope.languages, {selected: true});
|
$scope.selectedLanguage = filterFilter($scope.languages, {selected: true});
|
||||||
// controller to switch app language
|
// controller to switch app language
|
||||||
@ -362,7 +406,8 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
$scope.languages = Languages.setCurrentLanguage(lang);
|
$scope.languages = Languages.setCurrentLanguage(lang);
|
||||||
$scope.selectedLanguage = filterFilter($scope.languages, {selected: true});
|
$scope.selectedLanguage = filterFilter($scope.languages, {selected: true});
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
// Projector Sidebar Controller
|
// Projector Sidebar Controller
|
||||||
.controller('ProjectorSidebarCtrl', [
|
.controller('ProjectorSidebarCtrl', [
|
||||||
@ -388,7 +433,11 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
])
|
])
|
||||||
|
|
||||||
// Config Controller
|
// Config Controller
|
||||||
.controller('ConfigCtrl', function($scope, Config, configOption) {
|
.controller('ConfigCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'Config',
|
||||||
|
'configOption',
|
||||||
|
function($scope, Config, configOption) {
|
||||||
Config.bindAll({}, $scope, 'configs');
|
Config.bindAll({}, $scope, 'configs');
|
||||||
$scope.configGroups = configOption.data.config_groups;
|
$scope.configGroups = configOption.data.config_groups;
|
||||||
|
|
||||||
@ -397,16 +446,33 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
Config.get(key).value = value;
|
Config.get(key).value = value;
|
||||||
Config.save(key);
|
Config.save(key);
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
// Provide generic customslide form fields for create and update view
|
// Provide generic customslide form fields for create and update view
|
||||||
.factory('CustomslideFormFieldFactory', [
|
.factory('CustomslideForm', [
|
||||||
'gettextCatalog',
|
'gettextCatalog',
|
||||||
'CKEditorOptions',
|
'CKEditorOptions',
|
||||||
'Mediafile',
|
'Mediafile',
|
||||||
function (gettextCatalog, CKEditorOptions, Mediafile) {
|
function (gettextCatalog, CKEditorOptions, Mediafile) {
|
||||||
return {
|
return {
|
||||||
|
// ngDialog for customslide form
|
||||||
|
getDialog: function (customslide) {
|
||||||
|
if (customslide) {
|
||||||
|
var resolve = {
|
||||||
|
customslide: function(Customslide) {return Customslide.find(customslide.id);}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
template: 'static/templates/core/customslide-form.html',
|
||||||
|
controller: (customslide) ? 'CustomslideUpdateCtrl' : 'CustomslideCreateCtrl',
|
||||||
|
className: 'ngdialog-theme-default wide-form',
|
||||||
|
closeByEscape: false,
|
||||||
|
closeByDocument: false,
|
||||||
|
resolve: (resolve) ? resolve : null
|
||||||
|
}
|
||||||
|
},
|
||||||
getFormFields: function () {
|
getFormFields: function () {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@ -641,20 +707,32 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
])
|
])
|
||||||
|
|
||||||
// Customslide Controllers
|
// Customslide Controllers
|
||||||
.controller('CustomslideDetailCtrl', function($scope, Customslide, customslide) {
|
.controller('CustomslideDetailCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'ngDialog',
|
||||||
|
'CustomslideForm',
|
||||||
|
'Customslide',
|
||||||
|
'customslide',
|
||||||
|
function($scope, ngDialog, CustomslideForm, Customslide, customslide) {
|
||||||
Customslide.bindOne(customslide.id, $scope, 'customslide');
|
Customslide.bindOne(customslide.id, $scope, 'customslide');
|
||||||
Customslide.loadRelations(customslide, 'agenda_item');
|
Customslide.loadRelations(customslide, 'agenda_item');
|
||||||
})
|
|
||||||
|
// open edit dialog
|
||||||
|
$scope.openDialog = function (customslide) {
|
||||||
|
ngDialog.open(CustomslideForm.getDialog(customslide));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('CustomslideCreateCtrl', [
|
.controller('CustomslideCreateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
'$state',
|
||||||
'Customslide',
|
'Customslide',
|
||||||
'CustomslideFormFieldFactory',
|
'CustomslideForm',
|
||||||
function($scope, $state, Customslide, CustomslideFormFieldFactory) {
|
function($scope, $state, Customslide, CustomslideForm) {
|
||||||
$scope.customslide = {};
|
$scope.customslide = {};
|
||||||
// get all form fields
|
// get all form fields
|
||||||
$scope.formFields = CustomslideFormFieldFactory.getFormFields();
|
$scope.formFields = CustomslideForm.getFormFields();
|
||||||
|
|
||||||
// save form
|
// save form
|
||||||
$scope.save = function (customslide) {
|
$scope.save = function (customslide) {
|
||||||
@ -671,19 +749,34 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
'$state',
|
||||||
'Customslide',
|
'Customslide',
|
||||||
'CustomslideFormFieldFactory',
|
'CustomslideForm',
|
||||||
'customslide',
|
'customslide',
|
||||||
function($scope, $state, Customslide, CustomslideFormFieldFactory, customslide) {
|
function($scope, $state, Customslide, CustomslideForm, customslide) {
|
||||||
// set initial values for form model
|
$scope.alert = {};
|
||||||
$scope.model = customslide;
|
// set initial values for form model by create deep copy of customslide object
|
||||||
|
// so list/detail view is not updated while editing
|
||||||
|
$scope.model = angular.copy(customslide);
|
||||||
// get all form fields
|
// get all form fields
|
||||||
$scope.formFields = CustomslideFormFieldFactory.getFormFields();
|
$scope.formFields = CustomslideForm.getFormFields();
|
||||||
|
|
||||||
// save form
|
// save form
|
||||||
$scope.save = function (customslide) {
|
$scope.save = function (customslide) {
|
||||||
|
// inject the changed customslide (copy) object back into DS store
|
||||||
|
Customslide.inject(customslide);
|
||||||
|
// save change customslide object on server
|
||||||
Customslide.save(customslide).then(
|
Customslide.save(customslide).then(
|
||||||
function(success) {
|
function(success) {
|
||||||
$scope.closeThisDialog();
|
$scope.closeThisDialog();
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
// save error: revert all changes by restore
|
||||||
|
// (refresh) original customslide object from server
|
||||||
|
Customslide.refresh(customslide);
|
||||||
|
var message = '';
|
||||||
|
for (var e in error.data) {
|
||||||
|
message += e + ': ' + error.data[e] + ' ';
|
||||||
|
}
|
||||||
|
$scope.alert = {type: 'danger', msg: message, show: true};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -691,7 +784,10 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
])
|
])
|
||||||
|
|
||||||
// Tag Controller
|
// Tag Controller
|
||||||
.controller('TagListCtrl', function($scope, Tag) {
|
.controller('TagListCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'Tag',
|
||||||
|
function($scope, Tag) {
|
||||||
Tag.bindAll({}, $scope, 'tags');
|
Tag.bindAll({}, $scope, 'tags');
|
||||||
|
|
||||||
// setup table sorting
|
// setup table sorting
|
||||||
@ -716,13 +812,23 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('TagDetailCtrl', function($scope, Tag, tag) {
|
.controller('TagDetailCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'Tag',
|
||||||
|
'tag',
|
||||||
|
function($scope, Tag, tag) {
|
||||||
Tag.bindOne(tag.id, $scope, 'tag');
|
Tag.bindOne(tag.id, $scope, 'tag');
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('TagCreateCtrl', function($scope, $state, Tag) {
|
.controller('TagCreateCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'$state',
|
||||||
|
'Tag',
|
||||||
|
function($scope, $state, Tag) {
|
||||||
$scope.tag = {};
|
$scope.tag = {};
|
||||||
$scope.save = function (tag) {
|
$scope.save = function (tag) {
|
||||||
Tag.create(tag).then(
|
Tag.create(tag).then(
|
||||||
@ -731,9 +837,15 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('TagUpdateCtrl', function($scope, $state, Tag, tag) {
|
.controller('TagUpdateCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'$state',
|
||||||
|
'Tag',
|
||||||
|
'tag',
|
||||||
|
function($scope, $state, Tag, tag) {
|
||||||
$scope.tag = tag;
|
$scope.tag = tag;
|
||||||
$scope.save = function (tag) {
|
$scope.save = function (tag) {
|
||||||
Tag.save(tag).then(
|
Tag.save(tag).then(
|
||||||
@ -742,7 +854,8 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
// counter of new (unread) chat messages
|
// counter of new (unread) chat messages
|
||||||
.value('NewChatMessages', [])
|
.value('NewChatMessages', [])
|
||||||
@ -793,7 +906,9 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.directive('osFocusMe', function ($timeout) {
|
.directive('osFocusMe', [
|
||||||
|
'$timeout',
|
||||||
|
function ($timeout) {
|
||||||
return {
|
return {
|
||||||
link: function (scope, element, attrs, model) {
|
link: function (scope, element, attrs, model) {
|
||||||
$timeout(function () {
|
$timeout(function () {
|
||||||
@ -801,6 +916,7 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
title="{{ 'Project agenda item' | translate }}">
|
title="{{ 'Project agenda item' | translate }}">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
</a>
|
</a>
|
||||||
|
<!-- edit -->
|
||||||
|
<a os-perms="agenda.can_manage" ng-click="openDialog(customslide)"
|
||||||
|
class="btn btn-default btn-sm"
|
||||||
|
title="{{ 'Edit' | translate}}">
|
||||||
|
<i class="fa fa-pencil"></i>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<h1>{{ customslide.agenda_item.getTitle() }}</h1>
|
<h1>{{ customslide.agenda_item.getTitle() }}</h1>
|
||||||
<h2 translate>Agenda item</h2>
|
<h2 translate>Agenda item</h2>
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<h1 ng-if="model.id" translate>Edit agenda item</h1>
|
<h1 ng-if="model.id" translate>Edit agenda item</h1>
|
||||||
<h1 ng-if="!model.id" translate>New agenda item</h1>
|
<h1 ng-if="!model.id" translate>New agenda item</h1>
|
||||||
|
|
||||||
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
|
{{ alert.msg }}
|
||||||
|
</uib-alert>
|
||||||
|
|
||||||
<form name="customslideForm" ng-submit="save(model)">
|
<form name="customslideForm" ng-submit="save(model)">
|
||||||
<formly-form model="model" fields="formFields">
|
<formly-form model="model" fields="formFields">
|
||||||
<button type="submit" ng-disabled="customslideForm.$invalid" class="btn btn-primary" translate>
|
<button type="submit" ng-disabled="customslideForm.$invalid" class="btn btn-primary" translate>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<img src="/static/img/openslides-logo.png" alt="OpenSlides" class="login-logo center-block">
|
<img src="/static/img/openslides-logo.png" alt="OpenSlides" class="login-logo center-block">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body loginForm">
|
||||||
<uib-alert ng-repeat="alert in alerts" type="{{ alert.type }}" close="closeAlert($index)">
|
<uib-alert ng-repeat="alert in alerts" type="{{ alert.type }}" close="closeAlert($index)">
|
||||||
<span ng-bind-html="alert.msg"><span>
|
<span ng-bind-html="alert.msg"><span>
|
||||||
</uib-alert>
|
</uib-alert>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<div ng-controller="ProjectorControlCtrl">
|
<div ng-controller="ProjectorControlCtrl">
|
||||||
<!-- live view -->
|
<!-- live view -->
|
||||||
<div class="section" os-perms-lite="core.can_see_projector">
|
<div class="section" os-perms="core.can_see_projector">
|
||||||
<a href="#" ng-click="isLiveViewClosed = !isLiveViewClosed">
|
<a href="#" ng-click="isLiveViewClosed = !isLiveViewClosed">
|
||||||
<i class="fa toggle-icon" ng-class="isLiveViewClosed ? 'fa-angle-up' : 'fa-angle-down'"></i>
|
<i class="fa toggle-icon" ng-class="isLiveViewClosed ? 'fa-angle-up' : 'fa-angle-down'"></i>
|
||||||
<h4 translate>Live view</h4>
|
<h4 translate>Live view</h4>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div ng-controller="SlideCountdownCtrl">
|
<div ng-controller="SlideCountdownCtrl">
|
||||||
<div ng-if="visible">
|
<div ng-if="visible">
|
||||||
<div class="countdown well" style="margin-top: calc({{index}}*100px);">
|
<div class="countdown well" style="margin-top: calc({{index}}*100px);" ng-class="{ 'negative': seconds < 0 }">
|
||||||
{{ seconds | osSecondsToTime}}
|
{{ seconds | osSecondsToTime}}
|
||||||
<div class="description">{{ description }}</div>
|
<div class="description">{{ description }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,7 +18,9 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp.
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.config(function($stateProvider) {
|
.config([
|
||||||
|
'$stateProvider',
|
||||||
|
function($stateProvider) {
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('mediafiles', {
|
.state('mediafiles', {
|
||||||
url: '/mediafiles',
|
url: '/mediafiles',
|
||||||
@ -54,9 +56,16 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp.
|
|||||||
'@mediafiles.mediafile': {}
|
'@mediafiles.mediafile': {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('MediafileListCtrl', function($scope, $http, $timeout, Upload, Mediafile) {
|
.controller('MediafileListCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'$http',
|
||||||
|
'$timeout',
|
||||||
|
'Upload',
|
||||||
|
'Mediafile',
|
||||||
|
function($scope, $http, $timeout, Upload, Mediafile) {
|
||||||
Mediafile.bindAll({}, $scope, 'mediafiles');
|
Mediafile.bindAll({}, $scope, 'mediafiles');
|
||||||
|
|
||||||
// setup table sorting
|
// setup table sorting
|
||||||
@ -70,6 +79,15 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp.
|
|||||||
}
|
}
|
||||||
$scope.sortColumn = column;
|
$scope.sortColumn = column;
|
||||||
};
|
};
|
||||||
|
// define custom search filter string
|
||||||
|
$scope.getFilterString = function (mediafile) {
|
||||||
|
return [
|
||||||
|
mediafile.title,
|
||||||
|
mediafile.mediafile.type,
|
||||||
|
mediafile.mediafile.name,
|
||||||
|
mediafile.uploader.get_short_name()
|
||||||
|
].join(" ");
|
||||||
|
}
|
||||||
|
|
||||||
// delete
|
// delete
|
||||||
$scope.delete = function (mediafile) {
|
$scope.delete = function (mediafile) {
|
||||||
@ -80,7 +98,8 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp.
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('MediafileCreateCtrl', [
|
.controller('MediafileCreateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
|
@ -51,16 +51,16 @@
|
|||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="mediafile in mediafiles | filter: filter.search |
|
<tr ng-repeat="mediafile in mediafiles | osFilter: filter.search : getFilterString |
|
||||||
orderBy: sortColumn:reverse">
|
orderBy: sortColumn:reverse">
|
||||||
<td><a ng-href="{{ mediafile.mediafileUrl }}" target="_blank">{{ mediafile.title_or_filename }}</a>
|
<td><a ng-href="{{ mediafile.mediafileUrl }}" target="_blank">{{ mediafile.title_or_filename }}</a>
|
||||||
<td class="optional">{{ mediafile.mediafile.type }}
|
<td class="optional">{{ mediafile.mediafile.type }}
|
||||||
<td>{{ mediafile.filesize }}
|
<td>{{ mediafile.filesize }}
|
||||||
<td>{{ mediafile.timestamp }}
|
<td>{{ mediafile.timestamp | date:'yyyy-MM-dd HH:mm:ss' }}
|
||||||
<td>{{ mediafile.uploader.get_full_name() }}
|
<td>{{ mediafile.uploader.get_full_name() }}
|
||||||
<td os-perms="mediafiles.can_manage core.can_manage_projector" class="nobr">
|
<td os-perms="mediafiles.can_manage core.can_manage_projector" class="nobr">
|
||||||
<!-- projector, TODO: add link to activate slide -->
|
<!-- projector, TODO: add link to activate slide -->
|
||||||
<a href="#TODO" ng-if="mediafile.is_presentable" os-perms-lite="core.can_manage_projector"
|
<a href="" ng-show="mediafile.mediafile.type == 'application/pdf'" os-perms="core.can_manage_projector"
|
||||||
class="btn btn-default btn-sm"
|
class="btn btn-default btn-sm"
|
||||||
title="{{ 'Show' | translate }}">
|
title="{{ 'Show' | translate }}">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
|
@ -169,6 +169,7 @@ angular.module('OpenSlidesApp.motions', ['OpenSlidesApp.users'])
|
|||||||
name: name,
|
name: name,
|
||||||
useClass: jsDataModel,
|
useClass: jsDataModel,
|
||||||
verboseName: gettext('Motion'),
|
verboseName: gettext('Motion'),
|
||||||
|
agendaSupplement: gettext('Motion'),
|
||||||
methods: {
|
methods: {
|
||||||
getResourceName: function () {
|
getResourceName: function () {
|
||||||
return name;
|
return name;
|
||||||
@ -298,12 +299,18 @@ angular.module('OpenSlidesApp.motions', ['OpenSlidesApp.users'])
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.factory('Category', ['DS', function(DS) {
|
.factory('Category', [
|
||||||
|
'DS',
|
||||||
|
function(DS) {
|
||||||
return DS.defineResource({
|
return DS.defineResource({
|
||||||
name: 'motions/category',
|
name: 'motions/category',
|
||||||
});
|
});
|
||||||
}])
|
}
|
||||||
|
])
|
||||||
.run(['Motion', 'Category', function(Motion, Category) {}]);
|
|
||||||
|
|
||||||
|
.run([
|
||||||
|
'Motion',
|
||||||
|
'Category',
|
||||||
|
function(Motion, Category) {}
|
||||||
|
]);
|
||||||
}());
|
}());
|
||||||
|
@ -4,13 +4,20 @@
|
|||||||
|
|
||||||
angular.module('OpenSlidesApp.motions.projector', ['OpenSlidesApp.motions'])
|
angular.module('OpenSlidesApp.motions.projector', ['OpenSlidesApp.motions'])
|
||||||
|
|
||||||
.config(function(slidesProvider) {
|
.config([
|
||||||
|
'slidesProvider',
|
||||||
|
function(slidesProvider) {
|
||||||
slidesProvider.registerSlide('motions/motion', {
|
slidesProvider.registerSlide('motions/motion', {
|
||||||
template: 'static/templates/motions/slide_motion.html',
|
template: 'static/templates/motions/slide_motion.html',
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('SlideMotionCtrl', function($scope, Motion, User) {
|
.controller('SlideMotionCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'Motion',
|
||||||
|
'User',
|
||||||
|
function($scope, Motion, User) {
|
||||||
// Attention! Each object that is used here has to be dealt on server side.
|
// Attention! Each object that is used here has to be dealt on server side.
|
||||||
// Add it to the coresponding get_requirements method of the ProjectorElement
|
// Add it to the coresponding get_requirements method of the ProjectorElement
|
||||||
// class.
|
// class.
|
||||||
@ -18,6 +25,7 @@ angular.module('OpenSlidesApp.motions.projector', ['OpenSlidesApp.motions'])
|
|||||||
Motion.find(id);
|
Motion.find(id);
|
||||||
User.findAll();
|
User.findAll();
|
||||||
Motion.bindOne(id, $scope, 'motion');
|
Motion.bindOne(id, $scope, 'motion');
|
||||||
});
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
@ -18,7 +18,9 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.config(function($stateProvider) {
|
.config([
|
||||||
|
'$stateProvider',
|
||||||
|
function($stateProvider) {
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('motions', {
|
.state('motions', {
|
||||||
url: '/motions',
|
url: '/motions',
|
||||||
@ -132,7 +134,8 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
'@motions.category': {}
|
'@motions.category': {}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
// Service for generic motion form (create and update)
|
// Service for generic motion form (create and update)
|
||||||
.factory('MotionForm', [
|
.factory('MotionForm', [
|
||||||
@ -212,6 +215,15 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
},
|
},
|
||||||
ngModelElAttrs: {'ckeditor': 'CKEditorOptions'}
|
ngModelElAttrs: {'ckeditor': 'CKEditorOptions'}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'disable_versioning',
|
||||||
|
type: 'checkbox',
|
||||||
|
templateOptions: {
|
||||||
|
label: gettextCatalog.getString('Trivial change'),
|
||||||
|
description: gettextCatalog.getString("Don't create a new version.")
|
||||||
|
},
|
||||||
|
hide: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'more',
|
key: 'more',
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
@ -387,6 +399,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
}
|
}
|
||||||
$scope.sortColumn = column;
|
$scope.sortColumn = column;
|
||||||
};
|
};
|
||||||
|
// define custom search filter string
|
||||||
$scope.getFilterString = function (motion) {
|
$scope.getFilterString = function (motion) {
|
||||||
if (motion.category) {
|
if (motion.category) {
|
||||||
var category = motion.category.name;
|
var category = motion.category.name;
|
||||||
@ -394,10 +407,15 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
var category = ''
|
var category = ''
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
|
motion.identifier,
|
||||||
motion.getTitle(),
|
motion.getTitle(),
|
||||||
motion.getText(),
|
motion.getText(),
|
||||||
|
motion.getReason(),
|
||||||
_.map(motion.submitters, function (submitter) {return submitter.get_short_name()}).join(" "),
|
_.map(motion.submitters, function (submitter) {return submitter.get_short_name()}).join(" "),
|
||||||
category].join(" ");
|
_.map(motion.supporters, function (supporter) {return supporter.get_short_name()}).join(" "),
|
||||||
|
_.map(motion.tags, function (tag) {return tag.name}).join(" "),
|
||||||
|
category
|
||||||
|
].join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect all states of all workflows
|
// collect all states of all workflows
|
||||||
@ -492,7 +510,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
User.bindAll({}, $scope, 'users');
|
User.bindAll({}, $scope, 'users');
|
||||||
Workflow.bindAll({}, $scope, 'workflows');
|
Workflow.bindAll({}, $scope, 'workflows');
|
||||||
Motion.loadRelations(motion, 'agenda_item');
|
Motion.loadRelations(motion, 'agenda_item');
|
||||||
|
$scope.version = motion.active_version;
|
||||||
$scope.isCollapsed = true;
|
$scope.isCollapsed = true;
|
||||||
|
|
||||||
// open edit dialog
|
// open edit dialog
|
||||||
@ -541,6 +559,27 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
$scope.delete_poll = function (poll) {
|
$scope.delete_poll = function (poll) {
|
||||||
poll.DSDestroy();
|
poll.DSDestroy();
|
||||||
}
|
}
|
||||||
|
// show specific version
|
||||||
|
$scope.showVersion = function (version) {
|
||||||
|
$scope.version = version.id;
|
||||||
|
}
|
||||||
|
// permit specific version
|
||||||
|
$scope.permitVersion = function (version) {
|
||||||
|
$http.put('/rest/motions/motion/' + motion.id + '/manage_version/',
|
||||||
|
{'version_number': version.version_number})
|
||||||
|
.then(function(success) {
|
||||||
|
$scope.version = version.id;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// delete specific version
|
||||||
|
$scope.deleteVersion = function (version) {
|
||||||
|
$http.delete('/rest/motions/motion/' + motion.id + '/manage_version/',
|
||||||
|
{headers: {'Content-Type': 'application/json'},
|
||||||
|
data: JSON.stringify({version_number: version.version_number})})
|
||||||
|
.then(function(success) {
|
||||||
|
$scope.version = motion.active_version;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -571,11 +610,6 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
$scope.model.workflow_id = Config.get('motions_workflow').value;
|
$scope.model.workflow_id = Config.get('motions_workflow').value;
|
||||||
// get all form fields
|
// get all form fields
|
||||||
$scope.formFields = MotionForm.getFormFields();
|
$scope.formFields = MotionForm.getFormFields();
|
||||||
for (var i = 0; i < $scope.formFields.length; i++) {
|
|
||||||
if ($scope.formFields[i].key == "identifier") {
|
|
||||||
$scope.formFields[i].hide = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// save motion
|
// save motion
|
||||||
$scope.save = function (motion) {
|
$scope.save = function (motion) {
|
||||||
Motion.create(motion).then(
|
Motion.create(motion).then(
|
||||||
@ -605,10 +639,13 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
Tag.bindAll({}, $scope, 'tags');
|
Tag.bindAll({}, $scope, 'tags');
|
||||||
User.bindAll({}, $scope, 'users');
|
User.bindAll({}, $scope, 'users');
|
||||||
Workflow.bindAll({}, $scope, 'workflows');
|
Workflow.bindAll({}, $scope, 'workflows');
|
||||||
|
$scope.alert = {};
|
||||||
|
|
||||||
// set initial values for form model
|
// set initial values for form model by create deep copy of motion object
|
||||||
$scope.model = motion;
|
// so list/detail view is not updated while editing
|
||||||
|
$scope.model = angular.copy(motion);
|
||||||
$scope.model.more = false;
|
$scope.model.more = false;
|
||||||
|
|
||||||
// get all form fields
|
// get all form fields
|
||||||
$scope.formFields = MotionForm.getFormFields();
|
$scope.formFields = MotionForm.getFormFields();
|
||||||
// override default values for update form
|
// override default values for update form
|
||||||
@ -629,6 +666,13 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
// get reason of latest version
|
// get reason of latest version
|
||||||
$scope.formFields[i].defaultValue = motion.getReason(-1);
|
$scope.formFields[i].defaultValue = motion.getReason(-1);
|
||||||
}
|
}
|
||||||
|
if ($scope.formFields[i].key == "disable_versioning" &&
|
||||||
|
Config.get('motions_allow_disable_versioning')) {
|
||||||
|
// check current state if versioning is active
|
||||||
|
if (motion.state.versioning) {
|
||||||
|
$scope.formFields[i].hide = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($scope.formFields[i].key == "workflow_id") {
|
if ($scope.formFields[i].key == "workflow_id") {
|
||||||
// get saved workflow id from state
|
// get saved workflow id from state
|
||||||
$scope.formFields[i].defaultValue = motion.state.workflow_id;
|
$scope.formFields[i].defaultValue = motion.state.workflow_id;
|
||||||
@ -637,9 +681,22 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
|
|
||||||
// save motion
|
// save motion
|
||||||
$scope.save = function (motion) {
|
$scope.save = function (motion) {
|
||||||
|
// inject the changed motion (copy) object back into DS store
|
||||||
|
Motion.inject(motion);
|
||||||
|
// save change motion object on server
|
||||||
Motion.save(motion, { method: 'PATCH' }).then(
|
Motion.save(motion, { method: 'PATCH' }).then(
|
||||||
function(success) {
|
function(success) {
|
||||||
$scope.closeThisDialog();
|
$scope.closeThisDialog();
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
// save error: revert all changes by restore
|
||||||
|
// (refresh) original motion object from server
|
||||||
|
Motion.refresh(motion);
|
||||||
|
var message = '';
|
||||||
|
for (var e in error.data) {
|
||||||
|
message += e + ': ' + error.data[e] + ' ';
|
||||||
|
}
|
||||||
|
$scope.alert = {type: 'danger', msg: message, show: true};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -858,7 +915,10 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
.controller('CategoryListCtrl', function($scope, Category) {
|
.controller('CategoryListCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'Category',
|
||||||
|
function($scope, Category) {
|
||||||
Category.bindAll({}, $scope, 'categories');
|
Category.bindAll({}, $scope, 'categories');
|
||||||
|
|
||||||
// setup table sorting
|
// setup table sorting
|
||||||
@ -876,13 +936,23 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
$scope.delete = function (category) {
|
$scope.delete = function (category) {
|
||||||
Category.destroy(category.id);
|
Category.destroy(category.id);
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('CategoryDetailCtrl', function($scope, Category, category) {
|
.controller('CategoryDetailCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'Category',
|
||||||
|
'category',
|
||||||
|
function($scope, Category, category) {
|
||||||
Category.bindOne(category.id, $scope, 'category');
|
Category.bindOne(category.id, $scope, 'category');
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('CategoryCreateCtrl', function($scope, $state, Category) {
|
.controller('CategoryCreateCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'$state',
|
||||||
|
'Category',
|
||||||
|
function($scope, $state, Category) {
|
||||||
$scope.category = {};
|
$scope.category = {};
|
||||||
$scope.save = function (category) {
|
$scope.save = function (category) {
|
||||||
Category.create(category).then(
|
Category.create(category).then(
|
||||||
@ -891,9 +961,15 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('CategoryUpdateCtrl', function($scope, $state, Category, category) {
|
.controller('CategoryUpdateCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'$state',
|
||||||
|
'Category',
|
||||||
|
'category',
|
||||||
|
function($scope, $state, Category, category) {
|
||||||
$scope.category = category;
|
$scope.category = category;
|
||||||
$scope.save = function (category) {
|
$scope.save = function (category) {
|
||||||
Category.save(category).then(
|
Category.save(category).then(
|
||||||
@ -902,6 +978,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
});
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
@ -28,10 +28,14 @@
|
|||||||
<i class="fa fa-pencil"></i>
|
<i class="fa fa-pencil"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<h1>{{ motion.getTitle() }}</h1>
|
<h1>{{ motion.getTitle(version) }}</h1>
|
||||||
<h2>
|
<h2>
|
||||||
<translate>Motion</translate> {{ motion.identifier }}
|
<translate>Motion</translate> {{ motion.identifier }}
|
||||||
<span ng-if="motion.versions.length > 1" >| Version {{ motion.active_version }}</span>
|
<span ng-if="motion.versions.length > 1" >| Version {{ motion.getVersion(version).version_number }}</span>
|
||||||
|
<span ng-if="motion.active_version != version" class="label label-warning">
|
||||||
|
<i class="fa fa-exclamation-triangle"></i>
|
||||||
|
<translate>This version is not permitted.</translate>
|
||||||
|
</span>
|
||||||
<span ng-if="motion.agenda_item.item_number">
|
<span ng-if="motion.agenda_item.item_number">
|
||||||
–
|
–
|
||||||
<translate>Agenda</translate>: {{ motion.agenda_item.item_number }}
|
<translate>Agenda</translate>: {{ motion.agenda_item.item_number }}
|
||||||
@ -193,10 +197,10 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<h3 translate>Text</h3>
|
<h3 translate>Text</h3>
|
||||||
<div class="white-space-pre-line" ng-bind-html="motion.getText()"></div>
|
<div class="white-space-pre-line" ng-bind-html="motion.getText(version)"></div>
|
||||||
|
|
||||||
<!-- reason -->
|
<!-- reason -->
|
||||||
<div ng-if="motion.getReason() != ''">
|
<div ng-if="motion.getReason(version) != ''">
|
||||||
<h3 translate>Reason</h3>
|
<h3 translate>Reason</h3>
|
||||||
<div class="white-space-pre-line" ng-bind-html="motion.getReason()"></div>
|
<div class="white-space-pre-line" ng-bind-html="motion.getReason()"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -208,6 +212,39 @@
|
|||||||
<a href="{{ attachment.mediafileUrl }}" target="_blank">{{ attachment.title_or_filename }}</a>
|
<a href="{{ attachment.mediafileUrl }}" target="_blank">{{ attachment.title_or_filename }}</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<!-- version history -->
|
||||||
|
<div ng-if="motion.versions.length > 1">
|
||||||
|
<h3 translate>Version history</h3>
|
||||||
|
<ul>
|
||||||
|
<li ng-repeat="version in motion.versions">
|
||||||
|
<span ng-if="$parent.version == version.id">
|
||||||
|
<strong><translate>Version</translate> {{ version.version_number }}</strong>
|
||||||
|
</span>
|
||||||
|
<a ng-if="$parent.version != version.id" ng-click="showVersion(version)">
|
||||||
|
<translate>Version</translate> {{ version.version_number }}
|
||||||
|
</a>
|
||||||
|
<!-- active version -->
|
||||||
|
<i ng-if="motion.active_version == version.id" class="fa fa-star"
|
||||||
|
title="{{ 'This is the last active version.' | translate }}"></i>
|
||||||
|
<!-- permit version -->
|
||||||
|
<button os-perms="motions.can_manage" ng-show="motion.active_version != version.id"
|
||||||
|
ng-click="permitVersion(version)"
|
||||||
|
class="btn btn-default btn-xs" title="{{ 'Permit and activate' | translate }}">
|
||||||
|
<i class="fa fa-check"></i>
|
||||||
|
</button>
|
||||||
|
<!-- delete version -->
|
||||||
|
<button os-perms="motions.can_manage" ng-show="motion.active_version != version.id"
|
||||||
|
class="btn btn-default btn-xs"
|
||||||
|
ng-bootbox-confirm="{{ 'Are you sure you want to delete this version?' | translate }}<br>
|
||||||
|
<strong><translate>Version</translate> {{ version.version_number }}</strong>"
|
||||||
|
ng-bootbox-confirm-action="deleteVersion(version)"
|
||||||
|
title="{{ 'Delete' | translate }}">
|
||||||
|
<i class="fa fa-times"></i>
|
||||||
|
</button>
|
||||||
|
<br><translate>Last modified</translate>: {{ version.creation_time | date:'yyyy-MM-dd HH:mm:ss' }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- log -->
|
<!-- log -->
|
||||||
<button type="button" class="btn btn-default spacer" ng-click="isCollapsed = !isCollapsed" translate>
|
<button type="button" class="btn btn-default spacer" ng-click="isCollapsed = !isCollapsed" translate>
|
||||||
Show history
|
Show history
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
<h1 ng-if="model.id" translate>Edit motion</h1>
|
<h1 ng-if="model.id" translate>Edit motion</h1>
|
||||||
<h1 ng-if="!model.id" translate>New motion</h1>
|
<h1 ng-if="!model.id" translate>New motion</h1>
|
||||||
|
|
||||||
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
|
{{ alert.msg }}
|
||||||
|
</uib-alert>
|
||||||
|
|
||||||
<form name="motionForm" ng-submit="save(model)">
|
<form name="motionForm" ng-submit="save(model)">
|
||||||
<formly-form model="model" fields="formFields">
|
<formly-form model="model" fields="formFields">
|
||||||
<button type="submit" ng-disabled="motionForm.$invalid" class="btn btn-primary" translate>
|
<button type="submit" ng-disabled="motionForm.$invalid" class="btn btn-primary" translate>
|
||||||
|
@ -30,7 +30,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<!-- delete mode -->
|
<!-- delete mode -->
|
||||||
<button os-perms="motions.can_manage" class="btn btn-default"
|
<button os-perms="motions.can_manage" class="btn"
|
||||||
|
ng-class="$parent.isDeleteMode ? 'btn-primary' : 'btn-default'"
|
||||||
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
||||||
<i class="fa fa-check-square-o"></i>
|
<i class="fa fa-check-square-o"></i>
|
||||||
<translate>Select ...</translate>
|
<translate>Select ...</translate>
|
||||||
@ -45,7 +46,8 @@
|
|||||||
placeholder="{{ 'Search' | translate}}">
|
placeholder="{{ 'Search' | translate}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen">
|
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen"
|
||||||
|
ng-class="isFilterOpen ? 'btn-primary' : 'btn-default'">
|
||||||
<i class="fa fa-filter"></i>
|
<i class="fa fa-filter"></i>
|
||||||
<translate>Filter ...</translate>
|
<translate>Filter ...</translate>
|
||||||
</button>
|
</button>
|
||||||
@ -75,6 +77,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer-top-lg italic">
|
<div class="spacer-top-lg italic">
|
||||||
|
{{ motionsFiltered.length }} /
|
||||||
{{ motions.length }} {{ "motions" | translate }}<span ng-if="(motions|filter:{selected:true}).length > 0">,
|
{{ motions.length }} {{ "motions" | translate }}<span ng-if="(motions|filter:{selected:true}).length > 0">,
|
||||||
{{(motions|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
{{(motions|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -82,9 +85,9 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
<th ng-show="!$parent.isDeleteMode" os-perms="core.can_manage_projector" class="firstColumn">
|
<th ng-show="!$parent.isDeleteMode" os-perms="core.can_manage_projector" class="minimum">
|
||||||
<!-- delete selection column -->
|
<!-- delete selection column -->
|
||||||
<th ng-show="$parent.isDeleteMode" os-perms="motions.can_manage" class="firstColumn deleteColumn">
|
<th ng-show="$parent.isDeleteMode" os-perms="motions.can_manage" class="minimum deleteColumn">
|
||||||
<input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
|
<input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
|
||||||
<th ng-click="toggleSort('identifier')" class="sortable minimum">
|
<th ng-click="toggleSort('identifier')" class="sortable minimum">
|
||||||
<translate>Identifier</translate>
|
<translate>Identifier</translate>
|
||||||
@ -112,8 +115,8 @@
|
|||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="motion in motions | osFilter: filter.search : getFilterString | filter: {state_id: stateFilter} |
|
<tr ng-repeat="motion in motionsFiltered = (motions | osFilter: filter.search : getFilterString |
|
||||||
orderBy: sortColumn:reverse"
|
filter: {state_id: stateFilter} | orderBy: sortColumn:reverse)"
|
||||||
class="animate-item"
|
class="animate-item"
|
||||||
ng-class="{ 'activeline': motion.isProjected(), 'selected': motion.selected }">
|
ng-class="{ 'activeline': motion.isProjected(), 'selected': motion.selected }">
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
@ -161,9 +164,9 @@
|
|||||||
<!-- quickEdit columns -->
|
<!-- quickEdit columns -->
|
||||||
<td ng-if="motion.quickEdit && motion.isAllowed('quickedit')" colspan="5">
|
<td ng-if="motion.quickEdit && motion.isAllowed('quickedit')" colspan="5">
|
||||||
<h4>{{ motion.getTitle() }} <span class="text-muted">– <translate>QuickEdit</translate></span></h4>
|
<h4>{{ motion.getTitle() }} <span class="text-muted">– <translate>QuickEdit</translate></span></h4>
|
||||||
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
</alert>
|
</uib-alert>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<label for="inputIdentifier" translate>Identifier</label>
|
<label for="inputIdentifier" translate>Identifier</label>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<h1><translate>Vote</translate> {{ voteNumber }}</h1>
|
<h1><translate>Vote</translate> {{ voteNumber }}</h1>
|
||||||
|
|
||||||
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
</alert>
|
</uib-alert>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<translate>Special values</translate>:
|
<translate>Special values</translate>:
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<h1>{{ motion.getTitle() }}</h1>
|
<h1>{{ motion.getTitle() }}</h1>
|
||||||
<h2>
|
<h2>
|
||||||
<translate>Motion</translate> {{ motion.identifier }}
|
<translate>Motion</translate> {{ motion.identifier }}
|
||||||
<span ng-if="motion.versions.length > 1" >| Version {{ motion.active_version }}</span>
|
<span ng-if="motion.versions.length > 1" >| Version {{ motion.getVersion().version_number }}</span>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -60,7 +60,11 @@ angular.module('OpenSlidesApp.users', [])
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.factory('User', ['DS', 'Group', 'jsDataModel', function(DS, Group, jsDataModel) {
|
.factory('User', [
|
||||||
|
'DS',
|
||||||
|
'Group',
|
||||||
|
'jsDataModel',
|
||||||
|
function(DS, Group, jsDataModel) {
|
||||||
var name = 'users/user';
|
var name = 'users/user';
|
||||||
return DS.defineResource({
|
return DS.defineResource({
|
||||||
name: name,
|
name: name,
|
||||||
@ -79,33 +83,39 @@ angular.module('OpenSlidesApp.users', [])
|
|||||||
},
|
},
|
||||||
get_short_name: function() {
|
get_short_name: function() {
|
||||||
// should be the same as in the python user model.
|
// should be the same as in the python user model.
|
||||||
var firstName = _.trim(this.first_name),
|
var title = _.trim(this.title),
|
||||||
|
firstName = _.trim(this.first_name),
|
||||||
lastName = _.trim(this.last_name),
|
lastName = _.trim(this.last_name),
|
||||||
name;
|
name = '';
|
||||||
|
|
||||||
|
if (title) {
|
||||||
|
name = title + ' ';
|
||||||
|
}
|
||||||
if (firstName && lastName) {
|
if (firstName && lastName) {
|
||||||
// TODO: check config
|
name += [firstName, lastName].join(' ');
|
||||||
name = [firstName, lastName].join(' ');
|
|
||||||
} else {
|
} else {
|
||||||
name = firstName || lastName || this.username;
|
name += firstName || lastName || this.username;
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
},
|
},
|
||||||
get_full_name: function() {
|
get_full_name: function() {
|
||||||
// should be the same as in the python user model.
|
// should be the same as in the python user model.
|
||||||
var firstName = _.trim(this.first_name),
|
var title = _.trim(this.title),
|
||||||
|
firstName = _.trim(this.first_name),
|
||||||
lastName = _.trim(this.last_name),
|
lastName = _.trim(this.last_name),
|
||||||
structure_level = _.trim(this.structure_level),
|
structure_level = _.trim(this.structure_level),
|
||||||
name;
|
name = '';
|
||||||
|
|
||||||
|
if (title) {
|
||||||
|
name = title + ' ';
|
||||||
|
}
|
||||||
if (firstName && lastName) {
|
if (firstName && lastName) {
|
||||||
// TODO: check config
|
name += [firstName, lastName].join(' ');
|
||||||
name = [firstName, lastName].join(' ');
|
|
||||||
} else {
|
} else {
|
||||||
name = firstName || lastName || this.username;
|
name += firstName || lastName || this.username;
|
||||||
}
|
}
|
||||||
if (structure_level) {
|
if (structure_level) {
|
||||||
name = name + " (" + structure_level + ")";
|
name += " (" + structure_level + ")";
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
},
|
},
|
||||||
@ -126,14 +136,22 @@ angular.module('OpenSlidesApp.users', [])
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}])
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.factory('Group', ['DS', function(DS) {
|
.factory('Group', [
|
||||||
|
'DS',
|
||||||
|
function(DS) {
|
||||||
return DS.defineResource({
|
return DS.defineResource({
|
||||||
name: 'users/group',
|
name: 'users/group',
|
||||||
});
|
});
|
||||||
}])
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.run(['User', 'Group', function(User, Group) {}]);
|
.run([
|
||||||
|
'User',
|
||||||
|
'Group',
|
||||||
|
function(User, Group) {}
|
||||||
|
]);
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
@ -4,19 +4,26 @@
|
|||||||
|
|
||||||
angular.module('OpenSlidesApp.users.projector', ['OpenSlidesApp.users'])
|
angular.module('OpenSlidesApp.users.projector', ['OpenSlidesApp.users'])
|
||||||
|
|
||||||
.config(function(slidesProvider) {
|
.config([
|
||||||
|
'slidesProvider',
|
||||||
|
function(slidesProvider) {
|
||||||
slidesProvider.registerSlide('users/user', {
|
slidesProvider.registerSlide('users/user', {
|
||||||
template: 'static/templates/users/slide_user.html',
|
template: 'static/templates/users/slide_user.html',
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.controller('SlideUserCtrl', function($scope, User) {
|
.controller('SlideUserCtrl', [
|
||||||
|
'$scope',
|
||||||
|
'User',
|
||||||
|
function($scope, User) {
|
||||||
// Attention! Each object that is used here has to be dealt on server side.
|
// Attention! Each object that is used here has to be dealt on server side.
|
||||||
// Add it to the coresponding get_requirements method of the ProjectorElement
|
// Add it to the coresponding get_requirements method of the ProjectorElement
|
||||||
// class.
|
// class.
|
||||||
var id = $scope.element.id;
|
var id = $scope.element.id;
|
||||||
User.find(id);
|
User.find(id);
|
||||||
User.bindOne(id, $scope, 'user');
|
User.bindOne(id, $scope, 'user');
|
||||||
});
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
@ -18,7 +18,9 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.config(function($stateProvider) {
|
.config([
|
||||||
|
'$stateProvider',
|
||||||
|
function($stateProvider) {
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('users', {
|
.state('users', {
|
||||||
url: '/users',
|
url: '/users',
|
||||||
@ -33,6 +35,9 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
resolve: {
|
resolve: {
|
||||||
users: function(User) {
|
users: function(User) {
|
||||||
return User.findAll();
|
return User.findAll();
|
||||||
|
},
|
||||||
|
groups: function(Group) {
|
||||||
|
return Group.findAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -131,7 +136,8 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
});
|
});
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.run([
|
.run([
|
||||||
'operator',
|
'operator',
|
||||||
@ -143,6 +149,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
// Put the operator into the root scope
|
// Put the operator into the root scope
|
||||||
$http.get('/users/whoami/').success(function(data) {
|
$http.get('/users/whoami/').success(function(data) {
|
||||||
operator.setUser(data.user_id);
|
operator.setUser(data.user_id);
|
||||||
|
$rootScope.guest_enabled = data.guest_enabled;
|
||||||
if (data.user_id === null && !data.guest_enabled) {
|
if (data.user_id === null && !data.guest_enabled) {
|
||||||
// redirect to login dialog if use is not logged in
|
// redirect to login dialog if use is not logged in
|
||||||
$state.go('login', {guest_enabled: data.guest_enabled});
|
$state.go('login', {guest_enabled: data.guest_enabled});
|
||||||
@ -224,47 +231,6 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
/*
|
|
||||||
* Like osPerms but does only hide the DOM-Elements
|
|
||||||
*
|
|
||||||
* This is the Code from angular.js ngShow.
|
|
||||||
*/
|
|
||||||
.directive('osPermsLite', [
|
|
||||||
'$animate',
|
|
||||||
function($animate) {
|
|
||||||
var NG_HIDE_CLASS = 'os-perms-lite';
|
|
||||||
var NG_HIDE_IN_PROGRESS_CLASS = 'os-perms-lite-animate';
|
|
||||||
return {
|
|
||||||
restrict: 'A',
|
|
||||||
multiElement: true,
|
|
||||||
link: function(scope, element, $attr) {
|
|
||||||
var perms;
|
|
||||||
if ($attr.osPermsLite[0] === '!') {
|
|
||||||
perms = _.trimLeft($attr.osPermsLite, '!');
|
|
||||||
} else {
|
|
||||||
perms = $attr.osPermsLite;
|
|
||||||
}
|
|
||||||
scope.$watch(
|
|
||||||
function (scope) {
|
|
||||||
return scope.operator.hasPerms(perms);
|
|
||||||
}, function ngShowWatchAction(value) {
|
|
||||||
if ($attr.osPermsLite[0] === '!') {
|
|
||||||
value = !value;
|
|
||||||
}
|
|
||||||
// we're adding a temporary, animation-specific class for ng-hide since this way
|
|
||||||
// we can control when the element is actually displayed on screen without having
|
|
||||||
// to have a global/greedy CSS selector that breaks when other animations are run.
|
|
||||||
// Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845
|
|
||||||
$animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {
|
|
||||||
tempClasses: NG_HIDE_IN_PROGRESS_CLASS
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
// Service for generic assignment form (create and update)
|
// Service for generic assignment form (create and update)
|
||||||
.factory('UserForm', [
|
.factory('UserForm', [
|
||||||
'$http',
|
'$http',
|
||||||
@ -289,8 +255,16 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// angular-formly fields for user form
|
// angular-formly fields for user form
|
||||||
getFormFields: function () {
|
getFormFields: function (hideOnCreateForm) {
|
||||||
return [
|
return [
|
||||||
|
{
|
||||||
|
key: 'username',
|
||||||
|
type: 'input',
|
||||||
|
templateOptions: {
|
||||||
|
label: gettextCatalog.getString('Username')
|
||||||
|
},
|
||||||
|
hide: hideOnCreateForm
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'title',
|
key: 'title',
|
||||||
type: 'input',
|
type: 'input',
|
||||||
@ -373,7 +347,8 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
templateOptions: {
|
templateOptions: {
|
||||||
label: gettextCatalog.getString('Is present'),
|
label: gettextCatalog.getString('Is present'),
|
||||||
description: gettextCatalog.getString('Designates whether this user is in the room or not.')
|
description: gettextCatalog.getString('Designates whether this user is in the room or not.')
|
||||||
}
|
},
|
||||||
|
defaultValue: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'is_active',
|
key: 'is_active',
|
||||||
@ -383,7 +358,8 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
description: gettextCatalog.getString(
|
description: gettextCatalog.getString(
|
||||||
'Designates whether this user should be treated as ' +
|
'Designates whether this user should be treated as ' +
|
||||||
'active. Unselect this instead of deleting the account.')
|
'active. Unselect this instead of deleting the account.')
|
||||||
}
|
},
|
||||||
|
defaultValue: true
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -399,7 +375,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
'Group',
|
'Group',
|
||||||
function($scope, $state, ngDialog, UserForm, User, Group) {
|
function($scope, $state, ngDialog, UserForm, User, Group) {
|
||||||
User.bindAll({}, $scope, 'users');
|
User.bindAll({}, $scope, 'users');
|
||||||
Group.bindAll({}, $scope, 'groups');
|
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
|
||||||
$scope.alert = {};
|
$scope.alert = {};
|
||||||
|
|
||||||
// setup table sorting
|
// setup table sorting
|
||||||
@ -475,7 +451,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
'Group',
|
'Group',
|
||||||
function($scope, ngDialog, UserForm, User, user, Group) {
|
function($scope, ngDialog, UserForm, User, user, Group) {
|
||||||
User.bindOne(user.id, $scope, 'user');
|
User.bindOne(user.id, $scope, 'user');
|
||||||
Group.bindAll({}, $scope, 'groups');
|
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
|
||||||
|
|
||||||
// open edit dialog
|
// open edit dialog
|
||||||
$scope.openDialog = function (user) {
|
$scope.openDialog = function (user) {
|
||||||
@ -492,8 +468,9 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
'Group',
|
'Group',
|
||||||
function($scope, $state, User, UserForm, Group) {
|
function($scope, $state, User, UserForm, Group) {
|
||||||
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
|
Group.bindAll({where: {id: {'>': 2}}}, $scope, 'groups');
|
||||||
|
$scope.alert = {};
|
||||||
// get all form fields
|
// get all form fields
|
||||||
$scope.formFields = UserForm.getFormFields();
|
$scope.formFields = UserForm.getFormFields(true);
|
||||||
|
|
||||||
// save user
|
// save user
|
||||||
$scope.save = function (user) {
|
$scope.save = function (user) {
|
||||||
@ -503,6 +480,13 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
User.create(user).then(
|
User.create(user).then(
|
||||||
function(success) {
|
function(success) {
|
||||||
$scope.closeThisDialog();
|
$scope.closeThisDialog();
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
var message = '';
|
||||||
|
for (var e in error.data) {
|
||||||
|
message += e + ': ' + error.data[e] + ' ';
|
||||||
|
}
|
||||||
|
$scope.alert = {type: 'danger', msg: message, show: true};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -838,13 +822,13 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
])
|
])
|
||||||
|
|
||||||
.controller('LoginFormCtrl', [
|
.controller('LoginFormCtrl', [
|
||||||
|
'$rootScope',
|
||||||
'$scope',
|
'$scope',
|
||||||
'$http',
|
'$http',
|
||||||
'$stateParams',
|
'$stateParams',
|
||||||
'operator',
|
'operator',
|
||||||
'gettextCatalog',
|
'gettextCatalog',
|
||||||
'Config',
|
function ($rootScope, $scope, $http, $stateParams, operator, gettextCatalog) {
|
||||||
function ($scope, $http, $stateParams, operator, gettextCatalog, Config) {
|
|
||||||
$scope.alerts = [];
|
$scope.alerts = [];
|
||||||
|
|
||||||
// get login info-text from server
|
// get login info-text from server
|
||||||
@ -861,7 +845,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
|
|||||||
$scope.alerts.splice(index, 1);
|
$scope.alerts.splice(index, 1);
|
||||||
};
|
};
|
||||||
// check if guest login is allowed
|
// check if guest login is allowed
|
||||||
$scope.guestAllowed = $stateParams.guest_enabled;
|
$scope.guestAllowed = $rootScope.guest_enabled;
|
||||||
// login
|
// login
|
||||||
$scope.login = function () {
|
$scope.login = function () {
|
||||||
$scope.alerts = [];
|
$scope.alerts = [];
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<h1 ng-if="model.id" translate>Edit participant</h1>
|
<h1 ng-if="model.id" translate>Edit participant</h1>
|
||||||
<h1 ng-if="!model.id" translate>New participant</h1>
|
<h1 ng-if="!model.id" translate>New participant</h1>
|
||||||
|
|
||||||
<alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
{{ alert.msg }}
|
{{ alert.msg }}
|
||||||
</alert>
|
</uib-alert>
|
||||||
|
|
||||||
<form name="userForm" ng-submit="save(model)">
|
<form name="userForm" ng-submit="save(model)">
|
||||||
<formly-form model="model" fields="formFields">
|
<formly-form model="model" fields="formFields">
|
||||||
|
@ -40,7 +40,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<!-- delete mode -->
|
<!-- delete mode -->
|
||||||
<button os-perms="users.can_manage" class="btn btn-default"
|
<button os-perms="users.can_manage" class="btn"
|
||||||
|
ng-class="$parent.isDeleteMode ? 'btn-primary' : 'btn-default'"
|
||||||
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
||||||
<i class="fa fa-check-square-o"></i>
|
<i class="fa fa-check-square-o"></i>
|
||||||
<translate>Select ...</translate>
|
<translate>Select ...</translate>
|
||||||
@ -55,7 +56,8 @@
|
|||||||
placeholder="{{ 'Search' | translate}}">
|
placeholder="{{ 'Search' | translate}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen">
|
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen"
|
||||||
|
ng-class="isFilterOpen ? 'btn-primary' : 'btn-default'">
|
||||||
<i class="fa fa-filter"></i>
|
<i class="fa fa-filter"></i>
|
||||||
<translate>Filter ...</translate>
|
<translate>Filter ...</translate>
|
||||||
</button>
|
</button>
|
||||||
@ -64,7 +66,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div uib-collapse="!isFilterOpen" class="row spacer">
|
<div uib-collapse="!isFilterOpen" class="row spacer">
|
||||||
<div class="col-sm-6 text-right"></div>
|
<div class="col-sm-6 text-right"></div>
|
||||||
<div class="col-sm-6 text-right">
|
<div class="col-sm-6 text-right form-inline">
|
||||||
|
<!-- group filter -->
|
||||||
|
<select ng-model="groupFilter" class="form-control" id="groupFilter">
|
||||||
|
<option value="" translate>--- Select group ---</option>
|
||||||
|
<option ng-repeat="group in groups" value="{{ group.id }}">{{ group.name }}</option>
|
||||||
|
</select>
|
||||||
<!-- isPresent filter -->
|
<!-- isPresent filter -->
|
||||||
<input type="checkbox" ng-model="filterPresent" ng-false-value="''">
|
<input type="checkbox" ng-model="filterPresent" ng-false-value="''">
|
||||||
<translate>Is present</translate>
|
<translate>Is present</translate>
|
||||||
@ -83,6 +90,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spacer-top-lg italic">
|
<div class="spacer-top-lg italic">
|
||||||
|
{{ usersFiltered.length }} /
|
||||||
{{ users.length }} {{ "participants" | translate }}<span ng-if="(users|filter:{selected:true}).length > 0">,
|
{{ users.length }} {{ "participants" | translate }}<span ng-if="(users|filter:{selected:true}).length > 0">,
|
||||||
{{(users|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
{{(users|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -90,9 +98,9 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
<th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="firstColumn">
|
<th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="minimum">
|
||||||
<!-- delete selection column -->
|
<!-- delete selection column -->
|
||||||
<th ng-show="isDeleteMode" os-perms="users.can_manage" class="firstColumn deleteColumn">
|
<th ng-show="isDeleteMode" os-perms="users.can_manage" class="minimum deleteColumn">
|
||||||
<input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
|
<input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
|
||||||
<th ng-click="toggleSort('first_name')" class="sortable">
|
<th ng-click="toggleSort('first_name')" class="sortable">
|
||||||
<translate>Name</translate>
|
<translate>Name</translate>
|
||||||
@ -116,8 +124,9 @@
|
|||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="user in users | filter: filter.search | filter: {is_present: filterPresent} |
|
<tr ng-repeat="user in usersFiltered = (users | filter: filter.search | filter: {groups: groupFilter} |
|
||||||
orderBy: sortColumn:reverse"
|
filter: {is_present: filterPresent} | orderBy: sortColumn:reverse)"
|
||||||
|
class="animate-item"
|
||||||
ng-class="{ 'activeline': user.isProjected(), 'selected': user.selected }">
|
ng-class="{ 'activeline': user.isProjected(), 'selected': user.selected }">
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
<td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
|
<td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
|
||||||
|
Loading…
Reference in New Issue
Block a user