default sorting for users, mediafiles and assignments (fixes #3344)

This commit is contained in:
FinnStutzenstein 2017-08-11 10:18:50 +02:00
parent 2aeaf251a2
commit a365127a1c
5 changed files with 18 additions and 9 deletions

View File

@ -65,6 +65,8 @@ Core:
- Delay the 'could not load projector' error 3 seconds to not irritate users
with a slow internet connection [#3323].
- Added config value for standard font size in PDF [#3332].
- Added default sorting for agenda, motions, elections, mediafiles and
users [#3334, 3348].
Mediafiles:
- Fixed reloading of PDF on page change [#3274].

View File

@ -273,7 +273,11 @@ angular.module('OpenSlidesApp.assignments.site', [
'AssignmentPdfExport',
function($scope, ngDialog, AssignmentForm, Assignment, Tag, Agenda, Projector, ProjectionDefault,
gettextCatalog, User, osTableFilter, osTableSort, gettext, AssignmentPhases, AssignmentPdfExport) {
Assignment.bindAll({}, $scope, 'assignments');
$scope.$watch(function () {
return Assignment.lastModified();
}, function () {
$scope.assignments = _.orderBy(Assignment.getAll(), ['title']);
});
Tag.bindAll({}, $scope, 'tags');
$scope.$watch(function () {
return Projector.lastModified();

View File

@ -25,17 +25,17 @@ angular.module('OpenSlidesApp.mediafiles.list', [
'Logos',
function ($http, $scope, gettext, ngDialog, osTableFilter, osTableSort,
ProjectionDefault, Projector, User, Mediafile, MediafileForm, Logos) {
Mediafile.bindAll({}, $scope, 'mediafiles');
$scope.$watch(function () {
return Mediafile.lastModified();
}, function () {
$scope.mediafiles = _.orderBy(Mediafile.getAll(), ['title']);
});
User.bindAll({}, $scope, 'users');
$scope.$watch(function() {
return Projector.lastModified();
}, function() {
$scope.projectors = Projector.getAll();
updatePresentedMediafiles();
});
$scope.$watch(function () {
return Projector.lastModified();
}, function () {
var projectiondefault = ProjectionDefault.filter({name: 'mediafiles'})[0];
if (projectiondefault) {
$scope.defaultProjectorId = projectiondefault.projector_id;

View File

@ -895,9 +895,8 @@ angular.module('OpenSlidesApp.motions.site', [
$scope.$watch(function () {
return Motion.lastModified();
}, function () {
$scope.motions = Motion.getAll();
// always order by identifier (after custom ordering)
$scope.motions = _.orderBy($scope.motions, ['identifier']);
$scope.motions = _.orderBy(Motion.getAll(), ['identifier']);
_.forEach($scope.motions, function (motion) {
motion.personalNote = PersonalNoteManager.getNote(motion);
// For filtering, we cannot filter for .personalNote.star

View File

@ -537,7 +537,11 @@ angular.module('OpenSlidesApp.users.site', [
'ErrorMessage',
function($scope, $state, $http, $q, ngDialog, UserForm, User, Group, PasswordGenerator, Projector, ProjectionDefault,
Config, gettextCatalog, UserCsvExport, osTableFilter, osTableSort, gettext, UserPdfExport, ErrorMessage) {
User.bindAll({}, $scope, 'users');
$scope.$watch(function () {
return User.lastModified();
}, function () {
$scope.users = _.orderBy(User.getAll(), ['first_name']);
});
Group.bindAll({where: {id: {'>': 1}}}, $scope, 'groups');
$scope.$watch(function () {
return Projector.lastModified();