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:
parent
b02d7e810b
commit
ce198bd265
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -86,13 +86,13 @@ class TaskPresenter extends EntityPresenter
|
||||
}
|
||||
if ($description = $this->description()) {
|
||||
$data->title .= ' | ' . $description;
|
||||
}
|
||||
}
|
||||
$data->allDay = false;
|
||||
|
||||
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) ?: [];
|
||||
|
68807
public/built.js
68807
public/built.js
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
13746
public/css/built.css
vendored
File diff suppressed because one or more lines are too long
343
public/css/built.login.css
vendored
343
public/css/built.login.css
vendored
File diff suppressed because one or more lines are too long
9790
public/css/built.public.css
vendored
9790
public/css/built.public.css
vendored
File diff suppressed because one or more lines are too long
271
public/css/daterangepicker.css
vendored
271
public/css/daterangepicker.css
vendored
File diff suppressed because one or more lines are too long
1492
public/css/fullcalendar.css
vendored
1492
public/css/fullcalendar.css
vendored
File diff suppressed because one or more lines are too long
486
public/css/select2.css
vendored
486
public/css/select2.css
vendored
File diff suppressed because one or more lines are too long
4
public/css/tablesorter.css
vendored
4
public/css/tablesorter.css
vendored
File diff suppressed because one or more lines are too long
10530
public/js/Chart.min.js
vendored
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
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
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
1629
public/js/daterangepicker.min.js
vendored
1629
public/js/daterangepicker.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
17856
public/js/fullcalendar.min.js
vendored
17856
public/js/fullcalendar.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
80
public/js/jSignature.min.js
vendored
80
public/js/jSignature.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
5882
public/js/select2.min.js
vendored
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
5850
public/js/tablesorter.min.js
vendored
5850
public/js/tablesorter.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
82620
public/pdf.built.js
82620
public/pdf.built.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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];
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user