Sort newsletter libraries when rendered
This commit is contained in:
@@ -120,14 +120,14 @@
|
|||||||
% if isinstance(item['select_options'], dict):
|
% if isinstance(item['select_options'], dict):
|
||||||
% for section, options in item['select_options'].iteritems():
|
% for section, options in item['select_options'].iteritems():
|
||||||
<optgroup label="${section}">
|
<optgroup label="${section}">
|
||||||
% for option in options:
|
% for option in sorted(options, key=lambda x: x['text'].lower()):
|
||||||
<option value="${option['value']}">${option['text']}</option>
|
<option value="${option['value']}">${option['text']}</option>
|
||||||
% endfor
|
% endfor
|
||||||
</optgroup>
|
</optgroup>
|
||||||
% endfor
|
% endfor
|
||||||
% else:
|
% else:
|
||||||
<option value="border-all"></option>
|
<option value="border-all"></option>
|
||||||
% for option in item['select_options']:
|
% for option in sorted(item['select_options'], key=lambda x: x['text'].lower()):
|
||||||
<option value="${option['value']}">${option['text']}</option>
|
<option value="${option['value']}">${option['text']}</option>
|
||||||
% endfor
|
% endfor
|
||||||
% endif
|
% endif
|
||||||
@@ -263,14 +263,14 @@
|
|||||||
% if isinstance(item['select_options'], dict):
|
% if isinstance(item['select_options'], dict):
|
||||||
% for section, options in item['select_options'].iteritems():
|
% for section, options in item['select_options'].iteritems():
|
||||||
<optgroup label="${section}">
|
<optgroup label="${section}">
|
||||||
% for option in options:
|
% for option in sorted(options, key=lambda x: x['text'].lower()):
|
||||||
<option value="${option['value']}">${option['text']}</option>
|
<option value="${option['value']}">${option['text']}</option>
|
||||||
% endfor
|
% endfor
|
||||||
</optgroup>
|
</optgroup>
|
||||||
% endfor
|
% endfor
|
||||||
% else:
|
% else:
|
||||||
<option value="border-all"></option>
|
<option value="border-all"></option>
|
||||||
% for option in item['select_options']:
|
% for option in sorted(item['select_options'], key=lambda x: x['text'].lower()):
|
||||||
<option value="${option['value']}">${option['text']}</option>
|
<option value="${option['value']}">${option['text']}</option>
|
||||||
% endfor
|
% endfor
|
||||||
% endif
|
% endif
|
||||||
|
@@ -560,7 +560,7 @@ class RecentlyAdded(Newsletter):
|
|||||||
'show': 'TV Show Libraries',
|
'show': 'TV Show Libraries',
|
||||||
'artist': 'Music Libraries'}
|
'artist': 'Music Libraries'}
|
||||||
sections = {}
|
sections = {}
|
||||||
for s in sorted(self._get_sections(), key=lambda x: x['section_name']):
|
for s in self._get_sections():
|
||||||
if s['section_type'] != 'photo':
|
if s['section_type'] != 'photo':
|
||||||
library_type = library_types[s['section_type']]
|
library_type = library_types[s['section_type']]
|
||||||
group = sections.get(library_type, [])
|
group = sections.get(library_type, [])
|
||||||
|
Reference in New Issue
Block a user