Merge pull request #3792 from FinnStutzenstein/diverses

Layout changes, config for enabling amendments in the motions table
This commit is contained in:
Emanuel Schütze 2018-08-17 08:46:56 +02:00 committed by GitHub
commit c940275693
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 60 additions and 19 deletions

View File

@ -20,6 +20,7 @@ Motions:
- New table of contents with page numbers and categories in PDF [#3766].
- New teporal field "modified final version" where the final version can
be edited [#3781].
- New config to show amendments also in motions table [#3792]
Core:
- Python 3.4 is not supported anymore [#3777].

View File

@ -372,7 +372,7 @@ angular.module('OpenSlidesApp.core.pdf', [])
},
tocCategoryTitle: {
fontSize: 12,
margin: [0,0,0,0],
margin: [0,0,0,4],
bold: true,
},
tocCategorySection: {
@ -960,6 +960,9 @@ angular.module('OpenSlidesApp.core.pdf', [])
// not be empty otherwise it will be removed and the empty line is not displayed
if (element.nextSibling && element.nextSibling.nodeName === 'BR') {
currentParagraph.text.push(create('text', ' '));
} else if (isInsideAList(element) && lineNumberMode === 'none') {
// Put a spacer there, if there is one BR in a list
alreadyConverted.push(create('text', ' '));
}
currentParagraph.lineHeight = 1.25;
alreadyConverted.push(currentParagraph);

View File

@ -157,6 +157,15 @@ def get_config_variables():
group='Motions',
subgroup='Amendments')
yield ConfigVariable(
name='motions_amendments_main_table',
default_value=False,
input_type='boolean',
label='Show amendments together with motions',
weight=337,
group='Motions',
subgroup='Amendments')
yield ConfigVariable(
name='motions_amendments_prefix',
default_value='-',

View File

@ -111,6 +111,17 @@
left: 20px;
}
.motion-text.line-numbers-none li > br {
margin-top: 8px;
content: " ";
display: block;
&.os-line-break {
margin-top: 0;
content: "";
display: inline;
}
}
@mixin addChangeRecommendationBtn {
cursor: pointer;
content: "\f067";

View File

@ -468,6 +468,10 @@ angular.module('OpenSlidesApp.motions.site', [
},
// angular-formly fields for motion form
getFormFields: function (isCreateForm, isParagraphBasedAmendment) {
if (!isParagraphBasedAmendment) { // catch null and undefined. Angular formy doesn't like this.
isParagraphBasedAmendment = false;
}
var workflows = Workflow.getAll();
var images = Mediafile.getAllImages();
var formFields = [];
@ -1208,7 +1212,14 @@ angular.module('OpenSlidesApp.motions.site', [
return Motion.lastModified();
}, function () {
// get all main motions and order by identifier (after custom ordering)
$scope.motions = _.orderBy(Motion.filter({parent_id: undefined}), ['identifier']);
var motions;
if (Config.get('motions_amendments_main_table').value) {
motions = Motion.getAll();
} else {
motions = Motion.filter({parent_id: undefined});
}
$scope.motions = _.orderBy(motions, ['identifier']);
_.forEach($scope.motions, function (motion) {
MotionComment.populateFields(motion);
motion.personalNote = PersonalNoteManager.getNote(motion);
@ -3229,6 +3240,7 @@ angular.module('OpenSlidesApp.motions.site', [
// subgroup Amendments
gettext('Amendments');
gettext('Activate amendments');
gettext('Show amendments together with motions');
gettext('Prefix for the identifier for amendments');
gettext('Apply text for new amendments');
gettext('The title of the motion is always applied.');

View File

@ -31,6 +31,12 @@
<span ng-class="{'hiddenDiv': !selectHover}" uib-dropdown>
<i class="fa fa-cog pointer" uib-dropdown-toggle id="selectDropdown"></i>
<ul class="dropdown-menu" aria-labelledby="selectDropdown">
<li>
<a href ng-click="selectLeadMotion(null)" translate>
All motions
</a>
</li>
<li class="divider"></li>
<li ng-repeat="motion in leadMotions">
<a href ng-click="selectLeadMotion(motion)">
<span ng-if="motion.identifier">
@ -39,12 +45,6 @@
{{ motion.getTitle() | limitTo: 35 }}{{ motion.getTitle().length > 35 ? '...' : '' }}
</a>
</li>
<li class="divider" ng-if="amendment.state.getNextStates().length"></li>
<li>
<a href ng-click="selectLeadMotion(null)" translate>
All motions
</a>
</li>
</ul>
</span>
</h3>
@ -357,10 +357,11 @@
{{ getTextPreview(amendment.getText(), 400) }}
</div>
</div>
<!-- last column -->
<div class="col-xs-4 content" ng-style="{'width': isSelectMode ? 'calc(33.33% - 120px)' : 'calc(33.33% - 70px)'}">
<div style="width: 90%;">
<div ng-repeat="(id, field) in noSpecialCommentsFields">
<div class="nobr">
<div class="nobr" style="overflow: hidden;">
<i class="fa pointer spacer-right" ng-class="field[amendment.id] ? 'fa-caret-down' : 'fa-caret-right'"
ng-click="field[amendment.id] = !field[amendment.id]"
ng-if="isTextExpandable(amendment.comments[id], 30)"></i>

View File

@ -79,12 +79,7 @@
<span class="change-title" ng-if="motion.isAllowed('update') && !title_change_recommendation"></span>
</span>
<a ui-sref="motions.motion.detail({id: motion.getParentMotion().id })" ng-if="motion.isAmendment">
{{ motion.getTitleWithChanges(viewChangeRecommendations.mode) }}
</a>
<span ng-if="!motion.isAmendment">
{{ motion.getTitleWithChanges(viewChangeRecommendations.mode) }}
</span>
<i class="fa pointer" ng-class="motion.personalNote.star ? 'fa-star' : 'fa-star-o'"
ng-if="operator.user"
@ -102,6 +97,14 @@
</span>
<small>
<translate>Sequential number</translate> {{ motion.getSequentialNumber() }}
<span ng-if="motion.isAmendment">
&middot;
<a ui-sref="motions.motion.detail({id: motion.getParentMotion().id })" ng-if="motion.isAmendment">
<translate>Amendment to</translate>
{{ motion.getParentMotion().identifier || motion.getParentMotion().getTitle() }}
</a>
</span>
</small>
</h2>
</div>
@ -552,9 +555,6 @@
</translate>
</div>
<div ng-bind-html="motion.getTextByMode('agreed', version, highlight) | trusted"
class="motion-text motion-text-changed line-numbers-{{ lineNumberMode }}"></div>
<div style="text-align: right;" ng-if="(change_recommendations | filter:{motion_version_id:version}:true).length > 0">
<button class="btn btn-default"
ng-bootbox-confirm="{{ 'Do you want to copy the final version to the modified final version field?' | translate }}"
@ -572,6 +572,9 @@
<translate>New version on these changes</translate>
</button>
</div>
<div ng-bind-html="motion.getTextByMode('agreed', version, highlight) | trusted"
class="motion-text motion-text-changed line-numbers-{{ lineNumberMode }}"></div>
</div>
<!-- modified agreed view -->

View File

@ -5,7 +5,8 @@
<i class="fa fa-plus fa-lg"></i>
<translate>New</translate>
</a>
<a ui-sref="motions.motion.allamendments" class="btn btn-default btn-sm">
<a ui-sref="motions.motion.allamendments" ng-if="config('motions_amendments_enabled')"
class="btn btn-default btn-sm">
<i class="fa fa-book fa-lg"></i>
<translate>Amendments</translate>
</a>