Order attachments by title

This commit is contained in:
FinnStutzenstein 2018-04-11 12:56:34 +02:00
parent 2497969864
commit 30b307d309
3 changed files with 8 additions and 6 deletions

View File

@ -354,6 +354,7 @@ angular.module('OpenSlidesApp.motions.site', [
// Service for generic motion form (create and update)
.factory('MotionForm', [
'$filter',
'gettextCatalog',
'operator',
'Editor',
@ -367,8 +368,8 @@ angular.module('OpenSlidesApp.motions.site', [
'Workflow',
'Agenda',
'AgendaTree',
function (gettextCatalog, operator, Editor, MotionComment, Category, Config, Mediafile, MotionBlock,
Tag, User, Workflow, Agenda, AgendaTree) {
function ($filter, gettextCatalog, operator, Editor, MotionComment, Category,
Config, Mediafile, MotionBlock, Tag, User, Workflow, Agenda, AgendaTree) {
return {
// ngDialog for motion form
getDialog: function (motion) {
@ -498,7 +499,7 @@ angular.module('OpenSlidesApp.motions.site', [
type: 'select-multiple',
templateOptions: {
label: gettextCatalog.getString('Attachment'),
options: Mediafile.getAll(),
options: $filter('orderBy')(Mediafile.getAll(), 'title_or_filename'),
ngOptions: 'option.id as option.title_or_filename for option in to.options',
placeholder: gettextCatalog.getString('Select or search an attachment ...')
},

View File

@ -61,13 +61,14 @@ angular.module('OpenSlidesApp.topics.site', ['OpenSlidesApp.topics', 'OpenSlides
])
.factory('TopicForm', [
'$filter',
'gettextCatalog',
'operator',
'Editor',
'Mediafile',
'Agenda',
'AgendaTree',
function (gettextCatalog, operator, Editor, Mediafile, Agenda, AgendaTree) {
function ($filter, gettextCatalog, operator, Editor, Mediafile, Agenda, AgendaTree) {
return {
// ngDialog for topic form
getDialog: function (topic) {
@ -110,7 +111,7 @@ angular.module('OpenSlidesApp.topics.site', ['OpenSlidesApp.topics', 'OpenSlides
type: 'select-multiple',
templateOptions: {
label: gettextCatalog.getString('Attachment'),
options: Mediafile.getAll(),
options: $filter('orderBy')(Mediafile.getAll(), 'title_or_filename'),
ngOptions: 'option.id as option.title_or_filename for option in to.options',
placeholder: gettextCatalog.getString('Select or search an attachment ...')
}

View File

@ -30,7 +30,7 @@
<div ng-bind-html="topic.text | trusted" class="topictext"></div>
<h3 ng-if="topic.attachments.length > 0" translate>Attachments</h3>
<ul>
<li ng-repeat="attachment in topic.attachments">
<li ng-repeat="attachment in topic.attachments | orderBy: 'title_or_filename'">
<a href="{{ attachment.mediafileUrl }}" target="_blank">
{{ attachment.title_or_filename }}
</a>