Merge pull request #3702 from FinnStutzenstein/motionAgendaTitle

new style for motion agenda title
This commit is contained in:
Emanuel Schütze 2018-05-02 13:37:44 +02:00 committed by GitHub
commit cc5a1ea0fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 17 deletions

View File

@ -69,6 +69,18 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
}
return title;
},
getListOfSpeakersTitle: function () {
var title;
try {
title = this.getContentObject().getListOfSpeakersTitle();
if (this.item_number) {
title = this.item_number + ' · ' + title;
}
} catch (e) {
title = this.getTitle();
}
return title;
},
getAgendaTitle: function () {
return this.title;
},
@ -99,14 +111,16 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
}
});
},
getListViewTitle: function () {
var title;
getProjectorTitle: function () {
try {
title = this.getContentObject().getAgendaListViewTitle();
return this.getContentObject().getAgendaListViewTitle();
} catch (e) {
// when the content object is not in the DS store
title = this.list_view_title;
return this.list_view_title;
}
},
getListViewTitle: function () {
var title = this.getProjectorTitle();
if (this.item_number) {
title = this.item_number + ' · ' + title;
}

View File

@ -2,11 +2,11 @@
<!-- Title -->
<div id="title">
<h1>{{ agendaItem.getTitle() }}</h1>
<h2>
<span translate>List of speakers</span>
<h1 translate>List of speakers</h1>
<h2>{{ agendaItem.getListOfSpeakersTitle() }}
<span ng-if="(agendaItem.speakers | filter: {begin_time: null}).length > 0">
&ndash; {{ (agendaItem.speakers | filter: {begin_time: null}).length }} <translate>speakers</translate>
</span>
<span ng-if="agendaItem.speaker_list_closed" class="slimlabel label label-danger" translate>Closed</span>
</h2>
</div>

View File

@ -18,7 +18,7 @@
</td>
<td ng-if="!node.item.closed">
<p ng-class="{mainitem: node.item.parent_id === null, subitem: node.item.parent_id !== null}">
{{ node.item.title }}
{{ node.item.getProjectorTitle() }}
</p>
<table ng-if="node.children.length" class="agendalist-table">
<tr ng-repeat="node in node.children" ng-include="'projector_agenda_renderer.html'"></tr>

View File

@ -2,11 +2,12 @@
<!-- Title -->
<div id="title">
<h1>{{ item.getTitle() }}</h1>
<h1 translate>List of speakers</h1>
<h2>
<span translate>List of speakers</span>
{{ item.getListOfSpeakersTitle() }}
<span ng-if="(item.speakers | filter: {begin_time: null}).length > 0">
&ndash; {{ (item.speakers | filter: {begin_time: null}).length }} <translate>speakers</translate>
</span>
<span ng-if="item.speaker_list_closed" class="slimlabel label label-danger" translate>Closed</span>
</h2>
</div>

View File

@ -654,9 +654,9 @@ class Motion(RESTModelMixin, models.Model):
Note: It has to be the same return value like in JavaScript.
"""
if self.identifier:
string = '%s (%s %s)' % (self.title, _(self._meta.verbose_name), self.identifier)
string = '%s %s' % (_(self._meta.verbose_name), self.identifier)
else:
string = '%s (%s)' % (self.title, _(self._meta.verbose_name))
string = '%s (%s)' % (_(self._meta.verbose_name), self.title)
return string
@property

View File

@ -265,11 +265,21 @@ angular.module('OpenSlidesApp.motions', [
return this.getVersion(versionId).title;
},
getAgendaTitle: function () {
var title = '';
var title = gettextCatalog.getString('Motion');
if (this.identifier) {
title = gettextCatalog.getString('Motion') + ' ' + this.identifier + ': ';
title += ' ' + this.identifier;
} else {
title += ' (' + this.getTitle() + ')';
}
return title;
},
getListOfSpeakersTitle: function () {
var title = gettextCatalog.getString('Motion');
if (this.identifier) {
title += ' ' + this.identifier;
} else {
title += ' (' + this.getTitle() + ')';
}
title += this.getTitle();
return title;
},
getTitleWithChanges: function (changeRecommendationMode, versionId) {