summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-03 16:16:35 +0200
committerSimon Rettberg2019-04-03 16:17:06 +0200
commit466a0156c76df469f97881008e93ed208e727958 (patch)
treea67723872820b6b0be9a81038af6f3048e1f68cd
parent[locationinfo] Update translations (diff)
downloadslx-admin-466a0156c76df469f97881008e93ed208e727958.tar.gz
slx-admin-466a0156c76df469f97881008e93ed208e727958.tar.xz
slx-admin-466a0156c76df469f97881008e93ed208e727958.zip
[locationinfo] Style checkboxes, use icon in save button
-rw-r--r--modules-available/locationinfo/clientscript.js11
-rw-r--r--modules-available/locationinfo/templates/page-locations.html25
2 files changed, 23 insertions, 13 deletions
diff --git a/modules-available/locationinfo/clientscript.js b/modules-available/locationinfo/clientscript.js
index f9872e02..25c255fb 100644
--- a/modules-available/locationinfo/clientscript.js
+++ b/modules-available/locationinfo/clientscript.js
@@ -32,6 +32,8 @@ const allDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturd
* Opening times related...
*/
+var slxIdCounter = 0;
+
/**
* Adds a new opening time to the table in expert mode.
*/
@@ -39,9 +41,16 @@ function newOpeningTime(vals) {
var $row = $('#expert-template').find('div.row').clone();
if (vals['days'] && Array.isArray(vals['days'])) {
for (var i = 0; i < allDays.length; ++i) {
- $row.find('.i-' + allDays[i]).attr('checked', vals['days'].indexOf(allDays[i]) !== -1);
+ $row.find('.i-' + allDays[i]).prop('checked', vals['days'].indexOf(allDays[i]) !== -1);
}
}
+ $row.find('input').each(function() {
+ var $inp = $(this);
+ if ($inp.length === 0) return;
+ slxIdCounter++;
+ $inp.prop('id', 'id-inp-' + slxIdCounter);
+ $inp.siblings('label').prop('for', 'id-inp-' + slxIdCounter);
+ });
$row.find('.i-openingtime').val(vals['openingtime']);
$row.find('.i-closingtime').val(vals['closingtime']);
$('#expert-table').append($row);
diff --git a/modules-available/locationinfo/templates/page-locations.html b/modules-available/locationinfo/templates/page-locations.html
index c79cdfe8..f90a0f35 100644
--- a/modules-available/locationinfo/templates/page-locations.html
+++ b/modules-available/locationinfo/templates/page-locations.html
@@ -54,7 +54,10 @@
<div class="modal-body"></div>
<div class="modal-footer">
<a class="btn btn-default" data-dismiss="modal">{{lang_close}}</a>
- <button type="submit" class="btn btn-primary">{{lang_save}}</button>
+ <button type="submit" class="btn btn-primary">
+ <span class="glyphicon glyphicon-floppy-disk"></span>
+ {{lang_save}}
+ </button>
</div>
</form>
</div>
@@ -64,17 +67,15 @@
<div class="hidden" id="expert-template">
<div class="row expert-row" style="margin-top:1em;border-top:1px solid #ddd">
- <div class="col-xs-9 days-box">
- <label><input type="checkbox" class="i-Monday">{{lang_shortMonday}}</label> |
- <label><input type="checkbox" class="i-Tuesday">{{lang_shortTuesday}}</label> |
- <label><input type="checkbox" class="i-Wednesday">{{lang_shortWednesday}}</label> |
- <label><input type="checkbox" class="i-Thursday">{{lang_shortThursday}}</label> |
- <label><input type="checkbox" class="i-Friday">{{lang_shortFriday}}</label> |
- <label><input type="checkbox" class="i-Saturday">{{lang_shortSaturday}}</label> |
- <label><input type="checkbox" class="i-Sunday">{{lang_shortSunday}}</label>
- </div>
- <div class="col-xs-3 text-right">
- <label><input type="checkbox" class="i-delete"><span class="glyphicon glyphicon-trash"></span></label>
+ <div class="col-xs-12 days-box">
+ <div class="pull-right checkbox checkbox-inline"><input type="checkbox" class="i-delete"><label><span class="glyphicon glyphicon-trash"></span></label></div>
+ <div class="checkbox checkbox-inline"><input type="checkbox" class="i-Monday"><label>{{lang_shortMonday}}</label></div>
+ <div class="checkbox checkbox-inline"><input type="checkbox" class="i-Tuesday"><label>{{lang_shortTuesday}}</label></div>
+ <div class="checkbox checkbox-inline"><input type="checkbox" class="i-Wednesday"><label>{{lang_shortWednesday}}</label></div>
+ <div class="checkbox checkbox-inline"><input type="checkbox" class="i-Thursday"><label>{{lang_shortThursday}}</label></div>
+ <div class="checkbox checkbox-inline"><input type="checkbox" class="i-Friday"><label>{{lang_shortFriday}}</label></div>
+ <div class="checkbox checkbox-inline"><input type="checkbox" class="i-Saturday"><label>{{lang_shortSaturday}}</label></div>
+ <div class="checkbox checkbox-inline"><input type="checkbox" class="i-Sunday"><label>{{lang_shortSunday}}</label></div>
</div>
<div class="col-sm-6">
<div class="input-group bootstrap-timepicker">