New style for motion agenda title and list of speakers

Improved list of speakers slide title:
- h2 subtitle: use always motion identifier only (like in motion slides)
- h1 title: use always "list of speakers" (long motion title not useful
  if an other projector shows the motion slide with full title
  (identifier is enough)
This commit is contained in:
FinnStutzenstein 2018-04-11 14:33:44 +02:00 committed by Emanuel Schütze
parent 2497969864
commit 754040570d
6 changed files with 42 additions and 17 deletions

View File

@ -67,6 +67,18 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
} }
return title; 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 () { getAgendaTitle: function () {
return this.title; return this.title;
}, },
@ -97,14 +109,16 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
} }
}); });
}, },
getListViewTitle: function () { getProjectorTitle: function () {
var title;
try { try {
title = this.getContentObject().getAgendaListViewTitle(); return this.getContentObject().getAgendaListViewTitle();
} catch (e) { } catch (e) {
// when the content object is not in the DS store // 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) { if (this.item_number) {
title = this.item_number + ' · ' + title; title = this.item_number + ' · ' + title;
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -265,11 +265,21 @@ angular.module('OpenSlidesApp.motions', [
return this.getVersion(versionId).title; return this.getVersion(versionId).title;
}, },
getAgendaTitle: function () { getAgendaTitle: function () {
var title = ''; var title = gettextCatalog.getString('Motion');
if (this.identifier) { 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; return title;
}, },
getTitleWithChanges: function (changeRecommendationMode, versionId) { getTitleWithChanges: function (changeRecommendationMode, versionId) {