From 29638cc7024cd82fb7b3da707091d852f9e015b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Mon, 17 Oct 2016 20:21:26 +0200 Subject: [PATCH] Recreated migrations file for motionBlock. Minor template fixes for motionBlock. --- CHANGELOG | 3 +++ ...05_auto_20161004_2350.py => 0006_auto_20161017_2020.py} | 5 ++--- openslides/motions/static/js/motions/motion-block.js | 7 +++++++ openslides/motions/static/js/motions/site.js | 3 +++ .../static/templates/motions/motion-block-detail.html | 4 ++-- .../static/templates/motions/motion-block-list.html | 5 ++++- 6 files changed, 21 insertions(+), 6 deletions(-) rename openslides/motions/migrations/{0005_auto_20161004_2350.py => 0006_auto_20161017_2020.py} (89%) diff --git a/CHANGELOG b/CHANGELOG index e7bb8e99a..a32c10cef 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -32,6 +32,9 @@ Motions: - Changed label of former state "commited a bill" to "refered to committee". - Added options to calculate percentages on different bases. - 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: - Added field is_committee and new default group Committees. diff --git a/openslides/motions/migrations/0005_auto_20161004_2350.py b/openslides/motions/migrations/0006_auto_20161017_2020.py similarity index 89% rename from openslides/motions/migrations/0005_auto_20161004_2350.py rename to openslides/motions/migrations/0006_auto_20161017_2020.py index 6244fa0ab..90a0fa6d0 100644 --- a/openslides/motions/migrations/0005_auto_20161004_2350.py +++ b/openslides/motions/migrations/0006_auto_20161017_2020.py @@ -1,17 +1,16 @@ # -*- 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 import django.db.models.deletion from django.db import migrations, models - import openslides.utils.models class Migration(migrations.Migration): dependencies = [ - ('motions', '0004_auto_20160907_2343'), + ('motions', '0005_motionchangerecommendation'), ] operations = [ diff --git a/openslides/motions/static/js/motions/motion-block.js b/openslides/motions/static/js/motions/motion-block.js index adff7931e..19e596b23 100644 --- a/openslides/motions/static/js/motions/motion-block.js +++ b/openslides/motions/static/js/motions/motion-block.js @@ -158,6 +158,13 @@ angular.module('OpenSlidesApp.motions.motionBlock', []) $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); + }; } ]) diff --git a/openslides/motions/static/js/motions/site.js b/openslides/motions/static/js/motions/site.js index 7bbd403f1..a671d12aa 100644 --- a/openslides/motions/static/js/motions/site.js +++ b/openslides/motions/static/js/motions/site.js @@ -215,6 +215,9 @@ angular.module('OpenSlidesApp.motions.site', [ motionBlocks: function (MotionBlock) { return MotionBlock.findAll(); }, + motions: function(Motion) { + return Motion.findAll(); + }, items: function(Agenda) { return Agenda.findAll().catch( function () { diff --git a/openslides/motions/static/templates/motions/motion-block-detail.html b/openslides/motions/static/templates/motions/motion-block-detail.html index 8028ff409..e71364ffa 100644 --- a/openslides/motions/static/templates/motions/motion-block-detail.html +++ b/openslides/motions/static/templates/motions/motion-block-detail.html @@ -56,12 +56,12 @@ {{ motion.identifier }} {{ motion.getTitle() }} -
+
Remove from motion block + ng-bootbox-confirm-action="delete(motion)" translate>Remove from motion block
diff --git a/openslides/motions/static/templates/motions/motion-block-list.html b/openslides/motions/static/templates/motions/motion-block-list.html index abca205c8..6993bf333 100644 --- a/openslides/motions/static/templates/motions/motion-block-list.html +++ b/openslides/motions/static/templates/motions/motion-block-list.html @@ -26,13 +26,14 @@ Name + Motions {{ motionBlock.title }} -
+
Edit | @@ -41,5 +42,7 @@ {{ motionBlock.name }}" ng-bootbox-confirm-action="delete(motionBlock)" translate>Delete
+ + {{ motionBlock.motions.length }}