<!-- $Id: modform.tt2 12726 2016-03-09 04:01:24Z sikeda $ -->
[%- IF msg.value.spam_status == 'spam' -%][% idname = 'idspam' %][% therissomespam = '1' %][% ELSE %][% idname = 'id' %][% therissomeham = '1' %][% END -%]
[%- IF topic_required -%]
  <button class="action" type="button" name="action_distribute" value="[%|loc%]Distribute[%END%]" data-reveal-id="topics[% line_count %]" data-tooltip aria-haspopup="true" title="[%|loc%]Distribute[%END%]"><i class="fa fa-share fa-lg"></i>[% IF mod_display_message %] [%|loc%]Distribute[%END%][% END %]</button>&nbsp;
  <div id="topics[% line_count %]"class="reveal-modal medium" data-reveal aria-labelledby="[%|loc%]Required topic[%END%]" aria-hidden="true" role="dialog">
   [%- IF request_topic -%]
     <h3> [%|loc%]This list is configured to require topic(s).[%END%]</h3>

    <form class="noborder" action="[% path_cgi %]" method="post" name="moderate_mail[% line_count %]" id="moderate_mail[% line_count %]">
    <fieldset>
      <input type="hidden" name="list" value="[% list %]" />
      <input type="hidden" name="[% idname %]" value="[% msg.key %]" />

     <br />[%|loc%]Please select one or more topic(s) that correspond to the messages you wish to distribute:[%END%] <br />
     [% FOREACH t = available_topics %]
       <input id="topic_[%t.name%].[%line_count%]" type="checkbox" name="topic_[%t.name%]" value="1" /> <label for="topic_[%t.name%].[%line_count%]">[% t.title %] </label><br />
     [%- END- %]
     <br />
   [%- END -%]
   <button type="submit" name="action_distribute" value="[%|loc%]Distribute[%END%]" onclick="return checkbox_check_topic(moderate_mail[% line_count %],'warningTopic[% line_count %]');"><i class="fa fa-share fa-lg"></i> [%|loc%]Distribute[%END%]</button>&nbsp;
   <div class="formError" style="display:none"  id="warningTopic[% line_count %]">
     <p class="alert-box alert">[%|loc%]You must select a topic[%END%]</p>
   </div>
    </fieldset>
    </form>
    <a class="close-reveal-modal" aria-label="Close">&#215;</a>
  </div>
[%- ELSE -%]
  <form class="noborder" action="[% path_cgi %]" method="post" name="moderate_mail[% line_count %]" id="moderate_mail[% line_count %]">
    <fieldset>
    <input type="hidden" name="list" value="[% list %]" />
    <input type="hidden" name="[% idname %]" value="[% msg.key %]" />
    <button class="action" type="submit" name="action_distribute" value="[%|loc%]Distribute[%END%]" data-tooltip aria-haspopup="true" title="[%|loc%]Distribute[%END%]"><i class="fa fa-share fa-lg"></i>[% IF mod_display_message %] [%|loc%]Distribute[%END%][% END %]</button>&nbsp;
    </fieldset>
  </form>
