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