-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
249 lines (201 loc) · 12.3 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- link rel="stylesheet" href="css/timetracker.css" type="text/css" -->
<link rel="stylesheet" href="css/timetracker-flat.css" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/pikaday.css">
<link rel="stylesheet" href="css/jqtree.css">
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/moment.min.js"></script>
<script type="text/javascript" src="js/pikaday.js"></script>
<script type="text/javascript" src="js/tree.jquery.js"></script>
<script type="text/javascript" src="js/Chart.min.js"></script>
<script type="text/javascript" src="js/plugins.conf.js"></script>
<script type="text/javascript" src="js/timetracker.js"></script>
<title>Timetracker</title>
</head>
<body onLoad="ttInit();">
<div id="container">
<div id="header">
<h1 style="float: left;">timetracker</h1>
<div id="view-links">
<a href="javascript:void(0)" onClick="synchToServer()" class="view-switch"><i style="cursor:pointer;" class="fa fa-refresh fa-lg" id="synch-icon"></i> <span>Synch</span></a>
<a href="javascript:void(0)" class="view-switch" id="settings-button" title="Settings" onClick="setView('settingsView')"><i class="fa fa-wrench fa-lg"></i> <span>Tweak</span></a>
<a href="#void" class="view-switch" onClick="setView('analyze')"><i class="fa fa-bar-chart fa-lg"></i>
<span>Analyze</span></a> <!-- a href="javascript:void(0)" class="view-switch" id="settings-button" title="Settings" onClick="showEditForm('settings')"><i class="fa fa-wrench fa-lg"></i> Settings</a -->
<a href="#void" class="view-switch" onClick="setView('taskList')"><i class="fa fa-clock-o fa-lg"></i><span>
Track</span></a>
</div>
</div>
<div class="clearfix"></div>
<div id="feedback" class="notice" style="display:none">
</div>
<div id="client-project-controls">
<!-- Client controls -->
<div class="control-container rounded" id="client-controls">
<div class="control-title-container"><div class="control-title">Client/Category</div></div>
<form method="post" id="client-form" action="" ondblclick="clientControls.showAddClientForm()">
<div id="add-client-form" style="display:none;">
<input type="text" id="add-client-input" placeholder="New client name"/>
<a href="#void" class="button" title="Save" onClick="saveClient()"><i class="fa fa-floppy-o" aria-hidden="true"></i></a>
<a href="#void" class="button" title="Cancel" onClick="clientControls.cancelAddClientForm()"><i class="fa fa-times" aria-hidden="true"></i>
</a>
</div>
<div id="select-client-form" style="display:block;">
<select name="client_id" id="client-select" onchange="setClient()">
<option value="all">- All Clients -</option>
</select>
<a href="#void" class="button" onClick="clientControls.showAddClientForm()"><i class="fa fa-plus" aria-hidden="true"></i>
</a>
<a href="#void" id="edit-client-button" class="button edit" title="Edit" onClick="showGeneralEditForm('client')"><i class="fa fa-pencil" aria-hidden="true"></i></a>
</div>
</form>
</div>
<!-- Project controls -->
<div class="control-container rounded" id="project-controls" style="display:none;">
<div class="control-title-container"><div class="control-title">Project</div></div>
<form method="post" id="project-form" action="">
<div id="add-project-form" style="display:none;">
<input type="text" id="add-project-input" placeholder="New project name"/>
<a href="#void" class="button" onClick="saveProject()"><i class="fa fa-floppy-o" aria-hidden="true"></i></a>
<a href="#void" class="button" onClick="projectControls.cancelAddProjectForm()"><i class="fa fa-times" aria-hidden="true"></i></a>
</div>
<div id="select-project-form" style="display:block;">
<select name="project_id" id="project-select" onchange="setProject()">
<option value="all" style="color: #aaaaaa"> - All Projects - </option>
</select>
<a href="#void" class="button edit" id="edit-project-button" onClick="showGeneralEditForm('project')" style="display:none;"><i class="fa fa-pencil" aria-hidden="true"></i></a><a href="#void" class="button" onClick="projectControls.showAddProjectForm()"><i class="fa fa-plus" aria-hidden="true"></i></a>
</div>
</form>
</div>
</div>
<div class="clearfix"></div>
<!-- TaskList -->
<div id="taskList-view" class="view-container" style="display: none">
<div id="task-list">
<div id="tasklist-new-task-form">
<form method="post" id="task-form" action="">
<div class="glommed-field-div">
<input type="text" class="button-end-field" id="new-task-input" name="new-task-input" placeholder="Add new task" /><a href="#void" onClick="saveNewTask()" class="button field-end-button" id="save-new-task-button">Save</a>
</div>
</form>
</div>
<div class="task-list-item" id="task-list-item-template">
<div class="task {{task.status}}" style="display:flex;" data-task-id="{{task.id}}" onDblClick="showGeneralEditForm('task','{{task.id}}')">
<div style="width: 80%; flex: 1">
{{checkCompleted}} {{task.truncateName}}
<span class="task-meta">{{task.metaParentage}}{{task.metaPrettyTime}} <span class="fa-stack billability" style="font-size: 0.6em; display:{{billable_display}}; padding-left:5px;"><i class="fa fa-circle fa-2x fa-stack-2x"></i><i class="fa fa-usd fa-lg fa-stack-1x fa-inverse"></i></span> </span>
</div>
<div style="width: 20px; flex:0.05; font-size: 1.2em; margin-top: 2px;">
<i onClick="startGeneralSession('{{task.id}}')" style="cursor:pointer; color:#77aa88;" class="fa fa-play-circle fa-lg"></i>
</div>
</div>
</div>
<div><ul class="c-rating"></ul></div>
<div id="no-data-found" style="display: none;">
<div colspan="5" style="font-size: 1.5em; color: #aaa; text-align:center">No data to display</div>
</div>
</div>
<div id="taskList-options">
<div style="float: left; min-width: 200px;">
Sort by: <a href="#void" onClick="taskList.sort('name')">name</a> | <a href="#void" onClick="taskList.sort('priority')">priority</a> | <a href="#void" onClick="taskList.sort('status')">status</a> | <a href="#void" onClick="taskList.sort('time')">time</a> | <a href="#void" onClick="taskList.sort('sessionCount')">sessions</a> | <a href="#void" onClick="taskList.sort('lastSessionTime')">last session</a>
</div>
<!-- select id="sort-by" onChange="taskList.sort(this.value);">
<option value="name" selected>Sort by: name</option>
<option value="priority" >Sort by: priority</option>
<option value="status" >Sort by: status</option>
<option value="time" >Sort by: time</option>
</select -->
<div style="float: left; min-width: 200px;">
<input type="checkbox" id="hide-completed" onChange="taskList.hideCompleted()" checked> <label for="hide-completed">Hide completed</label>
</div>
</div>
</div>
<!-- Tweak -->
<div id="settingsView-view" class="view-container" style="display: none">
<div id="settings-fields-container">
<div id="settings-item-template" style="display:none" class="settings-item">
<div class="settings-label">{{label}}</div>
<div class="settings-input">{{input}}</div>
<div class="clearfix"></div>
</div>
</div>
<a href="#void" onClick="settingsView.save()" class="button">Save Settings</a>
<br>
<a href="#void" onClick="editJson()" class="button">View/Edit JSON</a>
<a href="#void" onClick="downloadJson()" class="button">Download JSON</a>
<a href="#void" onClick="synchToServer()" class="button">Synch with server</a>
<a href="#void" onClick="deleteLocalStorage()" class="button">Delete LS data</a>
<div id="test-output"></div>
<div id="json-output"></div>
</div>
<!-- Analyze -->
<div id="analyze-view" class="view-container" style="display: none">
<h3 id="analytics-view-title"></h3>
<div id="analyze-controls">
<input type="text" id="filter-start-time" placeholder="Start date" onChange="analyze.setStartTime()" />
<input type="text" id="filter-end-time" placeholder="End date" onChange="analyze.setEndTime()" />
</div>
<table class="datatable" id="analyze-table">
<thead>
<tr>
<td>Client</td><td>Project</td><td>Task</td><td>Start time</td><td>Duration</td>
<td>Decimal</td>
</tr>
</thead>
<tbody>
<tr class="js-data-template {{rowType}}-analyze-row" id="analyze-data-row-template" style="display:none" data-template="analyze-data-row">
<td>{{client}}</td>
<td>{{project}}</td>
<td>{{task}}</td>
<td>{{start_time}}{{session_edit}}</td>
<td style="text-align:right">{{durationHMS}}</td>
<td style="text-align:right">{{durationDecimal}}</td>
</tr>
<tr id="no-data-found-table" style="display: none;">
<td colspan="6" style="font-size: 1.5em; color: #aaa; text-align:center">No sessions to display</td></tr>
</tbody>
<tfoot class="js-data-template" id="analyze-totals-template" style="display:none">
<tr class="table-totals">
<td colspan="4">Billable time</td>
<td>{{totalBillableTimeHMS}}</td>
<td>{{totalBillableTimeDecimal}}</td>
</tr>
<tr class="table-totals">
<td colspan="4">Total time</td>
<td>{{totalTimeHMS}}</td>
<td>{{totalTimeDecimal}}</td>
</tr>
</tfoot>
</table>
<div id="analyze-stats-template" style="display:none; font-size: 0.9em; margin-top:10px">
Sessions: <b>{{sessions}}</b> length (avg): <b>{{avgSessionLength}}</b>
</div>
<div id="analyze-chart" style="display:none;">
<canvas id="bar-chart" width="600" height="400"></canvas>
<canvas id="time-line" width="600" height="400"></canvas>
</div>
</div>
<div id="task-tree">
</div>
<div id="active-session">
</div>
<div id="delete-confirm" style="display: none;" class="modal-popup centered-box">
<div id="delete-confirm-message"></div>
<a class="button" id="delete-confirm-yes">Yes</a> <a class="button" id="delete-confirm-no">No</a>
</div>
<div id="edit-popup" style="display: none;" class="modal-popup centered-box">
<div id="edit-field-template" style="display:none" class="edit-field">
<div class="edit-field-label">{{label}}</div>
<div class="edit-field-input">{{input}}</div>
<div class="clearfix"></div>
</div>
</div>
<div class="modal-bg" id="modal-bg" style="display:none;" onClick="cancelEditForm()">
</div>
</div>
</body>
</html>