diff options
author | Udo Walter | 2018-11-09 02:46:50 +0100 |
---|---|---|
committer | Udo Walter | 2018-11-09 02:46:50 +0100 |
commit | 093d16682743eb1502819bb6c127afeac65d4ede (patch) | |
tree | 6df837422263b4bc88dbd31ab06db6b45360fddd /modules-available/serversetup-bwlp/templates | |
parent | [serversetup-bwlp] bootmenu-edit UI improvements (diff) | |
download | slx-admin-093d16682743eb1502819bb6c127afeac65d4ede.tar.gz slx-admin-093d16682743eb1502819bb6c127afeac65d4ede.tar.xz slx-admin-093d16682743eb1502819bb6c127afeac65d4ede.zip |
[serversetup-bwlp] add location selection to menu edit + ui improvements
- add multiselect to select the locations
- add architecture information to the bootentry select modal
- add glyphicon to the hide entry column header
- default menu is now selected in the menu list
- fixed error when creating a menu (isdefault has no default value)
and when creating a menu without bootentries
Diffstat (limited to 'modules-available/serversetup-bwlp/templates')
-rw-r--r-- | modules-available/serversetup-bwlp/templates/menu-edit.html | 124 | ||||
-rw-r--r-- | modules-available/serversetup-bwlp/templates/menu-list.html | 11 |
2 files changed, 106 insertions, 29 deletions
diff --git a/modules-available/serversetup-bwlp/templates/menu-edit.html b/modules-available/serversetup-bwlp/templates/menu-edit.html index e695ef20..09814da9 100644 --- a/modules-available/serversetup-bwlp/templates/menu-edit.html +++ b/modules-available/serversetup-bwlp/templates/menu-edit.html @@ -38,12 +38,17 @@ </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"> - <div class="checkbox"> - <input name="defmenu" id="panel-defmenu" type="checkbox" {{#isdefault}}checked disabled{{/isdefault}} {{disabled}}> - <label for="panel-defmenu">{{lang_defaultMenu}}</label> - </div> + <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> @@ -56,7 +61,7 @@ <th>{{lang_title}}</th> <th style="width: 150px">{{lang_hotkey}}</th> <th style="width: 200px">{{lang_password}}</th> - <th style="width: 10px"></th> + <th style="width: 10px"><span class="glyphicon glyphicon-eye-close"></span></th> <th style="width: 10px"></th> </tr> </thead> @@ -124,7 +129,7 @@ </div> <div class="text-right"> <a href="?do=serversetup&show=menu" type="button" class="btn btn-default">{{lang_cancel}}</a> - <button type="submit" class="btn btn-primary" {{disabled}}> + <button id="save-button" type="submit" class="btn btn-primary" {{disabled}}> <span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}} </button> @@ -154,29 +159,69 @@ </div> {{#data}} {{#script}} - <div class="form-group"> - <label for="{{entryid}}-script">{{lang_scriptContent}}</label> - <pre id="{{entryid}}-script">{{.}}</pre> - </div> + <div class="form-group"> + <label for="{{entryid}}-script">{{lang_scriptContent}}</label> + <pre id="{{entryid}}-script">{{.}}</pre> + </div> + {{/script}} + {{^script}} + <div class="form-group"> + <label for="{{entryid}}-script">{{lang_archSelector}}</label> + <pre id="{{entryid}}-arch">{{arch}}</pre> + </div> + {{#archAgnostic}} + <div class="form-group"> + <label for="{{entryid}}-executable">{{lang_imageToLoad}}</label> + <pre id="{{entryid}}-executable">{{executable}}</pre> + </div> + <div class="form-group"> + <label for="{{entryid}}-initRd">{{lang_initRd}}</label> + <pre id="{{entryid}}-initRd">{{initRd}}</pre> + </div> + <div class="form-group"> + <label for="{{entryid}}-commandLine">{{lang_commandLine}}</label> + <pre id="{{entryid}}-commandLine" >{{commandLine}}</pre> + </div> + {{/archAgnostic}} + {{#PCBIOS}} + <div class="panel panel-default"> + <div class="panel-heading">PCBIOS</div> + <div class="panel-body"> + <div class="form-group"> + <label for="{{entryid}}-executable">{{lang_imageToLoad}}</label> + <pre id="{{entryid}}-executable">{{executable}}</pre> + </div> + <div class="form-group"> + <label for="{{entryid}}-initRd">{{lang_initRd}}</label> + <pre id="{{entryid}}-initRd">{{initRd}}</pre> + </div> + <div class="form-group"> + <label for="{{entryid}}-commandLine">{{lang_commandLine}}</label> + <pre id="{{entryid}}-commandLine" >{{commandLine}}</pre> + </div> + </div> + </div> + {{/PCBIOS}} + {{#EFI}} + <div class="panel panel-default"> + <div class="panel-heading">EFI</div> + <div class="panel-body"> + <div class="form-group"> + <label for="{{entryid}}-executable">{{lang_imageToLoad}}</label> + <pre id="{{entryid}}-executable">{{executable}}</pre> + </div> + <div class="form-group"> + <label for="{{entryid}}-initRd">{{lang_initRd}}</label> + <pre id="{{entryid}}-initRd">{{initRd}}</pre> + </div> + <div class="form-group"> + <label for="{{entryid}}-commandLine">{{lang_commandLine}}</label> + <pre id="{{entryid}}-commandLine" >{{commandLine}}</pre> + </div> + </div> + </div> + {{/EFI}} {{/script}} - {{#executable}} - <div class="form-group"> - <label for="{{entryid}}-executable">{{lang_imageToLoad}}</label> - <pre id="{{entryid}}-executable">{{.}}</pre> - </div> - {{/executable}} - {{#initRd}} - <div class="form-group"> - <label for="{{entryid}}-initRd">{{lang_initRd}}</label> - <pre id="{{entryid}}-initRd">{{.}}</pre> - </div> - {{/initRd}} - {{#commandLine}} - <div class="form-group"> - <label for="{{entryid}}-commandLine">{{lang_commandLine}}</label> - <pre id="{{entryid}}-commandLine" >{{.}}</pre> - </div> - {{/commandLine}} {{/data}} </div> {{/entrylist}} @@ -244,6 +289,29 @@ 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; $('.sort-val').each(function(index, element) { diff --git a/modules-available/serversetup-bwlp/templates/menu-list.html b/modules-available/serversetup-bwlp/templates/menu-list.html index 1f190bb7..5d8ee184 100644 --- a/modules-available/serversetup-bwlp/templates/menu-list.html +++ b/modules-available/serversetup-bwlp/templates/menu-list.html @@ -20,13 +20,22 @@ {{locationCount}} </td> <td align="center"> + {{^isdefault}} + <form method="post" action="?do=serversetup" {{^showSetDefault}}style="display: none;"{{/showSetDefault}}> + <input type="hidden" name="token" value="{{token}}"> + <input type="hidden" name="menuid" value="{{menuid}}"> + <button type="submit" name="action" value="setDefaultMenu" class="btn btn-xs btn-info"> + <span class="glyphicon glyphicon-ok"></span> + </button> + </form> + {{/isdefault}} {{#isdefault}} <span class="glyphicon glyphicon-ok"></span> {{/isdefault}} </td> <td align="center"> {{#allowEdit}} - <a href="?do=serversetup&show=editmenu&id={{menuid}}" class="btn btn-xs btn-default"> + <a href="?do=serversetup&show=editmenu&id={{menuid}}" class="btn btn-xs btn-primary"> <span class="glyphicon glyphicon-edit"></span> </a> {{/allowEdit}} |