Recreated migrations file for motionBlock.

Minor template fixes for motionBlock.
This commit is contained in:
Emanuel Schütze 2016-10-17 20:21:26 +02:00
parent 20f8875dcd
commit 29638cc702
6 changed files with 21 additions and 6 deletions

View File

@ -32,6 +32,9 @@ Motions:
- Changed label of former state "commited a bill" to "refered to committee". - Changed label of former state "commited a bill" to "refered to committee".
- Added options to calculate percentages on different bases. - Added options to calculate percentages on different bases.
- Added majority calculation. - Added majority calculation.
- Added blocks for motions which can set as agenda item.
Set states for multiple motions of a motion block by following
the recommendations of each motion.
Users: Users:
- Added field is_committee and new default group Committees. - Added field is_committee and new default group Committees.

View File

@ -1,17 +1,16 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-04 21:50 # Generated by Django 1.10.2 on 2016-10-17 18:20
from __future__ import unicode_literals from __future__ import unicode_literals
import django.db.models.deletion import django.db.models.deletion
from django.db import migrations, models from django.db import migrations, models
import openslides.utils.models import openslides.utils.models
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('motions', '0004_auto_20160907_2343'), ('motions', '0005_motionchangerecommendation'),
] ]
operations = [ operations = [

View File

@ -158,6 +158,13 @@ angular.module('OpenSlidesApp.motions.motionBlock', [])
$scope.alert = { type: 'danger', msg: data.detail, show: true }; $scope.alert = { type: 'danger', msg: data.detail, show: true };
}); });
}; };
$scope.delete = function (motion) {
motion.motion_block_id = null;
motion.title = motion.getTitle(-1);
motion.text = motion.getText(-1);
motion.reason = motion.getReason(-1);
Motion.save(motion);
};
} }
]) ])

View File

@ -215,6 +215,9 @@ angular.module('OpenSlidesApp.motions.site', [
motionBlocks: function (MotionBlock) { motionBlocks: function (MotionBlock) {
return MotionBlock.findAll(); return MotionBlock.findAll();
}, },
motions: function(Motion) {
return Motion.findAll();
},
items: function(Agenda) { items: function(Agenda) {
return Agenda.findAll().catch( return Agenda.findAll().catch(
function () { function () {

View File

@ -56,12 +56,12 @@
<strong> <strong>
<a ui-sref="motions.motion.detail({id: motion.id})">{{ motion.identifier }} {{ motion.getTitle() }}</a> <a ui-sref="motions.motion.detail({id: motion.id})">{{ motion.identifier }} {{ motion.getTitle() }}</a>
</strong> </strong>
<div class="hoverActions" ng-class="{'hiddenDiv': !motion.hover}"> <div os-perms="motions.can_manage" class="hoverActions" ng-class="{'hiddenDiv': !motion.hover}">
<!-- delete --> <!-- delete -->
<a href="" class="text-danger" <a href="" class="text-danger"
ng-bootbox-confirm="{{ 'Are you sure you want to remove this motion from motion block?' | translate }}<br> ng-bootbox-confirm="{{ 'Are you sure you want to remove this motion from motion block?' | translate }}<br>
<b>{{ motion.getTitle() }}</b>" <b>{{ motion.getTitle() }}</b>"
ng-bootbox-confirm-action="delete(motionBlock)" translate>Remove from motion block</a> ng-bootbox-confirm-action="delete(motion)" translate>Remove from motion block</a>
</div> </div>
<td> <td>
<div class="label" ng-class="'label-'+motion.state.css_class"> <div class="label" ng-class="'label-'+motion.state.css_class">

View File

@ -26,13 +26,14 @@
<thead> <thead>
<tr> <tr>
<th><translate>Name</translate> <th><translate>Name</translate>
<th><translate>Motions</translate>
<tbody> <tbody>
<tr ng-repeat="motionBlock in motionBlocks | filter: filter.search | orderBy: 'title'"> <tr ng-repeat="motionBlock in motionBlocks | filter: filter.search | orderBy: 'title'">
<td ng-mouseover="motionBlock.hover=true" ng-mouseleave="motionBlock.hover=false"> <td ng-mouseover="motionBlock.hover=true" ng-mouseleave="motionBlock.hover=false">
<strong> <strong>
<a ui-sref="motions.motionBlock.detail({id: motionBlock.id})">{{ motionBlock.title }}</a> <a ui-sref="motions.motionBlock.detail({id: motionBlock.id})">{{ motionBlock.title }}</a>
</strong> </strong>
<div class="hoverActions" ng-class="{'hiddenDiv': !motionBlock.hover}"> <div os-perms="motions.can_manage" class="hoverActions" ng-class="{'hiddenDiv': !motionBlock.hover}">
<!-- edit --> <!-- edit -->
<a ng-click="openFormDialog(motionBlock)" translate>Edit</a> | <a ng-click="openFormDialog(motionBlock)" translate>Edit</a> |
<!-- delete --> <!-- delete -->
@ -41,5 +42,7 @@
<b>{{ motionBlock.name }}</b>" <b>{{ motionBlock.name }}</b>"
ng-bootbox-confirm-action="delete(motionBlock)" translate>Delete</a> ng-bootbox-confirm-action="delete(motionBlock)" translate>Delete</a>
</div> </div>
<td>
{{ motionBlock.motions.length }}
</table> </table>
</div> </div>