[%- END -%]
<button type="button" class="action" name="action_reject" value="[%|loc%]Reject[%END%]" data-reveal-id="reject[% line_count %]" data-tooltip aria-haspopup="true" title="[%|loc%]Reject[%END%]" /><i class="fa fa-trash fa-lg"></i>[% IF mod_display_message %] [%|loc%]Reject[%END%][% END %]</button>
<div id="reject[% line_count %]" class="reveal-modal medium" data-reveal aria-labelledby="[%|loc%]Rejecting message[%END%]" aria-hidden="true" role="dialog">
  <h3>[%|loc%]Rejecting message[%END%]</h3>
    <form class="noborder" action="[% path_cgi %]" method="post" name="reject_mail[% line_count %]" id="reject_mail[% line_count %]">
    <fieldset>
    <input type="hidden" name="list" value="[% list %]" />
    <input type="hidden" name="[% idname %]" value="[% msg.key %]" />
    <input type="hidden" name="from_modindex" value="from_modindex" />
  <label>[%|loc%]Choose notification:[%END%]</label>
  <select  name="message_template">
    <option  value="reject_quiet"[%- IF msg.value.spam_status == 'spam' -%] [% one_template_is_selected = '1' %]selected="selected"[% END %]>[%|loc %]No notification[%END%]</option>
    [% FOREACH file = available_files %]
        <option  value="reject_[%  file  %]" [% IF file == default_reject_template && msg.value.spam_status != 'spam' -%][% one_template_is_selected = '1' %]selected="selected" [%END%] > [%  file  %]</option> 
    [%- END- %]
    <option  value="reject" [% IF one_template_is_selected != '1' %] selected="selected"[% END %]>[%|loc %]Server default rejection message[%END%]</option>
  </select>
  [% IF conf.reporting_spam_script_path %]
     [%- IF msg.value.spam_status != 'spam' -%]
        <br /> <input id="signal_spam[% line_count %]" type=checkbox name="signal_spam" /><label for="signal_spam[% line_count %]">[%|loc %]Report message as undetected spam [%END%]</label>
     [% END %] 
  [% END %] 
  <br /> <input id="blacklist[% line_count %]" type=checkbox name="blacklist" /><label for="blacklist[% line_count %]">[%|loc %]Add sender to blacklist[%END%]</label>

  <div class="formError" style="display:none"  id="warningSpam[% line_count %]">
   <p class="alert-box info text-left"><input type="checkbox" name="iConfirm" value="1" /> [%|loc%]You should rejet spams quietly because the sender of a spam is often spoofed, if you really want to send this notification, please confirm [%END%]</p>
   
  </div>
  <br />
  [%- IF msg.value.spam_status != 'spam' -%]
    <button name="action_reject" value="[%|loc%]Reject[%END%]" title="[%|loc%]Reject[%END%]"><i class="fa fa-trash fa-lg"></i> [%|loc%]Reject[%END%]</button>
  [% ELSE %]
    <button type="submit" name="action_reject" value="[%|loc%]Reject[%END%]" onclick="return check_reject_spam(reject_mail[% line_count %],'warningSpam[% line_count %]')" title="[%|loc%]Reject[%END%]"><i class="fa fa-trash fa-lg"></i> [%|loc%]Reject[%END%]</button>
  [% END %]
    </fieldset>
    </form>
    <a class="close-reveal-modal" aria-label="Close">&#215;</a>
  </div>
[% IF !mod_display_message %]
&nbsp;<button type="button" class="action" name="action_distribute" value="[%|loc%]view[%END%]" data-tooltip aria-haspopup="true" data-reveal-id="mainviewmod[% msg.key %]" onclick="jQuery('#viewmod[% msg.key %]').load('[% 'ajax/viewmod' | url_rel([list,msg.key]) %]')" title="[%|loc%]view[%END%]"><i class="fa fa-eye fa-lg"></i></button>
[% END %]

[% IF is_owner %]
    [% IF msg.value.is_subscriber %]
    &nbsp;
    [% ELSE %]
    <form class="noborder" 
     action="[% path_cgi %]" method="post"
     name="add_frommod[% line_count %]"><fieldset>
      <input type="hidden" name="list" value="[% list %]" />
      <input type="hidden" name="id" value="[% msg.key %]" />
      <input type="hidden" name="from_modindex" value="from_modindex" />
      <button class="action" type="submit" name="action_add_frommod"
       onclick="return request_confirm('[%|loc(msg.value.from)%]Dou you really want to add %1?[%END%]');"
       value="[%|loc%]Add subscribers[%END%]" data-tooltip aria-haspopup="true" title="[%|loc%]Add subscribers[%END%]"><i class="fa fa-user-plus fa-lg"></i>[% IF mod_display_message %] [%|loc%]Add subscribers[%END%][% END %]</button>
    </form>
    [% END %]
[% END %]
<!-- end modform.tt2 -->
