225 lines
12 KiB
HTML
225 lines
12 KiB
HTML
<!--
|
|
~ Copyright (c) 2015-2016 Codethink Limited
|
|
~
|
|
~ 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.
|
|
-->
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<button type="button" class="close" aria-hidden="true"
|
|
ng-click="close()">×</button>
|
|
<h3 class="panel-title">{{ modalTitle }}</h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<form class="form-horizontal" role="form" name="worklistForm">
|
|
<div class="form-group has-feedback"
|
|
ng-class="{'has-error': worklistForm.title.$invalid,
|
|
'has-success': !worklistForm.title.$invalid}">
|
|
<label for="title" class="col-sm-2 control-label">
|
|
Title
|
|
</label>
|
|
<div class="col-sm-10">
|
|
<input id="title"
|
|
name="title"
|
|
type="text"
|
|
class="form-control"
|
|
ng-model="worklist.title"
|
|
required
|
|
focus
|
|
maxlength="100"
|
|
placeholder="Worklist Title"
|
|
ng-disabled="isSaving">
|
|
<span class="form-control-feedback"
|
|
ng-show="worklistForm.title.$invalid">
|
|
<i class="fa fa-times fa-lg"></i>
|
|
</span>
|
|
<span class="form-control-feedback"
|
|
ng-show="!worklistForm.title.$invalid">
|
|
<i class="fa fa-check fa-lg"></i>
|
|
</span>
|
|
|
|
<div class="help-block text-danger"
|
|
ng-show="worklistForm.title.$invalid">
|
|
<span ng-show="worklistForm.title.$error.required">
|
|
A worklist title is required.
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="private" class="col-sm-2 control-label">
|
|
Private
|
|
</label>
|
|
<div class="col-sm-10 checkbox">
|
|
<input id="private"
|
|
type="checkbox"
|
|
class="modal-checkbox"
|
|
ng-model="worklist.private"
|
|
ng-disabled="isSaving"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="automatic" class="col-sm-2 control-label">
|
|
Automatic
|
|
</label>
|
|
<div class="col-sm-10 checkbox">
|
|
<input id="automatic"
|
|
type="checkbox"
|
|
class="modal-checkbox"
|
|
ng-model="worklist.automatic"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group" ng-show="worklist.automatic">
|
|
<div class="col-sm-12">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th colspan="4">
|
|
Criteria
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr ng-repeat="filter in worklist.filters">
|
|
<td colspan="3">
|
|
<span ng-show="worklist.filters.indexOf(filter) > 0">
|
|
or
|
|
</span>
|
|
{{filter.type == 'Story' ? 'Stories' : 'Tasks'}}
|
|
where
|
|
<span ng-repeat="criterion in filter.filter_criteria">
|
|
{{criterion.field | capitalize}}
|
|
{{criterion.negative ? 'is not' : 'is'}}
|
|
{{criterion.title}}
|
|
<span ng-hide="filter.filter_criteria.indexOf(criterion)
|
|
== filter.filter_criteria.length - 1">
|
|
and
|
|
</span>
|
|
</span>
|
|
</td>
|
|
<td class="text-right">
|
|
<a href class="close"
|
|
ng-click="remove(filter)">×</a>
|
|
</td>
|
|
</tr>
|
|
<tr ng-show="showAddFilter">
|
|
<td class="center-vertical col-sm-2">
|
|
<span ng-show="worklist.filters.length > 0">
|
|
or
|
|
</span>
|
|
<span class="dropdown" dropdown>
|
|
<a class="btn btn-xs btn-default dropdown-toggle"
|
|
dropdown-toggle>
|
|
{{newFilter.type == 'Story' ? 'Stories' : 'Tasks'}}
|
|
<i class="fa fa-caret-down"></i>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<li ng-repeat="type in ['Story', 'Task']">
|
|
<a href ng-click="setType(type)">
|
|
{{type == 'Story' ? 'Stories' : 'Tasks'}}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</span>
|
|
</td>
|
|
<td class="col-sm-9">
|
|
<span ng-repeat="criterion in newFilter.filter_criteria"
|
|
ng-controller="SearchCriteriaController"
|
|
ng-init="init([newFilter.type])">
|
|
<span class="center-vertical worklist-criterion"
|
|
style="display: inline-block">
|
|
<span class="dropdown" dropdown>
|
|
<a class="btn btn-xs btn-default dropdown-toggle"
|
|
dropdown-toggle>
|
|
{{criterion.negative ? 'not matching' : 'matching'}}
|
|
<i class="fa fa-caret-down"></i>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<li ng-repeat="not in [false, true]">
|
|
<a href
|
|
ng-click="criterion.negative = not">
|
|
{{not ? 'not matching' : 'matching'}}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</span>
|
|
<div tag-complete="criteria as criteria.title for criteria in searchForCriteria($viewValue)"
|
|
tag-complete-tags="criteria"
|
|
tag-complete-label-field="title"
|
|
tag-complete-option-template-url="'app/search/template/typeahead_criteria_item.html'"
|
|
tag-complete-tag-template-url="'app/search/template/criteria_tag_item.html'"
|
|
tag-complete-loading="loadingCriteria = isLoading"
|
|
tag-complete-on-select="setCriterion(criterion, tag)"
|
|
tag-remove-callback="removeTag(criterion)"
|
|
max-tags="1"
|
|
placeholder="Click to select a filter.">
|
|
</div>
|
|
</span>
|
|
<span ng-hide="newFilter.filter_criteria.indexOf(criterion)
|
|
== newFilter.filter_criteria.length - 1">
|
|
and
|
|
</span>
|
|
</span>
|
|
</td>
|
|
<td class="center-vertical col-sm-1">
|
|
<a href ng-click="addCriterion(newFilter)">
|
|
<i class="fa fa-plus-circle"></i>
|
|
and...
|
|
</a>
|
|
</td>
|
|
<td class="text-right center-vertical col-sm-1">
|
|
<a href class="btn btn-primary"
|
|
ng-click="saveNewFilter()"
|
|
ng-disabled="!checkNewFilter()">Save</a>
|
|
</td>
|
|
</tr>
|
|
<tr ng-show="!showAddFilter">
|
|
<td colspan="4" class="text-center">
|
|
<a href ng-click="showAddFilter = !showAddFilter">
|
|
<i class="fa fa-plus-circle"></i> or...
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-12 text-right">
|
|
<div class="btn" ng-show="isSaving">
|
|
<i class="fa fa-spinner fa-lg fa-spin"></i>
|
|
</div>
|
|
<button type="button"
|
|
class="btn btn-primary"
|
|
ng-click="save()"
|
|
ng-disabled="!worklistForm.$valid || isSaving">
|
|
Save Changes
|
|
</button>
|
|
<button type="button"
|
|
ng-click="close()"
|
|
class="btn btn-default"
|
|
ng-disabled="isSaving">
|
|
Cancel
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|