<!-- $Id: list_menu.tt2 12734 2016-03-13 03:31:09Z sikeda $ -->

[%# Note: When is_listmaster is set, is_privileged_owner is also set. %]
[%~ SET owner_item = owner.item(user.email) %]
[%~ SET editor_item = editor.item(user.email) %]
[% IF is_listmaster || owner_item || is_editor || is_subscriber %]
  <li class="nolink role"><span>
  [%# Show picture and higher privilege of user on this list. %]
  [%~ IF is_subscriber && pictures_display && pictures_url ~%]
    <img class="Pictures" src="[% pictures_url %]"
      alt="[%|loc%]Your picture[%END%]" />
  [%~ ELSIF owner_item || is_editor || is_subscriber ~%]
    <i class="fa fa-user"></i>
  [%~ END %]
  [%~ IF is_listmaster ~%]
    <i class="fa fa-star" style="color: #669900;"
    title="[%|loc%]You are listmaster.[%END%]"></i>
  [%~ ELSIF owner_item ~%]
    <i class="fa fa-star" title="[%|loc%]You are owner.[%END%]"></i>
  [%~ ELSIF is_editor ~%]
    <i class="fa fa-star-o" title="[%|loc%]You are editor.[%END%]"></i>
  [%~ END %]

  [%# Show display name of user specific to this list. %]
  [%~ IF top_menu ~%]
    [%~ IF is_subscriber ~%]
      [% subscriber.gecos || user.gecos || user.email %]<br/>
    [%~ ELSIF owner_item ~%]
      [% owner_item.gecos || user.gecos || user.email %]<br/>
    [%~ ELSIF is_editor ~%]
      [% editor_item.gecos || user.gecos || user.email %]<br/>
    [%~ END %]
  [%~ END ~%]

  [%# Show roles on this list. %]
  [%~ IF is_listmaster ~%]
    [%|loc%]Listmaster[%END%]
    [%~ IF owner_item || is_editor || is_subscriber %][%|loc%], [%END%][% END %]
  [%~ END %]
  [%~ IF owner_item || is_editor %]
    [%~ IF is_privileged_owner ~%]
      [%|loc%]Privileged owner[%END%]
      [%~ IF is_subscriber %][%|loc%], [%END%][% END %]
    [%~ ELSIF is_owner ~%]
      [%|loc%]Owner[%END%]
      [%~ IF is_subscriber %][%|loc%], [%END%][% END %]
    [%~ ELSIF is_editor ~%]
      [%|loc%]Editor[%END%]
      [%~ IF is_subscriber %][%|loc%], [%END%][% END %]
    [%~ END %]
  [%~ END %]
  [%~ IF is_subscriber ~%]
    [%|loc%]Subscriber[%END%]
  [%~ END %]
  </span></li>
[%~ END %]

<li class="menu_title"><label><i class="fa fa-envelope-square fa-lg"></i> [%|loc%]List Options[%END%]</label></li>

[% PROCESS 'list_panel.tt2' %]

<li class="divider"></li>
<li></li>
[% IF action == 'info'%][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
<li class="[% class %]"><a href="[% 'info' | url_rel([list]) %]">[%|loc%]List Home[%END%]</a></li>

[% IF is_owner || is_editor %]
  [% IF action == 'admin' || action_type == 'admin' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
  <li class="[% class %]"><a href="[% 'admin' | url_rel([list]) %]">[%|loc%]Admin[%END%]</a></li>
[% END %]

[% IF is_owner ||  is_editor %]
  <li class="has-dropdown" ><a href="[% 'modindex' | url_rel([list]) %]">[%|loc%]Moderate[% END %]</a>
    <ul class="dropdown">
    [% IF is_editor %]
      [% IF action == 'modindex' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
      <li  class="[% class %]"><a href="[% 'modindex' | url_rel([list]) %]">[%|loc%]Message[%END%] ([% mod_message %]) </a></li>
      [% IF action == 'docindex' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
      <li class="[% class %]"><a href="[% 'docindex' | url_rel([list]) %]">[%|loc%]Document[%END%] ([% mod_total_shared %])</a></li>
    [% END %]
    [% IF is_owner %]
      [% IF action == 'subindex' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
      <li class="[% class %]"><a href="[% 'subindex' | url_rel([list]) %]">[%|loc%]Subscriptions[%END%] ([% mod_subscription %])</a></li>
      [% IF action == 'sigindex' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
      <li class="[% class %]"><a href="[% 'sigindex' | url_rel([list]) %]">[%|loc%]Unsubscriptions[%END%] ([% mod_signoff %])</a></li>
    [% END %]
    </ul>
  </li>
[% END %]

[% IF is_owner %]
  [% IF action == 'stats' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
  <li class="[% class %]"><a href="[% 'stats' | url_rel([list]) %]">[%|loc%]Statistics[%END%]</a></li>
[% END %]

[% IF (is_subscriber == '1') %]
    [% IF may_suboptions == '1' %]
      [% IF action == 'suboptions' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
      <li class="[% class %]"><a href="[% 'suboptions' | url_rel([list]) %]" >[%|loc%]Subscriber Options[%END%]</a></li>
    [% END %]
    [% IF may_signoff == '1' %] 
      [% IF action == 'signoff' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
      <li class="[% class %]"><a href="[% 'signoff' | url_rel([list]) %]" onclick="request_confirm_link('[% 'signoff' | url_rel([list]) %]', '[% | escape_quote %][%|loc(list)%]Do you really want to unsubscribe from list %1?[%END%][%END%]'); return false;">[%|loc%]Unsubscribe[%END%]</a></li>
    [% END %]
[% ELSE %]
  [% IF may_subscribe %]
    [% IF action == 'subrequest' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
    <li class="[% class %]"><a  href="[% 'subscribe' | url_rel([list]) %]" [% IF listconf.custom_attribute.size == 0 %]onclick="request_confirm_link('[% 'subscribe' | url_rel([list]) %]', '[% | escape_quote %][%|loc(list)%]Do you really want to subscribe to list %1?[%END%][%END%]'); return false;"[% END %]>[%|loc%]Subscribe[%END%]</a></li>
  [% END %]

  [% IF ! user.email %]
    [% IF action == 'signoff' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
    <li class="[% class %]"><a href="[% 'sigrequest' | url_rel([list]) %]">[%|loc%]Unsubscribe[%END%]</a></li>
  [% END %]

[% END %]

<li class="divider"></li>
<li></li>
[% IF is_archived %]
  [% IF user.email && arc_access || !user.email && arc_public_access %]
    [% IF action == 'arc' || action == 'arcsearch_form' || action == 'arcsearch' ||  action == 'arc_protect' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
    <li class="[% class %]"><a href="[% 'arc' | url_rel([list]) %]" >[%|loc%]Archive[%END%]</a></li>
  [% ELSE %]
    <li class="menuInactive2"><span>[%|loc%]Archive[%END%]</span></li>
  [% END %]
[% END %]

[% IF may_post %]
  [% IF action == 'compose_mail' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
  <li class="[% class %]"><a href="[% 'compose_mail' | url_rel([list]) %]" >[%|loc%]Post[%END%]</a></li>
[% ELSE %]
  <li class="menuInactive2"><span>[%|loc%]Post[%END%]</span></li>
[% END %]

[% IF 0 %][%# Change if you want to display menu item. %]
  [% IF action == 'rss_request' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
  <li class="[% class %]"><a href="[% 'rss_request' | url_rel([list]) %]" >[%|loc%]RSS[%END%]</a></li>
[% END %]

[% IF shared == 'exist' %]
  [% IF may_d_read %]
    [% IF action == 'd_read' || action == 'd_edit' || action == 'd_properties' %][% SET class = 'active' %][% ELSE %][% SET class = '' %][% END %]
    <li class="[% class %]"><a href="[% 'd_read' | url_rel([list]) %]" >[%|loc%]Shared documents[%END%]</a></li>
  [% ELSE %]
    <li class="menuInactive2"><span>[%|loc%]Shared documents[%END%]</span></li>
  [% END %]
[% END %]

[% TRY %]
[% PROCESS additional_list_menu_links.tt2 %]
[% CATCH %]
[% END %]
<!-- end list_menu.tt2 -->
