Skip to content
Snippets Groups Projects
Commit f6e81ed4 authored by Jaden Diefenbaugh's avatar Jaden Diefenbaugh
Browse files

can edit group names in panel header

parent 3813a896
No related branches found
No related tags found
1 merge request!223Reports overhaul
......@@ -32,6 +32,10 @@ angular.module('reportApp').directive("groupPanelContent", ['GroupsService', fun
},
link: function(scope){
scope.deleteGroup = GroupsService.deleteGroup;
scope.editingGroupName = true;
scope.change = () => {
scope.editingGroupName = !scope.editingGroupName;
};
},
template: `
<div id="{{group.name}}-heading" class="panel-heading" role="tab">
......@@ -44,8 +48,24 @@ angular.module('reportApp').directive("groupPanelContent", ['GroupsService', fun
href="#collapse-{{group.name}}"
aria-expanded="true"
aria-controls="collapse-{{group.name}}">
{{ group.name }}
</a>
<span ng-if='!editingGroupName' ng-click='change()'>
<span>{{ group.name }}</span>
<span class='glyphicon glyphicon-pencil'></span>
</span>
<form class='form-inline' role='form' style='display: inline;' ng-if='editingGroupName'>
<span class='input-group'>
<input
required
type='text'
class='form-control'
placeholder='Group name...'
ng-model='group._name'/>
<span class='input-group-addon' ng-click='change()'>
Save
</span>
</span>
</form>
<div class='btn-group'>
<button class='btn btn-danger' ng-click='deleteGroup(group.name)'>Delete Group</button>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment