<!-- $Id: d_read.tt2 12733 2016-03-12 22:44:21Z sikeda $ -->
<h2>[%|loc%]Shared documents[%END%] <a  href="[% 'nomenu/help/shared' | url_rel %]" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help"><i class="fa fa-question-circle" title="[%|loc%]Help[%END%]"></i></a></h2>

[% IF file %]
  [% INSERT $file IF file %]
[% ELSE %]

<menu class="shared">
[% IF path %]
<li><span class="search_form"> <a class="actionMenuLinks" href="[% 'd_read' | url_rel([list,escaped_father]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]Up to higher level directory[%END%]"><i class="fa fa-folder-open fa-lg"><i class="fa fa-level-up fa-lg"></i></i></a></span></li>
[% END %]

[% IF expert_page %]
    <li><a class="actionMenuLinks" href="[% 'd_read' | url_rel([list,escaped_path],{type=>'directory',previous_action=>'d_read',show_user_page=>'1'}) %]"><i class="fa fa-user "></i> [%|loc%]User mode[%END%]</a></li>
    <li><a class="actionMenuLinksCurrentPage" href="[% 'd_read' | url_rel([list,escaped_path],{type=>'directory',previous_action=>'d_read',show_expert_page=>'1'}) %]"><i class="fa fa-cogs"></i> [%|loc%]Expert mode[%END%]</a></li>
[% ELSE %] 
    [% IF has_dir_rights %]
    <li><a class="actionMenuLinksCurrentPage" href="[% 'd_read' | url_rel([list,escaped_path],{type=>'directory',previous_action=>'d_read',show_user_page=>'1'}) %]"><i class="fa fa-user"></i> [%|loc%]User mode[%END%]</a></li>
    <li><a class="actionMenuLinks" href="[% 'd_read' | url_rel([list,escaped_path],{type=>'directory',previous_action=>'d_read',show_expert_page=>'1'}) %]"><i class="fa fa-cogs"></i> [%|loc%]Expert mode[%END%]</a></li>
    [% END %]
