-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
90 lines (82 loc) · 3.48 KB
/
index.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<html ng-app="notmuchApp">
<head>
<meta charset="utf-8">
<title>notmuch sinatra</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script src="js/angular.js"></script>
<script src="js/angular-resource.js"></script>
<script src="js/ui-bootstrap-tpls-1.1.2.js"></script>
<script>
var notmuchApp = angular.module('notmuchApp', ['ui.bootstrap','ngResource']);
notmuchApp.controller('handleSearch', ['$scope', 'getSearch',
function ($scope, getSearch) {
$scope.searchresults = getSearch.query();
}]);
notmuchApp.factory('getSearch', function ($resource) {
return $resource('/notmuch/search', {}, {
query: { method: 'GET', params: {query:'hund'}, isArray: true },
})
});
// return $resource('/notmuch/search?', {}, {
// query: { method: 'GET', params: {query: '@blub'}, isArray: true },
// })
//});
</script>
</head>
<body ng-controller="handleSearch">
<div class="container">
<form>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-search"></i></div>
<input type="text" class="form-control" placeholder="Search EMail" ng-model="searchterm">
<input type="submit" class="form-control" value="Search" ng-submit="searchresults();">
</div>
</div>
</form>
<form>
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-search"></i></div>
<input type="text" class="form-control" placeholder="Filter Results" ng-model="filterResults">
</div>
</div>
</form>
<table class="table table-striped col-md-8">
<thead>
<tr>
<td>
<a href="#" ng-click="sortType = 'searchresult.timestamp'; sortReverse = !sortReverse">
Time
<span ng-show="sortType == 'searchresult.timestamp' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'searchresult.timestamp' && sortReverse" class="fa fa-caret-up"></span>
</a>
</td>
<td>
<a href="#" ng-click="sortType = 'searchresult.authors'; sortReverse = !sortReverse">
Authors
<span ng-show="sortType == 'searchresult.authors' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'searchresult.authors' && sortReverse" class="fa fa-caret-up"></span>
</a>
</td>
<td>
<a href="#" ng-click="sortType = 'searchresult.subject'; sortReverse = !sortReverse">
Subject
<span ng-show="sortType == 'searchresult.subject' && !sortReverse" class="fa fa-caret-down"></span>
<span ng-show="sortType == 'searchresult.subject' && sortReverse" class="fa fa-caret-up"></span>
</a>
</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="searchresult in searchresults | orderBy:sortType:sortReverse | filter:filterResults">
<td class="col-md-1">{{searchresult.timestamp * 1000 | date:'yyyy-MM-dd HH:mm:ss'}}</td>
<td class="col-md-2">{{searchresult.authors}}</td>
<td class="col-md-2">{{searchresult.subject}}</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>