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 +++++++++++----------- template/en/default/admin/settings/edit.html.tmpl | 4 ++ 2 files changed, 41 insertions(+), 36 deletions(-) (limited to 'template') 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 %] -
diff --git a/template/en/default/admin/settings/edit.html.tmpl b/template/en/default/admin/settings/edit.html.tmpl index 7f95f883e..eeb6c3203 100644 --- a/template/en/default/admin/settings/edit.html.tmpl +++ b/template/en/default/admin/settings/edit.html.tmpl @@ -51,6 +51,7 @@ page, and the Default Value will automatically apply to everyone. + @@ -61,6 +62,9 @@ page, and the Default Value will automatically apply to everyone. +
Preference TextCategory Default Value Enabled
[% setting_descs.$name OR name FILTER html %] + [% settings.$name.category FILTER html %] +