[% END %]  
</menu>
[% IF path %]  
    <h3>[%|loc%]Listing of folder[%END%] [% visible_path %] </h3> 
    <menu class="shared">
    [% IF expert_page %]
    <span class="search_form">
      [% IF may_edit %]
        <a class="actionMenuLinks" href="[% 'd_delete' | url_rel([list,escaped_path]) %]" onclick="request_confirm_link('[% 'd_delete' | url_rel([list,escaped_path]) %]', '[% | escape_quote %][%|loc(visible_path)%]Do you really want to delete %1?[%END%][%END%]'); return false;"><i class="fa fa-trash"></i> [%|loc%]delete[%END%]</a> 
	<a class="actionMenuLinks"  href="[% 'd_properties' | url_rel([list,escaped_path]) %]"><i class="fa fa-cog"></i> [%|loc%]properties[%END%]</a>
      [% END %]
      [% IF may_control %]      
        <a  class="actionMenuLinks" href="[% 'd_control' | url_rel([list,escaped_path]) %]"><i class="fa fa-lock"></i> [%|loc%]access[%END%]</a>
      [% END %]      
    </span>
    [% END %]
    </menu>
    <p>
    [%|loc(doc_owner)%]Owner: %1[%END%] <br />
    [%|loc(doc_date)%]Last update: %1[%END%] <br /> 
    [% IF doc_title %]
    [%|loc(doc_title)%]Description: %1[%END%] <br /><br />
    [% END %]
    </p>
  [% ELSE %]
  <h3>[%|loc%]Listing of root folder[%END%]</h3>
  [% END %]   

  [% IF empty %]
    <p class="small-8 small-centered columns alert-box info text-center">[%|loc%]Empty folder[%END%]</p>
  [% ELSE %]
  <table  class="responsive listOfItems">
  <caption>[%|loc%]Listing of folder[%END%] [% visible_path %]</caption>
  <tr>
  
  [% IF order_by != 'order_by_doc' %]  
	<th><a href="[% 'd_read' | url_rel([list,escaped_path],{order=>'order_by_doc'}) %]">[%|loc%]Document[%END%]</a> </th>
  [% ELSE %]  
        <th class="sortby">[%|loc%]Document[%END%]</th>
  [% END %]
  [% IF order_by != 'order_by_author' %]  
	<th><a href="[% 'd_read' | url_rel([list,escaped_path],{order=>'order_by_author'}) %]">[%|loc%]Author[%END%]</a> </th>
  [% ELSE %]  	
        <th class="sortby">[%|loc%]Author[%END%]</span></td>
  [% END %]
  [% IF order_by != 'order_by_size' %] 
	<th><a href="[% 'd_read' | url_rel([list,escaped_path],{order=>'order_by_size'}) %]">[%|loc%]Size (Kb)[%END%]</a> </th>
  [% ELSE %]  
        <th class="sortby">[%|loc%]Size (Kb)[%END%]</th> 
  [% END %]
  [% IF order_by != 'order_by_date' %]
	<th><a href="[% 'd_read' | url_rel([list,escaped_path],{order=>'order_by_date'}) %]">[%|loc%]Last update[%END%]</a> </th>
  [% ELSE %]  
        <th class="sortby">[%|loc%]Last update[%END%]</span></td>
  [% END %]

  [% IF expert_page %]
   <th>[%|loc%]Actions[%END%]</th> 
  [% END %]
  </tr>
         
    [% IF sort_subdirs %]
      [% FOREACH s = sort_subdirs %]
        <tr class="color0">
	[% IF escaped_path %]
	  <td class="review_cels_mail"> <a href="[% 'd_read' | url_rel([list,escaped_path,s.escaped_doc]) %]"> 
	[% ELSE %]
	  <td class="review_cels_mail"> <a href="[% 'd_read' | url_rel([list,s.escaped_doc]) %]"> 
	[% END %]
	<img src="[% s.icon %]" alt="[% s.escaped_title %]" /> [% s.doc %]</a></td>
	<td class="review_cels">
	[% IF s.author_known %] 
	  [% s.author | mailto(s.author) | obfuscate(listconf.spam_protection) %]  
        [% ELSE %]
	   [%|loc%]Unknown[%END%] 
	[% END %]
	</td>	    
	<td>&nbsp;</td>
	<td class="review_cels"> [% s.date %] </td>

	[% IF expert_page %]
	  <td class="review_cels text-right">
	  [% IF s.edit %]
	    [% IF escaped_path %]
	      <a href="[% 'd_delete' | url_rel([list,escaped_path,s.escaped_doc]) %]" onclick="request_confirm_link('[% 'd_delete' | url_rel([list,escaped_path,s.escaped_doc]) %]', '[% | escape_quote %][%|loc(visible_path,s.doc)%]Do you really want to delete %1%2?[%END%][%END%]'); return false;"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]delete[%END%]"><i class="fa fa-trash fa-lg"></i></a>
            [% ELSE %]
	      <a href="[% 'd_delete' | url_rel([list,s.escaped_doc]) %]" onclick="request_confirm_link('[% 'd_delete' | url_rel([list,s.escaped_doc]) %]', '[% | escape_quote %][%|loc(visible_path,s.doc)%]Do you really want to delete %1%2?[%END%][%END%]'); return false;"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]delete[%END%]"><i class="fa fa-trash fa-lg"></i></a>
	    [% END %]

	[% ELSE %]

	[% END %]
	
	[% IF s.control %]
	    [% IF escaped_path %]
	     &nbsp;<a href="[% 'd_control' | url_rel([list,escaped_path,s.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]access[%END%]"><i class="fa fa-lock fa-lg"></i></a>
	    [% ELSE %]
	     &nbsp;<a href="[% 'd_control' | url_rel([list,s.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]access[%END%]"><i class="fa fa-lock fa-lg"></i></a>
            [% END %]
	 
	  [% ELSE %]

	  [% END %]
      
          [% IF s.edit %]
	    [% IF escaped_path %]
	      &nbsp;<a href="[% 'd_properties' | url_rel([list,escaped_path,s.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]properties[%END%]"><i class="fa fa-cog fa-lg"></i></a>
	    [% ELSE %] 
	      &nbsp;<a href="[% 'd_properties' | url_rel([list,s.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]properties[%END%]"><i class="fa fa-cog fa-lg"></i></a>
	    [% END %]
 
	[% ELSE %]

	[% END %]

      [% IF is_editor %]

          [% END %]
          </td>
	[% END %]
      </tr>
      [% END %] 
    [% END %]

    [% IF sort_files %]
      [% FOREACH f = sort_files %]
	[% IF f.moderate %]
	  [% IF expert_page %]
         <tr class="bg_color_bg">
	  [% END %]
	[% ELSE %]
         <tr class="color0">
        [% END %]
        
        [% IF f.html %]
	  <td class="review_cels_mail">
	  [% IF escaped_path %]
            <a href="[% 'd_read' | url_rel([list,escaped_path,f.escaped_doc]) %]" title="[%|loc%]Open in a new window[%END%]" target="html_window">
	  [% ELSE %]
            <a href="[% 'd_read' | url_rel([list,f.escaped_doc]) %]" title="[%|loc%]Open in a new window[%END%]" target="html_window">
	  [% END %]	  
	  <img src="[% f.icon %]" alt="[% f.escaped_title %]" /> [% f.doc %] </a>
	  </td>
	[% ELSIF f.url %]
	  <td class="review_cels_mail">
	  <a href="[% f.url %]" title="[%|loc%]Open in a new window[%END%]" target="html_window">
	  <img src="[% f.icon %]" alt="[% f.escaped_title %]" /> [% f.anchor %] </a>
	  </td>
	[% ELSE %]
	  [% IF f.moderate %]
	    [% IF expert_page %]
	      <td class="review_cels_mail">
	      [% IF escaped_path %]
	        <a href="[% 'd_read' | url_rel([list,escaped_path,f.escaped_doc]) %]">
	      [% ELSE %]
                <a href="[% 'd_read' | url_rel([list,f.escaped_doc]) %]">
	      [% END %]
	  <img src="[% f.icon %]" alt="[% f.escaped_title %]" /> [% f.doc %] </a>
	      </td>
        [% END %] 
	  [% ELSE %]
	    <td class="review_cels_mail">
	    [% IF escaped_path %]
	      <a href="[% 'd_read' | url_rel([list,escaped_path,f.escaped_doc]) %]">
	    [% ELSE %]
              <a href="[% 'd_read' | url_rel([list,f.escaped_doc]) %]">
	    [% END %]
	    <img src="[% f.icon %]" alt="[% f.escaped_title %]" /> [% f.doc %] </a>
	</td>  
	  [% END %]
     
        [% END %] 
	  
	 
	 
	[% IF f.moderate %]
	  [% IF expert_page %]
	    <td class="review_cels">[%|loc%]to moderate[%END%]</td>
          [% END %]
	[% ELSE %]
         <td class="review_cels">
	 [% IF f.author_known %]
	   [% f.author | mailto(f.author) | obfuscate(listconf.spam_protection) %]
 	 [% ELSE %]
           [%|loc%]Unknown[%END%]  
         [%END%]
	</td>
        [% END %]
	 
	[% IF f.moderate %]
	  [% IF expert_page %]
   	     <td class="review_cels">&nbsp;
	     [% IF !f.url %]
	       [% f.size %] 
	     [% END %]
	     </td>
	     <td class="review_cels"> [% f.date %] </td>
	  [% END %]
	[% ELSE %]
	  <td class="review_cels">&nbsp;
	  [% IF !f.url %]
	    [% f.size %] 
	  [% END %]
	  </td>
	  <td class="review_cels"> [% f.date %] </td>
	[% END %]

	 
	[% IF expert_page %]
	<td class="review_cels text-right">
        [% IF is_editor %]
          [% IF f.moderate %]
	  [% IF expert_page %]
          <a href="[% 'docindex' | url_rel([list]) %]"  class="tip-left color_10" data-tooltip aria-haspopup="true" title="[%|loc%]moderate[%END%]"> <i class="fa fa-shield fa-lg"></i></a>&nbsp;
	  [% END %]
          [% ELSE %]

          [%END%]
        [%END%]

	[% IF f.edit %]
	    [% IF escaped_path %]
	      <a href="[% 'd_editfile' | url_rel([list,escaped_path,f.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]edit[%END%]"><i class="fa fa-pencil fa-lg"></i></a>
	    [% ELSE %]
  	      <a href="[% 'd_editfile' | url_rel([list,f.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]edit[%END%]"><i class="fa fa-pencil fa-lg"></i></a>
	    [% END %]	  

	    [% IF escaped_path %]
              &nbsp;<a href="[% 'd_delete' | url_rel([list,escaped_path,f.escaped_doc]) %]" onclick="request_confirm_link('[% 'd_delete' | url_rel([list,escaped_path,f.escaped_doc]) %]', '[% | escape_quote %][%|loc(visible_path,f.doc,f.size)%]Do you really want to delete %1%2 (%3 Kb)?[%END%][%END%]'); return false;"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]delete[%END%]"><i class="fa fa-trash fa-lg"></i></a>
	    [% ELSE %]
              &nbsp;<a href="[% 'd_delete' | url_rel([list,f.escaped_doc]) %]" onclick="request_confirm_link('[% 'd_delete' | url_rel([list,f.escaped_doc]) %]', '[% | escape_quote %][%|loc(visible_path,f.doc,f.size)%]Do you really want to delete %1%2 (%3 Kb)?[%END%][%END%]'); return false;"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]delete[%END%]"><i class="fa fa-trash fa-lg"></i></a>
	    [% END %]

	[% ELSE %]

	[% END %]
		 
	[% IF f.control %]
	    [% IF escaped_path %]
	      &nbsp;<a href="[% 'd_control' | url_rel([list,escaped_path,f.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]access[%END%]"><i class="fa fa-lock fa-lg"></i></a>
	    [% ELSE %]
	      &nbsp;<a href="[% 'd_control' | url_rel([list,f.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]access[%END%]"><i class="fa fa-lock fa-lg"></i></a>
	    [% END %]

	  [% ELSE %]

	  [% END %]
        
	  [% IF f.edit %]
	    [% IF escaped_path %]
	      &nbsp;<a href="[% 'd_properties' | url_rel([list,escaped_path,f.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]properties[%END%]"><i class="fa fa-cog fa-lg"></i></a>
	    [% ELSE %]	    
	      &nbsp;<a href="[% 'd_properties' | url_rel([list,f.escaped_doc]) %]"  class="tip-left" data-tooltip aria-haspopup="true" title="[%|loc%]properties[%END%]"><i class="fa fa-cog fa-lg"></i></a>
	    [% END %]

	[% ELSE %]

	[% END %]
        </td>
        [% END %]
	</tr>
      [% END %] 
    [% END %]
  [% END %]
  </table>	        
 
  <br />
  [% IF expert_page %] 
  [% IF may_edit %]
   [% IF total_edit %]    

    <form method="post" action="[% path_cgi %]">
    <fieldset>
    <h6>
    [% IF path %]
      [%|loc(visible_path)%]Create a new folder inside folder %1[%END%]
    [% ELSE %]
      [%|loc%]Create a new folder inside root folder[%END%]
    [% END %]
    </h6>
    <label for="name_dir">[%|loc%]Folder name[%END%]</label> <input id="name_dir" maxlength="30" type="text" name="name_doc" />
    <input class="MainMenuLinks" type="submit" value="[%|loc%]Create[%END%]" name="action_d_create_dir" />
    <input type="hidden" name="previous_action" value="d_read" />
    <input type="hidden" name="list" value="[% list %]" />
    <input type="hidden" name="path" value="[% path %]" />
    <input type="hidden" name="type" value="directory" />
    <input type="hidden" name="action" value="d_create_dir" />
    </fieldset>
    </form>
   [% END %]

    <form method="post" action="[% path_cgi %]">
    <fieldset>
    <h6> [%|loc%]Create a new file[%END%]</h6>
    <label for="name_doc">[%|loc%]File name[%END%]</label> <input id="name_doc" maxlength="30" type="text" name="name_doc" />
    <input class="MainMenuLinks" type="submit" value="[%|loc%]Create[%END%]" name="action_d_create_dir" />
    <input type="hidden" name="previous_action" value="d_read" />
    <input type="hidden" name="list" value="[% list %]" />
    <input type="hidden" name="path" value="[% path %]" />
    <input type="hidden" name="type" value="file" />
    <input type="hidden" name="action" value="d_create_dir" />
    </fieldset>
    </form>

    <form method="post" action="[% path_cgi %]">
    <fieldset>
    <h6>[%|loc%]Add a bookmark[%END%]</h6>
    <label for="name_title">[%|loc%]title[%END%]</label> <input id="name_title" maxlength="100" size="25" type="text" name="name_doc" />
    <label for="url">[%|loc%]URL[%END%]</label> <input id="url" size="35" type="text" name="url" />
    <input class="MainMenuLinks" type="submit" value="[%|loc%]Add[%END%]" name="action_d_savefile" />
    <input type="hidden" name="previous_action" value="d_read" />
    <input type="hidden" name="list" value="[% list %]" />
    <input type="hidden" name="path" value="[% path %]" />
    <input type="hidden" name="action" value="d_savefile" />
    </fieldset>
    </form>

   <form method="post" action="[% path_cgi %]" enctype="multipart/form-data" >
   <fieldset>
   <h6>
   [% IF path %]
     [%|loc(visible_path)%]Upload a file inside folder %1[%END%]
   [% ELSE %]
     [%|loc%]Upload a file inside folder SHARED[%END%]
   [% END %]
   </h6>
   <input id="uploaded_file" type="file" name="uploaded_file"/>
   <input class="MainMenuLinks" type="submit" value="[%|loc%]Publish[%END%]" name="action_d_upload" />
   <input type="hidden" name="list" value="[% list %]" />
   <input type="hidden" name="path" value="[% path %]" />
   </form> 

      [% IF total_edit %]
        <form method="post" action="[% path_cgi %]" enctype="multipart/form-data" >
	<fieldset>
        <h6>
 	[% IF path %]
           [%|loc(visible_path)%]Unzip a file inside the folder %1[%END%]
         [% ELSE %]
           [%|loc%]Unzip a file inside the folder SHARED[%END%]
         [% END %]
        </h6>
        <input id="unzipped_file" type="file" name="unzipped_file"/>

        <input class="MainMenuLinks" type="submit" value="[%|loc%]Publish[%END%]" name="action_d_unzip" />
        <input type="hidden" name="list" value="[% list %]" />
        <input type="hidden" name="path" value="[% path %]" />
	</fieldset>
        </form> 
       
       [% END %]
     [% END %]
   [% END %]

[% END %]
   
<!-- end d_read.tt2 -->
