Working on the time tracker

This commit is contained in:
Hillel Coren 2017-10-02 20:07:41 +03:00
parent b34c6456bc
commit bfa0a973b5
3 changed files with 32 additions and 4 deletions

View File

@ -2469,7 +2469,7 @@ $LANG = array(
'descending' => 'Descending',
'sort_field' => 'Sort By',
'sort_direction' => 'Direction',
'discard' => 'Discard',
'time_am' => 'AM',
'time_pm' => 'PM',
'time_mins' => 'mins',

View File

@ -40,6 +40,10 @@
outline: none;
}
span.archived-link {
color: #888888 !important;
}
.fade-color {
animation-name: fadeToYellow;
}
@ -273,6 +277,12 @@
]
)->split() !!}
</span>
{!! Button::normal(trans('texts.discard'))
->appendIcon(Icon::create('remove-circle'))
->withAttributes([
'data-bind' => 'click: onCancelClick, visible: showDiscard',
])
->large() !!}
{!! Button::normal(trans('texts.cancel'))
->appendIcon(Icon::create('remove-circle'))
->withAttributes([
@ -350,9 +360,9 @@
<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 class="link" data-bind="text: clientName, click: $parent.viewClient, clickBubble: false, css: clientClass"></span>
<span data-bind="visible: clientName &amp;&amp; projectName"> | </span>
<span class="link" data-bind="text: projectName, click: $parent.viewProject, clickBubble: false"></span>
<span class="link" data-bind="text: projectName, click: $parent.viewProject, clickBubble: false, css: projectClass"></span>
&nbsp;
</p>
</div>

View File

@ -428,12 +428,20 @@
return task.isCreated() && ! task.isChanged();
});
self.showDiscard = ko.computed(function() {
var task = self.selectedTask();
if (! task) {
return false;
}
return ! task.isCreated();
});
self.showCancel = ko.computed(function() {
var task = self.selectedTask();
if (! task) {
return false;
}
return task.isChanged();
return task.isCreated() && task.isChanged();
});
self.startIcon = ko.computed(function() {
@ -983,6 +991,14 @@
return self.project() ? self.project().name() : '';
});
self.clientClass = ko.computed(function() {
return self.client() && self.client().deleted_at() ? 'archived-link' : '';
});
self.projectClass = ko.computed(function() {
return self.project() && self.project().deleted_at() ? 'archived-link' : '';
});
self.startClass = ko.computed(function() {
if (model.sendingRequest()) {
return 'disabled';
@ -1076,6 +1092,7 @@
var self = this;
self.name = ko.observable('');
self.public_id = ko.observable(-1);
self.deleted_at = ko.observable();
if (data) {
ko.mapping.fromJS(data, {}, this);
@ -1087,6 +1104,7 @@
self.name = ko.observable('');
self.public_id = ko.observable(-1);
self.contacts = ko.observableArray();
self.deleted_at = ko.observable();
self.mapping = {
'contacts': {