{% extends 'Admin/base.html.twig' %}
{% block title %}
OceanExpert | {{ institutesData.customParameters.title }}
{% endblock %}
{% block stylesheets %}
<link rel="stylesheet" type="text/css" href="{{ asset('css/admin-style.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/font-awesome.min.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/select2.min.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/select2-bootstrap.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/AdminLTE.min.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/autocomplete.min.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/register.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/tipped.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/navbar-login.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap3-wysihtml5.min.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/jquery-ui.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/profile.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/zebra_tooltips.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/dataTables.bootstrap.css') }}">
{% endblock %}
{% block body %}
{% include('navbarlogin.html.twig') %}
<div class="wrapper">
<div class="content-wrapper">
{% block content %}
<div class="col-xs-10 col-sm-10 col-md-10 col-lg-10">
<h3 class="heading">{{ institutesData.customParameters.title }}</h3>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
<div class="top-padding10">
Displaying {{ institutesData.getPaginationData.firstItemNumber }}
– {{ institutesData.getPaginationData.lastItemNumber }} results of {{ institutesData.getTotalItemCount }}.
</div>
</div>
<div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
<div class="form-inline">
<label
for="maxItemPerPage">
Institutes per page:
</label>
<select id="maxItemPerPage" class="form-control ">
{% for key, limit in institutesData.customParameters.limits %}
{% if institutesData.params.limit is defined and key == institutesData.params.limit %}
<option id="{{ key }}" selected>{{ limit }}</option>
{% else %}
<option id="{{ key }}">{{ limit }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div>
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
<form method="get">
<div class="form-inline">
<label
for="search"
class="col-sm-6 control-label label-search">
Search in institute name:
</label>
<div class="col-sm-6 float-right">
<input
type="text"
class="form-control"
id="search"
placeholder="Search"
name="search"
value="{{ app.request.get('search') }}" />
</div>
</div>
</form>
</div>
<div class="clearfix"></div>
<div class="col-xs-11 col-sm-11 col-md-11 col-lg-11">
<div class="box-body">
<table
id="allInstitute"
class="table table-bordered table-striped">
<thead>
<tr>
<th>{{ knp_pagination_sortable(institutesData, 'ID', 'i.idInst') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Name', 'i.instName') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Name (English)', 'i.instNameEng') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Parent', 'i.parentId') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Country', 'c.country') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Type', 'it.insttypeName') }}</th>
</tr>
</thead>
<tbody>
{% for institute in institutesData.items %}
<tr>
<td>
<a
href="{{ path('view_institution', {'instId' : institute.idInst}) }}"
target="_blank">
{{ institute.idInst }}
</a>
</td>
<td>
<a
href="{{ path('view_institution', {'instId' : institute.idInst}) }}"
target="_blank">
{{ institute.instName }}
</a>
</td>
<td>
<a
href="{{ path('view_institution', {'instId' : institute.idInst}) }}"
target="_blank">
{{ institute.instNameEng }}
</a>
</td>
<td>
{% if institute.parentId is defined and parentInstitutes[institute.parentId] is defined%}
<a
href="{{ path('view_institution', {'instId' : institute.parentId}) }}"
target="_blank">
{{ parentInstitutes[institute.parentId] }}
</a>
{% endif %}
</td>
<td>
{{ institute.country }}
</td>
<td>
{{ institute.insttypeName }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>{{ knp_pagination_sortable(institutesData, 'ID', 'i.idInst') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Name', 'i.instName') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Name (English)', 'i.instNameEng') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Parent', 'i.parentId') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Country', 'c.country') }}</th>
<th>{{ knp_pagination_sortable(institutesData, 'Type', 'it.insttypeName') }}</th>
</tr>
</tfoot>
</table>
<div class="col-md-6 pull-right">
<div class="navigation pagination-sm pull-right">
{{ knp_pagination_render(institutesData) }}
</div>
</div>
</div>
</div>
<!-- /.box-body -->
{% endblock %}
</div>
</div>
{% include "footer.html.twig" %}
<script src="{{ asset('js/app.min.js') }}"></script>
<script src="{{asset('js/icheck.min.js')}}" type="text/javascript"></script>
<script src="{{asset('js/validator.min.js')}}" type="text/javascript"></script>
<script src="{{asset('js/jquery-ui.js')}}" type="text/javascript"></script>
<script src="{{ asset('js/wysihtml5-0.3.0.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/handlebars.runtime.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/bootstrap3-wysihtml5.min.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/tipped.js') }}" type="text/javascript"></script>
<script type="text/javascript" >
function updateQueryStringParameter(uri, key, value) {
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
return uri.replace(re, '$1' + key + "=" + value + '$2');
} else {
return uri + separator + key + "=" + value;
}
}
$('#maxItemPerPage').change(function(){
var item = $('#maxItemPerPage').find(":selected").text();
var uri = window.location.href;
window.location.href = updateQueryStringParameter(uri, "limit", item );
});
/**
* perform the requested action in the admin section for the given user id
* reload the page after this action
*
* @param action requested action (approveUsers, disApproveUsers, deleteUser, hardDeleteUser)
* @param idDoc id of the users on which to perform the action
*/
function userAction(action, idDoc)
{
var ajaxUrlStart = '/admin/';
var ajaxUrl = ajaxUrlStart.concat(action);
$.ajax({
type: "POST",
url: ajaxUrl,
data: JSON.stringify({id:idDoc}),
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false, //_async,
success: function () {
window.location.reload(true);
}
});
}
</script>
{% endblock %}