summaryrefslogtreecommitdiff
path: root/resources/assets
diff options
context:
space:
mode:
Diffstat (limited to 'resources/assets')
-rw-r--r--resources/assets/js/forms.js35
-rw-r--r--resources/assets/js/vendor.js7
-rw-r--r--resources/assets/themes/base.less66
3 files changed, 79 insertions, 29 deletions
diff --git a/resources/assets/js/forms.js b/resources/assets/js/forms.js
index f5818e97..9970b907 100644
--- a/resources/assets/js/forms.js
+++ b/resources/assets/js/forms.js
@@ -16,7 +16,7 @@ global.checkAll = (id, checked) => {
* Sets the checkboxes according to the given type
*
* @param {string} id The elements ID
- * @param {list} shifts_list A list of numbers
+ * @param {list} shiftsList A list of numbers
*/
global.checkOwnTypes = (id, shiftsList) => {
$('#' + id + ' input[type="checkbox"]').each(function () {
@@ -144,10 +144,10 @@ $(function () {
elem.children('input').on('click', function (ev) {
ev.stopImmediatePropagation();
if (typeof elem.data('DateTimePicker') === 'undefined') {
- elem.datetimepicker(opts);
- elem.data('DateTimePicker').show();
+ elem.datetimepicker(opts);
+ elem.data('DateTimePicker').show();
} else {
- elem.data('DateTimePicker').toggle();
+ elem.data('DateTimePicker').toggle();
}
});
});
@@ -173,3 +173,30 @@ $(function () {
});
});
});
+
+/**
+ * Set the filter selects to latest state
+ *
+ * Uses DOMContentLoaded to prevent flickering
+ */
+window.addEventListener('DOMContentLoaded', () => {
+ const filter = document.getElementById('collapseShiftsFilterSelect');
+ if (!filter || localStorage.getItem('collapseShiftsFilterSelect') !== 'hidden') {
+ return;
+ }
+
+ filter.classList.remove('in');
+});
+$(() => {
+ if (typeof (localStorage) === 'undefined') {
+ return;
+ }
+
+ const onChange = (e) => {
+ localStorage.setItem('collapseShiftsFilterSelect', e.type);
+ };
+
+ $('#collapseShiftsFilterSelect')
+ .on('hidden.bs.collapse', onChange)
+ .on('shown.bs.collapse', onChange);
+});
diff --git a/resources/assets/js/vendor.js b/resources/assets/js/vendor.js
index bf3807f7..b4b6487d 100644
--- a/resources/assets/js/vendor.js
+++ b/resources/assets/js/vendor.js
@@ -10,6 +10,13 @@ require('./forms');
require('./sticky-headers');
require('./moment-countdown');
+moment.updateLocale('en', {
+ week : {
+ dow : 1, // Monday is the first day of the week.
+ doy : 4 // The week that contains Jan 4th is the first week of the year.
+ }
+});
+
$.ajaxSetup({
headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}
});
diff --git a/resources/assets/themes/base.less b/resources/assets/themes/base.less
index b44602f0..74dadc11 100644
--- a/resources/assets/themes/base.less
+++ b/resources/assets/themes/base.less
@@ -11,7 +11,7 @@ body {
}
.first {
- clear: both;
+ clear: both;
margin-top: 30px;
}
@@ -52,7 +52,7 @@ table a > .icon-icon_angel {
}
.table .form-group {
- margin-bottom: 0;
+ margin-bottom: 0;
}
.stats {
@@ -60,20 +60,22 @@ table a > .icon-icon_angel {
.make-xs-column(6);
font-size: 20px;
height: 150px;
- text-align: center;
-
- .number {
- font-size: 80px;
- font-weight: 200;
- }
- @media (max-width: @screen-md) {
- font-size: inherit;
- .number {
- font-size: 40px;
- }
+ text-align: center;
+
+ .number {
+ font-size: 80px;
+ font-weight: 200;
+ }
+
+ @media (max-width: @screen-md) {
+ font-size: inherit;
+ .number {
+ font-size: 40px;
+ }
}
}
+
.stats-danger {
color: @brand-danger;
}
@@ -87,12 +89,12 @@ table a > .icon-icon_angel {
}
.dashboard-panel {
- position: relative;
- font-size: 20px;
+ position: relative;
+ font-size: 20px;
color: @headings-color;
- .panel-link {
- position: absolute;
+ .panel-link {
+ position: absolute;
width: 100%;
height: 100%;
top: 0;
@@ -102,11 +104,11 @@ table a > .icon-icon_angel {
background-color: @brand-primary; /* Fix to make div clickable in IE */
opacity: 0; /* Fix to make div clickable in IE */
filter: alpha(opacity=1); /* Fix to make div clickable in IE */
- }
+ }
- .panel-link:hover {
+ .panel-link:hover {
opacity: 0.3;
- }
+ }
}
.panel-primary .panel-heading a {
@@ -140,7 +142,7 @@ table a > .icon-icon_angel {
}
.selection .checkbox {
- display: block;
+ display: block;
}
.shift-calendar {
@@ -190,9 +192,20 @@ table a > .icon-icon_angel {
flex-shrink: 0;
}
- .shift {
- margin: 0 5px 5px 0;
+ .shift-card {
+ z-index: 0;
overflow: hidden;
+ position: relative;
+ margin: 0 5px 5px 0;
+
+ &:hover {
+ overflow: visible;
+ z-index: 100;
+ }
+
+ .shift {
+ min-height: 100%;
+ }
}
}
@@ -201,13 +214,14 @@ table a > .icon-icon_angel {
}
.column_duration {
- text-align: right;
+ text-align: right;
}
.messages {
&:focus {
outline: none;
}
+
a:focus {
outline: none;
}
@@ -296,7 +310,9 @@ table a > .icon-icon_angel {
float: none;
width: 100%;
- position: relative; left: 0; right: 0;
+ position: relative;
+ left: 0;
+ right: 0;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;