Template improvements for motion blocks.
Fixed $stateProvider to allow camelCase in state name (Fixed #2479) - Refactor generic templateUrl function. - Rename MotionBlock templates. - Rename MotionBlock controller.
This commit is contained in:
parent
700c86a24c
commit
0270c31b32
@ -165,10 +165,8 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
angular.forEach(views, function(config, name) {
|
angular.forEach(views, function(config, name) {
|
||||||
|
// Sets additional default values for templateUrl
|
||||||
// Sets default values for templateUrl
|
var templateUrl,
|
||||||
var patterns = state.name.split('.'),
|
|
||||||
templateUrl,
|
|
||||||
controller,
|
controller,
|
||||||
defaultControllers = {
|
defaultControllers = {
|
||||||
create: 'CreateCtrl',
|
create: 'CreateCtrl',
|
||||||
@ -177,22 +175,43 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
detail: 'DetailCtrl',
|
detail: 'DetailCtrl',
|
||||||
};
|
};
|
||||||
|
|
||||||
// templateUrl
|
// Split up state name
|
||||||
if (_.last(patterns).match(/(create|update)/)) {
|
// example: "motions.motion.detail.update" -> ['motions', 'motion', 'detail', 'update']
|
||||||
// When state_patterns is in the form "app.module.create" or
|
var patterns = state.name.split('.')
|
||||||
// "app.module.update", use the form template.
|
|
||||||
templateUrl = 'static/templates/' + patterns[0] + '/' + patterns[1] + '-form.html';
|
// set app and module name from state
|
||||||
} else {
|
// - appName: patterns[0] (e.g. "motions")
|
||||||
// Replaces the first point through a slash (the app name)
|
// - moduleNames: patterns without first element (e.g. ["motion", "detail", "update"])
|
||||||
var appName = state.name.replace('.', '/');
|
var appName = ''
|
||||||
// Replaces any folowing points though a -
|
var moduleName = '';
|
||||||
templateUrl = 'static/templates/' + appName.replace(/\./g, '-') + '.html';
|
var moduleNames = [];
|
||||||
|
if (patterns.length > 0) {
|
||||||
|
appName = patterns[0];
|
||||||
|
moduleNames = patterns.slice(1);
|
||||||
}
|
}
|
||||||
|
if (moduleNames.length > 0) {
|
||||||
|
// convert from camcelcase to dash notation
|
||||||
|
// example: ["motionBlock", "detail"] -> ["motion-block", "detail"]
|
||||||
|
for (var i = 0; i < moduleNames.length; i++) {
|
||||||
|
moduleNames[i] = moduleNames[i].replace(/([a-z\d])([A-Z])/g, '$1-$2').toLowerCase();
|
||||||
|
};
|
||||||
|
|
||||||
|
// use special templateUrl for create and update view
|
||||||
|
// example: ["motion", "detail", "update"] -> "motion-form"
|
||||||
|
if (_.last(moduleNames).match(/(create|update)/)) {
|
||||||
|
moduleName = '/' + moduleNames[0] + '-form';
|
||||||
|
} else {
|
||||||
|
// convert modelNames array to url string
|
||||||
|
// example: ["motion-block", "detail"] -> "motion-block-detail"
|
||||||
|
moduleName = '/' + moduleNames.join('-');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
templateUrl = 'static/templates/' + appName + moduleName + '.html';
|
||||||
config.templateUrl = state.templateUrl || templateUrl;
|
config.templateUrl = state.templateUrl || templateUrl;
|
||||||
|
|
||||||
// controller
|
// controller
|
||||||
if (patterns.length >= 3) {
|
if (patterns.length >= 3) {
|
||||||
controller = _.capitalize(patterns[1]) + defaultControllers[_.last(patterns)];
|
controller = _.upperFirst(patterns[1]) + defaultControllers[_.last(patterns)];
|
||||||
config.controller = state.controller || controller;
|
config.controller = state.controller || controller;
|
||||||
}
|
}
|
||||||
result[name] = config;
|
result[name] = config;
|
||||||
@ -1417,6 +1436,16 @@ angular.module('OpenSlidesApp.core.site', [
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
.filter("toArray", function(){
|
||||||
|
return function(obj) {
|
||||||
|
var result = [];
|
||||||
|
angular.forEach(obj, function(val, key) {
|
||||||
|
result.push(val);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
//Mark all core config strings for translation in Javascript
|
//Mark all core config strings for translation in Javascript
|
||||||
.config([
|
.config([
|
||||||
'gettext',
|
'gettext',
|
||||||
|
@ -58,7 +58,7 @@ angular.module('OpenSlidesApp.motions.motionBlock', [])
|
|||||||
// Get ngDialog configuration.
|
// Get ngDialog configuration.
|
||||||
getDialog: function (motionBlock) {
|
getDialog: function (motionBlock) {
|
||||||
return {
|
return {
|
||||||
template: 'static/templates/motions/motionBlock-form.html',
|
template: 'static/templates/motions/motion-block-form.html',
|
||||||
controller: (motionBlock) ? 'MotionBlockUpdateCtrl' : 'MotionBlockCreateCtrl',
|
controller: (motionBlock) ? 'MotionBlockUpdateCtrl' : 'MotionBlockCreateCtrl',
|
||||||
className: 'ngdialog-theme-default wide-form',
|
className: 'ngdialog-theme-default wide-form',
|
||||||
closeByEscape: false,
|
closeByEscape: false,
|
||||||
@ -104,8 +104,7 @@ angular.module('OpenSlidesApp.motions.motionBlock', [])
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
// TODO: Rename this to MotionBlockListCtrl after $stateProvider is fixed, see #2479.
|
.controller('MotionBlockListCtrl', [
|
||||||
.controller('MotionblockListCtrl', [
|
|
||||||
'$scope',
|
'$scope',
|
||||||
'ngDialog',
|
'ngDialog',
|
||||||
'MotionBlock',
|
'MotionBlock',
|
||||||
@ -123,22 +122,21 @@ angular.module('OpenSlidesApp.motions.motionBlock', [])
|
|||||||
$scope.delete = function (motionBlock) {
|
$scope.delete = function (motionBlock) {
|
||||||
MotionBlock.destroy(motionBlock.id);
|
MotionBlock.destroy(motionBlock.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: In template we have filter toggleSort reverse sortColumn header. Use this stuff or remove it.
|
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
// TODO: Rename this to MotionBlockDetailCtrl after $stateProvider is fixed, see #2479.
|
.controller('MotionBlockDetailCtrl', [
|
||||||
.controller('MotionblockDetailCtrl', [
|
|
||||||
'$scope',
|
'$scope',
|
||||||
'ngDialog',
|
'ngDialog',
|
||||||
|
'Motion',
|
||||||
'MotionBlockForm',
|
'MotionBlockForm',
|
||||||
'MotionBlock',
|
'MotionBlock',
|
||||||
'motionBlock',
|
'motionBlock',
|
||||||
'Projector',
|
'Projector',
|
||||||
'ProjectionDefault',
|
'ProjectionDefault',
|
||||||
function($scope, ngDialog, MotionBlockForm, MotionBlock, motionBlock, Projector, ProjectionDefault) {
|
function($scope, ngDialog, Motion, MotionBlockForm, MotionBlock, motionBlock, Projector, ProjectionDefault) {
|
||||||
MotionBlock.bindOne(motionBlock.id, $scope, 'motionBlock');
|
MotionBlock.bindOne(motionBlock.id, $scope, 'motionBlock');
|
||||||
|
Motion.bindAll({}, $scope, 'motions');
|
||||||
$scope.$watch(function () {
|
$scope.$watch(function () {
|
||||||
return Projector.lastModified();
|
return Projector.lastModified();
|
||||||
}, function () {
|
}, function () {
|
||||||
|
@ -229,6 +229,9 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
motionBlock: function(MotionBlock, $stateParams) {
|
motionBlock: function(MotionBlock, $stateParams) {
|
||||||
return MotionBlock.find($stateParams.id);
|
return MotionBlock.find($stateParams.id);
|
||||||
},
|
},
|
||||||
|
motions: function(Motion) {
|
||||||
|
return Motion.findAll();
|
||||||
|
},
|
||||||
items: function(Agenda) {
|
items: function(Agenda) {
|
||||||
return Agenda.findAll().catch(
|
return Agenda.findAll().catch(
|
||||||
function () {
|
function () {
|
||||||
@ -246,7 +249,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
onEnter: ['$stateParams', '$state', 'ngDialog', 'MotionBlock',
|
onEnter: ['$stateParams', '$state', 'ngDialog', 'MotionBlock',
|
||||||
function($stateParams, $state, ngDialog, MotionBlock) {
|
function($stateParams, $state, ngDialog, MotionBlock) {
|
||||||
ngDialog.open({
|
ngDialog.open({
|
||||||
template: 'static/templates/motions/motionBlock-form.html',
|
template: 'static/templates/motions/motion-block-form.html',
|
||||||
controller: 'MotionBlockUpdateCtrl',
|
controller: 'MotionBlockUpdateCtrl',
|
||||||
className: 'ngdialog-theme-default wide-form',
|
className: 'ngdialog-theme-default wide-form',
|
||||||
closeByEscape: false,
|
closeByEscape: false,
|
||||||
@ -707,6 +710,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
'Workflow',
|
'Workflow',
|
||||||
'User',
|
'User',
|
||||||
'Agenda',
|
'Agenda',
|
||||||
|
'MotionBlock',
|
||||||
'MotionDocxExport',
|
'MotionDocxExport',
|
||||||
'MotionContentProvider',
|
'MotionContentProvider',
|
||||||
'MotionCatalogContentProvider',
|
'MotionCatalogContentProvider',
|
||||||
@ -716,11 +720,12 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
'HTMLValidizer',
|
'HTMLValidizer',
|
||||||
'Projector',
|
'Projector',
|
||||||
'ProjectionDefault',
|
'ProjectionDefault',
|
||||||
function($scope, $state, $http, ngDialog, MotionForm, Motion, Category, Tag, Workflow, User, Agenda, MotionDocxExport,
|
function($scope, $state, $http, ngDialog, MotionForm, Motion, Category, Tag, Workflow, User, Agenda, MotionBlock,
|
||||||
MotionContentProvider, MotionCatalogContentProvider, PdfMakeConverter, PdfMakeDocumentProvider,
|
MotionDocxExport, MotionContentProvider, MotionCatalogContentProvider, PdfMakeConverter, PdfMakeDocumentProvider,
|
||||||
gettextCatalog, HTMLValidizer, Projector, ProjectionDefault) {
|
gettextCatalog, HTMLValidizer, Projector, ProjectionDefault) {
|
||||||
Motion.bindAll({}, $scope, 'motions');
|
Motion.bindAll({}, $scope, 'motions');
|
||||||
Category.bindAll({}, $scope, 'categories');
|
Category.bindAll({}, $scope, 'categories');
|
||||||
|
MotionBlock.bindAll({}, $scope, 'motionBlocks');
|
||||||
Tag.bindAll({}, $scope, 'tags');
|
Tag.bindAll({}, $scope, 'tags');
|
||||||
Workflow.bindAll({}, $scope, 'workflows');
|
Workflow.bindAll({}, $scope, 'workflows');
|
||||||
User.bindAll({}, $scope, 'users');
|
User.bindAll({}, $scope, 'users');
|
||||||
@ -743,11 +748,13 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
$scope.multiselectFilter = {
|
$scope.multiselectFilter = {
|
||||||
state: [],
|
state: [],
|
||||||
category: [],
|
category: [],
|
||||||
|
motionBlock: [],
|
||||||
tag: []
|
tag: []
|
||||||
};
|
};
|
||||||
$scope.getItemId = {
|
$scope.getItemId = {
|
||||||
state: function (motion) {return motion.state_id;},
|
state: function (motion) {return motion.state_id;},
|
||||||
category: function (motion) {return motion.category_id;},
|
category: function (motion) {return motion.category_id;},
|
||||||
|
motionBlock: function (motion) {return motion.motion_block_id;},
|
||||||
tag: function (motion) {return motion.tags_id;}
|
tag: function (motion) {return motion.tags_id;}
|
||||||
};
|
};
|
||||||
// function to operate the multiselectFilter
|
// function to operate the multiselectFilter
|
||||||
@ -777,6 +784,10 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
if (motion.category) {
|
if (motion.category) {
|
||||||
category = motion.category.name;
|
category = motion.category.name;
|
||||||
}
|
}
|
||||||
|
var motionBlock = '';
|
||||||
|
if (motion.motionBlock) {
|
||||||
|
motionBlock = motion.motionBlock.title;
|
||||||
|
}
|
||||||
return [
|
return [
|
||||||
motion.identifier,
|
motion.identifier,
|
||||||
motion.getTitle(),
|
motion.getTitle(),
|
||||||
@ -802,6 +813,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
}
|
}
|
||||||
).join(" "),
|
).join(" "),
|
||||||
category,
|
category,
|
||||||
|
motionBlock
|
||||||
].join(" ");
|
].join(" ");
|
||||||
};
|
};
|
||||||
// for reset-button
|
// for reset-button
|
||||||
@ -809,6 +821,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
$scope.multiselectFilter = {
|
$scope.multiselectFilter = {
|
||||||
state: [],
|
state: [],
|
||||||
category: [],
|
category: [],
|
||||||
|
motionBlock: [],
|
||||||
tag: []
|
tag: []
|
||||||
};
|
};
|
||||||
if ($scope.filter) {
|
if ($scope.filter) {
|
||||||
@ -818,6 +831,7 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
$scope.are_filters_set = function () {
|
$scope.are_filters_set = function () {
|
||||||
return $scope.multiselectFilter.state.length > 0 ||
|
return $scope.multiselectFilter.state.length > 0 ||
|
||||||
$scope.multiselectFilter.category.length > 0 ||
|
$scope.multiselectFilter.category.length > 0 ||
|
||||||
|
$scope.multiselectFilter.motionBlock.length > 0 ||
|
||||||
$scope.multiselectFilter.tag.length > 0 ||
|
$scope.multiselectFilter.tag.length > 0 ||
|
||||||
($scope.filter ? $scope.filter.search : false);
|
($scope.filter ? $scope.filter.search : false);
|
||||||
};
|
};
|
||||||
@ -878,6 +892,14 @@ angular.module('OpenSlidesApp.motions.site', [
|
|||||||
}
|
}
|
||||||
save(motion);
|
save(motion);
|
||||||
};
|
};
|
||||||
|
$scope.toggle_motionBlock = function (motion, block) {
|
||||||
|
if (motion.motion_block_id == block.id) {
|
||||||
|
motion.motion_block_id = null;
|
||||||
|
} else {
|
||||||
|
motion.motion_block_id = block.id;
|
||||||
|
}
|
||||||
|
save(motion);
|
||||||
|
};
|
||||||
|
|
||||||
// open new/edit dialog
|
// open new/edit dialog
|
||||||
$scope.openDialog = function (motion) {
|
$scope.openDialog = function (motion) {
|
||||||
|
@ -0,0 +1,76 @@
|
|||||||
|
<div class="header">
|
||||||
|
<div class="title">
|
||||||
|
<div class="submenu">
|
||||||
|
<a ui-sref="motions.motionBlock.list" class="btn btn-sm btn-default">
|
||||||
|
<i class="fa fa-angle-double-left fa-lg"></i>
|
||||||
|
<translate>Back to overview</translate>
|
||||||
|
</a>
|
||||||
|
<!-- List of speakers -->
|
||||||
|
<a ui-sref="agenda.item.detail({id: motionBlock.agenda_item_id})" class="btn btn-sm btn-default">
|
||||||
|
<i class="fa fa-microphone fa-lg"></i>
|
||||||
|
<translate>List of speakers</translate>
|
||||||
|
</a>
|
||||||
|
<!-- project -->
|
||||||
|
<projector-button model="motionBlock" default-projector-id="defaultProjectorId">
|
||||||
|
</projector-button>
|
||||||
|
<!-- edit -->
|
||||||
|
<a ng-click="openDialog(motionBlock)"
|
||||||
|
class="btn btn-default btn-sm"
|
||||||
|
title="{{ 'Edit' | translate}}">
|
||||||
|
<i class="fa fa-pencil"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<h1>{{ motionBlock.agenda_item.getTitle() }}</h1>
|
||||||
|
<h2 translate>Motion block</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="details">
|
||||||
|
<!-- set state button (TODO)-->
|
||||||
|
<a os-perms="motions.can_manage" class="btn btn-default btn"
|
||||||
|
ng-bootbox-confirm="{{ 'Are you sure you want to override the state of all motions of this motion block?' | translate }}"
|
||||||
|
ng-bootbox-confirm-action="" translate>
|
||||||
|
<i class="fa fa-magic fa-lg"></i>
|
||||||
|
<translate>Set state for each motion according to their recommendation</translate>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="row spacer form-group">
|
||||||
|
<div class="col-sm-4 pull-right">
|
||||||
|
<input type="text" ng-model="filter.search" class="form-control"
|
||||||
|
placeholder="{{ 'Filter' | translate }}">
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-4 italic">
|
||||||
|
{{ motionsFiltered.length }} /
|
||||||
|
{{ motionBlock.motions.length }} {{ "motions" | translate }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="table table-striped table-bordered table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><translate>Motion</translate>
|
||||||
|
<th><translate>State</translate>
|
||||||
|
<th><translate>Recommendation</translate>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="motion in motionsFiltered = (motionBlock.motions | filter: filter.search | orderBy: 'identifier')">
|
||||||
|
<td ng-mouseover="motion.hover=true" ng-mouseleave="motion.hover=false">
|
||||||
|
<strong>
|
||||||
|
<a ui-sref="motions.motion.detail({id: motion.id})">{{ motion.identifier }} {{ motion.getTitle() }}</a>
|
||||||
|
</strong>
|
||||||
|
<div class="hoverActions" ng-class="{'hiddenDiv': !motion.hover}">
|
||||||
|
<!-- delete -->
|
||||||
|
<a href="" class="text-danger"
|
||||||
|
ng-bootbox-confirm="{{ 'Are you sure you want to remove this motion from motion block?' | translate }}<br>
|
||||||
|
<b>{{ motion.getTitle() }}</b>"
|
||||||
|
ng-bootbox-confirm-action="delete(motionBlock)" translate>Remove from motion block</a>
|
||||||
|
</div>
|
||||||
|
<td>
|
||||||
|
<div class="label" ng-class="'label-'+motion.state.css_class">
|
||||||
|
{{ motion.state.name | translate }}
|
||||||
|
</div>
|
||||||
|
<td>
|
||||||
|
<div class="label" ng-class="'label-'+motion.recommendation.css_class">
|
||||||
|
{{ motion.recommendation.recommendation_label | translate }}
|
||||||
|
</div>
|
||||||
|
</table>
|
||||||
|
</div>
|
@ -25,13 +25,9 @@
|
|||||||
<table class="table table-striped table-bordered table-hover">
|
<table class="table table-striped table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th ng-click="toggleSort('name')" class="sortable">
|
<th><translate>Name</translate>
|
||||||
<translate>Name</translate>
|
|
||||||
<i class="pull-right fa" ng-show="sortColumn === 'name' && header.sortable != false"
|
|
||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
|
||||||
</i>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="motionBlock in motionBlocks | filter: filter.search | orderBy: sortColumn:reverse">
|
<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>
|
@ -150,6 +150,12 @@
|
|||||||
<h3 ng-if="motion.category" translate>Category</h3>
|
<h3 ng-if="motion.category" translate>Category</h3>
|
||||||
{{ motion.category.name }}
|
{{ motion.category.name }}
|
||||||
|
|
||||||
|
<!-- Motion block -->
|
||||||
|
<h3 translate>Motion block</h3>
|
||||||
|
<a ui-sref="motions.motionBlock.detail({id: motion.motionBlock.id})"
|
||||||
|
os-perms="motions.can_manage">{{ motion.motionBlock.title }}</a>
|
||||||
|
<span os-perms="!motions.can_manage">{{ motion.motionBlock.title }}</span>
|
||||||
|
|
||||||
<!-- Tags -->
|
<!-- Tags -->
|
||||||
<h3 ng-if="motion.tags.length > 0" translate>Tags</h3>
|
<h3 ng-if="motion.tags.length > 0" translate>Tags</h3>
|
||||||
<span ng-repeat="tag in motion.tags">
|
<span ng-repeat="tag in motion.tags">
|
||||||
@ -160,10 +166,6 @@
|
|||||||
<h3 ng-if="motion.origin" translate>Origin</h3>
|
<h3 ng-if="motion.origin" translate>Origin</h3>
|
||||||
{{ motion.origin }}
|
{{ motion.origin }}
|
||||||
|
|
||||||
<!-- Motion block -->
|
|
||||||
<h3 translate>Motion block</h3>
|
|
||||||
{{ motion.motionBlock }}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<h3 ng-if="motion.polls.length > 0" translate>Voting result</h3>
|
<h3 ng-if="motion.polls.length > 0" translate>Voting result</h3>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<translate>Categories</translate>
|
<translate>Categories</translate>
|
||||||
</a>
|
</a>
|
||||||
<a ui-sref="motions.motionBlock.list" os-perms="motions.can_manage" class="btn btn-default btn-sm">
|
<a ui-sref="motions.motionBlock.list" os-perms="motions.can_manage" class="btn btn-default btn-sm">
|
||||||
<i class="fa fa-list fa-lg"></i>
|
<i class="fa fa-th-large fa-lg"></i>
|
||||||
<translate>Motion blocks</translate>
|
<translate>Motion blocks</translate>
|
||||||
</a>
|
</a>
|
||||||
<a ui-sref="core.tag.list" os-perms="core.can_manage_tags" class="btn btn-default btn-sm">
|
<a ui-sref="core.tag.list" os-perms="core.can_manage_tags" class="btn btn-default btn-sm">
|
||||||
@ -149,6 +149,25 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</span>
|
</span>
|
||||||
|
<!-- Motion block filter -->
|
||||||
|
<span class="dropdown" uib-dropdown ng-if="motionBlocks.length > 0">
|
||||||
|
<span class="pointer" id="dropdownBlock" uib-dropdown-toggle
|
||||||
|
ng-class="{'bold': multiselectFilter.motionBlock.length > 0, 'disabled': isDeleteMode}"
|
||||||
|
ng-disabled="isDeleteMode">
|
||||||
|
<translate>Motion block</translate>
|
||||||
|
<span class="caret"></span>
|
||||||
|
</span>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right"
|
||||||
|
aria-labelledby="dropdownBlock">
|
||||||
|
<li ng-repeat="block in motionBlocks">
|
||||||
|
<div class="dropdown-entry pointer"
|
||||||
|
ng-click="operateMultiselectFilter('motionBlock', block.id)">
|
||||||
|
<i class="fa fa-check" ng-if="multiselectFilter.motionBlock.indexOf(block.id) > -1"></i>
|
||||||
|
{{ block.title }}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</span>
|
||||||
<!-- Tag filter -->
|
<!-- Tag filter -->
|
||||||
<span class="dropdown" uib-dropdown ng-if="tags.length > 0">
|
<span class="dropdown" uib-dropdown ng-if="tags.length > 0">
|
||||||
<span class="pointer" id="dropdownTag" uib-dropdown-toggle
|
<span class="pointer" id="dropdownTag" uib-dropdown-toggle
|
||||||
@ -223,11 +242,22 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<!-- category -->
|
<!-- category -->
|
||||||
<div class="pointer dropdown-entry" ng-click="toggleSort('category')">
|
<div class="pointer dropdown-entry" ng-click="toggleSort('category.name')">
|
||||||
<translate>Category</translate>
|
<translate>Category</translate>
|
||||||
<span class="spacer-right pull-right"></span>
|
<span class="spacer-right pull-right"></span>
|
||||||
<i class="pull-right fa"
|
<i class="pull-right fa"
|
||||||
ng-style="{'visibility': sortColumn === 'category' && header.sortable != false ? 'visible' : 'hidden'}"
|
ng-style="{'visibility': sortColumn === 'category.name' && header.sortable != false ? 'visible' : 'hidden'}"
|
||||||
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
|
</i>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<!-- motion block -->
|
||||||
|
<div class="pointer dropdown-entry" ng-click="toggleSort('motionBlock.title')">
|
||||||
|
<translate>Motion block</translate>
|
||||||
|
<span class="spacer-right pull-right"></span>
|
||||||
|
<i class="pull-right fa"
|
||||||
|
ng-style="{'visibility': sortColumn === 'motionBlock.title' && header.sortable != false ? 'visible' : 'hidden'}"
|
||||||
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
ng-class="reverse ? 'fa-sort-desc' : 'fa-sort-asc'">
|
||||||
</i>
|
</i>
|
||||||
</div>
|
</div>
|
||||||
@ -274,6 +304,15 @@
|
|||||||
{{ category.name }}
|
{{ category.name }}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
<span ng-repeat="motionBlock in motionBlocks" class="pointer spacer-left-lg"
|
||||||
|
ng-if="multiselectFilter.motionBlock.indexOf(motionBlock.id) > -1"
|
||||||
|
ng-click="operateMultiselectFilter('motionBlock', motionBlock.id)"
|
||||||
|
ng-class="{'disabled': isDeleteMode}">
|
||||||
|
<span class="nobr">
|
||||||
|
<i class="fa fa-times-circle"></i>
|
||||||
|
{{ motionBlock.title }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
<span ng-repeat="tag in tags" class="pointer spacer-left-lg"
|
<span ng-repeat="tag in tags" class="pointer spacer-left-lg"
|
||||||
ng-if="multiselectFilter.tag.indexOf(tag.id) > -1"
|
ng-if="multiselectFilter.tag.indexOf(tag.id) > -1"
|
||||||
ng-click="operateMultiselectFilter('tag', tag.id)"
|
ng-click="operateMultiselectFilter('tag', tag.id)"
|
||||||
@ -296,7 +335,9 @@
|
|||||||
| osFilter: filter.search : getFilterString
|
| osFilter: filter.search : getFilterString
|
||||||
| SelectMultipleFilter: multiselectFilter.state : getItemId.state
|
| SelectMultipleFilter: multiselectFilter.state : getItemId.state
|
||||||
| SelectMultipleFilter: multiselectFilter.category : getItemId.category
|
| SelectMultipleFilter: multiselectFilter.category : getItemId.category
|
||||||
|
| SelectMultipleFilter: multiselectFilter.motionBlock : getItemId.motionBlock
|
||||||
| SelectMultipleFilter: multiselectFilter.tag : getItemId.tag
|
| SelectMultipleFilter: multiselectFilter.tag : getItemId.tag
|
||||||
|
| toArray
|
||||||
| orderBy: sortColumn : reverse)">
|
| orderBy: sortColumn : reverse)">
|
||||||
|
|
||||||
<!-- select column -->
|
<!-- select column -->
|
||||||
@ -314,7 +355,7 @@
|
|||||||
<div class="col-xs-6 content">
|
<div class="col-xs-6 content">
|
||||||
<div class="identifier-col">
|
<div class="identifier-col">
|
||||||
<div class="nobr" ng-show="motion.identifier">
|
<div class="nobr" ng-show="motion.identifier">
|
||||||
{{ motion.identifier }}:
|
{{ motion.identifier }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="title-col">
|
<div class="title-col">
|
||||||
@ -415,6 +456,41 @@
|
|||||||
{{ motion.category.name }}
|
{{ motion.category.name }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Motion block dropdown for manage user -->
|
||||||
|
<div os-perms="motions.can_manage" ng-show="motionBlocks.length > 0"
|
||||||
|
ng-mouseover="motion.motionBlockHover=true"
|
||||||
|
ng-mouseleave="motion.motionBlockHover=false">
|
||||||
|
<span uib-dropdown >
|
||||||
|
<span id="dropdown-motionBlock{{ motion.id }}" class="pointer"
|
||||||
|
uib-dropdown-toggle uib-tooltip="{{ 'Set a motion block' | translate }}"
|
||||||
|
tooltip-class="nobr">
|
||||||
|
<span ng-if="motion.motionBlock == null" ng-show="motion.hover">
|
||||||
|
<i class="fa fa-th-large"></i>
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
</span>
|
||||||
|
<span ng-if="motion.motionBlock != null">
|
||||||
|
<i class="fa fa-th-large spacer-right"></i>
|
||||||
|
{{ motion.motionBlock.title }}
|
||||||
|
<i class="fa fa-cog fa-lg spacer-left" ng-show="motion.motionBlockHover"></i>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<ul class="dropdown-menu" aria-labelledby="dropdown-motionBlock{{ motion.id }}">
|
||||||
|
<li ng-repeat="motionBlock in motionBlocks">
|
||||||
|
<div class="dropdown-entry pointer"
|
||||||
|
ng-click="toggle_motionBlock(motion, motionBlock)">
|
||||||
|
<i class="fa fa-check" ng-if="motionBlock.id == motion.motionBlock.id"></i>
|
||||||
|
{{ motionBlock.title }}
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<!-- Motion block string for normal user -->
|
||||||
|
<div os-perms="!motions.can_manage" ng-show="motion.motionBlock != null">
|
||||||
|
<i class="fa fa-sitemap spacer-right"></i>
|
||||||
|
{{ motion.motionBlock.title }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Tag dropdown for manage user -->
|
<!-- Tag dropdown for manage user -->
|
||||||
<div os-perms="motions.can_manage" ng-show="tags.length > 0"
|
<div os-perms="motions.can_manage" ng-show="tags.length > 0"
|
||||||
ng-mouseover="motion.tagHover=true"
|
ng-mouseover="motion.tagHover=true"
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
<div class="header">
|
|
||||||
<div class="title">
|
|
||||||
<div class="submenu">
|
|
||||||
<a ui-sref="motions.motionBlock.list" class="btn btn-sm btn-default">
|
|
||||||
<i class="fa fa-angle-double-left fa-lg"></i>
|
|
||||||
<translate>Back to overview</translate>
|
|
||||||
</a>
|
|
||||||
<!-- List of speakers -->
|
|
||||||
<a ui-sref="agenda.item.detail({id: motionBlock.agenda_item_id})" class="btn btn-sm btn-default">
|
|
||||||
<i class="fa fa-microphone fa-lg"></i>
|
|
||||||
<translate>List of speakers</translate>
|
|
||||||
</a>
|
|
||||||
<!-- project -->
|
|
||||||
<projector-button model="motionBlock" default-projector-id="defaultProjectorId">
|
|
||||||
</projector-button>
|
|
||||||
<!-- edit -->
|
|
||||||
<a ng-click="openDialog(motionBlock)"
|
|
||||||
class="btn btn-default btn-sm"
|
|
||||||
title="{{ 'Edit' | translate}}">
|
|
||||||
<i class="fa fa-pencil"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<h1>{{ motionBlock.agenda_item.getTitle() }}</h1>
|
|
||||||
<h2 translate>Motion Block</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="details">
|
|
||||||
{{ motionBlock.motions }}
|
|
||||||
</div>
|
|
Loading…
Reference in New Issue
Block a user