templates/Institute/viewInstitutes.html.twig line 1

Open in your IDE?
  1. {% extends 'Admin/base.html.twig' %}
  2. {% block title %}
  3. OceanExpert | {{ institutesData.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">{{ institutesData.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 {{ institutesData.getPaginationData.firstItemNumber }}
  32.                     – {{ institutesData.getPaginationData.lastItemNumber }} results of {{ institutesData.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.                         Institutes per page:
  40.                     </label>
  41.                     <select id="maxItemPerPage" class="form-control ">
  42.                         {% for key, limit in institutesData.customParameters.limits %}
  43.                             {% if institutesData.params.limit is defined and key == institutesData.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 in institute name:
  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.                 <div class="box-body">
  75.                     <table
  76.                             id="allInstitute"
  77.                             class="table table-bordered table-striped">
  78.                         <thead>
  79.                             <tr>
  80.                                 <th>{{ knp_pagination_sortable(institutesData, 'ID', 'i.idInst') }}</th>
  81.                                 <th>{{ knp_pagination_sortable(institutesData, 'Name', 'i.instName') }}</th>
  82.                                 <th>{{ knp_pagination_sortable(institutesData, 'Name (English)', 'i.instNameEng') }}</th>
  83.                                 <th>{{ knp_pagination_sortable(institutesData, 'Parent', 'i.parentId') }}</th>
  84.                                 <th>{{ knp_pagination_sortable(institutesData, 'Country', 'c.country') }}</th>
  85.                                 <th>{{ knp_pagination_sortable(institutesData, 'Type', 'it.insttypeName') }}</th>
  86.                             </tr>
  87.                         </thead>
  88.                         <tbody>
  89.                         {% for institute in institutesData.items %}
  90.                             <tr>
  91.                                 <td>
  92.                                     <a
  93.                                             href="{{ path('view_institution', {'instId' : institute.idInst}) }}"
  94.                                             target="_blank">
  95.                                         {{ institute.idInst }}
  96.                                     </a>
  97.                                 </td>
  98.                                 <td>
  99.                                     <a
  100.                                             href="{{ path('view_institution', {'instId' : institute.idInst}) }}"
  101.                                             target="_blank">
  102.                                         {{ institute.instName }}
  103.                                     </a>
  104.                                 </td>
  105.                                 <td>
  106.                                     <a
  107.                                             href="{{ path('view_institution', {'instId' : institute.idInst}) }}"
  108.                                             target="_blank">
  109.                                         {{ institute.instNameEng }}
  110.                                     </a>
  111.                                 </td>
  112.                                 <td>
  113.                                     {% if institute.parentId is defined and parentInstitutes[institute.parentId] is defined%}
  114.                                     <a
  115.                                             href="{{ path('view_institution', {'instId' : institute.parentId}) }}"
  116.                                             target="_blank">
  117.                                         {{ parentInstitutes[institute.parentId] }}
  118.                                     </a>
  119.                                     {% endif %}
  120.                                 </td>
  121.                                 <td>
  122.                                     {{ institute.country }}
  123.                                 </td>
  124.                                 <td>
  125.                                     {{ institute.insttypeName }}
  126.                                 </td>
  127.                             </tr>
  128.                         {% endfor %}
  129.                         </tbody>
  130.                         <tfoot>
  131.                         <tr>
  132.                             <th>{{ knp_pagination_sortable(institutesData, 'ID', 'i.idInst') }}</th>
  133.                             <th>{{ knp_pagination_sortable(institutesData, 'Name', 'i.instName') }}</th>
  134.                             <th>{{ knp_pagination_sortable(institutesData, 'Name (English)', 'i.instNameEng') }}</th>
  135.                             <th>{{ knp_pagination_sortable(institutesData, 'Parent', 'i.parentId') }}</th>
  136.                             <th>{{ knp_pagination_sortable(institutesData, 'Country', 'c.country') }}</th>
  137.                             <th>{{ knp_pagination_sortable(institutesData, 'Type', 'it.insttypeName') }}</th>
  138.                         </tr>
  139.                         </tfoot>
  140.                     </table>
  141.                     <div class="col-md-6 pull-right">
  142.                         <div class="navigation pagination-sm pull-right">
  143.                             {{ knp_pagination_render(institutesData) }}
  144.                         </div>
  145.                     </div>
  146.                 </div>
  147.             </div>
  148.         <!-- /.box-body -->
  149.         {% endblock %}
  150.     </div>
  151. </div>
  152.     {% include "footer.html.twig" %}
  153.     <script src="{{ asset('js/app.min.js') }}"></script>
  154.     <script src="{{asset('js/icheck.min.js')}}" type="text/javascript"></script>
  155.     <script src="{{asset('js/validator.min.js')}}" type="text/javascript"></script>
  156.     <script src="{{asset('js/jquery-ui.js')}}" type="text/javascript"></script>
  157.     <script src="{{ asset('js/wysihtml5-0.3.0.min.js') }}" type="text/javascript"></script>
  158.     <script src="{{ asset('js/handlebars.runtime.min.js') }}" type="text/javascript"></script>
  159.     <script src="{{ asset('js/bootstrap3-wysihtml5.min.js') }}" type="text/javascript"></script>
  160.     <script src="{{ asset('js/tipped.js') }}" type="text/javascript"></script>
  161.     <script type="text/javascript" >
  162.         function updateQueryStringParameter(uri, key, value) {
  163.             var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
  164.             var separator = uri.indexOf('?') !== -1 ? "&" : "?";
  165.             if (uri.match(re)) {
  166.                 return uri.replace(re, '$1' + key + "=" + value + '$2');
  167.             } else {
  168.                 return uri + separator + key + "=" + value;
  169.             }
  170.         }
  171.         $('#maxItemPerPage').change(function(){
  172.             var item = $('#maxItemPerPage').find(":selected").text();
  173.             var uri = window.location.href;
  174.             window.location.href = updateQueryStringParameter(uri, "limit", item );
  175.         });
  176.         /**
  177.          * perform the requested action in the admin section for the given user id
  178.          * reload the page after this action
  179.          *
  180.          * @param action requested action (approveUsers, disApproveUsers, deleteUser, hardDeleteUser)
  181.          * @param idDoc id of the users on which to perform the action
  182.          */
  183.         function userAction(action, idDoc)
  184.         {
  185.             var ajaxUrlStart = '/admin/';
  186.             var ajaxUrl = ajaxUrlStart.concat(action);
  187.             $.ajax({
  188.                 type: "POST",
  189.                 url: ajaxUrl,
  190.                 data: JSON.stringify({id:idDoc}),
  191.                 contentType: "application/json; charset=utf-8",
  192.                 dataType: "json",
  193.                 async: false, //_async,
  194.                 success: function () {
  195.                     window.location.reload(true);
  196.                 }
  197.             });
  198.         }
  199.     </script>
  200. {% endblock %}