Merge pull request #1956 from emanuelschuetze/master

Several template fixes
This commit is contained in:
Norman Jäckel 2016-02-08 22:32:56 +01:00
commit 3be21473a4
12 changed files with 161 additions and 77 deletions

View File

@ -27,7 +27,7 @@
"js-data": "~2.8.2", "js-data": "~2.8.2",
"js-data-angular": "~3.1.0", "js-data-angular": "~3.1.0",
"ng-file-upload": "~11.2.3", "ng-file-upload": "~11.2.3",
"ckeditor": "~4.5.6", "ckeditor": "4.5.6",
"angular-ckeditor": "~1.0.3", "angular-ckeditor": "~1.0.3",
"angular-pdf": "~1.3.0", "angular-pdf": "~1.3.0",
"roboto-condensed": "~0.3.0", "roboto-condensed": "~0.3.0",

View File

@ -71,13 +71,13 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
'$scope', '$scope',
'$http', '$http',
'$state', '$state',
'DS',
'operator', 'operator',
'ngDialog', 'ngDialog',
'Agenda', 'Agenda',
'AgendaTree', 'AgendaTree',
'Customslide',
'Projector', 'Projector',
function($scope, $http, $state, operator, ngDialog, Agenda, AgendaTree, Customslide, Projector) { function($scope, $http, $state, DS, operator, ngDialog, Agenda, AgendaTree, Projector) {
// Bind agenda tree to the scope // Bind agenda tree to the scope
$scope.$watch(function () { $scope.$watch(function () {
return Agenda.lastModified(); return Agenda.lastModified();
@ -126,6 +126,12 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
$state.go(item.content_object.collection.replace('/','.')+'.detail', $state.go(item.content_object.collection.replace('/','.')+'.detail',
{id: item.content_object.id}); {id: item.content_object.id});
}; };
// cancel QuickEdit mode
$scope.cancelQuickEdit = function (item) {
// revert all changes by restore (refresh) original item object from server
Agenda.refresh(item);
item.quickEdit = false;
};
// save changed item // save changed item
$scope.save = function (item) { $scope.save = function (item) {
Agenda.save(item).then( Agenda.save(item).then(
@ -143,9 +149,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
}; };
// delete related item // delete related item
$scope.deleteRelatedItem = function (item) { $scope.deleteRelatedItem = function (item) {
if (item.content_object.collection == 'core/customslide') { DS.destroy(item.content_object.collection, item.content_object.id);
Customslide.destroy(item.content_object.id);
}
}; };
// *** delete mode functions *** // *** delete mode functions ***
@ -169,9 +173,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
$scope.delete = function () { $scope.delete = function () {
angular.forEach($scope.items, function (item) { angular.forEach($scope.items, function (item) {
if (item.selected) { if (item.selected) {
if (item.content_object.collection == 'core/customslide') { DS.destroy(item.content_object.collection, item.content_object.id);
Customslide.destroy(item.content_object.id);
}
} }
}); });
$scope.isDeleteMode = false; $scope.isDeleteMode = false;

View File

@ -151,14 +151,12 @@
<a ui-sref="agenda.item.detail({id: item.id})" translate>List of speakers</a> <a ui-sref="agenda.item.detail({id: item.id})" translate>List of speakers</a>
<span os-perms="agenda.can_manage"> | <span os-perms="agenda.can_manage"> |
<a href="" ng-click="editDialog(item)" translate>Edit</a> | <a href="" ng-click="editDialog(item)" translate>Edit</a> |
<a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a> <a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a> |
<span ng-if="item.content_object.collection == 'core/customslide'"> |
<a href="" class="text-danger" <a href="" class="text-danger"
ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br> ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br>
<b>{{ item.getTitle() }}</b>" <b>{{ item.getTitle() }}</b>"
ng-bootbox-confirm-action="deleteRelatedItem(item)" translate>Delete</a> ng-bootbox-confirm-action="deleteRelatedItem(item)" translate>Delete</a>
</span> </span>
</span>
</div> </div>
<td ng-show="!item.quickEdit" os-perms="agenda.can_see_hidden_items" class="optional"> <td ng-show="!item.quickEdit" os-perms="agenda.can_see_hidden_items" class="optional">
{{ item.duration }} {{ item.duration }}
@ -170,7 +168,6 @@
<input os-perms="agenda.can_manage" type="checkbox" ng-model="item.closed" ng-change="save(item.id);"> <input os-perms="agenda.can_manage" type="checkbox" ng-model="item.closed" ng-change="save(item.id);">
<!-- quickEdit columns --> <!-- quickEdit columns -->
<td ng-show="item.quickEdit" os-perms="agenda.can_manage" colspan="3"> <td ng-show="item.quickEdit" os-perms="agenda.can_manage" colspan="3">
<form ng-submit="save(item)">
<h4>{{ item.getTitle() }} <span class="text-muted">&ndash; QuickEdit</span></h4> <h4>{{ item.getTitle() }} <span class="text-muted">&ndash; QuickEdit</span></h4>
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}"> <uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
{{ alert.msg }} {{ alert.msg }}
@ -197,15 +194,14 @@
</div> </div>
</div> </div>
<div class="spacer"> <div class="spacer">
<button ng-click="item.quickEdit=false" class="btn btn-default pull-left" translate> <button ng-click="cancelQuickEdit(item)" class="btn btn-default pull-left" translate>
Cancel Cancel
</button> &nbsp; </button> &nbsp;
<button type="submit" class="btn btn-primary" translate> <button ng-click="save(item)" class="btn btn-primary" translate>
Update Update
</button> </button>
<a href="" ng-click="editDialog(item)" class="pull-right"><translate>Edit ...</translate></a> <a href="" ng-click="editDialog(item)" class="pull-right"><translate>Edit ...</translate></a>
</div> </div>
</form>
</table> </table>
<uib-pagination total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage" ng-change="pageChanged()"></uib-pagination> <uib-pagination total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage" ng-change="pageChanged()"></uib-pagination>
</div> </div>

View File

@ -203,6 +203,12 @@ angular.module('OpenSlidesApp.assignments.site', ['OpenSlidesApp.assignments'])
$scope.openDialog = function (assignment) { $scope.openDialog = function (assignment) {
ngDialog.open(AssignmentForm.getDialog(assignment)); ngDialog.open(AssignmentForm.getDialog(assignment));
}; };
// cancel QuickEdit mode
$scope.cancelQuickEdit = function (assignment) {
// revert all changes by restore (refresh) original assignment object from server
Assignment.refresh(assignment);
assignment.quickEdit = false;
};
// save changed assignment // save changed assignment
$scope.save = function (assignment) { $scope.save = function (assignment) {
Assignment.save(assignment).then( Assignment.save(assignment).then(

View File

@ -162,7 +162,7 @@
</span> </span>
<!-- quickEdit columns --> <!-- quickEdit columns -->
<td ng-if="assignment.quickEdit" colspan="3"> <td ng-if="assignment.quickEdit" colspan="4">
<h4>{{ assignment.title }} <span class="text-muted">&ndash; Quick Edit</span></h4> <h4>{{ assignment.title }} <span class="text-muted">&ndash; Quick Edit</span></h4>
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}"> <uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
{{ alert.msg }} {{ alert.msg }}
@ -187,7 +187,7 @@
<div class="col-xs-6"></div> <div class="col-xs-6"></div>
</div> </div>
<div class="spacer"> <div class="spacer">
<button ng-click="assignment.quickEdit=false" class="btn btn-default pull-left" translate> <button ng-click="cancelQuickEdit(assignment)" class="btn btn-default pull-left" translate>
Cancel Cancel
</button> &nbsp; </button> &nbsp;
<button ng-click="save(assignment)" class="btn btn-primary" translate> <button ng-click="save(assignment)" class="btn btn-primary" translate>

View File

@ -51,7 +51,13 @@ h4 {
font-size: 18px; font-size: 18px;
color: #222; color: #222;
} }
.heading a {
color: #444;
}
.heading a:hover {
color: #2b6883;
text-decoration: none;
}
p { p {
padding-bottom: 14px; padding-bottom: 14px;
@ -284,11 +290,6 @@ img {
color: #444; color: #444;
} }
.col1 .meta h3 {
padding-bottom: 0;
margin-bottom: 5px;
}
.col1 .details { .col1 .details {
padding: 20px; padding: 20px;
width: auto; width: auto;
@ -317,14 +318,25 @@ img {
width: 70px; width: 70px;
} }
#content .col2 h4, .col1 .meta h3 { #content .col2 h4 {
font-size: 22px; font-size: 22px;
line-height: 24px; line-height: 24px;
font-family: 'Roboto Condensed Light'; font-family: 'Roboto Condensed Light';
font-weight: 300; font-weight: 300;
color: #444; color: #444;
} }
#content .col1 .meta .heading, #content .col1 .meta h3 {
font-size: 22px;
line-height: 24px;
font-weight: 300;
color: #444;
padding-bottom: 0;
margin-top: 20px;
margin-bottom: 5px;
}
#content .col1 .meta .heading .drop-down-name, #content .col1 .meta h3 {
font-family: 'Roboto Condensed Light';
}
#content .col2 a:hover h4 { #content .col2 a:hover h4 {
text-decoration: none; text-decoration: none;

View File

@ -16,6 +16,7 @@ body{
box-shadow: 0 0 7px rgba(0,0,0,0.6); box-shadow: 0 0 7px rgba(0,0,0,0.6);
height: 70px; height: 70px;
margin-bottom: 20px; margin-bottom: 20px;
font-family: 'Roboto Condensed Light';
} }
#logo { #logo {
position: relative; position: relative;
@ -46,6 +47,7 @@ body{
opacity: 0.8; opacity: 0.8;
} }
#currentTime { #currentTime {
font-family: 'Roboto Condensed Light';
border: 0 solid #000000; border: 0 solid #000000;
font-size: 24px; font-size: 24px;
position: absolute; position: absolute;
@ -56,6 +58,7 @@ body{
color: #fff; color: #fff;
} }
#footer { #footer {
font-family: 'Roboto Condensed Light';
position: fixed; position: fixed;
bottom: 0; bottom: 0;
height: 35px; height: 35px;
@ -275,11 +278,22 @@ tr.total td {
tr.elected td { tr.elected td {
background-color: #BED4DE !important; background-color: #BED4DE !important;
} }
.transparentTable td {
background-color: transparent;
padding-right: 10px;
}
.pollresults table .icon {
color: #636363;
height: 45px;
}
/*** Agenda list ***/ /*** Agenda list ***/
.agendalist p { .agendalist p {
font-size: 140%; font-size: 140%;
} }
.spacer {
margin-top: 10px;
}
.spacer-top { .spacer-top {
margin-top: 25px; margin-top: 25px;
} }

View File

@ -248,6 +248,8 @@ angular.module('OpenSlidesApp.motions', ['OpenSlidesApp.users'])
return operator.hasPerms('motions.can_manage'); return operator.hasPerms('motions.can_manage');
case 'reset_state': case 'reset_state':
return operator.hasPerms('motions.can_manage'); return operator.hasPerms('motions.can_manage');
case 'can_manage':
return operator.hasPerms('motions.can_manage');
default: default:
return false; return false;
} }

View File

@ -467,6 +467,12 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
$scope.openDialog = function (motion) { $scope.openDialog = function (motion) {
ngDialog.open(MotionForm.getDialog(motion)); ngDialog.open(MotionForm.getDialog(motion));
}; };
// cancel QuickEdit mode
$scope.cancelQuickEdit = function (motion) {
// revert all changes by restore (refresh) original motion object from server
Motion.refresh(motion);
motion.quickEdit = false;
};
// save changed motion // save changed motion
$scope.save = function (motion) { $scope.save = function (motion) {
// get (unchanged) values from latest version for update method // get (unchanged) values from latest version for update method
@ -762,8 +768,9 @@ angular.module('OpenSlidesApp.motions.site', ['OpenSlidesApp.motions'])
'motionpoll', 'motionpoll',
'voteNumber', 'voteNumber',
function($scope, gettextCatalog, MotionPoll, MotionPollForm, motionpoll, voteNumber) { function($scope, gettextCatalog, MotionPoll, MotionPollForm, motionpoll, voteNumber) {
// set initial values for form model // set initial values for form model by create deep copy of motionpoll object
$scope.model = motionpoll; // so detail view is not updated while editing poll
$scope.model = angular.copy(motionpoll);
$scope.voteNumber = voteNumber; $scope.voteNumber = voteNumber;
$scope.formFields = MotionPollForm.getFormFields(); $scope.formFields = MotionPollForm.getFormFields();
$scope.alert = {}; $scope.alert = {};

View File

@ -90,22 +90,27 @@
</span> </span>
<!-- State --> <!-- State -->
<h3 translate>State</h3> <h3 ng-if="!motion.isAllowed('change_state')" class="heading" translate>State</h3>
<span class="label" ng-class="'label-'+motion.state.css_class"> <div ng-if="motion.isAllowed('change_state')" class="heading">
{{ motion.state.name | translate }} <span uib-dropdown>
</span> <a href id="state-dropdown" class="drop-down-name" uib-dropdown-toggle>
<div ng-if="motion.isAllowed('change_state')" class="spacer"> <translate>State</translate>
<select ng-if="motion.state.getNextStates().length > 0" ng-model="stateSelect" class="form-control" ng-change="updateState(stateSelect)"> <i class="fa fa-cog"></i>
<option value="" translate>--- Set next state ---</option> </a>
<option ng-repeat="state in motion.state.getNextStates()" value="{{ state.id }}"> <ul uib-dropdown-menu aria-labelledby="state-dropdown">
{{ state.action_word | translate }} <li ng-repeat="state in motion.state.getNextStates()">
</option> <a href ng-click="updateState(state.id)">{{ state.action_word | translate }}</a>
</select> <li class="divider" ng-if="motion.state.getNextStates().length">
<button ng-if="motion.isAllowed('reset_state')" ng-click="reset_state()" <li>
class="btn btn-danger btn-xs spacer"> <a href ng-if="motion.isAllowed('reset_state')" ng-click="reset_state()">
<i class="fa fa-exclamation-triangle"></i> <i class="fa fa-exclamation-triangle"></i>
<translate>Reset state</translate> <translate>Reset state</translate>
</button> </a>
</ul>
</span>
</div>
<div class="label" ng-class="'label-'+motion.state.css_class">
{{ motion.state.name | translate }}
</div> </div>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">

View File

@ -197,7 +197,7 @@
</span> </span>
<!-- quickEdit columns --> <!-- quickEdit columns -->
<td ng-if="motion.quickEdit && motion.isAllowed('quickedit')" colspan="5"> <td ng-if="motion.quickEdit && motion.isAllowed('quickedit')" colspan="6">
<h4>{{ motion.getTitle() }} <span class="text-muted">&ndash; <translate>QuickEdit</translate></span></h4> <h4>{{ motion.getTitle() }} <span class="text-muted">&ndash; <translate>QuickEdit</translate></span></h4>
<uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}"> <uib-alert ng-show="alert.show" type="{{ alert.type }}" ng-click="alert={}" close="alert={}">
{{ alert.msg }} {{ alert.msg }}
@ -255,7 +255,7 @@
</div> </div>
</div> </div>
<div class="spacer"> <div class="spacer">
<button ng-click="motion.quickEdit=false" class="btn btn-default pull-left" translate> <button ng-click="cancelQuickEdit(motion)" class="btn btn-default pull-left" translate>
Cancel Cancel
</button> &nbsp; </button> &nbsp;
<button ng-if="motion.isAllowed('update')" ng-click="save(motion)" class="btn btn-primary" translate> <button ng-if="motion.isAllowed('update')" ng-click="save(motion)" class="btn btn-primary" translate>

View File

@ -10,6 +10,46 @@
<div ng-repeat="submitter in motion.submitters"> <div ng-repeat="submitter in motion.submitters">
{{ submitter.get_full_name() }}<br> {{ submitter.get_full_name() }}<br>
</div> </div>
<!-- Poll results -->
<h3 ng-if="motion.polls.length > 0" translate>Voting result</h3>
<div ng-repeat="poll in motion.polls | orderBy:'-id'" class="spacer">
<div ng-show="poll.has_votes" class="pollresults">
<strong ng-if="motion.polls.length > 1"><translate>Vote</translate> {{ motion.polls.length - $index }}:</strong>
<table class="transparentTable spacer">
<!-- yes -->
<tr>
<td class="icon">
<i class="fa fa-thumbs-up fa-2x"></i>
<td>
<span class="result_label"><translate>Yes</translate>:</span>
<span class="result_value">{{ poll.yes }} {{ poll.getYesPercent() }}</span>
<div ng-if="poll.getYesPercent(true)">
<uib-progressbar value="poll.getYesPercent(true)" type="success"></uib-progressbar>
</div>
<!-- no -->
<tr>
<td class="icon">
<i class="fa fa-thumbs-down fa-2x"></i>
<td>
<span class="result_label"><translate>No</translate>:</span>
<span class="result_value">{{ poll.no }} {{ poll.getNoPercent() }}</span>
<div ng-if="poll.getNoPercent(true)">
<uib-progressbar value="poll.getNoPercent(true)" type="danger"></uib-progressbar>
</div>
<!-- abstain -->
<tr>
<td class="icon">
<strong style="font-size: 26px">&empty;</strong>
<td>
<span class="result_label"><translate>Abstain</translate>:</span>
<span class="result_value">{{ poll.abstain }} {{ poll.getAbstainPercent() }}</span>
<div ng-if="poll.getAbstainPercent(true)">
<uib-progressbar value="poll.getAbstainPercent(true)" type="warning"></uib-progressbar>
</div>
</table>
</div>
</div>
</div> </div>
<!-- Title --> <!-- Title -->