forked from tgaff/listly_rails_angular
-
Notifications
You must be signed in to change notification settings - Fork 2
/
list.template.html
68 lines (55 loc) · 1.96 KB
/
list.template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!-- header -->
<div class="well">
<div class="container">
<div class="page-header">
<h1>Listly <span class='small'>- viewing list: "{{listCtrl.list.name}}"</span></h1>
</div>
</div>
</div>
<!-- page content -->
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<!-- new list form-->
<form class="form-inline" ng-submit="listCtrl.createItem()">
<div class="form-group">
<input ng-model="listCtrl.newItemName" type="text" name="list" class="form-control" placeholder="Name" autofocus>
</div>
<div class="form-group">
<input type="submit" class="btn btn-default" value="Create List">
</div>
</form>
<br>
<!-- list of items -->
<ul class="list-group">
<li class="list-group-item" ng-repeat="item in listCtrl.items">
<!-- description -->
{{item.name}}
<div class="pull-right">
<!-- pencil icon to toggle update form -->
<a ng-click="listCtrl.toggleEditForm(item)">
<span class="glyphicon glyphicon-pencil"></span>
</a>
<!-- trash can icon to delete todo -->
<a ng-click="listCtrl.deleteItem(item)">
<span class="glyphicon glyphicon-trash"></span>
</a>
</div>
<!-- form to update todo -->
<div ng-show="item.showForm">
<br>
<form class="form-inline update-todo" ng-submit="listCtrl.updateItem(item)">
<div class="form-group">
<input type="text" name="task" class="form-control" ng-model="item.name">
</div>
<div class="form-group">
<input type="submit" class="btn btn-block btn-default" value="Update">
</div>
</form>
</div>
</li>
</ul>
<a class="btn btn-default" ng-href="/lists">View all lists</a>
</div>
</div>
</div>