1[%# This Source Code Form is subject to the terms of the Mozilla Public
2  # License, v. 2.0. If a copy of the MPL was not distributed with this
3  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4  #
5  # This Source Code Form is "Incompatible With Secondary Licenses", as
6  # defined by the Mozilla Public License, v. 2.0.
7  #%]
8
9[%# INTERFACE:
10  # setting_names: an array of strings
11  # settings:      a hash of hashes, keyed by setting_name.
12  #                Each hash contains:
13  #                 is_enabled    - boolean
14  #                 default_value - string (global default for this setting)
15  #                 value         - string (user-defined preference)
16  #                 is_default    - boolean (true if user has no preference)
17  # has_settings_enabled : boolean; is true if there is at least one user pref
18  #                        enabled by the maintainer.
19  #%]
20
21[% PROCESS "global/setting-descs.none.tmpl" %]
22
23[% IF settings.size %]
24  [% UNLESS has_settings_enabled %]
25    <p class="criticalmessages">
26      全てのユーザ設定は
27      <a href="mailto:[% Param("maintainer") %]">管理者</a>
28      によって無効にされています。ですので、設定変更はできません。
29    </p>
30  [% END %]
31
32  <table id="user_prefs">
33    [% FOREACH name = setting_names %]
34      [% default_name = name _ '-isdefault' %]
35      [% default_val = settings.${name}.default_value %]
36      <tr>
37        <td class="right">
38          [% setting_descs.$name OR name FILTER html %]
39        </td>
40        <td>
41          [% IF settings.${name}.is_enabled %]
42            <select name="[% name FILTER html %]" id="[% name FILTER html %]">
43              <option value="[% default_name FILTER html %]"
44                [% ' selected="selected"' IF settings.${name}.is_default %]>
45                サイト既定 ([% setting_descs.${default_val} OR default_val FILTER html %])
46              </option>
47              [% FOREACH x = settings.${name}.legal_values %]
48                <option value="[% x FILTER html %]"
49                  [% ' selected="selected"'
50                    IF x == settings.${name}.value
51                    AND NOT settings.${name}.is_default %]>
52                  [% setting_descs.${x} OR x FILTER html %]
53                </option>
54              [% END %]
55            </select>
56          [% ELSE %]
57            <select name="[% name FILTER html %]" id="[% name FILTER html %]" disabled="disabled">
58              <option value="[% default_name FILTER html %]">
59                サイト既定 ([% setting_descs.${default_val} OR default_val FILTER html %])
60              </option>
61            </select>
62          [% END %]
63        </td>
64      </tr>
65    [% END %]
66  </table>
67[% END %]
68<br>
69