Merge "Configure Timeline from Story details"

This commit is contained in:
Jenkins 2014-06-05 18:27:29 +00:00 committed by Gerrit Code Review
commit f9fde5b5c2
4 changed files with 135 additions and 2 deletions

View File

@ -161,6 +161,19 @@ angular.module('sb.story').controller('StoryDetailController',
return modalInstance.result;
};
$scope.updateFilter = function () {
var modalInstance = $modal.open({
templateUrl: 'app/templates/story/update_filter.html',
controller: 'TimelineFilterController'
});
modalInstance.result.then(function(enabled_event_types) {
$scope.enabled_event_types = enabled_event_types;
});
// Return the modal's promise.
return modalInstance.result;
};
/**
* Initialize
*/

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 2014 Mirantis Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
angular.module('sb.story').controller('TimelineFilterController',
function($scope, $modalInstance, Preference) {
'use strict';
function init() {
$scope.enabled_event_types =
Preference.get('display_events_filter');
}
$scope.close = function () {
$modalInstance.dismiss('cancel');
};
$scope.save = function () {
Preference.set('display_events_filter',
$scope.enabled_event_types);
return $modalInstance.close($scope.enabled_event_types);
};
init();
})
;

View File

@ -186,8 +186,9 @@
<!-- Template for the task list -->
<script type="text/ng-template" id="/inline/discussion.html">
<div ng-controller="StoryDiscussionController">
<h4>Events timeline</h4>
<h4>Events timeline
<a href ng-click="updateFilter()"><i class="fa fa-gear"></i></a>
</h4>
<div class="discussion">
<div class="alert alert-warning"
ng-show="comments.length == 0">

View File

@ -0,0 +1,80 @@
<div class="panel panel-default">
<div class="panel-heading">
<button type="button" class="close" aria-hidden="true"
ng-click="close()">&times;</button>
<h3 class="panel-title">Update Timeline filter</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-xs-12">
<form class="form-horizontal" role="form" name="fiterForm">
<div class="form-group col-sm-10">
<label>Timeline events</label>
<p class="help-block">
Which types of Timeline events would you like to be
displayed?
</p>
</div>
<div class="form-group col-sm-10">
<input type="checkbox" name="enabledTypes"
id="storyCreated"
ng-model="enabled_event_types.story_created">
<label for="storyCreated">Story created</label>
<br/>
<input type="checkbox" name="enabledTypes"
id="storyDetailsChanged"
ng-model="enabled_event_types.story_details_changed">
<label for="storyDetailsChanged">Story details changed</label>
<br/>
<input type="checkbox" name="enabledTypes"
id="taskCreated"
ng-model="enabled_event_types.task_created">
<label for="taskCreated">Task created</label>
<br/>
<input type="checkbox" name="enabledTypes"
id="taskAssigneeChanged"
ng-model="enabled_event_types.task_assignee_changed">
<label for="taskAssigneeChanged">Task assignee changed</label>
<br/>
<input type="checkbox" name="enabledTypes"
id="taskStatusChanged"
ng-model="enabled_event_types.task_status_changed">
<label for="taskStatusChanged">Task status changed</label>
<br/>
<input type="checkbox" name="enabledTypes"
id="taskDetailsChanged"
ng-model="enabled_event_types.task_details_changed">
<label for="taskDetailsChanged">Task details changed</label>
<br/>
<input type="checkbox" name="enabledTypes"
id="taskDeleted"
ng-model="enabled_event_types.task_deleted">
<label for="taskDeleted">Task deleted</label>
<br/>
<input type="checkbox" name="enabledTypes"
id="userComment"
ng-model="enabled_event_types.user_comment">
<label for="userComment">User comment</label>
</div>
</form>
</div>
</div>
<div class="row">
<div class="col-xs-6 text-right">
<button type="button"
class="btn btn-primary"
ng-click="save()">
Save Changes
</button>
<button type="button"
ng-click="close()"
class="btn btn-default">
Cancel
</button>
</div>
</div>
</div>
</div>