Working on time tracker

This commit is contained in:
Hillel Coren 2017-09-27 23:15:42 +03:00
parent d105d2eb8d
commit 2244b04eb7
3 changed files with 66 additions and 30 deletions

View File

@ -2464,6 +2464,10 @@ $LANG = array(
'download_iphone_app' => 'Download the iPhone app', 'download_iphone_app' => 'Download the iPhone app',
'download_android_app' => 'Download the Android app', 'download_android_app' => 'Download the Android app',
'time_tracker_mobile_help' => 'Double tap a task to select it', 'time_tracker_mobile_help' => 'Double tap a task to select it',
'stopped' => 'Stopped',
'ascending' => 'Ascending',
'descending' => 'Descending',
'direction' => 'Direction',
); );

View File

@ -218,35 +218,67 @@
</div> </div>
<!-- Task List --> <!-- Task List -->
<div id="taskList" class="list-group col-sm-5 col-sm-pull-7" data-bind="foreach: filteredTasks" style="display:none"> <div id="taskList" class="list-group col-sm-5 col-sm-pull-7" style="display:none">
<a href="#" data-bind="click: $parent.selectTask, event: { mouseover: showActionButton, mouseout: hideActionButton }, css: listItemState" <div id="filterPanel" style="margin-bottom:0px;padding-top:20px;padding-bottom:0px;padding-left:10px;displayx:none;">
class="list-group-item"> <div class="panel panel-default">
<div class="pull-right" style="text-align:right;"> <div class="panel-body">
<div data-bind="visible: actionButtonVisible()" <div class="row" xstyle="padding-bottom:22px;">
data-bindx="style : { visibility : actionButtonVisible() ? '' : 'hidden' }"> <div class="col-md-12">
&nbsp;&nbsp; {!! Former::select('entity_state')
<button type="button" data-bind="css: startClass, click: onStartClick, clickBubble: false" ->addOption(trans('texts.all'), 'all')
class="btn btn-sm" style="padding-left:0px; padding-right: 12px; padding-bottom: 6px; margin-top:5px;"> ->addOption(trans('texts.stopped'), 'stopped')
<span data-bind="css: startIcon"></span> ->addOption(trans('texts.running'), 'running') !!}
</button> </div>
</div> </div>
</div> <div class="row">
<div class="pull-right" style="text-align:right; padding-left: 16px;"> <div class="col-md-6" style="padding-top:24px;">
<div data-bind="text: totalDuration, style: { fontWeight: isRunning() ? 'bold' : '' }"></div> {!! Former::select('sort_by')
<div data-bind="text: age, style: { fontWeight: isRunning() ? 'bold' : '' }" style="padding-top: 2px"></div> ->addOption(trans('texts.date'), 'date')
</div> ->addOption(trans('texts.duration'), 'duration')
<div style="white-space: nowrap; text-overflow: ellipsis; overflow: hidden;"> ->addOption(trans('texts.client'), 'client')
<h4 class="list-group-item-heading"> ->addOption(trans('texts.project'), 'project')
<span data-bind="text: description, style: { fontWeight: isRunning() ? 'bold' : '' }"></span>&nbsp; ->addOption(trans('texts.description'), 'description') !!}
</h4> </div>
<p class="list-group-item-text"> <div class="col-md-6" style="padding-top:24px;">
<span class="link" data-bind="text: clientName, click: $parent.viewClient, clickBubble: false"></span> {!! Former::select('direction')
<span data-bind="visible: clientName &amp;&amp; projectName"> | </span> ->addOption(trans('texts.ascending'), 'asc')
<span class="link" data-bind="text: projectName, click: $parent.viewProject, clickBubble: false"></span> ->addOption(trans('texts.descending'), 'desc') !!}
&nbsp; </div>
</p> </div>
</div> </div>
</a> </div>
</div>
<div data-bind="foreach: filteredTasks">
<a href="#" data-bind="click: $parent.selectTask, event: { mouseover: showActionButton, mouseout: hideActionButton }, css: listItemState"
class="list-group-item">
<div class="pull-right" style="text-align:right;">
<div data-bind="visible: actionButtonVisible()"
data-bindx="style : { visibility : actionButtonVisible() ? '' : 'hidden' }">
&nbsp;&nbsp;
<button type="button" data-bind="css: startClass, click: onStartClick, clickBubble: false"
class="btn btn-sm" style="padding-left:0px; padding-right: 12px; padding-bottom: 6px; margin-top:5px;">
<span data-bind="css: startIcon"></span>
</button>
</div>
</div>
<div class="pull-right" style="text-align:right; padding-left: 16px;">
<div data-bind="text: totalDuration, style: { fontWeight: isRunning() ? 'bold' : '' }"></div>
<div data-bind="text: age, style: { fontWeight: isRunning() ? 'bold' : '' }" style="padding-top: 2px"></div>
</div>
<div style="white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">
<h4 class="list-group-item-heading">
<span data-bind="text: description, style: { fontWeight: isRunning() ? 'bold' : '' }"></span>&nbsp;
</h4>
<p class="list-group-item-text">
<span class="link" data-bind="text: clientName, click: $parent.viewClient, clickBubble: false"></span>
<span data-bind="visible: clientName &amp;&amp; projectName"> | </span>
<span class="link" data-bind="text: projectName, click: $parent.viewProject, clickBubble: false"></span>
&nbsp;
</p>
</div>
</a>
</div>
</div> </div>
</div> </div>
@ -386,6 +418,7 @@
if (projectId == '-1') { if (projectId == '-1') {
$('input[name=project_name]').val(projectName); $('input[name=project_name]').val(projectName);
//var project = new ProjectModel(); //var project = new ProjectModel();
//project.name = projectName;
//model.selectedTask().project = project; //model.selectedTask().project = project;
//model.selectedTask().project_id(projectId); //model.selectedTask().project_id(projectId);
} else if (projectId) { } else if (projectId) {

View File

@ -28,7 +28,7 @@
} }
self.onFilterClick = function(event) { self.onFilterClick = function(event) {
console.log('filter clicked...'); $('#filterPanel').toggle();
} }
self.onRefreshClick = function() { self.onRefreshClick = function() {
@ -369,7 +369,6 @@
refreshProjectList(true); refreshProjectList(true);
self.selectedTask(task); self.selectedTask(task);
//self.filter('');
if (task) { if (task) {
task.focus(); task.focus();