templates/Institute/viewInstitute.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}OceanExpert - A Directory of Marine and Freshwater Professionals{% endblock %}
  3. {% block stylesheets %}
  4.     <link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.min.css') }}">
  5.     <link rel="stylesheet" type="text/css" href="{{ asset('css/font-awesome.min.css') }}">
  6.     <link rel="stylesheet" type="text/css" href="{{ asset('css/navbar-login.css') }}">
  7.     <link rel="stylesheet" type="text/css" href="{{ asset('css/social-buttons.css') }}">
  8.     <link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}">
  9.     <link rel="stylesheet" type="text/css" href="{{ asset('css/advancedSearch.css') }}">
  10.     <link rel="stylesheet" type="text/css" href="{{ asset('css/search.css') }}">
  11.     <link rel="stylesheet" type="text/css" href="{{ asset('css/google-fonts.css') }}">
  12.     <link rel="stylesheet" type="text/css" href="{{ asset('css/AdminLTE.min.css') }}">
  13.     <link rel="stylesheet" type="text/css" href="{{ asset('css/tipped.css') }}">
  14.     <link rel="stylesheet" type="text/css" href="{{ asset('css/institution.css') }}">
  15. {% endblock %}
  16. {% block body %}
  17.     {% include('navbarlogin.html.twig') %}
  18.     <!-- JSON-LD will be used for SEO and OIH -->
  19.     <script type="application/ld+json">
  20.         {{ OIHData | raw }}
  21.     </script>
  22.     <div class="container-fluid">
  23.         <!-- Content Wrapper. Contains page content -->
  24.         <div class="">
  25.             <!-- Content Header (Page header) -->
  26.             <section class="content-header">
  27.             </section>
  28.             <section class="content">
  29.                 <div class="row">
  30.                     <div class="col-md-3">
  31.                         <!-- Profile Image -->
  32.                         <div class="box box-primary">
  33.                             <div class="box-body box-profile">
  34.                                 {% if institute.idInst is defined and institute.idInst | trim != "" %}
  35.                                     <h4 class="text-center">OceanExpert ID : <strong>{{ institute.idInst }}</strong></h4>
  36.                                 {% endif %}
  37.                                 <div class="inst-logo">
  38.                                     {% if institute.instLogo != "" %}
  39.                                         {% if institute.instUrl != "" %}
  40.                                             <a
  41.                                                     href="{% if institute.instUrl starts with "http" %}{{ institute.instUrl }}{% else %}{{ 'http://' ~ institute.instUrl }}{% endif %}"
  42.                                                     target="_blank">
  43.                                                 <img
  44.                                                         src="{{ asset('uploads/institutes/'~institute.idInst~'/'~institute.instLogo)}}"
  45.                                                         class="img-thumbnail inst-image"
  46.                                                         alt="Institution Logo" />
  47.                                             </a>
  48.                                         {% else %}
  49.                                             <img
  50.                                                     src="{{ asset('uploads/institutes/'~institute.idInst~'/'~institute.instLogo)}}"
  51.                                                     class="img-thumbnail inst-image"
  52.                                                     alt="Institution Logo" />
  53.                                         {% endif %}
  54.                                     {% else %}
  55.                                         <i class="fa fa-university fa-5x" aria-hidden="true"></i>
  56.                                     {% endif %}
  57.                                 </div>
  58.                                 <p class="lead text-center">{{ institute.instName }}<br/>
  59.                                     <small><strong>
  60.                                             {% if institute.acronym is defined and institute.acronym != "" %}
  61.                                                 {{ institute.acronym }}
  62.                                             {% endif %}
  63.                                         </strong></small>
  64.                                 </p>
  65.                                 {% if institute.instNameEng is defined and institute.instNameEng != "" %}
  66.                                     <p class="text-center">({{ institute.instNameEng }})</p>
  67.                                 {% endif %}
  68.                                 {% if (app.user is not null and ((institute.createdId is defined and institute.createdId == app.user.id) or (institute.lastEditId is defined and institute.lastEditId == app.user.id)) ) or is_granted('ROLE_GLOBAL_EDITOR') %}
  69.                                     <div class="text-center">
  70.                                         {% if is_granted('ROLE_GLOBAL_EDITOR') %}
  71.                                             {% if institute.activated is defined and institute.activated  == 0 %}
  72.                                                 <span class="statusBtn"><button class="btn btn-success activate"><i
  73.                                                                 class="fa fa-check"
  74.                                                                 aria-hidden="true"></i> Activate</button></span>
  75.                                             {% elseif institute.activated is defined and institute.activated == 1 %}
  76.                                                 <span class="statusBtn"><button class="btn btn-danger ban"><i
  77.                                                                 class="fa fa-ban"
  78.                                                                 aria-hidden="true"></i> Deactivate</button></span>
  79.                                             {% elseif institute.activated is defined and institute.activated == 2 %}
  80.                                                 <span class="statusBtn"><button class="btn btn-warning activate"><i
  81.                                                                 class="fa fa-check"
  82.                                                                 aria-hidden="true"></i> Un-delete</button></span>
  83.                                             {% endif %}
  84.                                         {% endif %}
  85.                                         <a
  86.                                                 href="{{ path('edit_institute',{'instId': institute.idInst}) }}"
  87.                                                 class="btn btn-primary">
  88.                                             <i class="fa fa-user" aria-hidden="true"></i> Edit Institute
  89.                                         </a>
  90.                                     </div>
  91.                                 {% endif %}
  92.                             </div>
  93.                             <!-- /.box-body -->
  94.                         </div>
  95.                         <!-- /.box -->
  96.                         <div class="box box-primary">
  97.                             <div class="box-body">
  98.                                 <strong><i class="fa icon-profile fa-map-marker margin-r-5" aria-hidden="true"></i>
  99.                                     Address</strong>
  100.                                 <div class="data">
  101.                                     {{ institute.address |raw }}
  102.                                 </div>
  103.                                 {% if institute.insttypeName is defined and institute.insttypeName != "" %}
  104.                                     <hr class="details">
  105.                                     <strong><i class="fa icon-profile fa-flag margin-r-5" aria-hidden="true"></i>
  106.                                         Type</strong>
  107.                                     <p class="data tex-center">{{ institute.insttypeName }}</p>
  108.                                 {% endif %}
  109.                                 {% if institute.instEmail is defined and institute.instEmail != "" %}
  110.                                     <hr class="details">
  111.                                     <strong><i class="fa icon-profile fa-envelope margin-r-5"></i> Email</strong>
  112.                                     {% if app.user.email is defined %}
  113.                                         <p class="data tex-center"><a
  114.                                                     href="mailto:{{ institute.instEmail }}">{{ institute.instEmail }}</a>
  115.                                         </p>
  116.                                     {% else %}
  117.                                         <p class="data tex-center">Please login to view email.</p>
  118.                                     {% endif %}
  119.                                 {% endif %}
  120.                                 {% if institute.instTel is defined and institute.instTel != "" %}
  121.                                     <hr class="details">
  122.                                     <strong><i class="fa icon-profile fa-phone-square margin-r-5"></i>
  123.                                         Telephone</strong>
  124.                                     <p class="data tex-center">{{ institute.instTel }}</p>
  125.                                 {% endif %}
  126.                                 {% if institute.instFax is defined and institute.instFax != "" %}
  127.                                     <hr class="details">
  128.                                     <strong><i class="fa icon-profile fa-fax margin-r-5"></i> Fax</strong>
  129.                                     <p class="data tex-center">{{ institute.instFax }}</p>
  130.                                 {% endif %}
  131.                             </div>
  132.                         </div>
  133.                         {% if institute.parentIdInst is defined and institute.parentIdInst != "" and institute.parentIdInst != 0 %}
  134.                             <div class="box box-primary">
  135.                                 <div class="box-body">
  136.                                     <strong><i class="fa icon-profile fa-university margin-r-5" aria-hidden="true"></i>
  137.                                         Parent institute</strong>
  138.                                     {% if institute.parentInstLogo is defined and institute.parentInstLogo != "" %}
  139.                                         {% set instUrl = asset('uploads/institutes/'~institute.parentIdInst~'/'~institute.parentInstLogo) %}
  140.                                     {% else %}
  141.                                         {% set instUrl = asset('assets/uploads/institute.png') %}
  142.                                     {% endif %}
  143.                                     <div class="text-center">
  144.                                         <a
  145.                                                 href="{{ path('view_institution', {'instId': institute.parentIdInst}) }}"
  146.                                                 class="profile-url">
  147.                                             <img
  148.                                                     class="group list-group-image lazy img-thumbnail img-responsive"
  149.                                                     data-original="{{ instUrl }}"
  150.                                                     alt="Institution Logo" />
  151.                                         </a>
  152.                                         <div class="caption">
  153.                                             <p class="text-center">
  154.                                                 <strong>
  155.                                                     <a
  156.                                                             href="{{ path('view_institution', {'instId': institute.parentIdInst}) }}"
  157.                                                             class="profile-url">
  158.                                                         {{ institute.parentInstName }}
  159.                                                     </a>
  160.                                                 </strong>
  161.                                                 <br/><strong>{{ institute.parentAcronym }}</strong>
  162.                                                 <br/>({{ institute.parentInstNameEng }})
  163.                                             </p>
  164.                                         </div>
  165.                                     </div>
  166.                                 </div>
  167.                             </div>
  168.                         {% endif %}
  169.                     </div>
  170.                     <!-- /.col -->
  171.                     <div class="col-md-9">
  172.                         {% if (institute.instUrl is defined and institute.instUrl != "") or (institute.edmoCode is defined and institute.edmoCode != "") or (institute.seaRegions is defined and institute.seaRegions | length > 0) or (institute.activities is defined and institute.activities != "") %}
  173.                             <!-- About Me Box -->
  174.                             <div class="box box-primary">
  175.                                 <!-- /.box-header -->
  176.                                 <div class="box-body">
  177.                                     {% if institute.instUrl is defined and institute.instUrl != "" %}
  178.                                         <strong><i class="fa icon-profile fa-internet-explorer margin-r-5"
  179.                                                    aria-hidden="true"></i> Website</strong>
  180.                                         <p class="data tex-center"><a href="{% if institute.instUrl starts with "http" %}{{ institute.instUrl }}{% else %}{{ 'http://' ~ institute.instUrl }}{% endif %}" target="_blank">{{ institute.instUrl }}</a></p>
  181.                                     {% endif %}
  182.                                     {% if institute.edmoCode is defined and institute.edmoCode != "" %}
  183.                                         <hr>
  184.                                         <strong><i class="fa icon-profile fa-barcode margin-r-5" aria-hidden="true"></i>
  185.                                             EDMO code</strong>
  186.                                         <p class="data tex-center"><a href="http://seadatanet.maris2.nl/v_edmo/print.asp?n_code={{institute.edmoCode}}" target="_blank">{{ institute.edmoCode }}</a></p>
  187.                                     {% endif %}
  188.                                     {% if institute.seaRegions is defined and institute.seaRegions | length > 0 %}
  189.                                         <hr>
  190.                                         <strong><i class="fa icon-profile fa-globe margin-r-5" aria-hidden="true"></i>
  191.                                             Sea Region of study</strong>
  192.                                         <p class="data tex-center">
  193.                                             {% for seaRegion in institute.seaRegions %}
  194.                                                 {{ seaRegion.name }}<br/>
  195.                                             {% endfor %}
  196.                                         </p>
  197.                                     {% endif %}
  198.                                     {% if institute.activities is defined and institute.activities != "" %}
  199.                                         <hr>
  200.                                         <strong><i class="fa icon-profile fa-compass margin-r-5" aria-hidden="true"></i>
  201.                                             Activities</strong>
  202.                                         <p class="data tex-center">{{ institute.activities|raw }}</p>
  203.                                     {% endif %}
  204.                                 </div>
  205.                                 <!-- /.box-body -->
  206.                             </div>
  207.                         {% endif %}
  208.                         <!-- /.box -->
  209.                         {% if members.getTotalItemCount > 0 %}
  210.                             <div class="box box-primary">
  211.                                 <!-- /.box-header -->
  212.                                 <div class="box-body">
  213.                                     <div>
  214.                                         <strong><i class="fa icon-profile fa-users margin-r-5" aria-hidden="true"></i>
  215.                                             Associated Experts</strong>
  216.                                     </div>
  217.                                     <span class="col-md-3 search-display">
  218.                                     Displaying {{ members.getPaginationData.firstItemNumber }}
  219.                                         – {{ members.getPaginationData.lastItemNumber }}
  220.                                         results of {{ members.getTotalItemCount }}.
  221.                                     </span>
  222.                                     <div class="row">
  223.                                         <div class="col-md-12 tblhdrs">
  224.                                             <div class=" selectContainer">
  225.                                                 Show <select
  226.                                                         name="mlimit"
  227.                                                         id="mlimit"
  228.                                                         data-id="mlimit"
  229.                                                         class="maxresults">
  230.                                                     {% for key,option in limits.memberlimit.options %}
  231.                                                         {% if limits.memberlimit.selected == key %}
  232.                                                             <option id="{{ key }}" selected>{{ option }}</option>
  233.                                                         {% else %}
  234.                                                             <option id="{{ key }}">{{ option }}</option>
  235.                                                         {% endif %}
  236.                                                     {% endfor %}
  237.                                                 </select> Records
  238.                                             </div>
  239.                                             <span class=" pagination-sm">
  240.                                             {{ knp_pagination_render(members) }}
  241.                                         </span>
  242.                                         </div>
  243.                                     </div>
  244.                                     <div class="row list-group">
  245.                                         <div class="col-md-12">
  246.                                             {% for item in members %}
  247.                                                 <div class="item  col-xs-4 col-lg-4 list-group-item">
  248.                                                     <div class="thumbnail-institution">
  249.                                                         <a
  250.                                                                 href="{{ path('view_profile', {'user': item.idInd}) }}"
  251.                                                                 class="profile-url">
  252.                                                             <img
  253.                                                                     class="group list-group-image lazy img-thumbnail img-responsive"
  254.                                                                     data-original="{% if file_exists(web_path~asset('uploads/profile/profile_'~item.idInd~'.png')) %}{{ asset('uploads/profile/profile_'~item.idInd~'.png') }}{% endif %}"
  255.                                                                     src="{{ asset('assets/uploads/default.png') }}"
  256.                                                                     alt="User profile picture"
  257.                                                                     onError="this.src='{{ asset('assets/uploads/default.png') }}';" />
  258.                                                             </a>
  259.                                                         <div class="caption">
  260.                                                             <p class="group inner list-group-item-text">
  261.                                                                 <strong>
  262.                                                                     <a
  263.                                                                             href="{{ path('view_profile', {'user': item.idInd}) }}"
  264.                                                                             class="profile-url">
  265.                                                                         {{ item.fname | raw | title }} {{ item.sname | raw | upper }}
  266.                                                                     </a>
  267.                                                                 </strong>
  268.                                                                 {% if item.qualityChecked == 1 %}
  269.                                                                     <i
  270.                                                                             class="green fa fa-check-circle tipso"
  271.                                                                             title="User has been verified.">
  272.                                                                     </i>
  273.                                                                 {% endif %}
  274.                                                                 {% if item.retired == 1 %}
  275.                                                                     <span
  276.                                                                             class="label label-success">
  277.                                                                         Retired
  278.                                                                     </span>
  279.                                                                 {% endif %}
  280.                                                                 {% if item.deceased == 1 %}
  281.                                                                     <span
  282.                                                                             class="label label-danger">
  283.                                                                         Deceased
  284.                                                                     </span>
  285.                                                                 {% endif %}
  286.                                                                 <br/>
  287.                                                                 {% if item.jobtitle != "" %}
  288.                                                                     {{ item.jobtitle }}
  289.                                                                 {% endif %}
  290.                                                             </p>
  291.                                                         </div>
  292.                                                     </div>
  293.                                                 </div>
  294.                                             {% endfor %}
  295.                                         </div>
  296.                                         <hr class="caption blue"/>
  297.                                         <div class="col-md-12 pagination-sm pull-right">
  298.                                             {{ knp_pagination_render(members) }}
  299.                                         </div>
  300.                                     </div>
  301.                                 </div>
  302.                             </div>
  303.                         {% endif %}
  304.                         <!-- child institutes -->
  305.                         {% if childinstitutes.getTotalItemCount > 0 %}
  306.                         <div class="box box-primary">
  307.                             <!-- /.box-header -->
  308.                             <div class="box-body">
  309.                                 <div>
  310.                                     <strong>
  311.                                         <i class="fa icon-profile fa-university margin-r-5" aria-hidden="true"></i>
  312.                                         Child Institutes
  313.                                     </strong>
  314.                                 </div>
  315.                                 <span class="col-md-3 search-display">
  316.                                 Displaying {{ childinstitutes.getPaginationData.firstItemNumber }}
  317.                                     – {{ childinstitutes.getPaginationData.lastItemNumber }}
  318.                                     results of {{ childinstitutes.getTotalItemCount }}.
  319.                                 </span>
  320.                                 <div class="row">
  321.                                     <div class="col-md-12 tblhdrs">
  322.                                         <div class=" selectContainer">
  323.                                             Show <select name="cilimit" id="cilimit" data-id="cilimit" class="maxresults">
  324.                                                 {% for key,option in limits.childinstitutelimit.options %}
  325.                                                     {% if limits.childinstitutelimit.selected == key %}
  326.                                                         <option id="{{ key }}" selected>{{ option }}</option>
  327.                                                     {% else %}
  328.                                                         <option id="{{ key }}">{{ option }}</option>
  329.                                                     {% endif %}
  330.                                                 {% endfor %}
  331.                                             </select> Records
  332.                                         </div>
  333.                                         <span class=" pagination-sm">
  334.                                             {{ knp_pagination_render(childinstitutes) }}
  335.                                         </span>
  336.                                     </div>
  337.                                 </div>
  338.                                 <div class="row list-group">
  339.                                     <div class="col-md-12">
  340.                                         {% for item in childinstitutes %}
  341.                                             {% if item.instLogo is defined and item.instLogo != "" %}
  342.                                                 {% set instUrl = asset('uploads/institutes/'~item.idInst~'/'~item.instLogo) %}
  343.                                             {% else %}
  344.                                                 {% set instUrl = asset('assets/uploads/institute.png') %}
  345.                                             {% endif %}
  346.                                             <div class="item col-xs-4 col-lg-4 list-group-item">
  347.                                                 <div class="thumbnail-institution">
  348.                                                     <a
  349.                                                             href="{{ path('view_institution', {'instId': item.idInst}) }}"
  350.                                                             class="profile-url">
  351.                                                         <img
  352.                                                                 class="group list-group-image lazy img-thumbnail img-responsive"
  353.                                                                 data-original="{{ instUrl }}"
  354.                                                                 alt="Institution Logo" />
  355.                                                     </a>
  356.                                                     <div class="caption">
  357.                                                         <p class="group inner list-group-item-text">
  358.                                                             <strong>
  359.                                                                 <a
  360.                                                                         href="{{ path('view_institution', {'instId': item.idInst}) }}"
  361.                                                                         class="profile-url">
  362.                                                                     {{ item.instName }}
  363.                                                                 </a>
  364.                                                             </strong>
  365.                                                             <br/><strong>{{ item.acronym }}</strong>
  366.                                                             <br/>({{ item.instNameEng }})
  367.                                                         </p>
  368.                                                     </div>
  369.                                                 </div>
  370.                                             </div>
  371.                                         {% endfor %}
  372.                                     </div>
  373.                                 </div>
  374.                                 <hr class="caption blue"/>
  375.                                 <div class="col-md-12 pagination-sm pull-right">
  376.                                     {{ knp_pagination_render(childinstitutes) }}
  377.                                 </div>
  378.                             </div>
  379.                         </div>
  380.                         {% endif %}
  381.                         <!-- experts from child institutes -->
  382.                         {% if childmembers.getTotalItemCount > 0 %}
  383.                             <div class="box box-primary">
  384.                                 <!-- /.box-header -->
  385.                                 <div class="box-body">
  386.                                     <div>
  387.                                         <strong>
  388.                                             <i class="fa icon-profile fa-users margin-r-5" aria-hidden="true"></i>
  389.                                             Associated Experts from Child Institutes
  390.                                         </strong>
  391.                                     </div>
  392.                                     <span class="col-md-3 search-display">
  393.                                         Displaying {{ childmembers.getPaginationData.firstItemNumber }}
  394.                                         – {{ childmembers.getPaginationData.lastItemNumber }}
  395.                                         results of {{ childmembers.getTotalItemCount }}.
  396.                                     </span>
  397.                                     <div class="row">
  398.                                         <div class="col-md-12 tblhdrs">
  399.                                             <div class=" selectContainer">
  400.                                                 Show <select
  401.                                                         name="cmlimit"
  402.                                                         id="cmlimit"
  403.                                                         data-id="cmlimit"
  404.                                                         class="maxresults">
  405.                                                     {% for key,option in limits.childmemberlimit.options %}
  406.                                                         {% if limits.childmemberlimit.selected == key %}
  407.                                                             <option id="{{ key }}" selected>{{ option }}</option>
  408.                                                         {% else %}
  409.                                                             <option id="{{ key }}">{{ option }}</option>
  410.                                                         {% endif %}
  411.                                                     {% endfor %}
  412.                                                 </select> Records
  413.                                             </div>
  414.                                             <span class=" pagination-sm">
  415.                                                 {{ knp_pagination_render(childmembers) }}
  416.                                             </span>
  417.                                         </div>
  418.                                     </div>
  419.                                     <div class="row list-group">
  420.                                         <div class="col-md-12">
  421.                                             {% for item in childmembers %}
  422.                                                 <div class="item  col-xs-4 col-lg-4 list-group-item">
  423.                                                     <div class="thumbnail-institution">
  424.                                                         <a
  425.                                                                 href="{{ path('view_profile', {'user': item.idInd}) }}"
  426.                                                                 class="profile-url">
  427.                                                             <img
  428.                                                                     class="group list-group-image lazy img-thumbnail img-responsive"
  429.                                                                     data-original="{% if file_exists(web_path~asset('uploads/profile/profile_'~item.idInd~'.png')) %}{{ asset('uploads/profile/profile_'~item.idInd~'.png') }}{% endif %}"
  430.                                                                     alt="Institution Logo"
  431.                                                                     src="{{ asset('assets/uploads/default.png') }}"
  432.                                                                     onError="this.src='{{ asset('assets/uploads/default.png') }}';">
  433.                                                         </a>
  434.                                                         <div class="caption">
  435.                                                             <p class="group inner list-group-item-text">
  436.                                                                 <strong>
  437.                                                                     <a
  438.                                                                             href="{{ path('view_profile', {'user': item.idInd}) }}"
  439.                                                                             class="profile-url">
  440.                                                                         {{ item.fname | raw | title }} {{ item.sname | raw | upper }}
  441.                                                                     </a>
  442.                                                                 </strong>
  443.                                                                 {% if item.qualityChecked == 1 %}
  444.                                                                     <i
  445.                                                                             class="green fa fa-check-circle tipso"
  446.                                                                             title="User has been verified.">
  447.                                                                     </i>
  448.                                                                 {% endif %}
  449.                                                                 {% if item.retired == 1 %}
  450.                                                                     <span
  451.                                                                             class="label label-success">
  452.                                                                         Retired
  453.                                                                     </span>
  454.                                                                 {% endif %}
  455.                                                                 {% if item.deceased == 1 %} <span
  456.                                                                         class="label label-danger">Deceased</span>{% endif %}
  457.                                                                 <br/>{% if item.jobtitle != "" %}{{ item.jobtitle }}<br/>{% endif %}
  458.                                                                 {{ item.instName }}
  459.                                                             </p>
  460.                                                         </div>
  461.                                                     </div>
  462.                                                 </div>
  463.                                             {% endfor %}
  464.                                         </div>
  465.                                     </div>
  466.                                     <hr class="caption blue"/>
  467.                                     <div class="col-md-12 pagination-sm pull-right">
  468.                                         {{ knp_pagination_render(childmembers) }}
  469.                                     </div>
  470.                                 </div>
  471.                             </div>
  472.                         {% endif %}
  473.                     </div>
  474.                     <!-- /.col -->
  475.                 </div>
  476.             </section>
  477.         </div>
  478.         <em id='edited-by'
  479.             class="pull-right italics">
  480.             {% if institute.fDateEntered is defined and institute.fDateEntered != "" %}
  481.                 Created: {{ institute.fDateEntered|date('Y-m-d') }}
  482.                 {% if institute.createdBy is defined and  institute.createdBy != "" %}
  483.                     by {{ institute.createdBy }}
  484.                 {% endif %}
  485.                 |
  486.             {% endif %}
  487.             {% if institute.lDateUpdated is defined and institute.lDateUpdated != "" %}
  488.                 Last Updated: {{ institute.lDateUpdated|date('Y-m-d') }}
  489.             {% endif %}
  490.             {% if institute.lastEditBy is defined and  institute.lastEditBy != "" %}
  491.                 by {{ institute.lastEditBy }}
  492.             {% endif %}
  493.         </em>
  494.     </div>
  495.     {% include('footer.html.twig') %}
  496.     <script
  497.             src="{{ asset('js/jquery.noty.packaged.min.js') }}"
  498.             type="text/javascript">
  499.     </script>
  500.     <script
  501.             src="{{ asset('js/tipped.js') }}"
  502.             type="text/javascript">
  503.     </script>
  504.     <script type="text/javascript">
  505.         $(function () {
  506.             Tipped.create('.tipso', {maxWidth: 250});
  507.             function notify(type, text) {
  508.                 var n = noty({
  509.                     text: text,
  510.                     layout: 'top',
  511.                     theme: 'relax', // or 'relax'
  512.                     type: type,
  513.                     timeout: 5000,
  514.                 });
  515.             }
  516.             {% for flashMessage in app.session.flashbag.get('record_updated') %}
  517.             notify('success', '{{ flashMessage }}');
  518.             {% endfor %}
  519.             {% if is_granted('ROLE_GLOBAL_EDITOR') %}
  520.             $(document).delegate(".activate", "click", function () {
  521.                 $(this).html('<i class="fa fa-cog fa-spin" aria-hidden="true"></i> Activate')
  522.                 $.ajax({
  523.                     url: "{{ path('activate_institute',{'instituteId': institute.idInst}) }}",
  524.                     type: 'POST',
  525.                 })
  526.                         .done(function (response) {
  527.                             if (response.status === true) {
  528.                                 $(".statusBtn").html('<button class="btn btn-danger ban" id="ban"><i class="fa fa-ban" aria-hidden="true"></i> Deactivate</button>');
  529.                             } else {
  530.                                 $(".statusBtn").html('<button class="btn btn-success activate" id="activate"><i class="fa fa-check" aria-hidden="true"></i> Activate</button>');
  531.                             }
  532.                         });
  533.             });
  534.             $(document).delegate(".ban", "click", function () {
  535.                 $(this).html('<i class="fa fa-cog fa-spin" aria-hidden="true"></i> Deactivate')
  536.                 $.ajax({
  537.                     url: "{{ path('deactivate_institute',{'instituteId': institute.idInst}) }}",
  538.                     type: 'POST',
  539.                 })
  540.                         .done(function (response) {
  541.                             if (response.status === true) {
  542.                                 $(".statusBtn").html('<button class="btn btn-success activate" id="activate"><i class="fa fa-check" aria-hidden="true"></i> Activate</button>');
  543.                             } else {
  544.                                 $(".statusBtn").html('<button class="btn btn-danger ban" id="ban"><i class="fa fa-ban" aria-hidden="true"></i> Deactivate</button>');
  545.                             }
  546.                         });
  547.             });
  548.             {% endif %}
  549.                 //on select change, you navigate to indexAction and send the parameter maxItemPerPage
  550.                 $('.maxresults').change(function(){
  551.                     $this = $(this);
  552.                     var key = $this.data("id");
  553.                     //var url = '{{ path('view_institution',{'instId':institute.idInst}) }}';
  554.                     var item = $this.find(":selected").text();
  555.                     window.location.href = updateURL(key,item);
  556.                     // window.location.href = updateQueryStringParameter(url,key,item);
  557.                 })
  558.         });
  559.         function updateURL(key,val){
  560.             var url = window.location.href;
  561.             var reExp = new RegExp("[\?|\&]"+key + "=[0-9a-zA-Z\_\+\-\|\.\,\;]*");
  562.             if(reExp.test(url)) {
  563.                 // update
  564.                 reExp = new RegExp("[\?&]" + key + "=([^&#]*)");
  565.                 var delimiter = reExp.exec(url)[0].charAt(0);
  566.                 url = url.replace(reExp, delimiter + key + "=" + val);
  567.             } else {
  568.                 // add
  569.                 var newParam = key + "=" + val;
  570.                 if(url.indexOf('?') === -1){url += '?';}
  571.                 if(url.indexOf('#') > -1){
  572.                     var urlparts = url.split('#');
  573.                     url = urlparts[0] +  "&" + newParam +  (urlparts[1] ?  "#" +urlparts[1] : '');
  574.                 } else {
  575.                     url += "&" + newParam;
  576.                 }
  577.             }
  578.             url = url.replace('?&', '?');
  579.             return url;
  580.         }
  581.     </script>
  582. {% endblock %}