mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 21:51:14 -07:00
Add option group type to notifier and newsletter config modal
This commit is contained in:
parent
741f3d836a
commit
15c7212031
2 changed files with 14 additions and 6 deletions
|
@ -326,10 +326,14 @@
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<select class="form-control" id="${item['name']}" name="${item['name']}">
|
<select class="form-control" id="${item['name']}" name="${item['name']}">
|
||||||
% for key, value in sorted(item['select_options'].items()):
|
% for key, value in sorted(item['select_options'].items()):
|
||||||
% if key == item['value']:
|
% if isinstance(value, list):
|
||||||
<option value="${key}" selected>${value}</option>
|
<optgroup label="${key}">
|
||||||
|
% for option in sorted(value, key=lambda x: x['text'].lower()):
|
||||||
|
<option value="${option['value']}" ${'selected' if option['value'] == item['value'] else ''}>${option['text']}</option>
|
||||||
|
% endfor
|
||||||
|
</optgroup>
|
||||||
% else:
|
% else:
|
||||||
<option value="${key}">${value}</option>
|
<option value="${key}" ${'selected' if key == item['value'] else ''}>${value}</option>
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -113,10 +113,14 @@
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<select class="form-control" id="${item['name']}" name="${item['name']}">
|
<select class="form-control" id="${item['name']}" name="${item['name']}">
|
||||||
% for key, value in sorted(item['select_options'].items()):
|
% for key, value in sorted(item['select_options'].items()):
|
||||||
% if key == item['value']:
|
% if isinstance(value, list):
|
||||||
<option value="${key}" selected>${value}</option>
|
<optgroup label="${key}">
|
||||||
|
% for option in sorted(value, key=lambda x: x['text'].lower()):
|
||||||
|
<option value="${option['value']}" ${'selected' if option['value'] == item['value'] else ''}>${option['text']}</option>
|
||||||
|
% endfor
|
||||||
|
</optgroup>
|
||||||
% else:
|
% else:
|
||||||
<option value="${key}">${value}</option>
|
<option value="${key}" ${'selected' if key == item['value'] else ''}>${value}</option>
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue