Motion template improvements (Fixed #3303)

- Sort categories drop downs by config value (name or prefix) (fixed #3303).
- Show comment fiels in pdf without "Comment" as prefix.
- Improved heading style in web and pdf.
- Added motion block to motion pdf.
This commit is contained in:
Emanuel Schütze 2017-10-11 22:45:01 +02:00
parent 721064700a
commit 17959bd9c5
8 changed files with 45 additions and 18 deletions

View File

@ -46,6 +46,19 @@ h1, h2, h3, h4, h5, h6, #header .title {
#content .col1 .meta .heading .drop-down-name, #content .col1 .meta h3 {
font-family: 'Roboto Condensed Light';
}
.details h1 {
font-size: 20px;
color: #000;
}
.details h2 {
font-size: 18px;
color: #000;
}
.details h3 {
font-size: 16px;
color: #000;
}
/*
* Template styles for OpenSlides site

View File

@ -324,13 +324,13 @@ angular.module('OpenSlidesApp.motions.lineNumbering', [])
}
break;
case 'H1':
newLength *= 0.5;
newLength *= 0.66;
break;
case 'H2':
newLength *= 0.66;
newLength *= 0.75;
break;
case 'H3':
newLength *= 0.66;
newLength *= 0.85;
break;
}
return Math.ceil(newLength);

View File

@ -127,6 +127,18 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
]);
}
// motion block
if (motion.motionBlock) {
metaTableBody.push([
{
text: gettextCatalog.getString('Motion block') + ':',
style: ['bold', 'grey'] },
{
text: motion.motionBlock.title,
style: 'grey'
}
]);
}
// voting result
if (motion.polls.length > 0 && motion.polls[0].has_votes) {
var column1 = [];
@ -313,7 +325,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
var comments = [];
_.forEach(fields, function (field, id) {
if (motion.comments[id]) {
var title = gettextCatalog.getString('Comment') + ' ' + field.name;
var title = field.name;
if (!field.public) {
title += ' (' + gettextCatalog.getString('internal') + ')';
}
@ -1020,7 +1032,7 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf'])
var content = [];
_.forEach(fields, function (field, id) {
if (motion.comments[id]) {
var title = gettextCatalog.getString('Comment') + ' ' + field.name;
var title = field.name;
if (!field.public) {
title += ' (' + gettextCatalog.getString('internal') + ')';
}

View File

@ -235,7 +235,7 @@
<i class="fa fa-cog"></i>
</span>
<ul class="dropdown-menu" aria-labelledby="category-dropdown">
<li ng-repeat="category in categories">
<li ng-repeat="category in categories | orderBy: config('motions_export_category_sorting')">
<a href ng-click="toggleCategory(category)">
<i class="fa fa-check" ng-if="category.id == motion.category.id"></i>
{{ category.prefix }} &ndash; {{ category.name }}

View File

@ -21,7 +21,7 @@
</button>
</span>
</div>
<h3 class="toolbar-left" translate>Comments</h3>
<h1 class="toolbar-left" translate>Comments</h1>
</div>
<!-- comment fields -->
<div class="col-sm-12">

View File

@ -22,7 +22,7 @@
<i class="fa fa-thumb-tack" ng-class="{'rotate-45-deg-right': !personalNotePinned}"></i>
</button>
</div>
<h3 class="toolbar-left" translate>Personal note</h3>
<h1 class="toolbar-left" translate>Personal note</h1>
</div>
<!-- personal note editor field -->

View File

@ -85,7 +85,8 @@
<!-- category select -->
<select ng-show="selectedAction == 'setCategory'" ng-model="selectedCategory" class="form-control input-sm">
<option value="" translate>--- Select category ---</option>
<option ng-repeat="category in categories" value="{{ category.id }}">
<option ng-repeat="category in categories | orderBy: config('motions_export_category_sorting')"
value="{{ category.id }}">
{{ category.prefix }} &ndash; {{ category.name }}
</option>
<option value="no_category_selected" translate>No category</option>
@ -205,7 +206,7 @@
<span class="caret"></span>
</span>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownCategory">
<li ng-repeat="category in categories">
<li ng-repeat="category in categories | orderBy: config('motions_export_category_sorting')">
<a href ng-click="filter.operateMultiselectFilter('category', category.id, isSelectMode)">
<i class="fa fa-check" ng-if="filter.multiselectFilters.category.indexOf(category.id) > -1"></i>
{{ category.prefix }} &ndash; {{ category.name }}
@ -391,7 +392,8 @@
<translate>done</translate>
</span>
<!-- category -->
<span ng-repeat="category in categories" class="pointer spacer-left-lg"
<span ng-repeat="category in categories | orderBy: config('motions_export_category_sorting')"
class="pointer spacer-left-lg"
ng-if="filter.multiselectFilters.category.indexOf(category.id) > -1"
ng-click="filter.operateMultiselectFilter('category', category.id, isSelectMode)"
ng-class="{'disabled': isSelectMode}">
@ -625,7 +627,7 @@
</span>
</span>
<ul class="dropdown-menu" aria-labelledby="dropdownCategory{{ motion.id }}">
<li ng-repeat="category in categories">
<li ng-repeat="category in categories | orderBy: config('motions_export_category_sorting')">
<a href ng-click="toggleCategory(motion, category)">
<i class="fa fa-check" ng-if="category.id == motion.category.id"></i>
{{ category.prefix }} &ndash; {{ category.name }}

View File

@ -218,20 +218,20 @@ describe('linenumbering', function () {
expect(lineNumberingService.insertLineBreaksWithoutNumbers(outHtml, 80)).toBe(outHtml);
});
it('shortens the line for H1-elements by 1/2', function () {
it('shortens the line for H1-elements by 2/3', function () {
var inHtml = '<h1>' + longstr(80) + '</h1>';
var expected = '<h1>' + noMarkup(1) + 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMN' +
brMarkup(2) + 'OPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZAB</h1>';
var expected = '<h1>' + noMarkup(1) + 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZA' +
brMarkup(2) + 'BCDEFGHIJKLMNOPQRSTUVWXYZAB</h1>';
var outHtml = lineNumberingService.insertLineNumbers(inHtml, 80);
expect(outHtml).toBe(expected);
expect(lineNumberingService.stripLineNumbers(outHtml)).toBe(inHtml);
expect(lineNumberingService.insertLineBreaksWithoutNumbers(outHtml, 80)).toBe(outHtml);
});
it('shortens the line for H2-elements by 2/3', function () {
it('shortens the line for H2-elements by 0.75', function () {
var inHtml = '<h2>' + longstr(80) + '</h2>';
var expected = '<h2>' + noMarkup(1) + 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZA' +
brMarkup(2) + 'BCDEFGHIJKLMNOPQRSTUVWXYZAB</h2>';
var expected = '<h2>' + noMarkup(1) + 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH' +
brMarkup(2) + 'IJKLMNOPQRSTUVWXYZAB</h2>';
var outHtml = lineNumberingService.insertLineNumbers(inHtml, 80);
expect(outHtml).toBe(expected);
expect(lineNumberingService.stripLineNumbers(outHtml)).toBe(inHtml);