Merge pull request #1884 from emanuelschuetze/mediafileTemplate
Refactoring mediafile templates. (Fixes #1839, #1818, #1833)
This commit is contained in:
commit
bb1ae463db
@ -401,11 +401,10 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
|
|
||||||
.controller('AssignmentCreateCtrl', [
|
.controller('AssignmentCreateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
|
||||||
'Assignment',
|
'Assignment',
|
||||||
'AssignmentForm',
|
'AssignmentForm',
|
||||||
'Agenda',
|
'Agenda',
|
||||||
function($scope, $state, Assignment, AssignmentForm, Agenda) {
|
function($scope, Assignment, AssignmentForm, Agenda) {
|
||||||
$scope.model = {};
|
$scope.model = {};
|
||||||
// set default value for open posts form field
|
// set default value for open posts form field
|
||||||
$scope.model.open_posts = 1;
|
$scope.model.open_posts = 1;
|
||||||
@ -435,12 +434,11 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
|
|
||||||
.controller('AssignmentUpdateCtrl', [
|
.controller('AssignmentUpdateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
|
||||||
'Assignment',
|
'Assignment',
|
||||||
'AssignmentForm',
|
'AssignmentForm',
|
||||||
'Agenda',
|
'Agenda',
|
||||||
'assignment',
|
'assignment',
|
||||||
function($scope, $state, Assignment, AssignmentForm, Agenda, assignment) {
|
function($scope, Assignment, AssignmentForm, Agenda, assignment) {
|
||||||
$scope.alert = {};
|
$scope.alert = {};
|
||||||
// set initial values for form model by create deep copy of assignment object
|
// set initial values for form model by create deep copy of assignment object
|
||||||
// so list/detail view is not updated while editing
|
// so list/detail view is not updated while editing
|
||||||
@ -487,12 +485,11 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
|
|||||||
|
|
||||||
.controller('AssignmentPollUpdateCtrl', [
|
.controller('AssignmentPollUpdateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
|
||||||
'gettextCatalog',
|
'gettextCatalog',
|
||||||
'AssignmentPoll',
|
'AssignmentPoll',
|
||||||
'assignmentpoll',
|
'assignmentpoll',
|
||||||
'ballot',
|
'ballot',
|
||||||
function($scope, $state, gettextCatalog, AssignmentPoll, assignmentpoll, ballot) {
|
function($scope, gettextCatalog, AssignmentPoll, assignmentpoll, ballot) {
|
||||||
// set initial values for form model
|
// set initial values for form model
|
||||||
$scope.model = assignmentpoll;
|
$scope.model = assignmentpoll;
|
||||||
$scope.ballot = ballot;
|
$scope.ballot = ballot;
|
||||||
|
@ -23,6 +23,9 @@ angular.module('OpenSlidesApp.mediafiles', [])
|
|||||||
var filename = this.mediafile.name;
|
var filename = this.mediafile.name;
|
||||||
return /\/(.+?)$/.exec(filename)[1];
|
return /\/(.+?)$/.exec(filename)[1];
|
||||||
}],
|
}],
|
||||||
|
filetype: [function () {
|
||||||
|
return this.mediafile.type;
|
||||||
|
}],
|
||||||
title_or_filename: ['title', 'mediafile', function (title) {
|
title_or_filename: ['title', 'mediafile', function (title) {
|
||||||
return title || this.filename;
|
return title || this.filename;
|
||||||
}]
|
}]
|
||||||
|
@ -35,38 +35,25 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp.
|
|||||||
resolve: {
|
resolve: {
|
||||||
mediafiles: function(Mediafile) {
|
mediafiles: function(Mediafile) {
|
||||||
return Mediafile.findAll();
|
return Mediafile.findAll();
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.state('mediafiles.mediafile.create', {})
|
|
||||||
.state('mediafiles.mediafile.detail', {
|
|
||||||
url: '/{id:int}',
|
|
||||||
abstract: true,
|
|
||||||
resolve: {
|
|
||||||
mediafile: function(Mediafile, $stateParams) {
|
|
||||||
var id = $stateParams.id;
|
|
||||||
var file = Mediafile.find(id);
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
template: "<ui-view/>",
|
users: function(User) {
|
||||||
})
|
return User.findAll();
|
||||||
.state('mediafiles.mediafile.detail.update', {
|
},
|
||||||
views: {
|
|
||||||
'@mediafiles.mediafile': {}
|
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.controller('MediafileListCtrl', [
|
.controller('MediafileListCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$http',
|
'$http',
|
||||||
'$timeout',
|
'ngDialog',
|
||||||
'Upload',
|
|
||||||
'Mediafile',
|
'Mediafile',
|
||||||
function($scope, $http, $timeout, Upload, Mediafile) {
|
'MediafileForm',
|
||||||
|
'User',
|
||||||
|
function($scope, $http, ngDialog, Mediafile, MediafileForm, User) {
|
||||||
Mediafile.bindAll({}, $scope, 'mediafiles');
|
Mediafile.bindAll({}, $scope, 'mediafiles');
|
||||||
|
User.bindAll({}, $scope, 'users');
|
||||||
|
|
||||||
// setup table sorting
|
// setup table sorting
|
||||||
$scope.sortColumn = 'title';
|
$scope.sortColumn = 'title';
|
||||||
@ -89,62 +76,158 @@ angular.module('OpenSlidesApp.mediafiles.site', ['ngFileUpload', 'OpenSlidesApp.
|
|||||||
].join(" ");
|
].join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete
|
// open new/edit dialog
|
||||||
$scope.delete = function (mediafile) {
|
$scope.openDialog = function (mediafile) {
|
||||||
//TODO: add confirm message
|
ngDialog.open(MediafileForm.getDialog(mediafile));
|
||||||
Mediafile.destroy(mediafile.id).then(
|
};
|
||||||
function(success) {
|
|
||||||
//TODO: success message
|
// *** delete mode functions ***
|
||||||
|
$scope.isDeleteMode = false;
|
||||||
|
// check all checkboxes
|
||||||
|
$scope.checkAll = function () {
|
||||||
|
angular.forEach($scope.mediafiles, function (mediafile) {
|
||||||
|
mediafile.selected = $scope.selectedAll;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// uncheck all checkboxes if isDeleteMode is closed
|
||||||
|
$scope.uncheckAll = function () {
|
||||||
|
if (!$scope.isDeleteMode) {
|
||||||
|
$scope.selectedAll = false;
|
||||||
|
angular.forEach($scope.mediafiles, function (mediafile) {
|
||||||
|
mediafile.selected = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
};
|
||||||
|
// delete all selected mediafiles
|
||||||
|
$scope.deleteMultiple = function () {
|
||||||
|
angular.forEach($scope.mediafiles, function (mediafile) {
|
||||||
|
if (mediafile.selected)
|
||||||
|
Mediafile.destroy(mediafile.id);
|
||||||
|
});
|
||||||
|
$scope.isDeleteMode = false;
|
||||||
|
$scope.uncheckAll();
|
||||||
|
};
|
||||||
|
// delete single mediafile
|
||||||
|
$scope.delete = function (mediafile) {
|
||||||
|
Mediafile.destroy(mediafile.id);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.controller('MediafileCreateCtrl', [
|
.controller('MediafileCreateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
'MediafileForm',
|
||||||
'$timeout',
|
'User',
|
||||||
'operator',
|
function($scope, MediafileForm, User) {
|
||||||
'Upload',
|
User.bindAll({}, $scope, 'users');
|
||||||
function($scope, $state, $timeout, operator, Upload) {
|
|
||||||
$scope.mediafile = {};
|
$scope.mediafile = {};
|
||||||
$scope.save = uploadFile($timeout, $scope, $state, operator, Upload);
|
$scope.alert = {};
|
||||||
|
$scope.users = User.getAll();
|
||||||
|
|
||||||
|
// upload and save mediafile
|
||||||
|
$scope.save = function (mediafile) {
|
||||||
|
MediafileForm.uploadFile(mediafile).then(
|
||||||
|
function (success) {
|
||||||
|
$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};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
.controller('MediafileUpdateCtrl', [
|
.controller('MediafileUpdateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
|
'operator',
|
||||||
|
'Mediafile',
|
||||||
|
'User',
|
||||||
|
'mediafile',
|
||||||
|
function($scope, operator, Mediafile, User, mediafile) {
|
||||||
|
User.bindAll({}, $scope, 'users');
|
||||||
|
$scope.alert = {};
|
||||||
|
$scope.users = User.getAll();
|
||||||
|
|
||||||
|
// set initial values for form model by create deep copy of motion object
|
||||||
|
// so list/detail view is not updated while editing
|
||||||
|
$scope.mediafile = angular.copy(mediafile);
|
||||||
|
|
||||||
|
// save mediafile
|
||||||
|
$scope.save = function (mediafile) {
|
||||||
|
// reset title and uploader_id if empty
|
||||||
|
if (!mediafile.title) {
|
||||||
|
mediafile.title = mediafile.filename;
|
||||||
|
}
|
||||||
|
if (!mediafile.uploader_id) {
|
||||||
|
mediafile.uploader_id = operator.user.id;
|
||||||
|
}
|
||||||
|
// inject the changed mediafile (copy) object back into DS store
|
||||||
|
Mediafile.inject(mediafile);
|
||||||
|
// save change mediafile object on server
|
||||||
|
Mediafile.save(mediafile, { method: 'PATCH' }).then(
|
||||||
|
function (success) {
|
||||||
|
$scope.closeThisDialog();
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
Mediafile.refresh(mediafile);
|
||||||
|
var message = '';
|
||||||
|
for (var e in error.data) {
|
||||||
|
message += e + ': ' + error.data[e] + ' ';
|
||||||
|
}
|
||||||
|
$scope.alert = {type: 'danger', msg: message, show: true};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
// Service for mediafile form
|
||||||
|
.factory('MediafileForm', [
|
||||||
'$state',
|
'$state',
|
||||||
'$timeout',
|
|
||||||
'operator',
|
'operator',
|
||||||
'Upload',
|
'Upload',
|
||||||
'Mediafile',
|
'gettextCatalog',
|
||||||
'mediafile',
|
'User',
|
||||||
function($scope, $state, $timeout, operator, Upload, Mediafile, mediafile) {
|
function ($state, operator, Upload, gettextCatalog, User) {
|
||||||
$scope.mediafile = mediafile;
|
return {
|
||||||
$scope.save = uploadFile($timeout, $scope, $state, operator, Upload, mediafile);
|
// ngDialog for mediafile form
|
||||||
|
getDialog: function (mediafile) {
|
||||||
|
if (mediafile) {
|
||||||
|
var resolve = {
|
||||||
|
mediafile: function(Assignment) {return mediafile;}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
template: 'static/templates/mediafiles/mediafile-form.html',
|
||||||
|
controller: (mediafile) ? 'MediafileUpdateCtrl' : 'MediafileCreateCtrl',
|
||||||
|
className: 'ngdialog-theme-default wide-form',
|
||||||
|
closeByEscape: false,
|
||||||
|
closeByDocument: false,
|
||||||
|
resolve: (resolve) ? resolve : null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// upload selected file (used by create view only)
|
||||||
|
uploadFile: function (mediafile) {
|
||||||
|
if (!mediafile.title) {
|
||||||
|
mediafile.title = mediafile.newFile.name;
|
||||||
|
}
|
||||||
|
if (!mediafile.uploader_id) {
|
||||||
|
mediafile.uploader_id = operator.user.id;
|
||||||
|
}
|
||||||
|
return Upload.upload({
|
||||||
|
url: '/rest/mediafiles/mediafile/',
|
||||||
|
method: 'POST',
|
||||||
|
data: {mediafile: mediafile.newFile, title: mediafile.title, uploader_id: mediafile.uploader_id}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
function uploadFile($timeout, $scope, $state, operator, Upload, mediafile) {
|
|
||||||
return function(file) {
|
|
||||||
file.upload = Upload.upload({
|
|
||||||
url: '/rest/mediafiles/mediafile/' + (mediafile ? mediafile.id : ''),
|
|
||||||
method: mediafile ? 'PUT' : 'POST',
|
|
||||||
data: {mediafile: file.newFile, title: file.title, uploader_id: operator.user.id}
|
|
||||||
});
|
|
||||||
|
|
||||||
file.upload.then(function (response) {
|
|
||||||
$timeout(function () {
|
|
||||||
file.result = response.data;
|
|
||||||
$state.go('mediafiles.mediafile.list');
|
|
||||||
});
|
|
||||||
}, function (response) {
|
|
||||||
if (response.status > 0)
|
|
||||||
$scope.errorMsg = response.status + ': ' + response.data;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
@ -1,42 +1,46 @@
|
|||||||
<div class="header">
|
<h1 ng-if="mediafile.id" translate>Edit file</h1>
|
||||||
<div class="title">
|
<h1 ng-if="!mediafile.id" translate>New file</h1>
|
||||||
<div class="submenu">
|
|
||||||
<a ui-sref="mediafiles.mediafile.list" class="btn btn-sm btn-default">
|
|
||||||
<i class="fa fa-angle-double-left fa-lg"></i>
|
|
||||||
<translate>Back to overview</translate>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<h1 ng-if="mediafile.id" translate>Edit file</h1>
|
|
||||||
<h1 ng-if="!mediafile.id" translate>New file</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="details">
|
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
|
||||||
<form name="mediafileForm">
|
{{ alert.msg }}
|
||||||
|
</uib-alert>
|
||||||
|
|
||||||
|
<form name="mediafileForm" ng-submit="save(mediafile)">
|
||||||
|
<!-- file -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div ng-if="mediafile.id">
|
<label for="inputTitle" translate>File *</label>
|
||||||
<span translate>Current value: </span>{{ mediafile.filename }}
|
<!-- create view: show file select field -->
|
||||||
</div>
|
<input ng-if="!mediafile.id" type="file" ngf-select ng-model="mediafile.newFile" required>
|
||||||
<input type="file" ngf-select ng-model="mediafile.newFile" required/>
|
<!-- update view: show filename only -->
|
||||||
|
<div ng-if="mediafile.id">{{ mediafile.filename }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- title -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="inputTitle" translate>Title</label>
|
<label for="inputTitle" translate>Title</label>
|
||||||
<input type="text" ng-model="mediafile.title" class="form-control" name="inputTitle">
|
<input type="text" ng-model="mediafile.title" class="form-control" name="inputTitle">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span ng-show="mediafile.mediafile.result">Upload Successful</span>
|
<!-- uploader -->
|
||||||
|
<div os-perms="mediafiles.can_manage" class="form-group">
|
||||||
|
<label for="inputTitle" translate>Uploaded by</label>
|
||||||
|
<ui-select ng-model="mediafile.uploader_id">
|
||||||
|
<ui-select-match placeholder="{{ 'Select or search a participant ...' | translate }}" data-allow-clear="true">
|
||||||
|
{{ $select.selected.get_full_name() }}
|
||||||
|
</ui-select-match>
|
||||||
|
<ui-select-choices repeat="user.id as user in users | filter: $select.search">
|
||||||
|
<div ng-bind-html="user.get_full_name() | highlight: $select.search"></div>
|
||||||
|
</ui-select-choices>
|
||||||
|
</ui-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<i ng-show="mediafile.file.$error.required">*required</i><br>
|
|
||||||
<i ng-show="mediafile.file.$error.maxSize">File too large
|
<i ng-show="mediafile.file.$error.maxSize">File too large
|
||||||
{{ picFile.size / 1000000|number:1}}MB: max {{ mediafile.mediafile.$errorParam}}</i>
|
{{ picFile.size / 1000000|number:1}}MB: max {{ mediafile.mediafile.$errorParam}}</i>
|
||||||
|
|
||||||
<button type="submit" ng-click="save(mediafile)" class="btn btn-primary" translate>
|
<button type="submit" ng-disabled="mediafileForm.$invalid" class="btn btn-primary" translate>
|
||||||
Save
|
Save
|
||||||
</button>
|
</button>
|
||||||
<button ui-sref="mediafiles.mediafile.list" class="btn btn-default" translate>
|
<button ng-click="closeThisDialog()" class="btn btn-default" translate>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<div class="submenu">
|
<div class="submenu">
|
||||||
<a ui-sref="mediafiles.mediafile.create" os-perms="mediafiles.can_upload" class="btn btn-primary btn-sm">
|
<a ng-click="openDialog()" os-perms="mediafiles.can_upload" class="btn btn-primary btn-sm">
|
||||||
<i class="fa fa-plus fa-lg"></i>
|
<i class="fa fa-plus fa-lg"></i>
|
||||||
<translate>New</translate>
|
<translate>New</translate>
|
||||||
</a>
|
</a>
|
||||||
@ -12,71 +12,132 @@
|
|||||||
|
|
||||||
<div class="details">
|
<div class="details">
|
||||||
<div class="row form-group">
|
<div class="row form-group">
|
||||||
<div class="col-sm-8"></div>
|
<div class="col-sm-6">
|
||||||
<div class="col-sm-4">
|
<form class="form-inline">
|
||||||
<input type="text" os-focus-me ng-model="filter.search" class="form-control"
|
<!-- delete mode -->
|
||||||
placeholder="{{ 'Filter' | translate }}">
|
<button os-perms="mediafiles.can_manage" class="btn"
|
||||||
|
ng-class="$parent.isDeleteMode ? 'btn-primary' : 'btn-default'"
|
||||||
|
ng-click="$parent.isDeleteMode = !$parent.isDeleteMode; uncheckAll()">
|
||||||
|
<i class="fa fa-check-square-o"></i>
|
||||||
|
<translate>Select ...</translate>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<div class="form-inline text-right">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-addon"><i class="fa fa-search"></i></div>
|
||||||
|
<input type="text" os-focus-me ng-model="filter.search" class="form-control"
|
||||||
|
placeholder="{{ 'Search' | translate}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-default" ng-click="isFilterOpen = !isFilterOpen"
|
||||||
|
ng-class="isFilterOpen ? 'btn-primary' : 'btn-default'">
|
||||||
|
<i class="fa fa-filter"></i>
|
||||||
|
<translate>Filter ...</translate>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div uib-collapse="!isFilterOpen" class="row">
|
||||||
|
<div class="col-sm-6 text-right"></div>
|
||||||
|
<div class="col-sm-6 text-right">
|
||||||
|
<!-- pdf filter -->
|
||||||
|
<input type="checkbox" ng-model="filter.showPDFs" ng-true-value="'application/pdf'" ng-false-value=''>
|
||||||
|
<translate> Show PDF files only</translate>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div uib-collapse="!isDeleteMode" class="row spacer">
|
||||||
|
<div class="col-sm-12 text-left">
|
||||||
|
<!-- delete button -->
|
||||||
|
<a ng-show="isDeleteMode"
|
||||||
|
os-perms="mediafiles.can_manage" ng-click="deleteMultiple()"
|
||||||
|
class="btn btn-primary">
|
||||||
|
<i class="fa fa-trash fa-lg"></i>
|
||||||
|
<translate>Delete selected mediafiles</translate>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="spacer-top-lg italic">
|
||||||
|
{{ mediafilesFiltered.length }} /
|
||||||
|
{{ mediafiles.length }} {{ "files" | translate }}<span ng-if="(mediafiles|filter:{selected:true}).length > 0">,
|
||||||
|
{{(mediafiles|filter:{selected:true}).length}} {{ "selected" | translate }}</span>
|
||||||
</div>
|
</div>
|
||||||
<table class="table table-striped table-bordered table-hover">
|
<table class="table table-striped table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<!-- projector column -->
|
||||||
|
<th ng-show="!isDeleteMode" os-perms="core.can_manage_projector" class="minimum">
|
||||||
|
<!-- delete selection column -->
|
||||||
|
<th ng-show="isDeleteMode" os-perms="mediafiles.can_manage" class="minimum deleteColumn">
|
||||||
|
<input type="checkbox" ng-model="$parent.selectedAll" ng-change="checkAll()">
|
||||||
|
<!-- title -->
|
||||||
<th ng-click="toggleSort('title_or_filename')" class="sortable">
|
<th ng-click="toggleSort('title_or_filename')" class="sortable">
|
||||||
<translate>Title</translate>
|
<translate>Title</translate>
|
||||||
<i class="pull-right fa" ng-show="sortColumn === 'title_or_filename' && header.sortable != false"
|
<i class="pull-right fa" ng-show="sortColumn === 'title_or_filename' && header.sortable != false"
|
||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
<th ng-click="toggleSort('filetype')" class="sortable">
|
<!-- filetype -->
|
||||||
|
<th ng-click="toggleSort('filetype')" class="sortable optional">
|
||||||
<translate>Filetype</translate>
|
<translate>Filetype</translate>
|
||||||
<i class="pull-right fa" ng-show="sortColumn === 'filetype' && header.sortable != false"
|
<i class="pull-right fa" ng-show="sortColumn === 'filetype' && header.sortable != false"
|
||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
<th ng-click="toggleSort('filesize')" class="sortable">
|
<!-- filesize -->
|
||||||
|
<th ng-click="toggleSort('filesize')" class="sortable optional">
|
||||||
<translate>Filesize</translate>
|
<translate>Filesize</translate>
|
||||||
<i class="pull-right fa" ng-show="sortColumn === 'filesize' && header.sortable != false"
|
<i class="pull-right fa" ng-show="sortColumn === 'filesize' && header.sortable != false"
|
||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
<th ng-click="toggleSort('timestamp')" class="sortable">
|
<!-- upload time -->
|
||||||
|
<th ng-click="toggleSort('timestamp')" class="sortable optional">
|
||||||
<translate>Upload time</translate>
|
<translate>Upload time</translate>
|
||||||
<i class="pull-right fa" ng-show="sortColumn === 'timestamp' && header.sortable != false"
|
<i class="pull-right fa" ng-show="sortColumn === 'timestamp' && header.sortable != false"
|
||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
|
<!-- uploaded by -->
|
||||||
<th ng-click="toggleSort('uploader')" class="sortable">
|
<th ng-click="toggleSort('uploader')" class="sortable">
|
||||||
<translate>Uploaded by</translate>
|
<translate>Uploaded by</translate>
|
||||||
<i class="pull-right fa" ng-show="sortColumn === 'uploader' && header.sortable != false"
|
<i class="pull-right fa" ng-show="sortColumn === 'uploader' && header.sortable != false"
|
||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
<th os-perms="mediafiles.can_manage core.can_manage_projector">
|
|
||||||
<translate>Actions</translate>
|
|
||||||
</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="mediafile in mediafiles | osFilter: filter.search : getFilterString |
|
<tr ng-repeat="mediafile in mediafilesFiltered = (mediafiles | osFilter: filter.search : getFilterString |
|
||||||
orderBy: sortColumn:reverse">
|
filter: {filetype: filter.showPDFs} | orderBy: sortColumn:reverse)"
|
||||||
<td><a ng-href="{{ mediafile.mediafileUrl }}" target="_blank">{{ mediafile.title_or_filename }}</a>
|
class="animate-item"
|
||||||
<td class="optional">{{ mediafile.mediafile.type }}
|
ng-class="{ 'activeline': mediafile.isProjected(), 'selected': mediafile.selected }">
|
||||||
<td>{{ mediafile.filesize }}
|
<!-- projector column -->
|
||||||
<td>{{ mediafile.timestamp | date:'yyyy-MM-dd HH:mm:ss' }}
|
<!-- TOOD: implement project pdf feature -->
|
||||||
<td>{{ mediafile.uploader.get_full_name() }}
|
<td ng-show="!isDeleteMode"
|
||||||
<td os-perms="mediafiles.can_manage core.can_manage_projector" class="nobr">
|
os-perms="core.can_manage_projector">
|
||||||
<!-- projector, TODO: add link to activate slide -->
|
<a class="btn btn-default btn-sm"
|
||||||
<a href="" ng-show="mediafile.mediafile.type == 'application/pdf'" os-perms="core.can_manage_projector"
|
ng-if="mediafile.mediafile.type == 'application/pdf'"
|
||||||
class="btn btn-default btn-sm"
|
ng-class="{ 'btn-primary': mediafile.isProjected() }"
|
||||||
title="{{ 'Show' | translate }}">
|
ng-click="mediafile.project()"
|
||||||
|
ng-bootbox-alert="{{ 'Sorry, the function to project pdf files is not yet implemented.' | translate }}"
|
||||||
|
title="{{ 'Project mediafile' | translate }}">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
</a>
|
</a>
|
||||||
<!-- edit -->
|
<!-- delete selection column -->
|
||||||
<a ui-sref="mediafiles.mediafile.detail.update({id: mediafile.id })" os-perms="mediafiles.can_manage"
|
<td ng-show="isDeleteMode" os-perms="mediafiles.can_manage" class="deleteColumn">
|
||||||
class="btn btn-default btn-sm"
|
<input type="checkbox" ng-model="mediafile.selected">
|
||||||
title="{{ 'Edit' | translate }}">
|
<!-- mediafile data colums -->
|
||||||
<i class="fa fa-pencil"></i>
|
<td ng-mouseover="mediafile.hover=true" ng-mouseleave="mediafile.hover=false">
|
||||||
</a>
|
<strong><a ng-href="{{ mediafile.mediafileUrl }}" target="_blank">{{ mediafile.title_or_filename }}</a></strong>
|
||||||
<!-- delete -->
|
<div os-perms="mediafiles.can_manage" class="hoverActions" ng-class="{'hiddenDiv': !mediafile.hover}">
|
||||||
<a ng-click="delete(mediafile)" os-perms="mediafiles.can_manage" class="btn btn-danger btn-sm"
|
<a href="" ng-click="openDialog(mediafile)" translate>Edit</a> |
|
||||||
title="{{ 'Delete' | translate }}">
|
<a href="" class="text-danger"
|
||||||
<i class="fa fa-trash-o"></i>
|
ng-bootbox-confirm="{{ 'Are you sure you want to delete this file?' | translate }}<br>
|
||||||
</a>
|
<b>{{ mediafile.title }} [{{ mediafile.mediafile.name }}]</b>"
|
||||||
</tr>
|
ng-bootbox-confirm-action="delete(mediafile)" translate>Delete</a>
|
||||||
|
</div>
|
||||||
|
<td class="optional">{{ mediafile.mediafile.type }}
|
||||||
|
<td class="optional">{{ mediafile.filesize }}
|
||||||
|
<td class="optional">{{ mediafile.timestamp | date:'yyyy-MM-dd HH:mm:ss' }}
|
||||||
|
<td>{{ mediafile.uploader.get_full_name() }}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -603,7 +603,6 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
|
|
||||||
.controller('MotionCreateCtrl', [
|
.controller('MotionCreateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
|
||||||
'gettext',
|
'gettext',
|
||||||
'Motion',
|
'Motion',
|
||||||
'MotionForm',
|
'MotionForm',
|
||||||
@ -614,7 +613,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
'User',
|
'User',
|
||||||
'Workflow',
|
'Workflow',
|
||||||
'Agenda',
|
'Agenda',
|
||||||
function($scope, $state, gettext, Motion, MotionForm, Category, Config, Mediafile, Tag, User, Workflow, Agenda) {
|
function($scope, gettext, Motion, MotionForm, Category, Config, Mediafile, Tag, User, Workflow, Agenda) {
|
||||||
Category.bindAll({}, $scope, 'categories');
|
Category.bindAll({}, $scope, 'categories');
|
||||||
Mediafile.bindAll({}, $scope, 'mediafiles');
|
Mediafile.bindAll({}, $scope, 'mediafiles');
|
||||||
Tag.bindAll({}, $scope, 'tags');
|
Tag.bindAll({}, $scope, 'tags');
|
||||||
@ -652,7 +651,6 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
|
|
||||||
.controller('MotionUpdateCtrl', [
|
.controller('MotionUpdateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
|
||||||
'Motion',
|
'Motion',
|
||||||
'Category',
|
'Category',
|
||||||
'Config',
|
'Config',
|
||||||
@ -663,7 +661,7 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
'Workflow',
|
'Workflow',
|
||||||
'Agenda',
|
'Agenda',
|
||||||
'motion',
|
'motion',
|
||||||
function($scope, $state, Motion, Category, Config, Mediafile, MotionForm, Tag, User, Workflow, Agenda, motion) {
|
function($scope, Motion, Category, Config, Mediafile, MotionForm, Tag, User, Workflow, Agenda, motion) {
|
||||||
Category.bindAll({}, $scope, 'categories');
|
Category.bindAll({}, $scope, 'categories');
|
||||||
Mediafile.bindAll({}, $scope, 'mediafiles');
|
Mediafile.bindAll({}, $scope, 'mediafiles');
|
||||||
Tag.bindAll({}, $scope, 'tags');
|
Tag.bindAll({}, $scope, 'tags');
|
||||||
@ -746,13 +744,12 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
|
|||||||
|
|
||||||
.controller('MotionPollUpdateCtrl', [
|
.controller('MotionPollUpdateCtrl', [
|
||||||
'$scope',
|
'$scope',
|
||||||
'$state',
|
|
||||||
'gettextCatalog',
|
'gettextCatalog',
|
||||||
'MotionPoll',
|
'MotionPoll',
|
||||||
'MotionPollForm',
|
'MotionPollForm',
|
||||||
'motionpoll',
|
'motionpoll',
|
||||||
'voteNumber',
|
'voteNumber',
|
||||||
function($scope, $state, gettextCatalog, MotionPoll, MotionPollForm, motionpoll, voteNumber) {
|
function($scope, gettextCatalog, MotionPoll, MotionPollForm, motionpoll, voteNumber) {
|
||||||
// set initial values for form model
|
// set initial values for form model
|
||||||
$scope.model = motionpoll;
|
$scope.model = motionpoll;
|
||||||
$scope.voteNumber = voteNumber;
|
$scope.voteNumber = voteNumber;
|
||||||
|
Loading…
Reference in New Issue
Block a user