From c8cf2b58bae632b6801337971323d37cf9f5a0f0 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 21 Oct 2015 03:00:37 +0000 Subject: Bug 1209599 - group general preferences by category --- .../en/default/account/prefs/settings.html.tmpl | 73 +++++++++++----------- 1 file changed, 37 insertions(+), 36 deletions(-) (limited to 'template/en/default/account/prefs') diff --git a/template/en/default/account/prefs/settings.html.tmpl b/template/en/default/account/prefs/settings.html.tmpl index 0147f95ef..b09d7a491 100644 --- a/template/en/default/account/prefs/settings.html.tmpl +++ b/template/en/default/account/prefs/settings.html.tmpl @@ -16,9 +16,9 @@ #%] [%# INTERFACE: - # setting_names: an array of strings - # settings: a hash of hashes, keyed by setting_name. - # Each hash contains: + # settings: a hash of hashes, keyed by category ame. + # Each hash value is a list of hashes containing: + # name - string (name of the setting) # is_enabled - boolean # default_value - string (global default for this setting) # value - string (user-defined preference) @@ -29,7 +29,9 @@ [% PROCESS "global/setting-descs.none.tmpl" %] -[% IF settings.size %] +[% SET category_names = settings.keys.sort %] + +[% IF category_names.size %] [% UNLESS has_settings_enabled %]

All user preferences have been disabled by the @@ -39,49 +41,48 @@ [% END %] - [% FOREACH name = setting_names %] - [% default_name = name _ '-isdefault' %] - [% default_val = settings.${name}.default_value %] - - + + + [% FOREACH setting = settings.$category %] + [% setting_name = setting._setting_name %] + [% default_name = setting_name _ '-isdefault' %] + [% default_val = setting.default_value %] + + - [% END %] + [% END %]
- [% setting_descs.$name OR name FILTER html %] + [% FOREACH category = category_names %] +
+ [% category FILTER html %] +
+ [% setting_descs.$setting_name OR setting_name FILTER html %] - [% IF settings.${name}.is_enabled %] - + - [% IF name == "api_key_only" %] - [% INCLUDE "mfa/protected.html.tmpl" %] [% END %] - [% ELSE %] - + + [% IF setting_name == "api_key_only" %] + [% INCLUDE "mfa/protected.html.tmpl" %] [% END %]
[% END %] -
-- cgit v1.2.3-24-g4f1b