1<!-- lists.tt2 -->
2
3[% IF topic ~%]
4    <h3>[% topic | optdesc('listtopic') %]</h3>
5[%~ ELSIF subtitle ~%]
6    <h3>[% subtitle %]</h3>
7[%~ END %]
8
9[% letters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','others' ] %]
10[% all_letters = [] %]
11
12[% IF action == 'search_list' %]
13    [%~ PROCESS search_list_request.tt2 %]
14    [% IF occurrence ~%]
15        <p>[%|loc(occurrence)%]%1 occurrence(s) found[%END%]</p>
16    [%~ END %]
17[%~ ELSIF action == 'search_user' ~%]
18    <p>[%|loc(email)%]<strong>%1</strong> is subscribed to the following mailing lists[%END%]</p>
19[%~ END %]
20
21[% IF which && which.size %]
22    [% FOREACH letter IN letters %]
23        [% IF orderedlist.$letter.0 %]
24            <article id="[% letter %]" >
25                <h4 class="letter">
26                    [% IF letter == "others" %]
27                        [%|loc%]Others[%END%]
28                    [% ELSE %]
29                        [% letter %]
30                    [% END %]
31                </h4>
32                <ul class="listenum">
33                    [% FOREACH listname IN  orderedlist.$letter %]
34                        <li class="listenum">
35                            <a href="[% 'info' | url_rel([listname]) %]">
36                                [%|obfuscate(conf.spam_protection) %][% listname %]@[% domain %][% END %]
37                                [% IF which.$listname.is_owner || which.$listname.is_editor || which.$listname.is_subscriber ~%]
38                                    <span class="highlighted">(
39                                        [%~ IF which.$listname.is_owner ~%]
40                                            [%|loc%]Owner[%END ~%]
41                                            [% IF which.$listname.is_subscriber %]
42                                                [%|loc%], [%END%]
43                                            [%END ~%]
44                                        [% ELSIF which.$listname.is_editor ~%]
45                                            [%|loc%]Moderator[%END ~%]
46                                            [% IF which.$listname.is_subscriber %]
47                                                [%|loc%], [%END%]
48                                            [%END ~%]
49                                        [% END ~%]
50                                        [% IF which.$listname.is_subscriber %]
51                                            [%|loc%]Subscriber[%END%]
52                                        [%END ~%]
53                                    )</span>
54                                [% END %]
55                            </a>
56                            <p class="listenum" >[% which.$listname.subject %]</p>
57                        </li>
58                    [% END %]
59                </ul>
60                <span class="divider"></span>
61            </article>
62            [% all_letters.push(letter) %]
63        [% END %]
64    [% END %]
65
66    <br />
67
68    [% IF action == 'which' %]
69        [% IF ! which %]
70            &nbsp;&nbsp;<span class="color_dark">[%|loc(user.email)%]No subscriptions with address <strong>%1</strong>![%END%]</span>
71            <br />
72        [% END %]
73    [% END %]
74[% ELSE %]
75    <p>[%|loc%]No mailing list available.[%END%]</p>
76[% END %]
77
78[% IF all_letters.size %]
79    <script>
80    <!--
81    $(
82        '[% 'a[href="#' _ all_letters.join( '"], a[href="#' ) _ '"]' %]'
83    ).on('click', function(e) {
84        e.stopPropagation();
85        e.preventDefault();
86        id = $(this).attr('href').substr(1);
87        $( '[% '#' _ all_letters.join(', #') %]' ).hide();
88        $('#' + id).show();
89        return false;
90    });
91    //-->
92    </script>
93[% END %]
94<!-- end lists.tt2 -->
95