templates/Profile/profile.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}
  3.     OceanExpert - A Directory of Marine and Freshwater Professionals
  4. {% endblock %}
  5. {% block stylesheets %}
  6.     <link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.min.css') }}">
  7.     <link rel="stylesheet" type="text/css" href="{{ asset('css/viewProfile.css') }}">
  8.     <link rel="stylesheet" type="text/css" href="{{ asset('css/select2.min.css') }}">
  9.     <link rel="stylesheet" type="text/css" href="{{ asset('css/select2-bootstrap.css') }}">
  10.     <link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap-print.min.css') }}">
  11.     <link rel="stylesheet" type="text/css" href="{{ asset('css/font-awesome.min.css') }}">
  12.     <link rel="stylesheet" type="text/css" href="{{ asset('css/navbar-login.css') }}">
  13.     <link rel="stylesheet" type="text/css" href="{{ asset('css/social-buttons.css') }}">
  14.     <link rel="stylesheet" type="text/css" href="{{ asset('css/style.css') }}">
  15.     <link rel="stylesheet" type="text/css" href="{{ asset('css/search.css') }}">
  16.     <link rel="stylesheet" type="text/css" href="{{ asset('css/google-fonts.css') }}">
  17.     <link rel="stylesheet" type="text/css" href="{{ asset('css/AdminLTE.min.css') }}">
  18.     <link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.vertical-tabs.css') }}">
  19.     <link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap-datepicker.min.css') }}">
  20.     <link rel="stylesheet" type="text/css" href="{{ asset('css/tipped.css') }}">
  21. {% endblock %}
  22. {% block body %}
  23.     <style>
  24.         .form-inline > * {
  25.             margin: 15px 10px !important;
  26.         }
  27.         .tipso {
  28.             cursor: pointer;
  29.             font-size: 20px;
  30.         }
  31.     </style>
  32.     {% include('navbarlogin.html.twig') %}
  33.     {% if OIHData is defined %}
  34.         <!-- JSON-LD will be used for SEO and OIH -->
  35.         <script type="application/ld+json">
  36.             {{ OIHData | raw }}
  37.         </script>
  38.     {% endif %}
  39.     <div class="container-fluid">
  40.         <!-- Content Wrapper. Contains page content -->
  41.         <div class="">
  42.             <!-- Main content -->
  43.             <section class="content">
  44.                 {% if is_granted('ROLE_ADMIN')
  45.                     and is_granted('ROLE_PREVIOUS_ADMIN') == false
  46.                     and (expert.username is defined) %}
  47.                     <a
  48.                             id=""
  49.                             class="btn btn-primary pull-right"
  50.                             href="?_switch_user={{ expert.username }}"
  51.                             role="button">
  52.                         Login as this user
  53.                     </a>
  54.                 {% endif %}
  55.                 <img
  56.                         src="{{ asset('img/oceanexpert-print.png') }}"
  57.                         alt="print logo"
  58.                         class="print-logo"/>
  59.                 {% if expert.expertInfo.idInd is not defined %}
  60.                     <div class="alert alert-error">
  61.                         <h4>
  62.                             <strong>
  63.                                 <i class="fa fa-exclamation-triangle fa-fw" aria-hidden="true"></i>
  64.                                 The profile you are looking for was not found.
  65.                             </strong>
  66.                         </h4>
  67.                         <span>
  68.                             <a
  69.                                     href="{{ path('frontend_homepage') }}"
  70.                                     title="">
  71.                                 click here
  72.                             </a> to got to the Home Page.
  73.                         </span>
  74.                     </div>
  75.                 {% elseif expert.expertInfo.idInd is defined and expert.error is defined %}
  76.                     <div class="alert alert-error">
  77.                         {% if expert.expertInfo.idInd is defined %}
  78.                             {% if is_granted('ROLE_GLOBAL_EDITOR') %}
  79.                                 <h4>
  80.                                     <strong>
  81.                                         <i class="fa fa-exclamation-triangle fa-fw" aria-hidden="true"> </i>
  82.                                         Sorry we cannot display this profile yet as this profile is incomplete.
  83.                                     </strong>
  84.                                 </h4>
  85.                                 <span>
  86.                                     <a
  87.                                             href="{{ path('fos_admin_profile_edit',{'userId': expert.expertInfo.idInd}) }}"
  88.                                             title="">
  89.                                         click here
  90.                                     </a> to enter the necessary information.
  91.                                 </span>
  92.                             {% else %}
  93.                                 <h4>
  94.                                     <strong>
  95.                                         <i class="fa fa-exclamation-triangle fa-fw" aria-hidden="true"></i>
  96.                                         Sorry we cannot display your profile yet as your profile is incomplete.
  97.                                     </strong>
  98.                                 </h4>
  99.                                 <span>
  100.                                     <a
  101.                                             href="{{ path('fos_admin_profile_edit',{'userId': expert.expertInfo.idInd}) }}"
  102.                                             title="">
  103.                                         click here
  104.                                     </a> to enter the necessary information.
  105.                                 </span>
  106.                             {% endif %}
  107.                         {% else %}
  108.                             <h4>
  109.                                 <strong>
  110.                                     <i class="fa fa-exclamation-triangle fa-fw" aria-hidden="true"></i>
  111.                                     The profile you are looking for was not found.
  112.                                 </strong>
  113.                             </h4>
  114.                             <span>
  115.                                 <a
  116.                                         href="{{ path('frontend_homepage') }}"
  117.                                         title="">
  118.                                     click here
  119.                                 </a> to got to the Home Page.
  120.                             </span>
  121.                         {% endif %}
  122.                     </div>
  123.                 {% else %}
  124.                     <div class="row">
  125.                         <div class="col-md-3 col-p-5">
  126.                             <!-- Profile Image -->
  127.                             <div class="box box-primary">
  128.                                 <div class="box-body box-profile">
  129.                                     {% if expert.expertInfo.idInd is defined and expert.expertInfo.idInd | trim != "" %}
  130.                                         <h4 class="text-center">
  131.                                             OceanExpert ID : <strong>{{ expert.expertInfo.idInd}}</strong>
  132.                                         </h4>
  133.                                     {% endif %}
  134.                                     <img
  135.                                             class="profile-user-img img-responsive lazy"
  136.                                             data-original="{% if file_exists(web_path~asset('uploads/profile/profile_'~expert.expertInfo.idInd~'.png')) %}
  137.                                                         {{ asset('uploads/profile/profile_'~expert.expertInfo.idInd~'.png') }}
  138.                                                     {% else %}
  139.                                                         {{ asset('assets/uploads/default.png') }}
  140.                                                     {% endif %}"
  141.                                             alt="User profile picture"
  142.                                             onError="this.src='{{ asset('assets/uploads/default.png') }}';" />
  143.                                     {% if expert.expertInfo.fname is defined %}
  144.                                         <h2 class="expert-name">
  145.                                             {% if expert.expertInfo.title is defined %}
  146.                                                 {{ expert.expertInfo.title | raw }}
  147.                                             {% endif %}
  148.                                             {% if expert.expertInfo.fname is defined %}
  149.                                                 {{ expert.expertInfo.fname | raw }}
  150.                                             {% endif %}
  151.                                             {% if expert.expertInfo.mname is defined %}
  152.                                                 {{ expert.expertInfo.mname | raw }}
  153.                                             {% endif %}
  154.                                             {% if expert.expertInfo.sname is defined %}
  155.                                                 {{ expert.expertInfo.sname | raw | upper }}
  156.                                             {% endif %}
  157.                                             {% if expert.expertInfo.qualityChecked == 1 %}
  158.                                                 <i class="tipso green fa fa-check-circle" title="User has been verified."></i>
  159.                                             {% endif %}
  160.                                         </h2>
  161.                                     {% endif %}
  162.                                     {% if expert.expertInfo.retired is defined and expert.expertInfo.retired == 1 %}
  163.                                         <p class="text-center">
  164.                                             <span class="label label-success">
  165.                                                 Retired {% if expert.expertInfo.retiredDate is not null and expert.expertInfo.retiredDate|date("d/m/Y") !="30/11/-0001" %}
  166.                                                     on {{ expert.expertInfo.retiredDate | date("d/m/Y") }}
  167.                                                 {% endif %}
  168.                                             </span>
  169.                                         </p>
  170.                                     {% endif %}
  171.                                     {% if expert.expertInfo.deceased is defined and expert.expertInfo.deceased == 1 %}
  172.                                         <p class="text-center">
  173.                                             <span class="label label-danger">
  174.                                                 Deceased {% if expert.expertInfo.deceasedDate is not null and expert.expertInfo.deceasedDate|date("d/m/Y") !="30/11/-0001" %}
  175.                                                     on {{ expert.expertInfo.deceasedDate | date("d/m/Y") }}
  176.                                                 {% endif %}
  177.                                             </span>
  178.                                         </p>
  179.                                     {% endif %}
  180.                                     {% if expert.expertInfo.jobtitle is defined and expert.expertInfo.deceased == 0 %}
  181.                                         <p class="text-center">
  182.                                             {{ expert.expertInfo.jobtitle | raw }}
  183.                                         </p>
  184.                                     {% endif %}
  185.                                     {% if expert.expertInfo.dept is defined %}
  186.                                         <p class="text-center">
  187.                                             {{ expert.expertInfo.dept | raw }}
  188.                                         </p>
  189.                                     {% endif %}
  190.                                     {% if expert.instName is defined %}
  191.                                         <p class="lead text-center">
  192.                                             {% if expert.expertInfo.deceased == 1 %}
  193.                                                 <small>Last Associated with:</small><br/>
  194.                                             {% endif %}
  195.                                             {% if expert.idInst is defined
  196.                                                 and expert.idInst != ""
  197.                                             %}
  198.                                                 <a
  199.                                                         href="{{ path('view_institution',{'instId': expert.idInst}) }}"
  200.                                                         title="">
  201.                                                     {{ expert.instName }}
  202.                                                 </a>
  203.                                             {% endif %}
  204.                                         </p>
  205.                                     {% endif %}
  206.                                     <p class="lead text-center print">
  207.                                         {% if app.user.id is defined and expert.expertInfo.idInd is not defined %}
  208.                                             <a
  209.                                                     href="{{ path('fos_admin_profile_edit',{'userId': app.user.id}) }}"
  210.                                                     class="btn btn-primary">
  211.                                                 <i class="fa fa-user" aria-hidden="true"></i> Edit Profile
  212.                                             </a>
  213.                                         {% endif %}
  214.                                         {% if expert.expertInfo.idInd is defined %}
  215.                                         {% if (app.user is not null and expert.expertInfo.idInd == app.user.id) or is_granted('ROLE_GLOBAL_EDITOR') %}
  216.                                             {% if is_granted('ROLE_GLOBAL_EDITOR') %}
  217.                                                 {% if expert.expertInfo.status is defined and (expert.expertInfo.status  == 0 or expert.expertInfo.status  == 3 ) %}
  218.                                                     <span class="statusBtn">
  219.                                                             <button class="btn btn-success activate">
  220.                                                                 <i class="fa fa-check" aria-hidden="true"></i>
  221.                                                                 Activate
  222.                                                             </button>
  223.                                                         </span>
  224.                                                 {% elseif expert.expertInfo.status is defined and expert.expertInfo.status == 1 %}
  225.                                                     <span class="statusBtn">
  226.                                                             <button
  227.                                                                     class="btn btn-danger ban">
  228.                                                                 <i class="fa fa-ban" aria-hidden="true"> </i>
  229.                                                                 Deactivate
  230.                                                             </button>
  231.                                                         </span>
  232.                                                 {% elseif expert.expertInfo.status is defined and expert.expertInfo.status == 2 %}
  233.                                                     <span class="statusBtn">
  234.                                                             <button class="btn btn-warning undelete">
  235.                                                                 <i class="fa fa-check" aria-hidden="true"></i>
  236.                                                                 Un-Delete
  237.                                                             </button>
  238.                                                         </span>
  239.                                                 {% elseif expert.expertInfo.status is defined and expert.expertInfo.status == 3 %}
  240.                                                     <span class="statusBtn">
  241.                                                             <button class="btn btn-aqua activate">
  242.                                                                 <i class="fa fa-check" aria-hidden="true"></i>
  243.                                                                 Activate
  244.                                                             </button>
  245.                                                         </span>
  246.                                                 {% endif %}
  247.                                             {% endif %}
  248.                                             {% if app.user.id == expert.expertInfo.idInd %}
  249.                                                 <a
  250.                                                         href="{{ path('fos_admin_profile_edit',{'userId': expert.expertInfo.idInd}) }}"
  251.                                                         class="btn btn-primary">
  252.                                                     <i class="fa fa-user" aria-hidden="true"></i>
  253.                                                     Edit Profile
  254.                                                 </a>
  255.                                             {% else %}
  256.                                                 <a
  257.                                                         href="{{ path('fos_admin_profile_edit',{'userId': expert.expertInfo.idInd}) }}"
  258.                                                         class="btn btn-primary">
  259.                                                     <i class="fa fa-user" aria-hidden="true"></i>
  260.                                                     Edit Profile
  261.                                                 </a>
  262.                                             {% endif %}
  263.                                         {% endif %}
  264.                                     </p>
  265.                                     {% endif %}
  266.                                 </div>
  267.                                 <!-- /.box-body -->
  268.                             </div>
  269.                             <!-- /.box -->
  270.                             <!-- About Me Box -->
  271.                             {% if expert.expertInfo is defined %}
  272.                                 <div class="box box-primary">
  273.                                     <!-- /.box-header -->
  274.                                     <div class="box-body">
  275.                                         <strong>
  276.                                             <i class="fa icon-profile fa-map-marker margin-r-5" aria-hidden="true"></i>
  277.                                             Work Location
  278.                                         </strong>
  279.                                         <div class="data">
  280.                                             {{ expert.workLocation | raw }}
  281.                                         </div>
  282.                                         {% if expert.nationality is defined and expert.nationality !="" %}
  283.                                             <hr>
  284.                                             <strong>
  285.                                                 <i class="fa icon-profile fa-flag margin-r-5" aria-hidden="true"></i>
  286.                                                 Nationality
  287.                                             </strong>
  288.                                             <p class="data">
  289.                                                 {{ expert.nationality|replace({',':"\n"})|nl2br }}
  290.                                             </p>
  291.                                         {% endif %}
  292.                                         <hr>
  293.                                         {% if expert.expertInfo.deceased == 0 %}
  294.                                             <strong>
  295.                                                 <i class="fa icon-profile fa-envelope margin-r-5"></i>
  296.                                                 Email(s)
  297.                                             </strong>
  298.                                             {% if expert.expertInfo.email1 is defined %}
  299.                                                 {% if app.user.id is defined %}
  300.                                                     <p class="data">
  301.                                                         <u>Primary Email:</u><br/>
  302.                                                         <a
  303.                                                                 href="mailto:{{ expert.expertInfo.email1 }}">
  304.                                                             {{ expert.expertInfo.email1 | raw }}
  305.                                                         </a>
  306.                                                     </p>
  307.                                                     {% if expert.expertInfo.email2 is defined and expert.expertInfo.email2!="" %}
  308.                                                         <p class="data">
  309.                                                             <u>Notification Email:</u><br/>
  310.                                                             <a
  311.                                                                     href="mailto:{{ expert.expertInfo.email2 }}">
  312.                                                                 {{ expert.expertInfo.email2 | raw }}
  313.                                                             </a>
  314.                                                         </p>
  315.                                                     {% else %}
  316.                                                         <p class="data">
  317.                                                             <u>Notification Email:</u><br/>
  318.                                                             Same as Primary.
  319.                                                         </p>
  320.                                                     {% endif %}
  321.                                                 {% else %}
  322.                                                     <p class="data">
  323.                                                         Please login to see the email.
  324.                                                     </p>
  325.                                                 {% endif %}
  326.                                             {% endif %}
  327.                                             {% if expert.expertInfo.tel is defined and expert.expertInfo.tel !="" %}
  328.                                                 <hr>
  329.                                                 <strong>
  330.                                                     <i class="fa icon-profile fa-phone-square margin-r-5"></i>
  331.                                                     Telephone
  332.                                                 </strong>
  333.                                                 <p class="data">
  334.                                                     {{ expert.expertInfo.tel }}
  335.                                                 </p>
  336.                                             {% endif %}
  337.                                             {% if expert.expertInfo.fax is defined and expert.expertInfo.fax != "" %}
  338.                                                 <hr>
  339.                                                 <strong>
  340.                                                     <i class="fa icon-profile fa-fax margin-r-5"></i>
  341.                                                     Fax
  342.                                                 </strong>
  343.                                                 <p class="data">
  344.                                                     {{ expert.expertInfo.fax }}
  345.                                                 </p>
  346.                                             {% endif %}
  347.                                         {% endif %}
  348.                                         {% if is_granted('ROLE_GLOBAL_EDITOR') or (app.user.id is defined and expert.expertInfo.idInd == app.user.id ) %}
  349.                                             {% if expert.expertInfo.gender is defined %}
  350.                                                 <hr>
  351.                                                 <strong>
  352.                                                     <i class="fa icon-profile fa-venus-mars margin-r-5" aria-hidden="true"></i>
  353.                                                     Gender
  354.                                                 </strong>
  355.                                                 <p class="data">
  356.                                                     {{ expert.expertInfo.gender|capitalize }}
  357.                                                 </p>
  358.                                                 <hr/>
  359.                                             {% endif %}
  360.                                         {% endif %}
  361.                                     </div>
  362.                                     <!-- /.box-body -->
  363.                                 </div>
  364.                                 <!-- /.box -->
  365.                             {% endif %}
  366.                         </div>
  367.                         <div class="col-md-9 col-p-7">
  368.                             <div class="nav-tabs-custom">
  369.                                 <ul class="nav nav-tabs print ">
  370.                                     {% if app.user.id is defined %}
  371.                                         <li class="active">
  372.                                             <a
  373.                                                     href="#profile"
  374.                                                     data-toggle="tab">
  375.                                                 Profile
  376.                                             </a>
  377.                                         </li>
  378.                                         {% if is_granted('ROLE_GLOBAL_EDITOR') == false %}
  379.                                             {% if app.user.id is defined and app.user.id == expert.expertInfo.idInd %}
  380.                                                 <li>
  381.                                                     <a
  382.                                                             href="#settings"
  383.                                                             data-toggle="tab">
  384.                                                         Settings
  385.                                                     </a>
  386.                                                 </li>
  387.                                             {% endif %}
  388.                                         {% endif %}
  389.                                         {% if is_granted('ROLE_GLOBAL_EDITOR') %}
  390.                                             <li>
  391.                                                 <a
  392.                                                         href="#adminOptions"
  393.                                                         data-toggle="tab">
  394.                                                     Admin Options
  395.                                                 </a>
  396.                                             </li>
  397.                                         {% endif %}
  398.                                     {% endif %}
  399.                                 </ul>
  400.                                 <div class="tab-content">
  401.                                     <div class="active tab-pane" id="profile">
  402.                                         <div class="btn edit">
  403.                                             <button
  404.                                                     type="button"
  405.                                                     class="btn btn-primary"
  406.                                                     onclick="window.print()">
  407.                                                 <i class="fa fa-print" aria-hidden="true"></i>
  408.                                                 Print
  409.                                             </button>
  410.                                         </div>
  411.                                         {% if expert.profileUrl is defined %}
  412.                                             <div class="box-body">
  413.                                                 <strong>
  414.                                                     <i class="fa icon-profile fa-link margin-r-5"></i>
  415.                                                     Profile URL
  416.                                                 </strong>
  417.                                                 <p class="data">
  418.                                                     <a
  419.                                                             href="{{ expert.profileUrl }}">
  420.                                                         {{ expert.profileUrl }}
  421.                                                     </a>
  422.                                                 </p>
  423.                                             </div>
  424.                                         {% endif %}
  425.                                         {% if  (attribute(metadata, 'orcid') is defined and attribute(metadata, 'orcid')!="") or (attribute(metadata, 'researcherid') is defined and attribute(metadata, 'researcherid') !="") %}
  426.                                             <div class="box-body">
  427.                                                 <strong>
  428.                                                     <i class="fa icon-profile fa-external-link margin-r-5" aria-hidden="true"></i>
  429.                                                     Persistent Digital Identifiers (UIDs)
  430.                                                 </strong>
  431.                                                 <p class="data">
  432.                                                     {% if attribute(metadata, 'orcid') is defined and attribute(metadata, 'orcid') != "" %}
  433.                                                         {% if '/' in attribute(metadata, 'orcid') %}
  434.                                                             {% set foo = attribute(metadata, 'orcid') |split('/') %}
  435.                                                             {% set orcid = foo | last %}
  436.                                                             ORCID : <a
  437.                                                                 href="https://orcid.org/{{ orcid }}"
  438.                                                                 target="_blank">
  439.                                                             {{ attribute(metadata, 'orcid') }}
  440.                                                         </a> <br/>
  441.                                                         {% else %}
  442.                                                             ORCID : <a
  443.                                                                 href="https://orcid.org/{{ attribute(metadata, 'orcid') }}"
  444.                                                                 target="_blank">
  445.                                                             {{ attribute(metadata, 'orcid') }}
  446.                                                         </a><br/>
  447.                                                         {% endif %}
  448.                                                     {% endif %}
  449.                                                     {% if  attribute(metadata, 'researcherid') is defined and   attribute(metadata, 'researcherid') != "" %}
  450.                                                         ResearcherID : <a
  451.                                                             href="https://www.researcherid.com/rid/{{ attribute(metadata, 'researcherid') }}"
  452.                                                             target="_blank">
  453.                                                         {{ attribute(metadata, 'researcherid') }}
  454.                                                     </a> <br/>
  455.                                                     {% endif %}
  456.                                                 </p>
  457.                                             </div>
  458.                                         {% endif %}
  459.                                         {% if expert.expertInfo.degree is defined and expert.expertInfo.degree != "" %}
  460.                                             <div class="box-body">
  461.                                                 <strong>
  462.                                                     <i class="fa icon-profile fa-graduation-cap margin-r-5" aria-hidden="true"></i>
  463.                                                     Highest Degree
  464.                                                 </strong>
  465.                                                 <p class="data">
  466.                                                     {{ expert.expertInfo.degree }}
  467.                                                 </p>
  468.                                             </div>
  469.                                         {% endif %}
  470.                                         {% if expert.jobType is defined and expert.jobType != "" %}
  471.                                             <div class="box-body">
  472.                                                 <strong>
  473.                                                     <i class="fa icon-profile fa-briefcase margin-r-5" aria-hidden="true"></i>
  474.                                                     Job Type
  475.                                                 </strong>
  476.                                                 <p class="data">
  477.                                                     {{ expert.jobType|replace({'\\r':"\n"})|nl2br }}
  478.                                                 </p>
  479.                                             </div>
  480.                                         {% endif %}
  481.                                         {% if metadata.researcharea is defined and metadata.researcharea !="" %}
  482.                                             <div class="box-body">
  483.                                                 <strong>
  484.                                                     <i class="fa icon-profile fa-book margin-r-5" aria-hidden="true"></i>
  485.                                                     Subject Area
  486.                                                 </strong>
  487.                                                 <p class="data">
  488.                                                     {{ metadata.researcharea|replace({'\\r':"\n"})|nl2br }}
  489.                                                 </p>
  490.                                             </div>
  491.                                         {% elseif expert.subjectArea is defined and expert.subjectArea != "" %}
  492.                                             <div class="box-body">
  493.                                                 <strong>
  494.                                                     <i class="fa icon-profile fa-book margin-r-5" aria-hidden="true"></i>
  495.                                                     Subject Area
  496.                                                 </strong>
  497.                                                 <p class="data">
  498.                                                     {{ expert.subjectArea|replace({',':"\n"})|nl2br }}
  499.                                                 </p>
  500.                                             </div>
  501.                                         {% endif %}
  502.                                         {% if expert.expertInfo.activeng is defined and expert.expertInfo.activeng !="" %}
  503.                                             <div class="box-body">
  504.                                                 <strong>
  505.                                                     <i class="fa icon-profile fa-flask margin-r-5" aria-hidden="true"></i>
  506.                                                     Activities
  507.                                                 </strong>
  508.                                                 <p class="data">
  509.                                                     {{ expert.expertInfo.activeng|raw }}
  510.                                                 </p>
  511.                                             </div>
  512.                                         {% endif %}
  513.                                         {% if expert.studyregion is defined and expert.studyregion !="" %}
  514.                                             <div class="box-body">
  515.                                                 <strong>
  516.                                                     <i class="fa icon-profile fa-globe margin-r-5" aria-hidden="true"></i>
  517.                                                     Sea regions of study
  518.                                                 </strong>
  519.                                                 <p class="data">
  520.                                                     {{ expert.studyregion|replace({',':"\n"})|nl2br }}
  521.                                                 </p>
  522.                                             </div>
  523.                                         {% elseif expert.expertInfo.studyregion is defined and expert.expertInfo.studyregion !="" %}
  524.                                             <div class="box-body">
  525.                                                 <strong>
  526.                                                     <i class="fa icon-profile fa-book margin-r-5" aria-hidden="true"></i>
  527.                                                     Region of Study
  528.                                                 </strong>
  529.                                                 <p class="data">
  530.                                                     {% if expert.expertInfo.studyregion is defined %}
  531.                                                         {{ expert.expertInfo.studyregion|replace({'\\r':"\n"})|nl2br|title }}
  532.                                                     {% endif %}
  533.                                                 </p>
  534.                                             </div>
  535.                                         {% endif %}
  536.                                         {% if expert.expertInfo.skills is defined and expert.expertInfo.skills !="" %}
  537.                                             <div class="box-body">
  538.                                                 <strong>
  539.                                                     <i class="fa icon-profile fa-puzzle-piece margin-r-5" aria-hidden="true"></i>
  540.                                                     Skills
  541.                                                 </strong>
  542.                                                 <p class="data">
  543.                                                     {{ expert.expertInfo.skills | raw }}
  544.                                                 </p>
  545.                                             </div>
  546.                                         {% endif %}
  547.                                         {% if expert.expertInfo.languages is defined and expert.expertInfo.languages !="" %}
  548.                                             <div class="box-body">
  549.                                                 <strong>
  550.                                                     <i class="fa icon-profile fa-language margin-r-5" aria-hidden="true"></i>
  551.                                                     Working language(s)
  552.                                                 </strong>
  553.                                                 <p class="data">
  554.                                                     {{ expert.expertInfo.languages|replace({",":"<br />"})|raw }}
  555.                                                 </p>
  556.                                             </div>
  557.                                         {% endif %}
  558.                                         {% if  (attribute(metadata, 'google-scholar') is defined and attribute(metadata, 'google-scholar') !="") or (attribute(metadata, 'other-citation') is defined and attribute(metadata, 'other-citation') !="") or (attribute(metadata, 'researchgate') is defined and attribute(metadata, 'researchgate') !="") %}
  559.                                             <div class="box-body">
  560.                                                 <strong>
  561.                                                     <i class="fa icon-profile fa-book margin-r-5" aria-hidden="true"></i>
  562.                                                     Citation(s)
  563.                                                 </strong>
  564.                                                 <p class="data">
  565.                                                     {% if attribute(metadata, 'google-scholar') is defined and attribute(metadata, 'google-scholar') != "" %}
  566.                                                         <a href="{{ attribute(metadata, 'google-scholar') }}"
  567.                                                            target="_blank">Google Scholar</a><br/>
  568.                                                     {% endif %}
  569.                                                     {% if attribute(metadata, 'researchgate') is defined and attribute(metadata, 'researchgate') != "" %}
  570.                                                         <a href="{{ attribute(metadata, 'researchgate') }}"
  571.                                                            target="_blank">ResearchGate</a>
  572.                                                         <br/>
  573.                                                     {% endif %}
  574.                                                     {% if  attribute(metadata, 'other-citation') is defined and   attribute(metadata, 'other-citation') != "" %}
  575.                                                         <a href="{{ attribute(metadata, 'other-citation') }}"
  576.                                                            target="_blank">Other</a><br/>
  577.                                                     {% endif %}
  578.                                                 </p>
  579.                                             </div>
  580.                                         {% endif %}
  581.                                         {% if ((expert.expertInfo.linkedin is defined and expert.expertInfo.linkedin !='' ) or (expert.expertInfo.facebook is defined and expert.expertInfo.facebook !='' ) or (expert.expertInfo.linkedin is defined and expert.expertInfo.twitter !='' ) or (expert.expertInfo.other is defined and expert.expertInfo.other !='' )) and expert.expertInfo.deceased == 0 %}
  582.                                             <div class="box-body">
  583.                                                 <strong>
  584.                                                     <i class="fa icon-profile fa-hashtag margin-r-5" aria-hidden="true"></i>
  585.                                                     Social
  586.                                                 </strong>
  587.                                                 <p>
  588.                                                     {% if expert.expertInfo.linkedin is defined and expert.expertInfo.linkedin !="" %}
  589.                                                         <a
  590.                                                                 href="{{ expert.expertInfo.linkedin }}"
  591.                                                                 target="_blank">
  592.                                                             <img
  593.                                                                     class="social-icon lazy"
  594.                                                                     alt="linkedin img"
  595.                                                                     data-original="{{ asset('img/linkedin-logo.png') }}" />
  596.                                                         </a>
  597.                                                     {% endif %}
  598.                                                     {% if expert.expertInfo.facebook is defined and expert.expertInfo.facebook !="" %}
  599.                                                         <a
  600.                                                                 href="{{ expert.expertInfo.facebook }}"
  601.                                                                 target="_blank">
  602.                                                             <img
  603.                                                                     class="social-icon lazy"
  604.                                                                     alt="facebook img"
  605.                                                                     data-original="{{ asset('img/facebook-logo.png') }}" />
  606.                                                         </a>
  607.                                                     {% endif %}
  608.                                                     {% if expert.twitter and expert.twitter !="" %}
  609.                                                         <a
  610.                                                                 href="{{ expert.twitter }}"
  611.                                                                 target="_blank">
  612.                                                             <img
  613.                                                                     class="social-icon lazy img-fluid"
  614.                                                                     alt="X img"
  615.                                                                     data-original="{{ asset('img/x-logo.png') }}" />
  616.                                                         </a>
  617.                                                     {% endif %}
  618.                                                     {% if expert.expertInfo.other %}
  619.                                                         <a
  620.                                                                 href="{{ expert.expertInfo.other }}"
  621.                                                                 target="_blank">
  622.                                                             <img
  623.                                                                     class="social-icon lazy"
  624.                                                                     alt="other img"
  625.                                                                     data-original="{{ asset('img/other.png') }}" />
  626.                                                         </a>
  627.                                                     {% endif %}
  628.                                                 </p>
  629.                                             </div>
  630.                                         {% endif %}
  631.                                         {% if ((expert.expertInfo.url1 is defined or expert.expertInfo.url2 is defined ) and (expert.expertInfo.url1 != "" or expert.expertInfo.url2 != "" )) and  expert.expertInfo.deceased == 0 %}
  632.                                             <div class="box-body">
  633.                                                 <strong>
  634.                                                     <i class="fa icon-profile fa-globe margin-r-5" aria-hidden="true"></i>
  635.                                                     Website(s)
  636.                                                 </strong>
  637.                                                 {% if expert.expertInfo.url1 %}
  638.                                                     <p class="data">
  639.                                                         <a
  640.                                                                 href="{{ expert.expertInfo.url1 }}"
  641.                                                                 title="Website"
  642.                                                                 target="_blank">
  643.                                                             {{ expert.expertInfo.url1 }}
  644.                                                         </a>
  645.                                                     </p>
  646.                                                 {% endif %}
  647.                                                 {% if expert.expertInfo.url2 %}
  648.                                                     <p class="data">
  649.                                                         <a
  650.                                                                 href="{{ expert.expertInfo.url2 }}"
  651.                                                                 title="Website"
  652.                                                                 target="_blank">
  653.                                                             {{ expert.expertInfo.url2 }}
  654.                                                         </a>
  655.                                                     </p>
  656.                                                 {% endif %}
  657.                                             </div>
  658.                                         {% endif %}
  659.                                         {% if expert.expertInfo.comments is defined and expert.expertInfo.comments !="" %}
  660.                                             <div class="box-body">
  661.                                                 <strong>
  662.                                                     <i class="fa icon-profile fa-comments" aria-hidden="true"></i>
  663.                                                     Comment(s)
  664.                                                 </strong>
  665.                                                 <p class="data">
  666.                                                     {{ expert.expertInfo.comments | raw }}
  667.                                                 </p>
  668.                                             </div>
  669.                                         {% endif %}
  670.                                         {% if app.user and eventData.getTotalItemCount > 0 %}
  671.                                             <div class="box box-primary eventParticipation">
  672.                                                 <!-- /.box-header -->
  673.                                                 <div class="box-body">
  674.                                                     <div>
  675.                                                         <strong>
  676.                                                             <i class="fa fa-calendar margin-r-5" aria-hidden="true"></i>
  677.                                                             EVENTS IN WHICH {% if expert.expertInfo.fname is defined %}
  678.                                                                 {% if expert.expertInfo.title is defined %}
  679.                                                                     {{ expert.expertInfo.title | raw }}
  680.                                                                 {% endif %}
  681.                                                                 {% if expert.expertInfo.fname is defined %}
  682.                                                                     {{ expert.expertInfo.fname | raw }}
  683.                                                                 {% endif %}
  684.                                                                 {% if expert.expertInfo.sname is defined %}
  685.                                                                     {{ expert.expertInfo.sname | raw | upper }}
  686.                                                                 {% endif %}
  687.                                                             {% endif %} IS/HAS BEEN INVOLVED. ({{ eventData.getTotalItemCount }})
  688.                                                         </strong>
  689.                                                     </div>
  690.                                                     <span class="col-md-6 search-display">
  691.                                                         Displaying {{ eventData.getPaginationData.firstItemNumber }} â€“ {{ eventData.getPaginationData.lastItemNumber }} results of {{ eventData.getTotalItemCount }}.
  692.                                                     </span>
  693.                                                     <span class="col-md-6">
  694.                                                         <div class=" pagination-sm pull-right">
  695.                                                             {{ knp_pagination_render(eventData) }}
  696.                                                         </div>
  697.                                                     </span>
  698.                                                     <div class="col-md-12">
  699.                                                         <table class="table table-striped table-hover">
  700.                                                             <tbody>
  701.                                                             {% for item in eventData %}
  702.                                                                 <tr>
  703.                                                                     <td>
  704.                                                                         <i class="fa fa-calendar fa-4x" aria-hidden="true"></i>
  705.                                                                     </td>
  706.                                                                     <td>
  707.                                                                         <strong>
  708.                                                                             <a
  709.                                                                                     href="{{ path('view_event', {'event': item.idEvent}) }}"
  710.                                                                                     class="profile-url">{{ item.title }}
  711.                                                                             </a>
  712.                                                                         </strong><br />
  713.                                                                         {{ item.startOn|date('d/m/Y') }} - {{ item.endOn | date('d/m/y') }}<br />
  714.                                                                         {% if item.address is defined and item.address!="" %}
  715.                                                                             {{ item.address | raw }}<br />
  716.                                                                         {% endif %}
  717.                                                                         {% if item.city is defined and item.city!="" %}
  718.                                                                             {{ item.city | raw }}
  719.                                                                         {% endif %}
  720.                                                                         {% if item.state is defined and item.state!="" %}
  721.                                                                             {{ item.state | raw }}<br />
  722.                                                                         {% endif %}
  723.                                                                         {% if item.country is defined and item.country!="" %}
  724.                                                                             {{ item.country | raw | upper }}
  725.                                                                         {% endif %}
  726.                                                                     </td>
  727.                                                                 </tr>
  728.                                                             {% endfor %}
  729.                                                             </tbody>
  730.                                                         </table>
  731.                                                     </div>
  732.                                                     <span class="col-md-12">
  733.                                                         <div class=" pagination-sm pull-right">
  734.                                                             {{ knp_pagination_render(eventData) }}
  735.                                                         </div>
  736.                                                     </span>
  737.                                                 </div>
  738.                                             </div>
  739.                                         {% endif %}
  740.                                     </div>
  741.                                     <!-- /.tab-pane -->
  742.                                     {% if is_granted('ROLE_GLOBAL_EDITOR') == false %}
  743.                                         {% if app.user.id is defined and app.user.id == expert.expertInfo.idInd %}
  744.                                             <div
  745.                                                     class="tab-pane"
  746.                                                     id="settings">
  747.                                                 <div class="row">
  748.                                                     <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">
  749.                                                         <!-- Nav tabs -->
  750.                                                         <ul class="nav nav-tabs tabs-left sideways">
  751.                                                             {#<li class="active"><a href="#general"#}
  752.                                                             {#data-toggle="tab">General</a>#}
  753.                                                             {#</li>#}
  754.                                                             <li>
  755.                                                                 <a
  756.                                                                         href="#status"
  757.                                                                         data-toggle="tab">
  758.                                                                     Change Status
  759.                                                                 </a>
  760.                                                             </li>
  761.                                                             <!--
  762.                                                             <li>
  763.                                                                 <a
  764.                                                                         href="#changeUsername"
  765.                                                                         data-toggle="tab">
  766.                                                                     Change Username
  767.                                                                 </a>
  768.                                                             </li>
  769.                                                             -->
  770.                                                             <li>
  771.                                                                 <a
  772.                                                                         href="#email"
  773.                                                                         data-toggle="tab">
  774.                                                                     Change Email
  775.                                                                 </a>
  776.                                                             </li>
  777.                                                             <li>
  778.                                                                 <a
  779.                                                                         href="#subscription"
  780.                                                                         data-toggle="tab">
  781.                                                                     Email Subscription
  782.                                                                 </a>
  783.                                                             </li>
  784.                                                             <li>
  785.                                                                 <a
  786.                                                                         href="#delete"
  787.                                                                         data-toggle="tab">
  788.                                                                     Deactivate Account
  789.                                                                 </a>
  790.                                                             </li>
  791.                                                         </ul>
  792.                                                     </div>
  793.                                                     <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9">
  794.                                                         <!-- Tab panes -->
  795.                                                         <div class="tab-content">
  796.                                                             <div class="tab-pane active" id="general">
  797.                                                                 <legend class="panel-content">
  798.                                                                     User settings
  799.                                                                 </legend>
  800.                                                             </div>
  801.                                                             <div class="tab-pane" id="status">
  802.                                                                 <legend class="panel-content">
  803.                                                                     Change your status (Retirement)
  804.                                                                 </legend>
  805.                                                                 Have you retired recently?
  806.                                                                 Please use the options below to change your profile status to <em>retired</em>
  807.                                                                 and to add the date of your retirement.
  808.                                                                 <form class="form-inline col-xs-12 col-sm-8 col-md-offset-3 col-sm-offset-2">
  809.                                                                     <div class="form-group">
  810.                                                                         <div class="onoffswitch">
  811.                                                                             <input
  812.                                                                                     type="checkbox"
  813.                                                                                     name="userRetired"
  814.                                                                                     class="onoffswitch-checkbox"
  815.                                                                                     {% if expert.expertInfo.retired is defined and expert.expertInfo.retired == 1 %}
  816.                                                                                         checked=""
  817.                                                                                     {% endif %}
  818.                                                                                     id="userRetired"
  819.                                                                                     value="{% if expert.expertInfo.retired is defined %}{{ expert.expertInfo.retired }}{% endif %}">
  820.                                                                             <label
  821.                                                                                     class="onoffswitch-label"
  822.                                                                                     for="userRetired">
  823.                                                                                 <span class="onoffswitch-inner"></span>
  824.                                                                                 <span class="onoffswitch-switch"></span>
  825.                                                                             </label>
  826.                                                                         </div>
  827.                                                                     </div>
  828.                                                                     <div class="form-group">
  829.                                                                         <input
  830.                                                                                 type="text"
  831.                                                                                 id="userRetiredDate"
  832.                                                                                 class="form-control datepicker"
  833.                                                                                 {% if expert.expertInfo.retired is defined and expert.expertInfo.retired == 1 %}
  834.                                                                                     {% if expert.expertInfo.retiredDate is not null and expert.expertInfo.retiredDate|date("d/m/Y") !="30/11/-0001" %}
  835.                                                                                         value="{{ expert.expertInfo.retiredDate|date('Y-m-d') }}"
  836.                                                                                     {% endif %}
  837.                                                                                 {% else %}
  838.                                                                                     value=""
  839.                                                                                     disabled=""
  840.                                                                                 {% endif %}
  841.                                                                                 id="userRetiredDate"
  842.                                                                                 placeholder="Retired date" />
  843.                                                                     </div>
  844.                                                                     <button
  845.                                                                             type="button"
  846.                                                                             class="btn btn-success "
  847.                                                                             id="userBtnRetired">
  848.                                                                         Save
  849.                                                                     </button>
  850.                                                                 </form>
  851.                                                             </div>
  852.                                                             <!--
  853.                                                             <div class="tab-pane" id="changeUsername">
  854.                                                                 <legend class="panel-content">
  855.                                                                     Change your Username
  856.                                                                 </legend>
  857.                                                                 <form class="form-horizontal">
  858.                                                                     <span class="text-danger col-sm-offset-2 errorUsername"></span>
  859.                                                                     <div class="form-group">
  860.                                                                         <label for="currentUsername"
  861.                                                                                class="col-sm-2 control-label">Your
  862.                                                                             Username</label>
  863.                                                                         <div class="col-sm-10">
  864.                                                                             <input type="text"
  865.                                                                                    class="form-control currentUsername"
  866.                                                                                    id="currentUsername" readonly=""
  867.                                                                                    value="{% if expert.username is defined %}{{ expert.username | raw }}{% endif %}">
  868.                                                                         </div>
  869.                                                                     </div>
  870.                                                                     <div class="form-group">
  871.                                                                         <label for="newUsername"
  872.                                                                                class="col-sm-2 control-label">New
  873.                                                                             Username</label>
  874.                                                                         <div class="col-sm-10">
  875.                                                                             <input type="text"
  876.                                                                                    class="form-control newUsername"
  877.                                                                                    id="newUsername"
  878.                                                                                    placeholder="Enter new username."
  879.                                                                                    required="">
  880.                                                                         </div>
  881.                                                                     </div>
  882.                                                                     <div class="form-group">
  883.                                                                         <div class="col-sm-offset-2 col-sm-10">
  884.                                                                             <button type="button"
  885.                                                                                     class="btn btn-success changeUsername">
  886.                                                                                 Change Username
  887.                                                                             </button>
  888.                                                                         </div>
  889.                                                                     </div>
  890.                                                                 </form>
  891.                                                             </div>
  892.                                                             -->
  893.                                                             <div class="tab-pane" id="email">
  894.                                                                 <legend class="panel-content">
  895.                                                                     Change your primary email address
  896.                                                                 </legend>
  897.                                                                 <form class="form-horizontal">
  898.                                                                     <div class="text-danger col-sm-offset-2 errorEmail"></div>
  899.                                                                     <div class="form-group">
  900.                                                                         <label for="currentEmail"
  901.                                                                                class="col-sm-2 control-label">Your Primary
  902.                                                                             Email</label>
  903.                                                                         <div class="col-sm-10">
  904.                                                                             <input type="email"
  905.                                                                                    class="form-control currentEmail"
  906.                                                                                    id="currentEmail" readonly=""
  907.                                                                                    value="{% if expert.email is defined %}{{ expert.email | raw }}{% endif %}">
  908.                                                                         </div>
  909.                                                                     </div>
  910.                                                                     <div class="form-group">
  911.                                                                         <label for="newEmail"
  912.                                                                                class="col-sm-2 control-label">New
  913.                                                                             Email</label>
  914.                                                                         <div class="col-sm-10">
  915.                                                                             <input type="email"
  916.                                                                                    class="form-control newEmail"
  917.                                                                                    id="newEmail"
  918.                                                                                    placeholder="Enter new Email."
  919.                                                                                    required="">
  920.                                                                         </div>
  921.                                                                     </div>
  922.                                                                     <div class="form-group">
  923.                                                                         <div class="col-sm-offset-2 col-sm-10">
  924.                                                                             <button type="button"
  925.                                                                                     class="btn btn-success confirmEmail">
  926.                                                                                 Confirm
  927.                                                                                 Email
  928.                                                                             </button>
  929.                                                                         </div>
  930.                                                                     </div>
  931.                                                                     <div class="col-sm-offset-2 col-sm-10 errorConfirmCode text-danger"></div>
  932.                                                                     <div class="form-group" style="display:none;">
  933.                                                                         <label for="confirmCode"
  934.                                                                                class="col-sm-2 control-label">Confirmation
  935.                                                                             Code</label>
  936.                                                                         <div class="col-sm-10">
  937.                                                                             <input type="text"
  938.                                                                                    class="form-control confirmCode"
  939.                                                                                    id="confirmCode"
  940.                                                                                    placeholder="Enter confirmation code."
  941.                                                                                    required="">
  942.                                                                         </div>
  943.                                                                     </div>
  944.                                                                 </form>
  945.                                                             </div>
  946.                                                             <div class="tab-pane" id="subscription">
  947.                                                                 <legend class="panel-content">
  948.                                                                     Change your subscription settings
  949.                                                                 </legend>
  950.                                                                 <div class="col-xs-12 col-sm-8">
  951.                                                                     Do you want to receive emails from OceanExpert/IODE?
  952.                                                                 </div>
  953.                                                                 <form class="form-inline col-xs-12 col-sm-8 col-md-offset-3 col-sm-offset-2">
  954.                                                                     <div class="form-group">
  955.                                                                         <div class="onoffswitch">
  956.                                                                             <input type="checkbox" name="userDoNotInvite"
  957.                                                                                    class="onoffswitch-checkbox"
  958.                                                                                     {% if expert.expertInfo.doNotInvite is defined and expert.expertInfo.doNotInvite == 0 %}
  959.                                                                                         checked=""
  960.                                                                                     {% endif %}
  961.                                                                                    id="userDoNotInvite"
  962.                                                                                    value="1">
  963.                                                                             <label class="onoffswitch-label"
  964.                                                                                    for="userDoNotInvite">
  965.                                                                                 <span class="onoffswitch-inner"></span>
  966.                                                                                 <span class="onoffswitch-switch"></span>
  967.                                                                             </label>
  968.                                                                         </div>
  969.                                                                     </div>
  970.                                                                     <button type="button" class="btn btn-success "
  971.                                                                             id="usrBtnSubscription">
  972.                                                                         Save
  973.                                                                     </button>
  974.                                                                 </form>
  975.                                                             </div>
  976.                                                             <div class="tab-pane" id="delete">
  977.                                                                 <legend class="panel-content">
  978.                                                                     Deactivate your OceanExpert account
  979.                                                                 </legend>
  980.                                                                 We are sorry to see you go.<br />
  981.                                                                 Once your account has been deactivated,
  982.                                                                 you will no longer be able to login to OceanExpert (and partner sites like
  983.                                                                 <a
  984.                                                                         href="https://oceanteacher.org"
  985.                                                                         target="_blank">
  986.                                                                     OTGA
  987.                                                                 </a>, <a
  988.                                                                         href="https://catalogue.odis.org"
  989.                                                                         target="_blank">
  990.                                                                     ODISCat
  991.                                                                 </a>, etc... ) and
  992.                                                                 your profile will no longer be available for other experts to view.<br />
  993.                                                                 In case you choose to change you decision after the account is deactivated,
  994.                                                                 please contact us at <a href="mailto:info@oceanexpert.org">info@oceanexpert.org</a>.
  995.                                                                 <div class="top-buffer50">
  996.                                                                     <button type="button"
  997.                                                                             class="btn btn-danger deactivateAccount col-sm-offset-2 ">
  998.                                                                         Deactivate your Account
  999.                                                                     </button>
  1000.                                                                     <div class="text-danger deleteError"></div>
  1001.                                                                 </div>
  1002.                                                             </div>
  1003.                                                         </div>
  1004.                                                     </div>
  1005.                                                 </div>
  1006.                                             </div>
  1007.                                         {% endif %}
  1008.                                     {% endif %}
  1009.                                     <!-- /.tab-pane -->
  1010.                                     {% if is_granted('ROLE_GLOBAL_EDITOR') %}
  1011.                                         <div class="tab-pane" id="adminOptions">
  1012.                                             <div class="helptext">
  1013.                                                 <i class="fa fa-fw fa-info-circle"></i>
  1014.                                                 Use the following options to change settings for
  1015.                                                 <strong>
  1016.                                                     {% if expert.expertInfo.fname is defined %}
  1017.                                                         {% if expert.expertInfo.title is defined %}{{ expert.expertInfo.title | raw }} {% endif %}
  1018.                                                         {% if expert.expertInfo.fname is defined %}{{ expert.expertInfo.fname | raw }} {% endif %}
  1019.                                                         {% if expert.expertInfo.mname is defined %}{{ expert.expertInfo.mname | raw }} {% endif %}
  1020.                                                         {% if expert.expertInfo.sname is defined %}{{ expert.expertInfo.sname | raw | upper }} {% endif %}
  1021.                                                     {% endif %}
  1022.                                                 </strong>
  1023.                                             </div>
  1024.                                             <div class="panel-group" id="accordion">
  1025.                                                 <div class="panel panel-default" id="panel1">
  1026.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1027.                                                          data-target="#cusername">
  1028.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1029.                                                             <a class="javascript:void(0)">
  1030.                                                                 Change Username
  1031.                                                             </a>
  1032.                                                         </h4>
  1033.                                                     </div>
  1034.                                                     <div id="cusername" class="panel-collapse collapse">
  1035.                                                         <div class="panel-body">
  1036.                                                             <div class="tab-pane" id="changeUsername">
  1037.                                                                 <legend class="panel-content">Change your Username
  1038.                                                                 </legend>
  1039.                                                                 <form class="form-horizontal">
  1040.                                                                     <span class="text-danger col-sm-offset-2 errorUsername"></span>
  1041.                                                                     <div class="form-group">
  1042.                                                                         <label for="admCurUsername"
  1043.                                                                                class="col-sm-2 control-label">Your
  1044.                                                                             Username</label>
  1045.                                                                         <div class="col-sm-10">
  1046.                                                                             <input type="text"
  1047.                                                                                    class="form-control currentUsername"
  1048.                                                                                    id="admCurUsername" readonly=""
  1049.                                                                                    value="{% if expert.username is defined %}{{ expert.username | raw }}{% endif %}">
  1050.                                                                         </div>
  1051.                                                                     </div>
  1052.                                                                     <div class="form-group">
  1053.                                                                         <label for="adnNewUsername"
  1054.                                                                                class="col-sm-2 control-label">New
  1055.                                                                             Username</label>
  1056.                                                                         <div class="col-sm-10">
  1057.                                                                             <input type="text"
  1058.                                                                                    class="form-control newUsername"
  1059.                                                                                    id="adnNewUsername"
  1060.                                                                                    placeholder="Enter new username."
  1061.                                                                                    required="">
  1062.                                                                         </div>
  1063.                                                                     </div>
  1064.                                                                     <div class="form-group">
  1065.                                                                         <div class="col-sm-offset-2 col-sm-10">
  1066.                                                                             <button type="button"
  1067.                                                                                     class="btn btn-success changeUsername">
  1068.                                                                                 Change Username
  1069.                                                                             </button>
  1070.                                                                         </div>
  1071.                                                                     </div>
  1072.                                                                 </form>
  1073.                                                             </div>
  1074.                                                         </div>
  1075.                                                     </div>
  1076.                                                 </div>
  1077.                                                 <div class="panel panel-default" id="panel2">
  1078.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1079.                                                          data-target="#changeEmail">
  1080.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1081.                                                             <a class="javascript:void(0)">
  1082.                                                                 Change Email
  1083.                                                             </a>
  1084.                                                         </h4>
  1085.                                                     </div>
  1086.                                                     <div id="changeEmail" class="panel-collapse collapse">
  1087.                                                         <div class="panel-body">
  1088.                                                             <legend class="panel-content">
  1089.                                                                 Change your primary email address
  1090.                                                             </legend>
  1091.                                                             <form class="form-horizontal">
  1092.                                                                 <div class="text-danger col-sm-offset-2 errorEmail"></div>
  1093.                                                                 <div class="form-group">
  1094.                                                                     <label for="admCurrentEmail"
  1095.                                                                            class="col-sm-2 control-label">Your Primary
  1096.                                                                         Email</label>
  1097.                                                                     <div class="col-sm-10">
  1098.                                                                         <input type="email"
  1099.                                                                                class="form-control currentEmail"
  1100.                                                                                id="admCurrentEmail" readonly=""
  1101.                                                                                value="{% if expert.email is defined %}{{ expert.email | raw }}{% endif %}">
  1102.                                                                     </div>
  1103.                                                                 </div>
  1104.                                                                 <div class="form-group">
  1105.                                                                     <label for="admNewEmail"
  1106.                                                                            class="col-sm-2 control-label">New
  1107.                                                                         Email</label>
  1108.                                                                     <div class="col-sm-10">
  1109.                                                                         <input type="email"
  1110.                                                                                class="form-control newEmail"
  1111.                                                                                id="admNewEmail"
  1112.                                                                                placeholder="Enter new Email."
  1113.                                                                                required="">
  1114.                                                                     </div>
  1115.                                                                 </div>
  1116.                                                                 <div class="form-group">
  1117.                                                                     <div class="col-sm-offset-2 col-sm-10">
  1118.                                                                         <button type="button"
  1119.                                                                                 class="btn btn-success confirmEmail">
  1120.                                                                             Change Email
  1121.                                                                         </button>
  1122.                                                                     </div>
  1123.                                                                 </div>
  1124.                                                                 <div class="col-sm-offset-2 col-sm-10 errorConfirmCode text-danger"></div>
  1125.                                                                 <div class="form-group" style="display:none;">
  1126.                                                                     <label for="admConfirmCode"
  1127.                                                                            class="col-sm-2 control-label">Confirmation
  1128.                                                                         Code</label>
  1129.                                                                     <div class="col-sm-10">
  1130.                                                                         <input
  1131.                                                                                 type="text"
  1132.                                                                                 class="form-control confirmCode"
  1133.                                                                                 id="admConfirmCode"
  1134.                                                                                 placeholder="Enter confirmation code."
  1135.                                                                                 required=""
  1136.                                                                                 onkeypress="return event.charCode >= 48 && event.charCode <= 57"
  1137.                                                                                 maxlength="6" />
  1138.                                                                     </div>
  1139.                                                                 </div>
  1140.                                                             </form>
  1141.                                                         </div>
  1142.                                                     </div>
  1143.                                                 </div>
  1144.                                                 <div class="panel panel-default" id="panel4">
  1145.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1146.                                                          data-target="#qualitycontrol">
  1147.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1148.                                                             <a href="javascript:void(0)">Quality Control</a>
  1149.                                                         </h4>
  1150.                                                     </div>
  1151.                                                     <div id="qualitycontrol" class="panel-collapse collapse">
  1152.                                                         <div class="panel-body">
  1153.                                                             <legend class="panel-content" id="qclabel">
  1154.                                                                 {% if expert.expertInfo.qualityChecked is defined and expert.expertInfo.qualityChecked == true %}
  1155.                                                                     This record has been marked as quality controlled
  1156.                                                                     {% if expert.expertInfo.qualityCheckedDate is not null and expert.expertInfo.qualityCheckedDate|date("d/m/Y") !="30/11/-0001" %}
  1157.                                                                         on <strong>{{ expert.expertInfo.qualityCheckedDate | date("F j, Y ") }}</strong>
  1158.                                                                     {% endif %}
  1159.                                                                     by <strong>{{ expert.qcby }}</strong>
  1160.                                                                 {% else %}
  1161.                                                                     This record has not been quality controlled
  1162.                                                                 {% endif %}
  1163.                                                             </legend>
  1164.                                                             <form class="form-inline col-xs-12 col-sm-8 col-md-offset-3 col-sm-offset-2">
  1165.                                                                 <div class="form-group">
  1166.                                                                     <div class="onoffswitch">
  1167.                                                                         <input
  1168.                                                                                 type="checkbox"
  1169.                                                                                 name="verify"
  1170.                                                                                 class="onoffswitch-checkbox"
  1171.                                                                                 {% if expert.expertInfo.qualityChecked is defined and expert.expertInfo.qualityChecked == true %}
  1172.                                                                                     checked=""
  1173.                                                                                 {% endif %}
  1174.                                                                                 id="verify"
  1175.                                                                                 value="{% if expert.expertInfo.qualityChecked is defined and expert.expertInfo.qualityChecked == true %}1{% else %}0{% endif %}" />
  1176.                                                                         <label class="onoffswitch-label" for="verify">
  1177.                                                                             <span class="onoffswitch-inner"></span>
  1178.                                                                             <span class="onoffswitch-switch"></span>
  1179.                                                                         </label>
  1180.                                                                     </div>
  1181.                                                                 </div>
  1182.                                                                 <div class="form-group">
  1183.                                                                     <button type="button" class="btn btn-success verify"
  1184.                                                                             data-value="1">Save
  1185.                                                                     </button>
  1186.                                                                 </div>
  1187.                                                             </form>
  1188.                                                         </div>
  1189.                                                     </div>
  1190.                                                 </div>
  1191.                                                 <div class="panel panel-default" id="panel5">
  1192.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1193.                                                          data-target="#memberstatus">
  1194.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1195.                                                             <a href="javascript:void(0)">
  1196.                                                                 Member Status
  1197.                                                             </a>
  1198.                                                         </h4>
  1199.                                                     </div>
  1200.                                                     <div id="memberstatus" class="panel-collapse collapse">
  1201.                                                         <div class="panel-body">
  1202.                                                             <form class="form-inline col-xs-12 col-sm-8 col-md-offset-3 col-sm-offset-2">
  1203.                                                                 <legend class="panel-content">Retired</legend>
  1204.                                                                 <div class="form-group">
  1205.                                                                     <div class="onoffswitch">
  1206.                                                                         <input
  1207.                                                                                 type="checkbox"
  1208.                                                                                 name="retired"
  1209.                                                                                 class="onoffswitch-checkbox"
  1210.                                                                                 {% if expert.expertInfo.retired is defined and expert.expertInfo.retired == 1 %}
  1211.                                                                                     checked=""
  1212.                                                                                 {% endif %}
  1213.                                                                                 id="retired"
  1214.                                                                                 value="{% if expert.expertInfo.retired is defined %}{{ expert.expertInfo.retired }}{% endif %}">
  1215.                                                                         <label class="onoffswitch-label" for="retired">
  1216.                                                                             <span class="onoffswitch-inner"></span>
  1217.                                                                             <span class="onoffswitch-switch"></span>
  1218.                                                                         </label>
  1219.                                                                     </div>
  1220.                                                                 </div>
  1221.                                                                 <div class="form-group">
  1222.                                                                     <input
  1223.                                                                             type="text"
  1224.                                                                             id="retiredDate"
  1225.                                                                             class="form-control datepicker"
  1226.                                                                             {% if expert.expertInfo.retired is defined and expert.expertInfo.retired == 1 %}
  1227.                                                                                 {% if expert.expertInfo.retiredDate is not null and expert.expertInfo.retiredDate|date("d/m/Y") !="30/11/-0001" %}
  1228.                                                                                     value="{{ expert.expertInfo.retiredDate|date('Y-m-d') }}"
  1229.                                                                                 {% endif %}
  1230.                                                                             {% else %}
  1231.                                                                                 value=""
  1232.                                                                                 disabled=""
  1233.                                                                             {% endif %}
  1234.                                                                             id="retiredDate"
  1235.                                                                             placeholder="Retired date" />
  1236.                                                                 </div>
  1237.                                                                 <button type="button" class="btn btn-success "
  1238.                                                                         id="btnRetired">
  1239.                                                                     Save
  1240.                                                                 </button>
  1241.                                                             </form>
  1242.                                                             <form class="form-inline col-xs-12 col-sm-8 col-md-offset-3 col-sm-offset-2">
  1243.                                                                 <legend class="panel-content">Deceased</legend>
  1244.                                                                 <div class="form-group">
  1245.                                                                     <div class="onoffswitch">
  1246.                                                                         <input type="checkbox" name="deceased"
  1247.                                                                                class="onoffswitch-checkbox"
  1248.                                                                                 {% if expert.expertInfo.deceased is defined and expert.expertInfo.deceased == 1 %}
  1249.                                                                                     checked=""
  1250.                                                                                 {% endif %}
  1251.                                                                                id="deceased"
  1252.                                                                                value="{% if expert.expertInfo.deceased is defined %}{{ expert.expertInfo.deceased }}{% endif %}">
  1253.                                                                         <label class="onoffswitch-label" for="deceased">
  1254.                                                                             <span class="onoffswitch-inner"></span>
  1255.                                                                             <span class="onoffswitch-switch"></span>
  1256.                                                                         </label>
  1257.                                                                     </div>
  1258.                                                                 </div>
  1259.                                                                 <div class="form-group">
  1260.                                                                     <input
  1261.                                                                             type="text"
  1262.                                                                             id="deceasedDate"
  1263.                                                                             class="form-control datepicker"
  1264.                                                                             id="deceasedDate"
  1265.                                                                             {% if expert.expertInfo.deceased is defined and expert.expertInfo.deceased == 1 %}
  1266.                                                                                 {% if expert.expertInfo.retiredDate is not null and expert.expertInfo.deceasedDate|date("d/m/Y") !="30/11/-0001" %}
  1267.                                                                                     value="{{ expert.expertInfo.deceasedDate|date('Y-m-d') }}"
  1268.                                                                                 {% endif %}
  1269.                                                                             {% else %}
  1270.                                                                                 value=""
  1271.                                                                                 disabled
  1272.                                                                             {% endif %}
  1273.                                                                             placeholder="Deceased date">
  1274.                                                                 </div>
  1275.                                                                 <button type="button" class="btn btn-success"
  1276.                                                                         id="btnDeceased">
  1277.                                                                     Save
  1278.                                                                 </button>
  1279.                                                             </form>
  1280.                                                         </div>
  1281.                                                     </div>
  1282.                                                 </div>
  1283.                                                 <div class="panel panel-default" id="panel6">
  1284.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1285.                                                          data-target="#donotinvite">
  1286.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1287.                                                             <a href="javascript:void(0)">
  1288.                                                                 Do Not Invite
  1289.                                                             </a>
  1290.                                                         </h4>
  1291.                                                     </div>
  1292.                                                     <div id="donotinvite" class="panel-collapse collapse">
  1293.                                                         <div class="panel-body">
  1294.                                                             <legend class="panel-content">
  1295.                                                                 {% if expert.expertInfo.doNoInviteBy is defined and expert.expertInfo.doNotInvite!="" %}
  1296.                                                                     This record has been set as do not invite on <strong>{{ expert.expertInfo.doNoInviteOn | date('Y-m-d') }}</strong> by <strong>{{ expert.doNoInviteBy }}</strong>
  1297.                                                                 {% else %}
  1298.                                                                     Please select "Yes" to add this member to the do not invite list.
  1299.                                                                 {% endif %}
  1300.                                                             </legend>
  1301.                                                             <form class="form-inline col-xs-12 col-sm-8 col-md-offset-3 col-sm-offset-2">
  1302.                                                                 <div class="form-group">
  1303.                                                                     <div class="onoffswitch">
  1304.                                                                         <input type="checkbox" name="noinvite"
  1305.                                                                                class="onoffswitch-checkbox"{% if expert.expertInfo.doNotInvite is defined and expert.expertInfo.doNotInvite == 1 %} checked="" {% endif %}
  1306.                                                                                id="noinvite"
  1307.                                                                                value="{% if expert.expertInfo.doNotInvite is defined %}{{ expert.expertInfo.doNotInvite }}{% endif %}">
  1308.                                                                         <label class="onoffswitch-label" for="noinvite">
  1309.                                                                             <span class="onoffswitch-inner"></span>
  1310.                                                                             <span class="onoffswitch-switch"></span>
  1311.                                                                         </label>
  1312.                                                                     </div>
  1313.                                                                 </div>
  1314.                                                                 <button type="button" class="btn btn-success"
  1315.                                                                         id="btnDonotinvite">Save
  1316.                                                                 </button>
  1317.                                                             </form>
  1318.                                                         </div>
  1319.                                                     </div>
  1320.                                                 </div>
  1321.                                                 <div class="panel panel-default" id="panel7">
  1322.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1323.                                                          data-target="#comments">
  1324.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1325.                                                             <a href="javascript:void(0)">
  1326.                                                                 Comments
  1327.                                                             </a>
  1328.                                                         </h4>
  1329.                                                     </div>
  1330.                                                     <div id="comments" class="panel-collapse collapse">
  1331.                                                         <div class="panel-body">
  1332.                                                             <form class="form-horizontal col-md-8">
  1333.                                                                 <div class="form-group">
  1334.                                                                     <label for="admincomment" class="col-sm-4 control-label panel-content">Add admin comment:</label>
  1335.                                                                     <div class="col-sm-8">
  1336.                                                                         <div id="newAdmComment">{% if expert.expertInfo.adminComments is defined %}{{ expert.expertInfo.adminComments | raw}}{% endif %}</div>
  1337.                                                                         <textarea class="form-control" id="admincomment" placeholder="Add admin comment:"></textarea>
  1338.                                                                     </div>
  1339.                                                                 </div>
  1340.                                                                 <div class="form-group">
  1341.                                                                     <div class="col-sm-offset-4 col-sm-8">
  1342.                                                                         <button type="button" class="btn btn-success"
  1343.                                                                                 id="btnAdminComments">Save
  1344.                                                                         </button>
  1345.                                                                     </div>
  1346.                                                                 </div>
  1347.                                                             </form>
  1348.                                                         </div>
  1349.                                                     </div>
  1350.                                                 </div>
  1351.                                                 <div class="panel panel-default" id="panel8">
  1352.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1353.                                                          data-target="#groups">
  1354.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1355.                                                             <a href="javascript:void(0)">
  1356.                                                                 Manage Groups
  1357.                                                             </a>
  1358.                                                         </h4>
  1359.                                                     </div>
  1360.                                                     <div id="groups" class="panel-collapse collapse">
  1361.                                                         <div class="panel-body">
  1362.                                                             <form class="form-horizontal col-md-6">
  1363.                                                                 <div class="form-group">
  1364.                                                                     <label for="groups" class="col-sm-4 control-label panel-content">Add Groups</label>
  1365.                                                                     <div class="col-sm-8">
  1366.                                                                         <select class="form-control select2 noSearch" style="width: 100%;" id="groups" name="groups[]" data-placeholder="e.g. IOC" multiple="multiple">
  1367.                                                                             {% if adminOption.userGroups is defined %}
  1368.                                                                                 {% for groups in adminOption.userGroups %}
  1369.                                                                                     {% if groups.idGroup in expert.groupids %}
  1370.                                                                                         <option label="{{ groups.idGroup }}"
  1371.                                                                                                 value="{{ groups.idGroup }}"
  1372.                                                                                                 selected="">{{ groups.groupname }}</option>
  1373.                                                                                     {% else %}
  1374.                                                                                         <option label="{{ groups.idGroup }}"
  1375.                                                                                                 value="{{ groups.idGroup }}">{{ groups.groupname }}</option>
  1376.                                                                                     {% endif %}
  1377.                                                                                 {% endfor %}
  1378.                                                                             {% endif %}
  1379.                                                                         </select>
  1380.                                                                     </div>
  1381.                                                                 </div>
  1382.                                                                 <div class="form-group">
  1383.                                                                     <div class="col-sm-offset-4 col-sm-8">
  1384.                                                                         <button type="button" class="btn btn-success"
  1385.                                                                                 id="btnAddGroups">Save
  1386.                                                                         </button>
  1387.                                                                     </div>
  1388.                                                                 </div>
  1389.                                                             </form>
  1390.                                                             {#<form class="form-horizontal col-md-6">#}
  1391.                                                             {#<div class="panel-content">Add Group Roles</div>#}
  1392.                                                             {#{% if adminOption.userGroups is defined %}#}
  1393.                                                             {#{% for groups in adminOption.userGroups %}#}
  1394.                                                             {#{% if groups.idGroup in expert.groupids %}#}
  1395.                                                             {#<div class="form-group">#}
  1396.                                                             {#<div class="col-sm-8">#}
  1397.                                                             {#<div class="form-group">#}
  1398.                                                             {#<label for="inputEmail3" class="col-sm-6 control-label">{{ groups.groupname }}</label>#}
  1399.                                                             {#<div class="col-sm-6">#}
  1400.                                                             {#<input type="email" class="form-control" id="inputEmail3" placeholder="Group role">#}
  1401.                                                             {#</div>#}
  1402.                                                             {#</div>#}
  1403.                                                             {#</div>#}
  1404.                                                             {#</div>#}
  1405.                                                             {#{% endif %}#}
  1406.                                                             {#{% endfor %}#}
  1407.                                                             {#{% endif %}#}
  1408.                                                             {##}
  1409.                                                             {##}
  1410.                                                             {#<div class="form-group">#}
  1411.                                                             {#<div class="col-sm-offset-4 col-sm-8">#}
  1412.                                                             {#<button type="button" class="btn btn-success" id="btnAddGroupsRoles">Save#}
  1413.                                                             {#</button>#}
  1414.                                                             {#</div>#}
  1415.                                                             {#</div>#}
  1416.                                                             {#</form>#}
  1417.                                                         </div>
  1418.                                                     </div>
  1419.                                                 </div>
  1420.                                                 <div class="panel panel-default" id="panel9">
  1421.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1422.                                                          data-target="#privileges">
  1423.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1424.                                                             <a href="javascript:void(0)">
  1425.                                                                 Assign Privileges
  1426.                                                             </a>
  1427.                                                         </h4>
  1428.                                                     </div>
  1429.                                                     <div id="privileges" class="panel-collapse collapse">
  1430.                                                         <div class="panel-body">
  1431.                                                             <legend class="col-lg-12 panel-content">Editing</legend>
  1432.                                                             <div class="row">
  1433.                                                                 <form class="form-horizontal col-lg-12">
  1434.                                                                     {% if expert.instName is defined %}
  1435.                                                                         <div class="form-group">
  1436.                                                                             <label for="groups"
  1437.                                                                                    class="col-xs-6 control-label panel-content">
  1438.                                                                                 Allow to edit own institution
  1439.                                                                             </label>
  1440.                                                                             <div class="col-xs-4">
  1441.                                                                                 <div class="onoffswitch">
  1442.                                                                                     <input type="checkbox"
  1443.                                                                                            name="ownInstitute"
  1444.                                                                                            class="onoffswitch-checkbox"
  1445.                                                                                            id="ownInstitute"
  1446.                                                                                            value="{{ expert.canEditOwnInst }}"
  1447.                                                                                             {% if expert.canEditOwnInst == 1 %}
  1448.                                                                                                 checked="checked"
  1449.                                                                                             {% endif %}
  1450.                                                                                             {% if expert[2]['idInst'] is not defined %}
  1451.                                                                                         disabled="disabled"
  1452.                                                                                             {% endif %}>
  1453.                                                                                     <label class="onoffswitch-label"
  1454.                                                                                            for="ownInstitute">
  1455.                                                                                         <span class="onoffswitch-inner"></span>
  1456.                                                                                         <span class="onoffswitch-switch"></span>
  1457.                                                                                     </label>
  1458.                                                                                 </div>
  1459.                                                                             </div>
  1460.                                                                         </div>
  1461.                                                                     {% endif %}
  1462.                                                                     <div class="form-group">
  1463.                                                                         <label
  1464.                                                                                 for="groups"
  1465.                                                                                 class="col-xs-6 control-label panel-content">
  1466.                                                                             Allow to edit all records from the following countries institution
  1467.                                                                         </label>
  1468.                                                                         <div class="col-xs-4">
  1469.                                                                             <div class="onoffswitch">
  1470.                                                                                 <input type="checkbox"
  1471.                                                                                        name="countryList"
  1472.                                                                                        class="onoffswitch-checkbox"
  1473.                                                                                        {% if expert.countries| length >0 %}checked{% endif %}
  1474.                                                                                        id="countryList"
  1475.                                                                                        value="{% if expert.countries| length >0 %}1{% else %}0{% endif %}">
  1476.                                                                                 <label class="onoffswitch-label"
  1477.                                                                                        for="countryList">
  1478.                                                                                     <span class="onoffswitch-inner"></span>
  1479.                                                                                     <span class="onoffswitch-switch"></span>
  1480.                                                                                 </label>
  1481.                                                                             </div>
  1482.                                                                         </div>
  1483.                                                                     </div>
  1484.                                                                     <div class="form-group">
  1485.                                                                         <label for="groups"
  1486.                                                                                class="col-xs-2 control-label panel-content">Add
  1487.                                                                             Countries</label>
  1488.                                                                         <div class="col-xs-4">
  1489.                                                                             <select
  1490.                                                                                     class="form-control select2 noSearch"
  1491.                                                                                     style="width: 100%;"
  1492.                                                                                     id="countries"
  1493.                                                                                     name="countries[]"
  1494.                                                                                     data-placeholder="e.g. Belgium"
  1495.                                                                                     multiple="multiple"
  1496.                                                                                     {% if expert.countries| length == 0 %}disabled{% else %}0{% endif %}>
  1497.                                                                                 {% for countries in adminOption.countries %}
  1498.                                                                                     {% if countries.idCountry in expert.countries %}
  1499.                                                                                         <option
  1500.                                                                                                 label="{{ countries.idCountry }}"
  1501.                                                                                                 value="{{ countries.idCountry }}"
  1502.                                                                                                 selected="">{{ countries.country }}
  1503.                                                                                         </option>
  1504.                                                                                     {% else %}
  1505.                                                                                         <option
  1506.                                                                                                 label="{{ countries.idCountry }}"
  1507.                                                                                                 value="{{ countries.idCountry }}">
  1508.                                                                                             {{ countries.country }}
  1509.                                                                                         </option>
  1510.                                                                                     {% endif %}
  1511.                                                                                 {% endfor %}
  1512.                                                                             </select>
  1513.                                                                         </div>
  1514.                                                                     </div>
  1515.                                                                     {% if is_granted('ROLE_ADMIN') and expert.roles is defined %}
  1516.                                                                         <div
  1517.                                                                                 class="form-group">
  1518.                                                                             <label
  1519.                                                                                     for="groups"
  1520.                                                                                     class="col-xs-6 control-label panel-content">
  1521.                                                                                 Allow to edit all records in OceanExpert
  1522.                                                                             </label>
  1523.                                                                             <div
  1524.                                                                                     class="col-xs-4">
  1525.                                                                                 <div
  1526.                                                                                         class="onoffswitch">
  1527.                                                                                     <input
  1528.                                                                                             type="checkbox"
  1529.                                                                                             name="editor"
  1530.                                                                                             {% if "ROLE_GLOBAL_EDITOR" in expert.roles %}checked{% endif %}
  1531.                                                                                             class="onoffswitch-checkbox"
  1532.                                                                                             id="editor"
  1533.                                                                                             value="{% if "ROLE_GLOBAL_EDITOR" in expert.roles %}1{% else %}0{% endif %}">
  1534.                                                                                     <label
  1535.                                                                                             class="onoffswitch-label"
  1536.                                                                                             for="editor">
  1537.                                                                                         <span class="onoffswitch-inner"></span>
  1538.                                                                                         <span class="onoffswitch-switch"></span>
  1539.                                                                                     </label>
  1540.                                                                                 </div>
  1541.                                                                             </div>
  1542.                                                                         </div>
  1543.                                                                     {% elseif is_granted('ROLE_GLOBAL_EDITOR') %}
  1544.                                                                         <input
  1545.                                                                                 type="hidden"
  1546.                                                                                 name="editor"
  1547.                                                                                 checked="checked"
  1548.                                                                                 class="onoffswitch-checkbox"
  1549.                                                                                 id="editor"
  1550.                                                                                 value="1" />
  1551.                                                                     {% endif %}
  1552.                                                                     <div class="form-group">
  1553.                                                                         <div class="col-sm-offset-6 col-sm-8">
  1554.                                                                             <button
  1555.                                                                                     type="button"
  1556.                                                                                     class="btn btn-success"
  1557.                                                                                     id="addPrivileges">
  1558.                                                                                 Save
  1559.                                                                             </button>
  1560.                                                                         </div>
  1561.                                                                     </div>
  1562.                                                                 </form>
  1563.                                                             </div>
  1564.                                                             {% if is_granted('ROLE_ADMIN') and expert.roles is defined %}
  1565.                                                                 <legend
  1566.                                                                         class="col-lg-12 panel-content">
  1567.                                                                     Administrative rights
  1568.                                                                 </legend>
  1569.                                                                 <div class="row">
  1570.                                                                     <form class="form-horizontal col-lg-12">
  1571.                                                                         {% if is_granted('ROLE_LME') %}
  1572.                                                                             <div class="form-group">
  1573.                                                                                 <label
  1574.                                                                                         for="lme"
  1575.                                                                                         class="col-xs-6 control-label panel-content">
  1576.                                                                                     LME Editor
  1577.                                                                                 </label>
  1578.                                                                                 <div class="col-xs-4">
  1579.                                                                                     <div class="onoffswitch">
  1580.                                                                                         <input
  1581.                                                                                                 type="checkbox"
  1582.                                                                                                 name="lme"
  1583.                                                                                                 class="onoffswitch-checkbox"
  1584.                                                                                                 id="lme"
  1585.                                                                                                 {% if "ROLE_LME" in expert.roles %}checked{% endif %}
  1586.                                                                                                 value="{% if "ROLE_LME" in expert.roles %}1{% else %}0{% endif %}" />
  1587.                                                                                         <label
  1588.                                                                                                 class="onoffswitch-label"
  1589.                                                                                                 for="lme">
  1590.                                                                                             <span class="onoffswitch-inner"></span>
  1591.                                                                                             <span class="onoffswitch-switch"></span>
  1592.                                                                                         </label>
  1593.                                                                                     </div>
  1594.                                                                                 </div>
  1595.                                                                             </div>
  1596.                                                                         {% endif %}
  1597.                                                                         <div class="form-group">
  1598.                                                                             <label for="manager"
  1599.                                                                                    class="col-xs-6 control-label panel-content">Manager</label>
  1600.                                                                             <div class="col-xs-4">
  1601.                                                                                 <div class="onoffswitch">
  1602.                                                                                     <input type="checkbox"
  1603.                                                                                            name="manager"
  1604.                                                                                            class="onoffswitch-checkbox"
  1605.                                                                                            {% if "ROLE_MANAGER" in expert.roles %}checked{% endif %}
  1606.                                                                                            id="manager"
  1607.                                                                                            value="{% if "ROLE_MANAGER" in expert.roles %}1{% else %}0{% endif %}">
  1608.                                                                                     <label class="onoffswitch-label"
  1609.                                                                                            for="manager">
  1610.                                                                                         <span class="onoffswitch-inner"></span>
  1611.                                                                                         <span class="onoffswitch-switch"></span>
  1612.                                                                                     </label>
  1613.                                                                                 </div>
  1614.                                                                             </div>
  1615.                                                                         </div>
  1616.                                                                         {% if is_granted('ROLE_SUPERADMIN') %}
  1617.                                                                             <div class="form-group">
  1618.                                                                                 <label for="administrator"
  1619.                                                                                        class="col-xs-6 control-label panel-content">
  1620.                                                                                     Administrator
  1621.                                                                                 </label>
  1622.                                                                                 <div class="col-xs-4">
  1623.                                                                                     <div class="onoffswitch">
  1624.                                                                                         <input
  1625.                                                                                                 type="checkbox"
  1626.                                                                                                 name="administrator"
  1627.                                                                                                 class="onoffswitch-checkbox"
  1628.                                                                                                 id="administrator"
  1629.                                                                                                 {% if "ROLE_ADMIN" in expert.roles %}
  1630.                                                                                                     checked
  1631.                                                                                                 {% endif %}
  1632.                                                                                                value="{% if "ROLE_ADMIN" in expert.roles %}1{% else %}0{% endif %}">
  1633.                                                                                         <label
  1634.                                                                                                 class="onoffswitch-label"
  1635.                                                                                                 for="administrator">
  1636.                                                                                             <span class="onoffswitch-inner"></span>
  1637.                                                                                             <span class="onoffswitch-switch"></span>
  1638.                                                                                         </label>
  1639.                                                                                     </div>
  1640.                                                                                 </div>
  1641.                                                                             </div>
  1642.                                                                         {% endif %}
  1643.                                                                         {% if is_granted('ROLE_SUPERADMIN') %}
  1644.                                                                             <div class="form-group">
  1645.                                                                                 <label
  1646.                                                                                         for="superadmin"
  1647.                                                                                         class="col-xs-6 control-label panel-content">
  1648.                                                                                     Super Administrator
  1649.                                                                                 </label>
  1650.                                                                                 <div class="col-xs-4">
  1651.                                                                                     <div class="onoffswitch">
  1652.                                                                                         <input
  1653.                                                                                                 type="checkbox"
  1654.                                                                                                 {% if "ROLE_SUPERADMIN" in expert.roles %}
  1655.                                                                                                     checked
  1656.                                                                                                 {% endif %}
  1657.                                                                                                 name="superadmin"
  1658.                                                                                                 class="onoffswitch-checkbox"
  1659.                                                                                                 id="superadmin"
  1660.                                                                                                 value="{% if "ROLE_SUPERADMIN" in expert.roles %}1{% else %}0{% endif %}" />
  1661.                                                                                         <label class="onoffswitch-label"
  1662.                                                                                                for="superadmin">
  1663.                                                                                             <span class="onoffswitch-inner"></span>
  1664.                                                                                             <span class="onoffswitch-switch"></span>
  1665.                                                                                         </label>
  1666.                                                                                     </div>
  1667.                                                                                 </div>
  1668.                                                                             </div>
  1669.                                                                             <div class="form-group">
  1670.                                                                                 <label
  1671.                                                                                         for="odiscatadmin"
  1672.                                                                                         class="col-xs-6 control-label panel-content">
  1673.                                                                                     ODISCat Administrator
  1674.                                                                                 </label>
  1675.                                                                                 <div class="col-xs-4">
  1676.                                                                                     <div class="onoffswitch">
  1677.                                                                                         <input
  1678.                                                                                                 type="checkbox"
  1679.                                                                                                 {% if "ROLE_ODISCATADMIN" in expert.roles %}
  1680.                                                                                                     checked
  1681.                                                                                                 {% endif %}
  1682.                                                                                                 name="odiscatadmin"
  1683.                                                                                                 class="onoffswitch-checkbox"
  1684.                                                                                                 id="odiscatadmin"
  1685.                                                                                                 value="{% if "ROLE_ODISCATADMIN" in expert.roles %}1{% else %}0{% endif %}" />
  1686.                                                                                         <label class="onoffswitch-label"
  1687.                                                                                                for="odiscatadmin">
  1688.                                                                                             <span class="onoffswitch-inner"></span>
  1689.                                                                                             <span class="onoffswitch-switch"></span>
  1690.                                                                                         </label>
  1691.                                                                                     </div>
  1692.                                                                                 </div>
  1693.                                                                             </div>
  1694.                                                                             <div class="form-group">
  1695.                                                                                 <label
  1696.                                                                                         for="oceancdadmin"
  1697.                                                                                         class="col-xs-6 control-label panel-content">
  1698.                                                                                     OceanCD Administrator
  1699.                                                                                 </label>
  1700.                                                                                 <div class="col-xs-4">
  1701.                                                                                     <div class="onoffswitch">
  1702.                                                                                         <input
  1703.                                                                                                 type="checkbox"
  1704.                                                                                                 {% if "ROLE_OCEANCD" in expert.roles %}
  1705.                                                                                                     checked
  1706.                                                                                                 {% endif %}
  1707.                                                                                                 name="oceancdadmin"
  1708.                                                                                                 class="onoffswitch-checkbox"
  1709.                                                                                                 id="oceancdadmin"
  1710.                                                                                                 value="{% if "ROLE_OCEANCD" in expert.roles %}1{% else %}0{% endif %}" />
  1711.                                                                                         <label class="onoffswitch-label"
  1712.                                                                                                for="oceancdadmin">
  1713.                                                                                             <span class="onoffswitch-inner"></span>
  1714.                                                                                             <span class="onoffswitch-switch"></span>
  1715.                                                                                         </label>
  1716.                                                                                     </div>
  1717.                                                                                 </div>
  1718.                                                                             </div>
  1719.                                                                         {% endif %}
  1720.                                                                         <div class="form-group">
  1721.                                                                             <div class="col-sm-offset-6 col-sm-8">
  1722.                                                                                 <button type="button"
  1723.                                                                                         class="btn btn-success"
  1724.                                                                                         id="addRoles">Save
  1725.                                                                                 </button>
  1726.                                                                             </div>
  1727.                                                                         </div>
  1728.                                                                     </form>
  1729.                                                                 </div>
  1730.                                                             {% endif %}
  1731.                                                         </div>
  1732.                                                     </div>
  1733.                                                 </div>
  1734.                                                 <div class="panel panel-default" id="panel10">
  1735.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1736.                                                          data-target="#password">
  1737.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1738.                                                             <a class="javascript:void(0)">
  1739.                                                                 Send Password
  1740.                                                             </a>
  1741.                                                         </h4>
  1742.                                                     </div>
  1743.                                                     <div id="password" class="panel-collapse collapse">
  1744.                                                         <div class="panel-body">
  1745.                                                             <form class="form-horizontal col-lg-12">
  1746.                                                                 <div class="form-group">
  1747.                                                                     <label for="groups"
  1748.                                                                            class="col-xs-6 control-label panel-content">Send password reset link to user</label>
  1749.                                                                     <div class="col-xs-4">
  1750.                                                                         {% if expert.expertInfo.status is defined and expert.expertInfo.status == 1 %}
  1751.                                                                             <button type="button" class="btn btn-success" id="resetLink">Send Password reset link</button>
  1752.                                                                         {% else %}
  1753.                                                                             <button type="button" class="btn btn-success disabled" disabled>Send Password reset link</button>
  1754.                                                                         {% endif %}
  1755.                                                                     </div>
  1756.                                                                 </div>
  1757.                                                             </form>
  1758.                                                         </div>
  1759.                                                     </div>
  1760.                                                 </div>
  1761.                                                 <div class="panel panel-default" id="panel3">
  1762.                                                     <div class="panel-heading collapsed" data-toggle="collapse"
  1763.                                                          data-target="#deactivateAccount">
  1764.                                                         <h4 class="panel-title"><i class="fa fa-plus pull-right"></i>
  1765.                                                             <a class="javascript:void(0)">
  1766.                                                                 Deactivate Account
  1767.                                                             </a>
  1768.                                                         </h4>
  1769.                                                     </div>
  1770.                                                     <div id="deactivateAccount" class="panel-collapse collapse">
  1771.                                                         <div class="panel-body">
  1772.                                                             <legend class="panel-content">
  1773.                                                                 Deactivate OceanExpert account
  1774.                                                             </legend>
  1775.                                                             <div class="top-buffer50">
  1776.                                                                 {% if expert.expertInfo.status is defined and expert.expertInfo.status == 1 %}
  1777.                                                                     <button type="button" class="btn btn-danger deactivateAccount col-sm-offset-2">
  1778.                                                                         <i class="fa fa-ban" aria-hidden="true"></i>
  1779.                                                                         Deactivate Account
  1780.                                                                     </button>
  1781.                                                                 {% else %}
  1782.                                                                     <button type="button" class="btn btn-danger disabled col-sm-offset-2" disabled>
  1783.                                                                         <i class="fa fa-ban" aria-hidden="true"></i>
  1784.                                                                         Deactivate
  1785.                                                                     </button>
  1786.                                                                 {% endif %}
  1787.                                                                 <div class="text-danger deleteError"></div>
  1788.                                                             </div>
  1789.                                                         </div>
  1790.                                                     </div>
  1791.                                                 </div>
  1792.                                             </div>
  1793.                                         </div>
  1794.                                     {% endif %}
  1795.                                     <!-- /.tab-pane -->
  1796.                                 </div>
  1797.                                 <!-- /.tab-content -->
  1798.                             </div>
  1799.                             <div
  1800.                                     id="edited-by"
  1801.                                     class="pull-right italics">
  1802.                                 {% if expert.expertInfo.fDateEnt is defined and expert.expertInfo.fDateEnt != "" %}
  1803.                                     Created: {{ expert.expertInfo.fDateEnt|date('Y-m-d') }}
  1804.                                     {% if expert.createdBy is defined and  expert.createdBy != "" %}
  1805.                                         by {{ expert.createdBy }}
  1806.                                     {% endif %}  |
  1807.                                 {% endif %}
  1808.                                 {% if expert.expertInfo.lDateUpd is defined and expert.expertInfo.lDateUpd != "" %}
  1809.                                     Last Updated: {{ expert.expertInfo.lDateUpd|date('Y-m-d') }}
  1810.                                     {% if expert.lastEditBy is defined and  expert.lastEditBy != "" %}
  1811.                                         by {{ expert.lastEditBy }}
  1812.                                     {% endif %}
  1813.                                 {% endif %}
  1814.                             </div>
  1815.                             <br/><br/>
  1816.                             <div
  1817.                                     id="groups-by"
  1818.                                     class="pull-right italics">
  1819.                                 {% if expert.groups is defined and expert.groups | length > 0 %}
  1820.                                     Group(s):
  1821.                                     {% for groups in expert.groups %}
  1822.                                         <a href="{{ path('view_group', {groupId: groups.idGroup}) }}">{{ groups.groupname }}</a>
  1823.                                         {% if not loop.last %},{% endif %}
  1824.                                     {% endfor %}
  1825.                                 {% endif %}
  1826.                             </div>
  1827.                             <!-- /.nav-tabs-custom -->
  1828.                         </div>
  1829.                         <!-- /.col -->
  1830.                     </div>
  1831.                     <!-- /.row -->
  1832.                 {% endif %}
  1833.             </section>
  1834.             <!-- /.content -->
  1835.         </div>
  1836.         <!-- /.content-wrapper -->
  1837.     </div>
  1838.     <div
  1839.             class="modal fade"
  1840.             id="modal-refresh"
  1841.             tabindex="-1"
  1842.             role="dialog"
  1843.             aria-labelledby="myModalLabel"
  1844.             aria-hidden="true">
  1845.         <div class="modal-dialog">
  1846.             <div class="modal-content">
  1847.                 <div class="modal-header">
  1848.                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
  1849.                     <h4 class="modal-title" id="myModalLabel">
  1850.                         <i class="fa fa-fw fa-thumbs-up"></i><span class="modal-heading"></span>
  1851.                     </h4>
  1852.                 </div>
  1853.                 <div class="modal-body">
  1854.                     <p><span class="modal-message"></span></p>
  1855.                     <p>Page will refresh in <span class="timer"></span>...</p>
  1856.                 </div>
  1857.                 <div class="modal-footer">
  1858.                     <button type="button" class="btn btn-success" data-dismiss="modal">Refresh</button>
  1859.                 </div>
  1860.             </div>
  1861.         </div>
  1862.     </div>
  1863.     {% include('footer.html.twig') %}
  1864.     <script src="{{ asset('js/app.min.js') }}" type="text/javascript"></script>
  1865.     <script src="{{ asset('js/oejs.js') }}" type="text/javascript"></script>
  1866.     <script src="{{ asset('js/bootstrap-datepicker.js') }}" type="text/javascript"></script>
  1867.     <script src="{{ asset('js/tipped.js') }}" type="text/javascript"></script>
  1868.     <script type="text/javascript">
  1869.         {% if expert.expertInfo.idInd is defined %}
  1870.         $(function () {
  1871.             Tipped.create('.tipso', {maxWidth: 250});
  1872.             $("#update-profile").click(function (event) {
  1873.                 $.ajax({
  1874.                     url: "{{ path('update_profile_time') }}",
  1875.                     data: {userId: {{ expert.expertInfo.idInd }}},
  1876.                     method: "POST"
  1877.                 }).done(function (data) {
  1878.                     if (data == "updated successfully") {
  1879.                         $("#update-profile").removeClass("btn-primary").addClass("btn-success");
  1880.                         $("#update-profile").html('<i class="fa fa-thumbs-up" aria-hidden="true"></i> Thanks for the heads-up');
  1881.                         $("#update-profile").prop('disabled', true);
  1882.                         $("#updated-on").html("Last Updated on {{ 'now'|date('Y-m-d') }}");
  1883.                     } else {
  1884.                     }
  1885.                 })
  1886.                     .fail(function (data) {
  1887.                     });
  1888.             });
  1889.             {% if is_granted('ROLE_GLOBAL_EDITOR') %}
  1890.             $(document).delegate(".activate", "click", function () {
  1891.                 $(this).html('<i class="fa fa-cog fa-spin" aria-hidden="true"></i> Activate');
  1892.                 $.ajax({
  1893.                     url: "{{ path('approve_users') }}",
  1894.                     type: 'POST',
  1895.                     data: {'id': {{ expert.expertInfo.idInd}}},
  1896.                 }).done(function (response) {
  1897.                     if (response[0].status == 1) {
  1898.                         $(".statusBtn").html('<button class="btn btn-danger ban" id="ban"><i class="fa fa-ban" aria-hidden="true"></i> Deactivate</button>');
  1899.                     }
  1900.                 });
  1901.             });
  1902.             $(document).delegate(".ban", "click", function () {
  1903.                 $(this).html('<i class="fa fa-cog fa-spin" aria-hidden="true"></i> Deactivate');
  1904.                 $.ajax({
  1905.                     url: "{{ path('deactivate_user',{'userId': expert.expertInfo.idInd}) }}",
  1906.                     type: 'POST',
  1907.                 }).done(function (response) {
  1908.                     console.log(response);
  1909.                     if (response[0].status === true) {
  1910.                         $(".statusBtn").html('<button class="btn btn-success activate" id="activate"><i class="fa fa-check" aria-hidden="true"></i> Activate</button>');
  1911.                     }
  1912.                 });
  1913.             });
  1914.             {% endif %}
  1915.         });
  1916.         {% endif %}
  1917.     </script>
  1918.     {% if expert.expertInfo.idInd is defined %}
  1919.         <script>
  1920.             $(function () {
  1921.                 $(".changeUsername").click(function (e) {
  1922.                     e.preventDefault();
  1923.                     var $form = $(this).parents("form");
  1924.                     var $newUsername = $form.find(".newUsername");
  1925.                     var $currentUsername = $form.find(".currentUsername");
  1926.                     var $errorUsername = $form.find(".errorUsername");
  1927.                     var currentUsername = $form.find(".currentUsername").val();
  1928.                     var newUsername = $form.find(".newUsername").val();
  1929.                     if ($.trim(newUsername) == "") {
  1930.                         $newUsername.parents(".form-group").addClass('has-error');
  1931.                         $(this).parents("form").children('.text-danger').text("Please enter new username.");
  1932.                         return false;
  1933.                     } else {
  1934.                         var $this = $(this);
  1935.                         $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Changing username');
  1936.                         $(this).attr('disabled', true);
  1937.                         $newUsername.parents(".form-group").removeClass('has-error');
  1938.                         $(this).parents("form").children('.text-danger').text();
  1939.                         $.ajax({
  1940.                             url: "{{ path('change_username') }}",
  1941.                             type: 'POST',
  1942.                             data: {username: currentUsername, newusername: newUsername},
  1943.                         })
  1944.                             .done(function (response) {
  1945.                                 if (response == "success") {
  1946.                                     $errorUsername.removeClass('text-danger').addClass('text-success').html("<i class='fa fa-thumbs-up'></i> Username changed successfully.");
  1947.                                     {% if is_granted('ROLE_GLOBAL_EDITOR') and app.user.id != expert.expertInfo.idInd %}
  1948.                                     $currentUsername.val(newUsername);
  1949.                                     $newUsername.val("");
  1950.                                     $this.html("Change Username");
  1951.                                     $this.attr('disabled', false);
  1952.                                     window.history.pushState(history.state, "Title", newUsername);
  1953.                                     {% else %}
  1954.                                     $this.html("Username changed successfully").delay(1000).queue(function (n) {
  1955.                                         $(this).html("<i class='fa fa-cog fa-spin fa-fw'></i> Refreshing page");
  1956.                                         n();
  1957.                                     });
  1958.                                     $("#modal-refresh").modal("show");
  1959.                                     $(".modal-heading").text('Username changed.');
  1960.                                     $(".modal-message").text("Username changed successfully. This page will now refresh to reflect change in the username.");
  1961.                                     countdown(10);
  1962.                                     $('#modal-refresh').on('hidden.bs.modal', function (e) {
  1963.                                         window.location.href = "{{ path('view_profile',{'user': expert.expertInfo.idInd}) }}";
  1964.                                     });
  1965.                                     {% endif %}
  1966.                                 } else {
  1967.                                     $newUsername.parents(".form-group").addClass('has-error');
  1968.                                     $(this).parents("form").addClass('has-error');
  1969.                                     $errorUsername.text(response);
  1970.                                     $this.html("Change Username");
  1971.                                     $this.attr('disabled', false);
  1972.                                 }
  1973.                             });
  1974.                     }
  1975.                 });
  1976.                 // $(".confirmEmail").click(function(e) {
  1977.                 $("form").delegate(".confirmEmail", "click", function (e) {
  1978.                     e.preventDefault();
  1979.                     var $form = $(this).parents("form");
  1980.                     var $currentEmail = $form.find(".currentEmail");
  1981.                     var currentEmail = $form.find(".currentEmail").val();
  1982.                     var $newEmail = $form.find(".newEmail");
  1983.                     var newEmail = $form.find(".newEmail").val();
  1984.                     var $errorEmail = $form.find(".errorEmail");
  1985.                     var $confirmCode = $form.find(".confirmCode");
  1986.                     var $errorConfirmCode = $form.find(".errorConfirmCode");
  1987.                     var $confirmbtn = $form.find(".confirmEmail");
  1988.                     var email = $.trim(newEmail);
  1989.                     //var pattern = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]+)?$/);
  1990.                     const pattern = new RegExp(/^[\w._%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/);
  1991.                     if ((email == "") || (pattern.test(email) == false)) {
  1992.                         $newEmail.parents(".form-group").addClass('has-error');
  1993.                         $errorEmail.html("<i class='fa fa-exclamation-triangle'></i> Please enter valid new email.");
  1994.                         return false;
  1995.                     } else {
  1996.                         var $this = $(this);
  1997.                         $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Changing ...');
  1998.                         $(this).attr('disabled', true);
  1999.                         $newEmail.parents(".form-group").removeClass('has-error');
  2000.                         $(this).parents("form").children('.text-danger').text();
  2001.                         $.ajax({
  2002.                             url: "{{ path('fos_email_check') }}",
  2003.                             type: 'GET',
  2004.                             data: {email: email}
  2005.                         }).done(function (response) {
  2006.                             if (response.status == 1) {
  2007.                                 //email seems to be available
  2008.                                 $newEmail.parents(".form-group").removeClass('has-error');
  2009.                                 $this.parents("form").children('.text-danger').text("");
  2010.                                 {% if is_granted('ROLE_GLOBAL_EDITOR') and app.user.id != expert.expertInfo.idInd %}
  2011.                                 $.ajax({
  2012.                                     url: "{{ path('change_email') }}",
  2013.                                     type: 'POST',
  2014.                                     data: {
  2015.                                         currentEmail: currentEmail,
  2016.                                         newEmail: email
  2017.                                     },
  2018.                                 }).done(function (response) {
  2019.                                     if (response.status == 1) {
  2020.                                         $errorEmail.removeClass('text-danger').addClass('text-success');
  2021.                                         $errorEmail.html("<i class='fa fa-thumbs-up'></i> Email has been changed.");
  2022.                                         $confirmbtn.attr("disabled", false);
  2023.                                         $confirmbtn.html("Change Email");
  2024.                                         $currentEmail.val(email);
  2025.                                         $newEmail.val("");
  2026.                                     }
  2027.                                 });
  2028.                                 {% else %}
  2029.                                 $.ajax({
  2030.                                     url: "{{ path('send_email_verification') }}",
  2031.                                     type: 'POST',
  2032.                                     data: {oldEmail: currentEmail, newEmail: email},
  2033.                                 }).done(function (response) {
  2034.                                     if (response.status == 1) {
  2035.                                         $confirmCode.parents(".form-group").css('display', 'block');
  2036.                                         $errorConfirmCode.html('<i class="fa fa-info-circle" aria-hidden="true"></i> An email containing a 6 digit confirmation code is sent to your new email address: <strong>' + email + '</strong>. Enter it in the box below to confirm your change.');
  2037.                                         var html = '<div class="form-group">';
  2038.                                         html += '<div class="col-sm-offset-2 col-sm-10">';
  2039.                                         html += '<button type="button" class="btn btn-success changeEmail margin-r-5">Change Email</button>';
  2040.                                         html += '<button type="button" class="btn btn-success confirmEmail">Resend Email</button>';
  2041.                                         html += '</div>';
  2042.                                         html += '</div>';
  2043.                                         $this.parents("form").append(html);
  2044.                                         $this.parents(".form-group").remove();
  2045.                                         $this.attr('disabled', false);
  2046.                                     } else {
  2047.                                         $errorEmail.addClass('text-danger');
  2048.                                         $errorEmail.html("<i class='fa fa-thumbs-down'></i> " + response.message);
  2049.                                         $this.parents(".form-group").remove();
  2050.                                         $this.attr('disabled', false);
  2051.                                     }
  2052.                                 });
  2053.                                 {% endif %}
  2054.                             } else {
  2055.                                 $newEmail.parents(".form-group").addClass('has-error');
  2056.                                 $errorEmail.removeClass('text-success').addClass('text-danger');
  2057.                                 $errorEmail.html("<i class='fa fa-exclamation-triangle'></i> " + response.message);
  2058.                                 $this.html('Confirm Email');
  2059.                                 $this.attr('disabled', false);
  2060.                             }
  2061.                         });
  2062.                     }
  2063.                 });
  2064.                 $("form").delegate(".changeEmail", "click", function (e) {
  2065.                     e.preventDefault();
  2066.                     var $form = $(this).parents("form");
  2067.                     var $currentEmail = $form.find(".currentEmail");
  2068.                     var currentEmail = $form.find(".currentEmail").val();
  2069.                     var $newEmail = $form.find(".newEmail");
  2070.                     var newEmail = $form.find(".newEmail").val();
  2071.                     var $errorEmail = $form.find(".errorEmail");
  2072.                     var $confirmCode = $form.find(".confirmCode");
  2073.                     var $errorConfirmCode = $form.find(".errorConfirmCode");
  2074.                     var $modelRefresh = $("#modal-refresh");
  2075.                     var $changeEmailbtn = $(".changeEmail");
  2076.                     var email = $.trim(newEmail);
  2077.                     var confirmCode = $.trim($confirmCode.val());
  2078.                     if (confirmCode == "") {
  2079.                         $confirmCode.parents(".form-group").addClass('has-error');
  2080.                         $errorEmail.removeClass('text-success').addClass('text-danger');
  2081.                         $errorEmail.html("<i class='fa fa-exclamation-triangle'></i> Please enter confirmation code.");
  2082.                         return false;
  2083.                     }
  2084.                     //var pattern = new RegExp(/^([\w-\.]+@([\w-]+\.)+[\w-]+)?$/);
  2085.                     const pattern = new RegExp(/^[\w._%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/);
  2086.                     if ((email == "") || (pattern.test(email) == false)) {
  2087.                         $newEmail.html(".form-group").addClass('has-error');
  2088.                         $errorEmail.html("<i class='fa fa-exclamation-triangle'></i> Please enter valid new email.");
  2089.                         return false;
  2090.                     } else {
  2091.                         var $this = $(this);
  2092.                         $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Checking email');
  2093.                         $(this).attr('disabled', true);
  2094.                         $newEmail.parents(".form-group").removeClass('has-error');
  2095.                         $(this).parents("form").children('.text-danger').text();
  2096.                         $.ajax({
  2097.                             url: "{{ path('change_email') }}",
  2098.                             type: 'POST',
  2099.                             data: {
  2100.                                 currentEmail: currentEmail,
  2101.                                 newEmail: newEmail,
  2102.                                 confirmCode: confirmCode
  2103.                             },
  2104.                         }).done(function (response) {
  2105.                             if (response.status == 1) {
  2106.                                 $this.html("Email changed.").delay(1000).queue(function (n) {
  2107.                                     $(this).html("Refreshing page");
  2108.                                     n();
  2109.                                 });
  2110.                                 $modelRefresh.modal("show");
  2111.                                 $(".modal-heading").text('Email address Changed.');
  2112.                                 $(".modal-message").text("Email address changed successfully. This page will now refresh to reflect change in the Email address");
  2113.                                 countdown(11);
  2114.                                 $modelRefresh.on('hidden.bs.modal', function (e) {
  2115.                                     window.location.href = "{{ path('view_profile',{'user': expert.expertInfo.idInd}) }}";
  2116.                                 });
  2117.                             } else {
  2118.                                 $errorConfirmCode.removeClass('text-success').addClass('text-danger');
  2119.                                 $errorConfirmCode.html("<i class='fa fa-exclamation-triangle' aria-hidden='true'></i> Your confirmation code is invalid. Please check the code in your email and try again or resend the email using Resend Email button below.");
  2120.                                 $changeEmailbtn.html('Change Email');
  2121.                                 $changeEmailbtn.attr('disabled', false);
  2122.                             }
  2123.                         });
  2124.                     }
  2125.                 });
  2126.                 $(".deactivateAccount").click(function () {
  2127.                     if (confirm("Are you sure you want to deactivate this OceanExpert account?") == true) {
  2128.                         var $this = $(this);
  2129.                         $this.html('<i class="fa fa-cog fa-spin fa-fw"></i> Deactivating account');
  2130.                         $this.attr('disabled', true);
  2131.                         $.ajax({
  2132.                             url: "{{ path('deactivate_user',{'userId': expert.expertInfo.idInd}) }}",
  2133.                             type: 'POST'
  2134.                         }).done(function (response) {
  2135.                             if (response[0].status == 1) {
  2136.                                 {% if is_granted('ROLE_GLOBAL_EDITOR') and app.user.id != expert.expertInfo.idInd %}
  2137.                                 $this.html("<i class='fa fa-ban' aria-hidden='true'></i> User deactivated successfully.");
  2138.                                 $this.attr('disabled', true);
  2139.                                 {% else %}
  2140.                                 $this.html("<i class='fa fa-ban' aria-hidden='true'></i> Account deactivated successfully.")
  2141.                                     .delay(1000)
  2142.                                     .queue(function (n) {
  2143.                                         $(this).html("<i class='fa fa-cog fa-spin fa-fw'></i> Refreshing page");
  2144.                                         n();
  2145.                                     }
  2146.                                 );
  2147.                                 $("#modal-refresh").modal("show");
  2148.                                 $(".modal-heading").text('Account deactivated.');
  2149.                                 $(".modal-message").text(response.message);
  2150.                                 countdown(3);
  2151.                                 $('#modal-refresh').on('hidden.bs.modal', function (e) {
  2152.                                     location.reload();
  2153.                                 });
  2154.                                 {% endif %}
  2155.                             } else {
  2156.                                 $this.siblings(".deleteError").html(response.message);
  2157.                                 $this.attr('disabled', false);
  2158.                                 $this.html("Deactivate your Account");
  2159.                             }
  2160.                         });
  2161.                     } else {
  2162.                         return false;
  2163.                     }
  2164.                 });
  2165.                 $(".panel-heading").on('click', function (e) {
  2166.                     e.preventDefault();
  2167.                     if ($(this).hasClass('collapsed')) {
  2168.                         $(this).find('.fa').removeClass('fa-plus').addClass('fa-minus');
  2169.                     } else {
  2170.                         $(this).find('.fa').removeClass('fa-minus').addClass('fa-plus');
  2171.                     }
  2172.                 });
  2173.                 $('.datepicker').datepicker({
  2174.                     format: "yyyy-mm-dd",
  2175.                     autoclose: true,
  2176.                     todayHighlight: true
  2177.                 });
  2178.                 $(".onoffswitch-checkbox").click(function (e) {
  2179.                     if ($(this).is(":checked")) {
  2180.                         $(this).parents().siblings('.form-group').find('.datepicker').prop('disabled', false);
  2181.                         $(this).parents().siblings('.form-group').find('.datepicker').val("");
  2182.                         $(this).val(1);
  2183.                     } else {
  2184.                         $(this).parents().siblings('.form-group').find('.datepicker').prop('disabled', true);
  2185.                         $(this).parents().siblings('.form-group').find('.datepicker').val("");
  2186.                         $(this).val(0);
  2187.                     }
  2188.                 });
  2189.                 // Ajax Functionalities
  2190.                 $(".verify").click(function () {
  2191.                     var text = $(this).html();
  2192.                     var $this = $(this);
  2193.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2194.                     $(this).attr('disabled', true);
  2195.                     $.ajax({
  2196.                         url: "{{ path('profile_verified') }}",
  2197.                         type: 'POST',
  2198.                         data: {userId: {{ expert.expertInfo.idInd }}, action: $("#verify").val()},
  2199.                     }).done(function (response) {
  2200.                         $("#qclabel").html(response);
  2201.                         $this.html(text);
  2202.                         $this.attr('disabled', false);
  2203.                         if ($this.data('value') == 0) {
  2204.                             $this.hide();
  2205.                         } else {
  2206.                             $(".verify").show();
  2207.                             $(".verify").removeClass('hidden');
  2208.                         }
  2209.                     });
  2210.                 });
  2211.                 $("#btnRetired").click(function () {
  2212.                     var $this = $(this);
  2213.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2214.                     $(this).attr('disabled', true);
  2215.                     $.ajax({
  2216.                         url: "{{ path('set_retired') }}",
  2217.                         type: 'POST',
  2218.                         data: {
  2219.                             userId: {{ expert.expertInfo.idInd }},
  2220.                             retiredDate: $("#retiredDate").val(),
  2221.                             retiredStatus: $("#retired").val(),
  2222.                         },
  2223.                     }).done(function (response) {
  2224.                         $this.html("Saved").delay(2000).queue(function (n) {
  2225.                             $(this).html("Save");
  2226.                             n();
  2227.                         });
  2228.                         $this.attr('disabled', false);
  2229.                     });
  2230.                 });
  2231.                 $("#userBtnRetired").click(function () {
  2232.                     var $this = $(this);
  2233.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2234.                     $(this).attr('disabled', true);
  2235.                     $.ajax({
  2236.                         url: "{{ path('set_retired') }}",
  2237.                         type: 'POST',
  2238.                         data: {
  2239.                             userId: {{ expert.expertInfo.idInd }},
  2240.                             retiredDate: $("#userRetiredDate").val(),
  2241.                             retiredStatus: $("#userRetired").val(),
  2242.                         },
  2243.                     }).done(function (response) {
  2244.                         $this.html("Saved").delay(2000).queue(function (n) {
  2245.                             $(this).html("Save");
  2246.                             n();
  2247.                         });
  2248.                         $this.attr('disabled', false);
  2249.                     });
  2250.                 });
  2251.                 $("#usrBtnSubscription").click(function () {
  2252.                     var $this = $(this);
  2253.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2254.                     $(this).attr('disabled', true);
  2255.                     if ($("#userDoNotInvite").val() == 1){
  2256.                         var status = 0;
  2257.                     }else if($("#userDoNotInvite").val() == 0){
  2258.                         var status = 1;
  2259.                     }
  2260.                     $.ajax({
  2261.                         url: "{{ path('set_donotinvite') }}",
  2262.                         type: 'POST',
  2263.                         data: {
  2264.                             userId: {{ expert.expertInfo.idInd }},
  2265.                             status: status,
  2266.                         },
  2267.                     }).done(function (response) {
  2268.                         $this.html("Saved").delay(2000).queue(function (n) {
  2269.                             $(this).html("Save");
  2270.                             n();
  2271.                         });
  2272.                         $this.attr('disabled', false);
  2273.                     });
  2274.                 });
  2275.                 $("#btnDeceased").click(function () {
  2276.                     var $this = $(this);
  2277.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2278.                     $(this).attr('disabled', true);
  2279.                     $.ajax({
  2280.                         url: "{{ path('set_deceased') }}",
  2281.                         type: 'POST',
  2282.                         data: {
  2283.                             userId: {{ expert.expertInfo.idInd }},
  2284.                             deceasedDate: $("#deceasedDate").val(),
  2285.                             deceasedStatus: $("#deceased").val(),
  2286.                         },
  2287.                     }).done(function (response) {
  2288.                         $this.html("Saved").delay(2000).queue(function (n) {
  2289.                             $(this).html("Save");
  2290.                             n();
  2291.                         });
  2292.                         $this.attr('disabled', false);
  2293.                     });
  2294.                 });
  2295.                 $("#btnDonotinvite").click(function () {
  2296.                     var $this = $(this);
  2297.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2298.                     $(this).attr('disabled', true);
  2299.                     $.ajax({
  2300.                         url: "{{ path('set_donotinvite') }}",
  2301.                         type: 'POST',
  2302.                         data: {
  2303.                             userId: {{ expert.expertInfo.idInd }},
  2304.                             status: $("#noinvite").val(),
  2305.                         },
  2306.                     }).done(function (response) {
  2307.                         $this.html("Saved").delay(2000).queue(function (n) {
  2308.                             $(this).html("Save");
  2309.                             n();
  2310.                         });
  2311.                         $this.attr('disabled', false);
  2312.                         $this.parents().closest(".panel-body").find(".panel-content").html(response);
  2313.                     });
  2314.                 });
  2315.                 $("#btnAdminComments").click(function () {
  2316.                     var $this = $(this);
  2317.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2318.                     $(this).attr('disabled', true);
  2319.                     $.ajax({
  2320.                         url: "{{ path('set_admincomments') }}",
  2321.                         type: 'POST',
  2322.                         data: {
  2323.                             userId: {{ expert.expertInfo.idInd }},
  2324.                             comments: $("#admincomment").val(),
  2325.                         },
  2326.                     }).done(function (response) {
  2327.                         $this.html("Saved").delay(2000).queue(function (n) {
  2328.                             $("#newAdmComment").html(response);
  2329.                             $("#admincomment").val("");
  2330.                             $(this).html("Save");
  2331.                             n();
  2332.                         });
  2333.                         $this.attr('disabled', false);
  2334.                     });
  2335.                 });
  2336.                 $("#btnAddGroups").click(function () {
  2337.                     var groupsArr = [];
  2338.                     $.each($("#groups option:selected"), function (index, val) {
  2339.                         groupsArr.push(this.value);
  2340.                     });
  2341.                     var $this = $(this);
  2342.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2343.                     $(this).attr('disabled', true);
  2344.                     $.ajax({
  2345.                         url: "{{ path('set_groups') }}",
  2346.                         type: 'POST',
  2347.                         data: {
  2348.                             userId: {{ expert.expertInfo.idInd }},
  2349.                             groups: groupsArr
  2350.                         },
  2351.                     }).done(function (response) {
  2352.                         $this.html("Saved").delay(2000).queue(function (n) {
  2353.                             $(this).html("Save");
  2354.                             n();
  2355.                         });
  2356.                         $this.attr('disabled', false);
  2357.                     });
  2358.                 });
  2359.                 $("#countryList").change(function () {
  2360.                     if (this.checked) {
  2361.                         $("#countries").attr('disabled', false);
  2362.                     } else {
  2363.                         $("#countries").attr('disabled', true);
  2364.                         // $("#countries").select2("val", "");
  2365.                     }
  2366.                 });
  2367.                 $("#editor").change(function (e) {
  2368.                     if (this.checked) {
  2369.                         $("#countryList").siblings(".onoffswitch-label").addClass("onoffswitch-disabled");
  2370.                         $("#ownInstitute").siblings(".onoffswitch-label").addClass("onoffswitch-disabled");
  2371.                         $("#countryList").attr('disabled', true);
  2372.                         $("#ownInstitute").attr('disabled', true);
  2373.                         $("#countries").attr('disabled', true);
  2374.                     } else {
  2375.                         $("#countryList").siblings(".onoffswitch-label").removeClass("onoffswitch-disabled");
  2376.                         $("#ownInstitute").siblings(".onoffswitch-label").removeClass("onoffswitch-disabled");
  2377.                         $("#countryList").change();
  2378.                         $("#countryList").attr('disabled', false);
  2379.                         $("#ownInstitute").attr('disabled', false);
  2380.                     }
  2381.                 });
  2382.                 $("#addPrivileges").click(function () {
  2383.                     var countryArr = [];
  2384.                     $.each($("#countries option:selected"), function (index, val) {
  2385.                         countryArr.push(this.value);
  2386.                     });
  2387.                     var $this = $(this);
  2388.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2389.                     $(this).attr('disabled', true);
  2390.                     $.ajax({
  2391.                         url: "{{ path('set_privileges') }}",
  2392.                         type: 'POST',
  2393.                         data: {
  2394.                             userId: {{ expert.expertInfo.idInd }},
  2395.                             countries: countryArr,
  2396.                             ownInstitute: $("#ownInstitute").val(),
  2397.                             countryList: $("#countryList").val(),
  2398.                             editor: $("#editor").val(),
  2399.                         },
  2400.                     }).done(function (response) {
  2401.                         $this.html("Saved").delay(2000).queue(function (n) {
  2402.                             $(this).html("Save");
  2403.                             n();
  2404.                         });
  2405.                         $this.attr('disabled', false);
  2406.                     });
  2407.                 });
  2408.                 {% if expert.username is defined %}
  2409.                 $("#resetLink").click(function () {
  2410.                     var $this = $(this);
  2411.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Sending Email');
  2412.                     $(this).attr('disabled', true);
  2413.                     $.ajax({
  2414.                         url: "{{ path('reset_password_link') }}",
  2415.                         type: 'POST',
  2416.                         data: {
  2417.                             username: '{{ expert.username }}',
  2418.                         },
  2419.                     }).done(function (response) {
  2420.                         $this.html(response).delay(2000).queue(function (n) {
  2421.                             $(this).html("Send Password Reset link");
  2422.                             n();
  2423.                         });
  2424.                         $this.attr('disabled', false);
  2425.                     });
  2426.                 });
  2427.                 {% endif %}
  2428.                 $("#addRoles").click(function () {
  2429.                     var $this = $(this);
  2430.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Saving');
  2431.                     $(this).attr('disabled', true);
  2432.                     {% if expert.username is defined %}
  2433.                     {% set username = expert.username %}
  2434.                     {% elseif expert.expertInfo.username is defined %}
  2435.                     {% set username = expert.expertInfo.username %}
  2436.                     {% else %}
  2437.                     {% set username = '' %}
  2438.                     {% endif %}
  2439.                     $.ajax({
  2440.                         url: "{{ path('assign_roles') }}",
  2441.                         type: 'POST',
  2442.                         data: {
  2443.                             username: '{% if expert.username is defined %}{{ expert.username | raw }}{% endif %}',
  2444.                             manager: $("#manager").val(),
  2445.                             lme: $("#lme").val(),
  2446.                             administrator: $("#administrator").val(),
  2447.                             oceancdadmin: $("#oceancdadmin").val(),
  2448.                             odiscatadmin: $("#odiscatadmin").val(),
  2449.                             superadmin: $("#superadmin").val()
  2450.                         },
  2451.                     }).done(function (response) {
  2452.                         $this.html(response.message).delay(2000).queue(function (n) {
  2453.                             $(this).html("Save");
  2454.                             n();
  2455.                         });
  2456.                         $this.attr('disabled', false);
  2457.                     });
  2458.                 });
  2459.                 $(".undelete").click(function () {
  2460.                     var $this = $(this);
  2461.                     $(this).html('<i class="fa fa-cog fa-spin fa-fw"></i> Recovering');
  2462.                     $(this).attr('disabled', true);
  2463.                     $.ajax({
  2464.                         url: "{{ path('recover_account') }}",
  2465.                         type: 'POST',
  2466.                         data: {userId: "{{ expert.expertInfo.idInd }}"},
  2467.                     }).done(function (response) {
  2468.                         $this.html(response.message).delay(2000).queue(function (n) {
  2469.                             $this.parent().html('<button class="btn btn-danger ban"><i class="fa fa-ban" aria-hidden="true"></i> Deactivate</button>');
  2470.                             n();
  2471.                         });
  2472.                         $this.attr('disabled', false);
  2473.                     });
  2474.                 });
  2475.                 function countdown(remaining) {
  2476.                     if (remaining <= 0) {
  2477.                         $(".timer").text("Refreshing ");
  2478.                         window.location.href = "{{ path('view_profile',{'user': expert.expertInfo.idInd}) }}";
  2479.                     }
  2480.                     $(".timer").text(remaining);
  2481.                     setTimeout(function () {
  2482.                         countdown(remaining - 1);
  2483.                     }, 1000);
  2484.                 }
  2485.                 if ( document.location.href.indexOf('?page') > -1 ) {
  2486.                     $('html, body').animate({
  2487.                         scrollTop: $(".eventParticipation").offset().top-50
  2488.                     }, 500);
  2489.                 }
  2490.             });
  2491.         </script>
  2492.     {% endif %}
  2493. {% endblock %}