summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-12-27 12:45:48 +0100
committermsquare <msquare@notrademark.de>2017-12-27 12:45:48 +0100
commit02b775684d643850e4a4ea3d9ac7028b6af3b469 (patch)
tree6dd98a613a2f09a422d04632a080ef94979103eb
parent1e8f0c484588882e01bc173f7f60e2cf1376f790 (diff)
some beauty for the my shifts table
-rw-r--r--includes/view/User_view.php20
-rw-r--r--public/css/theme0.css3
-rw-r--r--public/css/theme1.css3
-rw-r--r--public/css/theme2.css3
-rw-r--r--public/css/theme3.css3
-rw-r--r--public/css/theme4.css3
-rw-r--r--public/css/theme5.css3
-rw-r--r--public/css/theme6.css3
-rw-r--r--themes/base.less4
9 files changed, 36 insertions, 9 deletions
diff --git a/includes/view/User_view.php b/includes/view/User_view.php
index 7a36aafe..198897f3 100644
--- a/includes/view/User_view.php
+++ b/includes/view/User_view.php
@@ -351,9 +351,10 @@ function User_view_myshift($shift, $user_source, $its_me)
}
$myshift = [
- 'date' => date('Y-m-d', $shift['start']),
- 'time' => date('H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']),
- 'room' => $shift['Name'],
+ 'date' => glyph('calendar') . date('Y-m-d', $shift['start']) . '<br>'
+ . glyph('time') . date('H:i', $shift['start']) . ' - ' . date('H:i', $shift['end']),
+ 'duration' => round(($shift['end'] - $shift['start']) / 3600, 2) . ' h',
+ 'room' => Room_name_render($shift),
'shift_info' => $shift_info,
'comment' => ''
];
@@ -363,11 +364,12 @@ function User_view_myshift($shift, $user_source, $its_me)
}
if ($shift['freeloaded']) {
+ $myshift['duration'] = '<p class="text-danger">' . round(-($shift['end'] - $shift['start']) / 3600 * 2, 2) . ' h' . '</p>';
if (in_array('user_shifts_admin', $privileges)) {
$myshift['comment'] .= '<br />'
- . '<p class="error">' . _('Freeloaded') . ': ' . $shift['freeload_comment'] . '</p>';
+ . '<p class="text-danger">' . _('Freeloaded') . ': ' . $shift['freeload_comment'] . '</p>';
} else {
- $myshift['comment'] .= '<br /><p class="error">' . _('Freeloaded') . '</p>';
+ $myshift['comment'] .= '<br /><p class="text-danger">' . _('Freeloaded') . '</p>';
}
}
@@ -416,7 +418,7 @@ function User_view_myshifts($shifts, $user_source, $its_me, $tshirt_score, $tshi
if (count($myshifts_table) > 0) {
$myshifts_table[] = [
'date' => '<b>' . _('Sum:') . '</b>',
- 'time' => '<b>' . round($timesum / 3600, 2) . ' h</b>',
+ 'duration' => '<b>' . round($timesum / 3600, 2) . ' h</b>',
'room' => '',
'shift_info' => '',
'comment' => '',
@@ -425,7 +427,7 @@ function User_view_myshifts($shifts, $user_source, $its_me, $tshirt_score, $tshi
if($its_me || $tshirt_admin) {
$myshifts_table[] = [
'date' => '<b>' . _('Your t-shirt score') . '&trade;:</b>',
- 'time' => '<b>' . round($tshirt_score, 2) . ' h</b>',
+ 'duration' => '<b>' . round($tshirt_score, 2) . ' h</b>',
'room' => '',
'shift_info' => '',
'comment' => '',
@@ -512,8 +514,8 @@ function User_view($user_source, $admin_user_privilege, $freeloader, $user_angel
]),
($its_me || $admin_user_privilege) ? '<h2>' . _('Shifts') . '</h2>' : '',
($its_me || $admin_user_privilege) ? table([
- 'date' => _('Day'),
- 'time' => _('Time'),
+ 'date' => _('Day &amp; time'),
+ 'duration' => _('Duration'),
'room' => _('Location'),
'shift_info' => _('Name &amp; workmates'),
'comment' => _('Comment'),
diff --git a/public/css/theme0.css b/public/css/theme0.css
index 1aaa0de8..b3214c54 100644
--- a/public/css/theme0.css
+++ b/public/css/theme0.css
@@ -6866,6 +6866,9 @@ body {
.space-top {
margin-top: 15px;
}
+.column_duration {
+ text-align: right;
+}
.messages:focus {
outline: none;
}
diff --git a/public/css/theme1.css b/public/css/theme1.css
index 1fd11527..842ea757 100644
--- a/public/css/theme1.css
+++ b/public/css/theme1.css
@@ -6889,6 +6889,9 @@ body {
.space-top {
margin-top: 15px;
}
+.column_duration {
+ text-align: right;
+}
.messages:focus {
outline: none;
}
diff --git a/public/css/theme2.css b/public/css/theme2.css
index ff93fab0..9a04d8b8 100644
--- a/public/css/theme2.css
+++ b/public/css/theme2.css
@@ -6866,6 +6866,9 @@ body {
.space-top {
margin-top: 15px;
}
+.column_duration {
+ text-align: right;
+}
.messages:focus {
outline: none;
}
diff --git a/public/css/theme3.css b/public/css/theme3.css
index a443c579..99d3eafd 100644
--- a/public/css/theme3.css
+++ b/public/css/theme3.css
@@ -6875,6 +6875,9 @@ body {
.space-top {
margin-top: 15px;
}
+.column_duration {
+ text-align: right;
+}
.messages:focus {
outline: none;
}
diff --git a/public/css/theme4.css b/public/css/theme4.css
index 6ab26363..cb9f95c5 100644
--- a/public/css/theme4.css
+++ b/public/css/theme4.css
@@ -6889,6 +6889,9 @@ body {
.space-top {
margin-top: 15px;
}
+.column_duration {
+ text-align: right;
+}
.messages:focus {
outline: none;
}
diff --git a/public/css/theme5.css b/public/css/theme5.css
index eaee345e..0b32c10f 100644
--- a/public/css/theme5.css
+++ b/public/css/theme5.css
@@ -6869,6 +6869,9 @@ body {
.space-top {
margin-top: 15px;
}
+.column_duration {
+ text-align: right;
+}
.messages:focus {
outline: none;
}
diff --git a/public/css/theme6.css b/public/css/theme6.css
index 138bbbf7..705ddc28 100644
--- a/public/css/theme6.css
+++ b/public/css/theme6.css
@@ -6893,6 +6893,9 @@ body {
.space-top {
margin-top: 15px;
}
+.column_duration {
+ text-align: right;
+}
.messages:focus {
outline: none;
}
diff --git a/themes/base.less b/themes/base.less
index 1b11f01c..e45b7f85 100644
--- a/themes/base.less
+++ b/themes/base.less
@@ -157,6 +157,10 @@ body {
margin-top: 15px;
}
+.column_duration {
+ text-align: right;
+}
+
.messages {
&:focus {
outline: none;