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  # tabs: List of hashes. May not be empty. Each hash has three members:
11  #   name: string. Name of the tab (used internally.)
12  #   description: string. Description of the tab (used in tab title).
13  #   saveable: boolean. True if tab has a form which can be submitted.
14  #               True if user is not receiving self-generated mail.
15  # Note: For each tab name, a template "prefs/${tab.name}.tmpl" must exist,
16  # and its interface must be fulfilled.
17  # current_tab: A direct reference to one of the hashes in the tabs list.
18  #              This tab will be displayed.
19  # changes_saved: boolean/string. True if the CGI processed form data before
20  #                displaying anything, and can contain an optional custom
21  #                message if required (which Perl still evaluates as True).
22  # dont_show_button: boolean. Prevent the display of the "Submit Changes" button.
23  #%]
24
25[% filtered_login = user.login FILTER html %]
26[% PROCESS global/header.html.tmpl
27   title = "Persönliche Einstellungen"
28   subheader = filtered_login
29   style_urls = ['skins/standard/admin.css']
30   javascript_urls = ['js/util.js', 'js/field.js']
31   doc_section = "userpreferences.html"
32   yui = ['autocomplete']
33 %]
34
35[% tabs = [{ name => "settings", label => "Allgemeine Einstellungen",
36              link => "userprefs.cgi?tab=settings", saveable => "1" },
37            { name => "email", label => "E-Mail-Einstellungen",
38              link => "userprefs.cgi?tab=email", saveable => "1" },
39            { name => "saved-searches", label => "Gespeicherte Suchen",
40              link => "userprefs.cgi?tab=saved-searches", saveable => "1" },
41            { name => "account", label => "Benutzerkonto",
42              link => "userprefs.cgi?tab=account", saveable => "1" },
43            { name => "permissions", label => "Systemberechtigungen",
44              link => "userprefs.cgi?tab=permissions", saveable => "0" } ] %]
45
46[% Hook.process('tabs') %]
47
48[% FOREACH tab IN tabs %]
49  [% IF tab.name == current_tab_name %]
50    [% current_tab = tab %]
51    [% LAST %]
52  [% END %]
53[% END %]
54
55[% WRAPPER global/tabs.html.tmpl
56   tabs        = tabs
57   current_tab = current_tab
58%]
59
60[% IF changes_saved %]
61  <div id="message">
62    [% current_tab.label %]: Ihre Änderungen sind gesichert.
63
64    [% IF email_changes_saved %]
65      <p>
66        Eine E-Mail wurde an sowohl die alte als auch die neue E-Mail-Adresse
67        versandt, mit der Bitte, die Änderung zu bestätigen.
68        Bitte folgen Sie den darin enthaltenen Anleitungen.
69      </p>
70    [% END %]
71  </div>
72[% END %]
73
74<h3>[% current_tab.label %]</h3>
75
76[% IF current_tab.saveable %]
77  <form name="userprefsform" method="post" action="userprefs.cgi">
78    <input type="hidden" name="tab" value="[% current_tab.name %]">
79    <input type="hidden" name="token" value="[% token FILTER html %]">
80[% END %]
81
82[% PROCESS "account/prefs/${current_tab.name}.html.tmpl"
83                                     IF current_tab.name.defined %]
84
85[% IF current_tab.saveable %]
86    <input type="hidden" name="dosave" value="1">
87
88    [% UNLESS dont_show_button %]
89      <table>
90        <tr>
91          <td width="150">&nbsp;</td>
92          <td>
93            <input type="submit" id="update" value="Änderungen vornehmen">
94          </td>
95        </tr>
96      </table>
97    [% END %]
98  </form>
99[% END %]
100
101[% END %]
102
103[% PROCESS global/footer.html.tmpl %]
104