templates/Documents/viewDocuments.html.twig line 1

Open in your IDE?
  1. {% extends 'Admin/base.html.twig' %}
  2. {% block title %}
  3. OceanExpert | {{ documentData.customParameters.title }}
  4. {% endblock %}
  5. {% block stylesheets %}
  6. <link rel="stylesheet" type="text/css" href="{{ asset('css/admin-style.css') }}">
  7. <link rel="stylesheet" type="text/css" href="{{ asset('css/font-awesome.min.css') }}">
  8. <link rel="stylesheet" type="text/css" href="{{ asset('css/select2.min.css') }}">
  9. <link rel="stylesheet" type="text/css" href="{{ asset('css/select2-bootstrap.css') }}">
  10. <link rel="stylesheet" type="text/css" href="{{ asset('css/AdminLTE.min.css') }}">
  11. <link rel="stylesheet" type="text/css" href="{{ asset('css/autocomplete.min.css') }}">
  12. <link rel="stylesheet" type="text/css" href="{{ asset('css/register.css') }}">
  13. <link rel="stylesheet" type="text/css" href="{{ asset('css/tipped.css') }}">
  14. <link rel="stylesheet" type="text/css" href="{{ asset('css/navbar-login.css') }}">
  15. <link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap3-wysihtml5.min.css') }}">
  16. <link rel="stylesheet" type="text/css" href="{{ asset('css/jquery-ui.css') }}">
  17. <link rel="stylesheet" type="text/css" href="{{ asset('css/profile.css') }}">
  18. <link rel="stylesheet" type="text/css" href="{{ asset('css/zebra_tooltips.css') }}">
  19. <link rel="stylesheet" type="text/css" href="{{ asset('css/dataTables.bootstrap.css') }}">
  20. {% endblock %}
  21. {% block body %}
  22. {% include('navbarlogin.html.twig') %}
  23. <div class="wrapper">
  24.     <div class="content-wrapper">
  25.         {% block content %}
  26.             <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10">
  27.                 <h3 class="heading">{{ documentData.customParameters.title }}</h3>
  28.             </div>
  29.             <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
  30.                 <div class="top-padding10">
  31.                     Displaying {{ documentData.getPaginationData.firstItemNumber }}
  32.                     – {{ documentData.getPaginationData.lastItemNumber }} results of {{ documentData.getTotalItemCount }}.
  33.                 </div>
  34.             </div>
  35.             <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
  36.                 <div class="form-inline">
  37.                     <label
  38.                             for="maxItemPerPage">
  39.                         Documents per page:
  40.                     </label>
  41.                     <select id="maxItemPerPage" class="form-control ">
  42.                         {% for key, limit in documentData.customParameters.limits %}
  43.                             {% if documentData.params.limit is defined and key == documentData.params.limit %}
  44.                                 <option id="{{ key }}" selected>{{ limit }}</option>
  45.                             {% else %}
  46.                                 <option id="{{ key }}">{{ limit }}</option>
  47.                             {% endif %}
  48.                         {% endfor %}
  49.                     </select>
  50.                 </div>
  51.             </div>
  52.             <div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
  53.                 <form method="get">
  54.                     <div class="form-inline">
  55.                         <label
  56.                                 for="search"
  57.                                 class="col-sm-6 control-label label-search">
  58.                             Search document title:
  59.                         </label>
  60.                         <div class="col-sm-6 float-right">
  61.                             <input
  62.                                     type="text"
  63.                                     class="form-control"
  64.                                     id="search"
  65.                                     placeholder="Search"
  66.                                     name="search"
  67.                                     value="{{  app.request.get('search') }}" />
  68.                         </div>
  69.                     </div>
  70.                 </form>
  71.             </div>
  72.             <div class="clearfix"></div>
  73.             <div class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
  74.                 <p>
  75.                     Below you can see the list of all documents that are stored in OceanExpert.
  76.                 </p>
  77.                 <p>
  78.                     To find the document(s) you are looking for you have these options:
  79.                 </p>
  80.                 <ul>
  81.                     <li>
  82.                         You can browse through the list (sort the documents by clicking on ID, Title or Date in the table header or footer).
  83.                     </li>
  84.                     <li>
  85.                         Use one of the <a
  86.                                 href="{{ path('view_all_doclists') }}"
  87.                                 target="_blank">
  88.                             Document Lists
  89.                         </a> of IOC documents for a particular IOC programme (e.g. <a
  90.                                 href="{{ path('view_doclist', {'idDoclist':6}) }}"
  91.                                 target="_blank">
  92.                             IODE Session reports
  93.                         </a>).
  94.                     </li>
  95.                     <li>
  96.                         The search box at the top right of this page gives you the possibility to search for documents
  97.                         that contain a certain word in their title.<br />
  98.                         Note that this is a very simple search and you need to enter complete words that appear as such in the title<br />
  99.                         (e.g. <em>'national contact manual'</em> will work, <em>'national manual'</em> will not work for a document
  100.                         with the title <em>'IOC National Contact Manual (National Focal Points contact list)'</em> ).
  101.                     </li>
  102.                     <li>
  103.                         For more advanced search queries, you can use the <a
  104.                                 href="https://oceanexpert.org/advancedSearch"
  105.                                 target="_blank">
  106.                             Search page
  107.                         </a> that enables you to do a more elaborated search for availlable documents
  108.                         (e.g. using boolean operators "AND" or "OR").
  109.                     </li>
  110.                 </ul>
  111.             </div>
  112.             <div class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
  113.                 <div class="box-body">
  114.                     <table
  115.                             id="allDocument"
  116.                             class="table table-bordered table-striped">
  117.                         <thead>
  118.                             <tr>
  119.                                 <th>{{ knp_pagination_sortable(documentData, 'ID', 'd.idDoc') }}</th>
  120.                                 <th>{{ knp_pagination_sortable(documentData, 'Title', 'd.title') }}</th>
  121.                                 <th>{{ knp_pagination_sortable(documentData, 'Date', 'd.createdAt') }}</th>
  122.                                 <th>Doclist(s)</th>
  123.                             </tr>
  124.                         </thead>
  125.                         <tbody>
  126.                         {% for document in documentData.items %}
  127.                             <tr>
  128.                                 <td>
  129.                                     <a
  130.                                             href="{{ path('view_document', {'idDoc': document.idDoc}) }}"
  131.                                             target="_blank">
  132.                                         {{ document.idDoc }}
  133.                                     </a>
  134.                                 </td>
  135.                                 <td>
  136.                                     <a
  137.                                             href="{{ path('view_document', {'idDoc': document.idDoc}) }}"
  138.                                             target="_blank">
  139.                                         {{ document.title }}
  140.                                     </a>
  141.                                 </td>
  142.                                 <td>
  143.                                     {{ document.createdAt|date("d/m/Y") }}
  144.                                 </td>
  145.                                 <td>
  146.                                     {# if document.idDoc and doclistDocuments[document.idDoc] and doclistDocuments[document.idDoc][0] and doclistDocuments[document.idDoc][0]['idDoclist'] #}
  147.                                     {% if document.idDoc and doclistDocuments[document.idDoc] is defined %}
  148.                                         {% for doclist in doclistDocuments[document.idDoc] %}
  149.                                             {% if doclists[doclist['idDoclist']] is defined %}
  150.                                                 <a
  151.                                                         href="{{ path('view_doclist', {'idDoclist': doclist['idDoclist']}) }}"
  152.                                                         target="_blank">
  153.                                                     {{ doclists[doclist['idDoclist']] }}
  154.                                                 </a>
  155.                                             {% endif %}
  156.                                         {% endfor %}
  157.                                     {% endif %}
  158.                                 </td>
  159.                             </tr>
  160.                         {% endfor %}
  161.                         </tbody>
  162.                         <tfoot>
  163.                         <tr>
  164.                             <th>{{ knp_pagination_sortable(documentData, 'ID', 'd.idDoc') }}</th>
  165.                             <th>{{ knp_pagination_sortable(documentData, 'Title', 'd.title') }}</th>
  166.                             <th>{{ knp_pagination_sortable(documentData, 'Date', 'd.createdAt') }}</th>
  167.                             <th>Doclist(s)</th>
  168.                         </tr>
  169.                         </tfoot>
  170.                     </table>
  171.                     <div class="col-md-6 pull-right">
  172.                         <div class="navigation pagination-sm pull-right">
  173.                             {{ knp_pagination_render(documentData) }}
  174.                         </div>
  175.                     </div>
  176.                 </div>
  177.             </div>
  178.         </div>
  179.         <!-- /.box-body -->
  180.         {% endblock %}
  181.     </div>
  182. </div>
  183.     {% include "footer.html.twig" %}
  184.     <script src="{{ asset('js/app.min.js') }}"></script>
  185.     <script src="{{asset('js/icheck.min.js')}}" type="text/javascript"></script>
  186.     <script src="{{asset('js/validator.min.js')}}" type="text/javascript"></script>
  187.     <script src="{{asset('js/jquery-ui.js')}}" type="text/javascript"></script>
  188.     <script src="{{ asset('js/wysihtml5-0.3.0.min.js') }}" type="text/javascript"></script>
  189.     <script src="{{ asset('js/handlebars.runtime.min.js') }}" type="text/javascript"></script>
  190.     <script src="{{ asset('js/bootstrap3-wysihtml5.min.js') }}" type="text/javascript"></script>
  191.     <script src="{{ asset('js/tipped.js') }}" type="text/javascript"></script>
  192.     <script type="text/javascript" >
  193.         function updateQueryStringParameter(uri, key, value) {
  194.             var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
  195.             var separator = uri.indexOf('?') !== -1 ? "&" : "?";
  196.             if (uri.match(re)) {
  197.                 return uri.replace(re, '$1' + key + "=" + value + '$2');
  198.             } else {
  199.                 return uri + separator + key + "=" + value;
  200.             }
  201.         }
  202.         $('#maxItemPerPage').change(function(){
  203.             var item = $('#maxItemPerPage').find(":selected").text();
  204.             var uri = window.location.href;
  205.             window.location.href = updateQueryStringParameter(uri, "limit", item );
  206.         });
  207.         /**
  208.          * perform the requested action in the admin section for the given user id
  209.          * reload the page after this action
  210.          *
  211.          * @param action requested action (approveUsers, disApproveUsers, deleteUser, hardDeleteUser)
  212.          * @param idDoc id of the users on which to perform the action
  213.          */
  214.         function userAction(action, idDoc)
  215.         {
  216.             var ajaxUrlStart = '/admin/';
  217.             var ajaxUrl = ajaxUrlStart.concat(action);
  218.             $.ajax({
  219.                 type: "POST",
  220.                 url: ajaxUrl,
  221.                 data: JSON.stringify({id:idDoc}),
  222.                 contentType: "application/json; charset=utf-8",
  223.                 dataType: "json",
  224.                 async: false, //_async,
  225.                 success: function (result) {
  226.                     window.location.reload(true);
  227.                 }
  228.             });
  229.         }
  230.     </script>
  231. {% endblock %}