tabs.html.tmpl 1.39 KB
Newer Older
1 2 3
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
  #
5 6
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
7 8 9 10 11 12 13 14 15 16
  #%]

[%# INTERFACE:
  # tabs: List of hashes. Must have at least one item.  Each hash has:
  #   name: string. Name of the tab.
  #   link: string. relative URL to the tab's resource on this installation.
  #   label: string. text displayed in the tab.
  # current_tab_name: string. name of the currently selected tab
  #%]

17 18
<div class="tabbed">
  <table class="tabs" cellspacing="0" cellpadding="10" border="0" width="100%">
19
    <tr>
20
      <td class="spacer">&nbsp;</td>
21 22 23

      [% FOREACH tab = tabs %]
        [% IF tab.name == current_tab_name %]
24 25
          <td id="tab_[% tab.name FILTER html %]" class="selected">
            [% tab.label FILTER html %]</td>
26
        [% ELSE %]
27
          <td id="tab_[% tab.name FILTER html %]" class="clickable_area"
28
              onClick="document.location='[% tab.link FILTER js FILTER html %]'">
29 30
            <a href="[% tab.link FILTER html %]">[% tab.label FILTER html %]</a>
          </td>
31 32 33
        [% END %]
      [% END %]

34 35 36 37 38 39 40 41 42
      <td class="spacer">&nbsp;</td>
    </tr>
  </table>

  <div class="tabbody">
    [% content %]
  </div>

</div>