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