<!-- $Id: subscriber_table.tt2 12726 2016-03-09 04:01:24Z sikeda $ -->
[% IF total != 0 %]
    <table  class="listOfItems responsive">
    <caption>[%|loc%]List members[%END%]</caption>
      <tbody>
        <tr>
	[% SET colspan = 0 %]
	[% IF is_owner %]
	   [% SET colspan = colspan + 1 %]
	   <th><a href="#" onclick="toggle_selection(document.myform.email);return false;" title="[%|loc%]Toggle Selection[%END%]"><i class="fa fa-check-square-o"></i> </a></th>
	[% END %]

	[% SET colspan = colspan + 3 %]
        [% IF sortby == 'email' %]
  	    <th colspan="2" class="sortby">
	    [%|loc%]Email[%END%]
	[% ELSE %]
	    <th colspan="2">	    
	    <a href="[% 'review' | url_rel([list,1,size,'email']) %]">[%|loc%]Email[%END%]</a>
	[% END %]
	</th>
        [% IF sortby == 'domain' %]
  	    <th class="sortby">
	    [%|loc%]Domain[%END%]
	[% ELSE %]
	    <th>
               <a href="[% 'review' | url_rel([list,1,size,'domain']) %]">[%|loc%]Domain[%END%]</a>
	[% END %]
	</th>
	[% IF pictures_display %]
	    [% SET colspan = colspan + 1 %]
  	    <th>	    
  	    [%|loc%]Picture[%END%]
	    </th>
  	[% END %]

	[% SET colspan = colspan + 1 %]
	[% IF sortby == 'name' %]
	<th class="sortby">
	  [%|loc%]Name[%END%]
	[% ELSE %]
	<th>
          <a href="[% 'review' | url_rel([list,1,size,'name']) %]">[%|loc%]Name[%END%]</a>
	[% END %] 
	</th>
        [% IF is_owner %]
	  [% SET colspan = colspan + 4 %]
          <th>
	  [%|loc%]Reception[%END%]
	  </th>
            [% IF sortby == 'sources' %]
  	      <th class="sortby">
	      [%|loc%]Sources[%END%]
	    [% ELSE %]
	      <th>
	      <a href="[% 'review' | url_rel([list,1,size,'sources']) %]" >[%|loc%]Sources[%END%]</a>
	    [% END %]
	    </th>
	  [% IF sortby == 'date' %]
  	    <th class="sortby">
	    [%|loc%]Sub date[%END%]
	  [% ELSE %]
	    <th>
            <a href="[% 'review' | url_rel([list,1,size,'date']) %]" >[%|loc%]Sub date[%END%]</a>
	  [% END %]
          </th>
	  <th>[%|loc%]Last update[%END%]</th>
	  [% IF additional_fields %]
	    [% SET colspan = colspan + 1 %]
	    <th>[% additional_fields %]</th>
	  [% END %]
          [% FOREACH ca_k IN list_conf.custom_attribute %]
	    [% SET colspan = colspan + 1 %]
	    <th>[% ca_k.name %]</th>
	  [% END %]
        [% END %]
      </tr>
      [% FOREACH u = thosesubscribers %]
	[% IF dark == '1' %]
	  <tr>
	[% ELSE %]
          <tr class="color0">
	[% END %]

	 [% IF is_owner %]
	    <td>
	        <input type="checkbox" name="email" value="[% u.escaped_email %]" />
	    </td>
 	 [% END %]
	 [% IF u.bounce %]
	   <td colspan="2" class="text-left">
	 
	     [% IF is_owner %]
	       <a href="[% 'editsubscriber' | url_rel([list,u.escaped_email,'review']) %]">[% u.email %]</a>
	     [% ELSE %]
 	       [% u.email %]
 	     [% END %]
	   </td>
	 [% IF is_owner %]
           <td class="color7"><strong>[%|loc%]bouncing[%END%]</strong>
	   </td>
	 [% END %]

	 [% ELSE %]
	   <td colspan="3" class="text-left">
	     [% IF is_owner %]
	       <a href="[% 'editsubscriber' | url_rel([list,u.escaped_email,'review']) %]">[% u.email %]</a>
	     [% ELSE %]
	       [% u.email %]
	     [% END %]
	   </td>
	 [% END %]

  	  [% IF pictures_display %]
  	    [% IF u.pictures_url %]
  	      <td>
  	      <a href="[%u.pictures_url%]" title="[%|loc%]Open in a new window[%END%]" target="pictures"><img class="Pictures" src="[%u.pictures_url%]" alt="[%|loc(u.email)%]%1's picture[%END%]" /></a>   
  	      </td>
  	    [% ELSE %]
  	      <td>
  	      </td>
  	    [% END %]
  	  [% END %]
	  <td>
             <span>
	        [% u.gecos %]&nbsp;
	     </span>
          </td>
	  [% IF is_owner %]
  	    <td>
  	      [%|optdesc('reception')%][% u.reception %][%END%]
	    </td>
            <td>
            [% IF u.subscribed %]
              [% IF u.included %]
                 [%|loc%]subscribed[%END%]<br />[% u.sources %]
              [% ELSE %]
                 [%|loc%]subscribed[%END%]
              [% END %]
            [% ELSE %]
              [% u.sources %]
            [% END %]   
            </td>
	    <td>
	      [% u.date %]
	    </td>
	    <td>
	      [% u.update_date %]
	    </td>
    	  [% IF additional_fields %]
	     <td>
	      [% u.additional %]
	     </td>
	  [% END %]
	  [% FOREACH ca_k IN list_conf.custom_attribute %]<td>[% SET id = ca_k.id %][% u.custom_attribute.$id.value %]</td>[% END %]
       	  [% END %]
        </tr>

        [% IF dark == '1' %]
	  [% SET dark = 0 %]
	[% ELSE %]
	  [% SET dark = 1 %]
	[% END %]
      [% END %]
        </tbody>
      </table>
      [% ELSE %]
      <p class="small-12 medium-8 medium-centered columns alert-box info text-center">[%|loc%]List has no subscribers[%END%]</p>
    [% END %]
<!-- End subscribers_table.tt2 -->
