1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Working on time tracker

This commit is contained in:
Hillel Coren 2017-09-18 08:27:40 +03:00
parent b02d7e810b
commit ce198bd265
34 changed files with 231407 additions and 125 deletions

View File

@ -1306,13 +1306,14 @@ class Utils
public static function brewerColor($number) {
$colors = [
'#377eb8',
'#4daf4a',
'#984ea3',
'#ff7f00',
'#a65628',
'#f781bf',
'#e41a1c',
'#1c9f77',
'#d95d02',
'#716cb1',
'#e62a8b',
'#5fa213',
'#e6aa04',
'#a87821',
'#676767',
];
$number = ($number-1) % count($colors);

View File

@ -70,7 +70,7 @@ class ExpensePresenter extends EntityPresenter
if ($subColors && $expense->expense_category_id) {
$data->borderColor = $data->backgroundColor = Utils::brewerColor($expense->expense_category->public_id);
} else {
$data->borderColor = $data->backgroundColor = '#e41a1c';
$data->borderColor = $data->backgroundColor = '#d95d02';
}
return $data;

View File

@ -336,7 +336,7 @@ class InvoicePresenter extends EntityPresenter
if ($subColors) {
$data->borderColor = $data->backgroundColor = $invoice->present()->statusColor();
} else {
$data->borderColor = $data->backgroundColor = $invoice->isQuote() ? '#984ea3' : '#377eb8';
$data->borderColor = $data->backgroundColor = $invoice->isQuote() ? '#716cb1' : '#377eb8';
}
return $data;

View File

@ -58,7 +58,7 @@ class PaymentPresenter extends EntityPresenter
if ($subColors) {
$data->borderColor = $data->backgroundColor = Utils::brewerColor($payment->payment_status_id);
} else {
$data->borderColor = $data->backgroundColor = '#4daf4a';
$data->borderColor = $data->backgroundColor = '#5fa213';
}
return $data;

View File

@ -92,7 +92,7 @@ class TaskPresenter extends EntityPresenter
if ($subColors && $task->project_id) {
$data->borderColor = $data->backgroundColor = Utils::brewerColor($task->project->public_id);
} else {
$data->borderColor = $data->backgroundColor = '#ff7f00';
$data->borderColor = $data->backgroundColor = '#a87821';
}
$parts = json_decode($task->time_log) ?: [];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

13746
public/css/built.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

486
public/css/select2.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

10530
public/js/Chart.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2498
public/js/card.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

9559
public/js/d3.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5882
public/js/select2.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1271,3 +1271,19 @@ function pad(n, width, z) {
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
function brewerColor(number) {
var colors = [
'#1c9f77',
'#d95d02',
'#716cb1',
'#e62a8b',
'#5fa213',
'#e6aa04',
'#a87821',
'#676767',
];
var number = (number-1) % colors.length;
return colors[number];
}

View File

@ -5,6 +5,10 @@
<style type="text/css">
.form-control {
margin-bottom: 20px;
}
a:focus {
outline: none;
}
@ -33,9 +37,14 @@
content: "";
}
.list-group-item-type1:before {
background-color: purple;
}
.list-group-item-type1:before { background-color: #1c9f77; }
.list-group-item-type2:before { background-color: #d95d02; }
.list-group-item-type3:before { background-color: #716cb1; }
.list-group-item-type4:before { background-color: #e62a8b; }
.list-group-item-type5:before { background-color: #5fa213; }
.list-group-item-type6:before { background-color: #e6aa04; }
.list-group-item-type7:before { background-color: #a87821; }
.list-group-item-type8:before { background-color: #676767; }
</style>
@ -92,8 +101,8 @@
<!-- Task List -->
<div class="list-group col-sm-5 col-sm-pull-7" data-bind="foreach: filteredTasks">
<a href="#" data-bind="click: $parent.selectTask, hasFocus: $data == $parent.selectedTask(), event: { mouseover: showActionButton, mouseout: hideActionButton }"
class="list-group-item list-group-item-type1">
<a href="#" data-bind="click: $parent.selectTask, hasFocus: $data == $parent.selectedTask(), event: { mouseover: showActionButton, mouseout: hideActionButton }, css: projectColor"
class="list-group-item">
<div class="pull-right" style="text-align:right;">
<div data-bind="visible: actionButtonVisible()"
data-bindx="style : { visibility : actionButtonVisible() ? '' : 'hidden' }">
@ -306,6 +315,15 @@
}
}
self.projectColor = ko.computed(function() {
if (! self.project) {
return '';
}
var projectId = self.project.public_id();
var colorNum = (projectId-1) % 8;
return 'list-group-item-type' + (colorNum+1);
});
self.isRunning = ko.computed(function() {
if (! self.time_log().length) {
return false;