summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp/templates
diff options
context:
space:
mode:
authorSimon Rettberg2019-01-11 16:48:54 +0100
committerSimon Rettberg2019-01-11 16:48:54 +0100
commit856ff2fa8e9b103ee4033c8ceec3e80af87009bb (patch)
treea6fe34cf6aa1209d26feb7a2be89ea8173432e80 /modules-available/serversetup-bwlp/templates
parentMerge branch 'master' into ipxe (diff)
downloadslx-admin-856ff2fa8e9b103ee4033c8ceec3e80af87009bb.tar.gz
slx-admin-856ff2fa8e9b103ee4033c8ceec3e80af87009bb.tar.xz
slx-admin-856ff2fa8e9b103ee4033c8ceec3e80af87009bb.zip
[serversetup-bwlp] Decouple location assigning from menu editing
Diffstat (limited to 'modules-available/serversetup-bwlp/templates')
-rw-r--r--modules-available/serversetup-bwlp/templates/menu-assign-location.html69
-rw-r--r--modules-available/serversetup-bwlp/templates/menu-edit.html51
2 files changed, 76 insertions, 44 deletions
diff --git a/modules-available/serversetup-bwlp/templates/menu-assign-location.html b/modules-available/serversetup-bwlp/templates/menu-assign-location.html
new file mode 100644
index 00000000..077d137e
--- /dev/null
+++ b/modules-available/serversetup-bwlp/templates/menu-assign-location.html
@@ -0,0 +1,69 @@
+<h2>{{lang_assignMenuToLocation}}</h2>
+<h3>{{locationName}}</h3>
+
+<form method="post" action="?do=serversetup">
+
+ <input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="action" value="savelocation">
+ <input type="hidden" name="locationid" value="{{locationid}}">
+ <table class="table">
+ <thead>
+ <tr>
+ <th class="slx-smallcol"></th>
+ <th>{{lang_menuTitle}}</th>
+ <th class="slx-smallcol">{{lang_menuEntryOverride}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <div class="radio radio-inline">
+ <input type="radio" name="menuid" value="0" {{default_selected}}>
+ <label></label>
+ </div>
+ </td>
+ <td>
+ <i>{{lang_useDefaultMenu}}</i>
+ </td>
+ <td></td>
+ </tr>
+ {{#list}}
+ <tr>
+ <td>
+ <div class="radio radio-inline">
+ <input type="radio" name="menuid" value="{{menuid}}" {{menu_selected}}>
+ <label></label>
+ </div>
+ </td>
+ <td>
+ {{title}}
+ </td>
+ <td class="text-right">
+ <select name="defaultentryid-{{menuid}}" class="form-control">
+ <option value="0" style="font-style:italic">{{lang_useDefaultMenuEntry}}</option>
+ {{#entries}}
+ <option value="{{id}}" {{selected}}>{{title}}</option>
+ {{/entries}}
+ </select>
+ </td>
+ </tr>
+ {{/list}}
+ </tbody>
+ </table>
+
+ <div class="pull-right">
+ <button type="submit" class="btn btn-primary">
+ <span class="glyphicon glyphicon-floppy-disk"></span>
+ {{lang_save}}
+ </button>
+ </div>
+
+</form>
+
+<div class="clearfix"></div>
+
+<script>
+ function deleteMenu(menuid) {
+ $("#delete-menu-id").val(menuid);
+ }
+</script> \ No newline at end of file
diff --git a/modules-available/serversetup-bwlp/templates/menu-edit.html b/modules-available/serversetup-bwlp/templates/menu-edit.html
index 2141103f..21c6a30e 100644
--- a/modules-available/serversetup-bwlp/templates/menu-edit.html
+++ b/modules-available/serversetup-bwlp/templates/menu-edit.html
@@ -36,33 +36,18 @@
</div>
</div>
</div>
- <div class="row list-group-item">
- <div class="col-sm-3">
- <label for="panel-locations">{{lang_menuLocations}}</label>
- </div>
- <div class="col-sm-9">
- <select id="panel-locations" multiple name="locations[]">
- {{#locations}}
- <option value="{{locationid}}" {{disabled}} {{#selected}}selected{{/selected}}>{{locationpad}} {{locationname}}</option>
- {{/locations}}
- </select>
- {{#globalMenuWarning}}
- <span id="global-menu-warning" style="margin-left: 20px; color: red; display: none;">{{lang_globalMenuWarning}}</span>
- {{/globalMenuWarning}}
- </div>
- </div>
<div>
<table class="table">
<thead>
<tr>
- <th style="width: 10px"></th>
- <th style="width: 10px"></th>
- <th style="width: 10px">{{lang_entryId}}</th>
+ <th class="slx-smallcol"></th>
+ <th class="slx-smallcol"></th>
+ <th class="slx-smallcol">{{lang_entryId}}</th>
<th>{{lang_title}}</th>
- <th style="width: 150px">{{lang_hotkey}}</th>
- <th style="width: 200px">{{lang_password}}</th>
- <th style="width: 10px"><span class="glyphicon glyphicon-eye-close"></span></th>
- <th style="width: 10px"></th>
+ <th width="11%">{{lang_hotkey}}</th>
+ <th width="15%">{{lang_password}}</th>
+ <th class="slx-smallcol"><span class="glyphicon glyphicon-eye-close"></span></th>
+ <th class="slx-smallcol"></th>
</tr>
</thead>
<tbody id="table-body" style="overflow: auto;">
@@ -289,28 +274,6 @@
var spacerText = "{{lang_spacer}}";
document.addEventListener("DOMContentLoaded", function() {
- var locationSelect = $('#panel-locations');
- locationSelect.multiselect({numberDisplayed: 1});
- var globalMenuWarning = $('#global-menu-warning');
- if (globalMenuWarning.length) {
- var saveButton = $('#save-button');
- if (locationSelect.val() !== null) {
- saveButton.prop('disabled', false);
- globalMenuWarning.hide();
- } else {
- saveButton.prop('disabled', true);
- globalMenuWarning.show();
- }
- locationSelect.change(function () {
- if ($(this).val() !== null) {
- saveButton.prop('disabled', false);
- globalMenuWarning.hide();
- } else {
- saveButton.prop('disabled', true);
- globalMenuWarning.show();
- }
- });
- }
function reassignSortValues() {
var startValue = 1;