templates/search/missions.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% import 'macro/user.html.twig' as user_macro %}
  3. {% block title %}
  4.     {% if keyword and keyword != "" %}
  5.         {{ keyword }} jobs
  6.     {% else %}
  7.         Jobs
  8.     {% endif %}
  9.     in
  10.     {% if location is defined and location is iterable %}
  11.         {% set locationCount = location|length %}
  12.         {% if locationCount == 1 %}
  13.             {{ location[0] }}
  14.         {% elseif locationCount == 2 %}
  15.             {{ location[0] }} and {{ location[1] }}
  16.         {% else %}
  17.             {% for i in 0..locationCount-2 %}
  18.                 {{ location[i] }},
  19.             {% endfor %}
  20.             and {{ location[locationCount-1] }}
  21.         {% endif %}
  22.     {% endif %}
  23.     ({{ currentDate|format_datetime(pattern="MMMM yyyy", locale='en') }})
  24.      - Avopy.com
  25. {% endblock %}
  26. {% block stylesheets %}
  27.     <style>
  28.         .txt-lu {
  29.             border: 1px solid #F1948A;
  30.             padding: 6px;
  31.             border-radius: 2rem;
  32.             background-color: #F1948A;
  33.             color: white !important;
  34.             font-size: 13px;
  35.         }
  36.         .txt-nlu {
  37.             border: 1px solid #72C896;
  38.             padding: 6px;
  39.             border-radius: 2rem;
  40.             background-color: #72C896;
  41.             color: white !important;
  42.             font-size: 13px;
  43.         }
  44.         .small {
  45.             margin-bottom: 20px !important;
  46.         }
  47.         .wt-joincommunity {
  48.             width: 100%;
  49.             text-align: center;
  50.             background-color: #fff;
  51.             border: 1px solid #eee;
  52.             border-radius: 3px;
  53.             z-index: 9;
  54.             padding-top: 40px;
  55.             padding-bottom: 40px;
  56.             display: flex;
  57.             flex-wrap: wrap;
  58.             flex-direction: column;
  59.             align-items: center;
  60.             justify-content: center;
  61.             -webkit-box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1);
  62.             box-shadow: 0 6px 20px 0 rgba(0, 0, 0, 0.1);
  63.         }
  64.     </style>
  65.     <style>
  66.         .social-share-link, .share-messenger {
  67.             padding: initial !important;
  68.         }
  69.         .apply-btn {
  70.             margin-bottom: 20px;
  71.             padding-left: inherit !important;
  72.             padding-right: inherit !important;
  73.             text-align: center !important;
  74.         }
  75.         @media only screen and (max-width: 600px) {
  76.             .apply-btn {
  77.                 margin-top: 20px;
  78.                 margin-bottom: 5px;
  79.             }
  80.         }
  81.         .popup-offer-question .mfp-close {
  82.             margin-top: 20px !important;
  83.             margin-right: 15px !important;
  84.             color: #000 !important;
  85.         }
  86.         .job-listing .job-listing-company-logo img {
  87.             border-radius: 50px;
  88.         }
  89.         .job-listing .job-listing-company-logo {
  90.             max-width: 102px;
  91.         }
  92.         .alert-txt {
  93.             font-size: 18px;
  94.         }
  95.         @media (max-width: 768px) {
  96.             .notify-box .sort-by {
  97.                 position: absolute;
  98.                 margin-top: 18px;
  99.                 left: 0;
  100.             }
  101.             .notify-box {
  102.                 margin-bottom: 30px;
  103.             }
  104.         }
  105.         #more-filter {
  106.             color: #00B28E !important;
  107.             cursor: pointer;
  108.             box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  109.             border-radius: 30px !important;
  110.             background: white !important;
  111.             border: 2px solid #00b28e !important;
  112.             align-items: center;
  113.         }
  114.     </style>
  115. {% endblock %}
  116. {% block body %}
  117.     <div class="container margin-top-10" id="searchapp">
  118.         <div class="row">
  119.             <div class="col-xl-12 col-lg-12 content-left-offset">
  120.                 <form action="{{ path('mission_search') }}" method="post" id="formSearch">
  121.                     <div class="row" style="margin-top: 20px;">
  122.                         <div class="sidebar-widget col-md-3">
  123.                             <label class="small">Keywords</label>
  124.                             <div class="keywords-container">
  125.                                 <input name="search" placeholder="Keywords, Job title …" type="text" id="search"
  126.                                        class="with-border" value="{{ keyword }}"/>
  127.                             </div>
  128.                         </div>
  129.                         <div class="sidebar-widget col-md-2 hide-on-mobile other-input-search">
  130.                             <label class="small">Type of job</label>
  131.                             <div class="keywords-container">
  132.                                 <select id="categorie" name="category" class="selectpicker with-border">
  133.                                     <option value=""
  134.                                         {% if "" == category %} selected {% endif %}
  135.                                     >All
  136.                                     </option>
  137.                                     <option value="Full-time"
  138.                                         {% if "Full-time" == category %} selected {% endif %}
  139.                                     >Full-time
  140.                                     </option>
  141.                                     <option value="Part-time"
  142.                                         {% if "Part-time" == category %} selected {% endif %}
  143.                                     >Part-time
  144.                                     </option>
  145.                                     <option value="Contract"
  146.                                         {% if "Contract" == category %} selected {% endif %}
  147.                                     >Contract
  148.                                     </option>
  149.                                     <option value="Internship"
  150.                                         {% if "Internship" == category %} selected {% endif %}
  151.                                     >Internship
  152.                                     </option>
  153.                                 </select>
  154.                             </div>
  155.                         </div>
  156.                         <div class="sidebar-widget col-md-3 hide-on-mobile other-input-search">
  157.                             <label class="small">Experience</label>
  158.                             <div class="keywords-container">
  159.                                 <select id="experience" name="experience[]" class="selectpicker with-border" multiple
  160.                                         title="Choose">
  161.                                     <option value="0 to 2 years"
  162.                                         {% if "0 to 2 years" in experience %} selected {% endif %}
  163.                                     >0 to 2 years
  164.                                     </option>
  165.                                     <option value="2 to 5 years"
  166.                                         {% if "2 to 5 years" in experience %} selected {% endif %}
  167.                                     >2 to 5 years
  168.                                     </option>
  169.                                     <option value="5 to 10 years"
  170.                                         {% if "5 to 10 years" in experience %} selected {% endif %}
  171.                                     >5 to 10 years
  172.                                     </option>
  173.                                     <option value="10 to 15 years"
  174.                                         {% if "10 to 15 years" in experience %} selected {% endif %}
  175.                                     >10 to 15 years
  176.                                     </option>
  177.                                     <option value="15 to 20 years"
  178.                                         {% if "15 to 20 years" in experience %} selected {% endif %}
  179.                                     >15 to 20 years
  180.                                     </option>
  181.                                     <option value="More than 20 years"
  182.                                         {% if "More than 20 years" in experience %} selected {% endif %}
  183.                                     >More than 20 years
  184.                                     </option>
  185.                                 </select>
  186.                             </div>
  187.                         </div>
  188.                         <div class="sidebar-widget col-md-2 hide-on-mobile other-input-search">
  189.                             <label class="small">Location</label>
  190.                             <div class="keywords-container input-with-icon">
  191.                                 <select id="location" name="location[]" class="with-border selectpicker" multiple
  192.                                         data-live-search="true">
  193.                                     <option
  194.                                         value="All UAE" {{ 'All UAE' in location ? 'selected' : '' }}>
  195.                                         All UAE
  196.                                     </option>
  197.                                     {% for name,region in regions %}
  198.                                         <optgroup label="{{ name }}">
  199.                                             <option value="{{ name }}" {% if name in location %} selected {% endif %}>
  200.                                                 All
  201.                                                 {{ name }}</option>
  202.                                             {% for department in region %}
  203.                                                 <option
  204.                                                     value="{{ department }}" {% if department in location %} selected {% endif %}>
  205.                                                     {{ department }}
  206.                                                 </option>
  207.                                             {% endfor %}
  208.                                         </optgroup>
  209.                                     {% endfor %}
  210.                                 </select>
  211.                                 <i class="icon-material-outline-location-on"></i>
  212.                             </div>
  213.                         </div>
  214.                         <div class="col-md-3 margin-bottom-10  mobileshow" >
  215.                             <button type="button" class="button ripple-effect " onclick="showMoreInputSearch()" id="more-filter">
  216.                                 <b >More filters <i class="icon-feather-plus"></i></b>
  217.                             </button>
  218.                         </div>
  219.                         <div class="sidebar-widget col-md-2">
  220.                             {% if app.user %}
  221.                                 <div class="hide-on-mobile">
  222.                                     <br>
  223.                                 </div>
  224.                                 <button type="submit" class="button full-width">
  225.                                     Search
  226.                                     <i class="icon-material-outline-search"></i>
  227.                                 </button>
  228.                             {% else %}
  229.                                 <div class="hide-on-mobile">
  230.                                     <br>
  231.                                 </div>
  232.                                 <a href="#sign-in-dialog" class="button full-width popup-with-zoom-anim">
  233.                                     Search
  234.                                     <i class="icon-material-outline-search"></i>
  235.                                 </a>
  236.                             {% endif %}
  237.                         </div>
  238.                     </div>
  239.                     {% if isComing %}
  240.                     <div
  241.                         class="d-flex flex-column compact-list-layout align-content-around align-items-center padding-top-50 padding-bottom-50">
  242.                         <img src="{{ asset('images/search-file.png') }}" alt="recherche missions"/>
  243.                         <h2 class="marting-top-20" style="text-align: center;font-size: 23px;">
  244.                             Your profile is now reachable to recruiters and you shall very soon be able to apply to
  245.                             offers!
  246.                         </h2>
  247.                         <p id="timer" class="margin-top-35 text-blue" style="font-size:3em"></p>
  248.                     </div>
  249.                     {% else %}
  250.                     <div class="notify-box"
  251.                         {% if not app.user %}
  252.                             style="display: none"
  253.                         {% endif %}
  254.                     >
  255.                         <div class="switch-container">
  256.                             {% if app.user %}
  257.                                 {% if app.user.isFreelance %}
  258.                                     <label class="switch">
  259.                                         <input type="checkbox" id="alertSwitch" {% if alert %} checked {% endif %}>
  260.                                         <span class="switch-button" style="margin-top: 7px;"></span>
  261.                                         <span class="switch-text text-black alert-txt">
  262.                                                 {# <b><i class="icon-feather-bell" style="color: #ffc400; font-weight: 900;"></i></b> #}
  263.                                                 <img src="{{ asset('images/bell-img.png') }}" alt="Avopy - job alert"
  264.                                                      style="padding-bottom: 5px;">
  265.                                                 Do you want to receive
  266.                                                 <a href="{{ path('user_setting', {'goto': 'settings'}) }}#divOfferAlert"
  267.                                                    class=""><b>job alert</b></a>
  268.                                                 to be the first to apply to this type of job?
  269.                                             </span>
  270.                                     </label>
  271.                                 {% endif %}
  272.                             {% endif %}
  273.                         </div>
  274.                         {% if app.user %}
  275.                             <div class="sort-by">
  276.                                 <span>Sort by</span>
  277.                                 <select name="order" onchange="setSearchLibelle();this.form.submit()" class="selectpicker hide-tick">
  278.                                     <option value="pertinence" {{ order == 'pertinence' ? 'selected' : '' }}>
  279.                                         Relevance
  280.                                     </option>
  281.                                     <option class="no-wrap" value="desc" {{ order == 'desc' ? 'selected' : '' }}>
  282.                                         Newest
  283.                                     </option>
  284.                                     <option class="no-wrap" value="asc" {{ order == 'asc' ? 'selected' : '' }}>
  285.                                         Oldest
  286.                                     </option>
  287.                                 </select>
  288.                             </div>
  289.                         {% endif %}
  290.                     </div>
  291.                 </form>
  292.                 <div class="row">
  293.                     <div class="col-md-9">
  294.                         <div class="listings-container margin-top-5">
  295.                             {% if not noFound %}
  296.                                 <h1 style="font-size: 22px;">
  297.                                     {% if keyword and keyword != "" %}
  298.                                         {{ keyword }} jobs
  299.                                     {% else %}
  300.                                         Jobs
  301.                                     {% endif %}
  302.                                     in
  303.                                     {% if location is defined and location is iterable %}
  304.                                         {% set locationCount = location|length %}
  305.                                         {% if locationCount == 1 %}
  306.                                             {{ location[0]|replace({'All UAE' : 'UAE'}) }}
  307.                                         {% elseif locationCount == 2 %}
  308.                                             {{ location[0]|replace({'All UAE' : 'UAE'}) }} and {{ location[1]|replace({'All UAE' : 'UAE'}) }}
  309.                                         {% else %}
  310.                                             {% for i in 0..locationCount-2 %}
  311.                                                 {{ location[i]|replace({'All UAE' : 'UAE'}) }},
  312.                                             {% endfor %}
  313.                                             and {{ location[locationCount-1]|replace({'All UAE' : 'UAE'}) }}
  314.                                         {% endif %}
  315.                                     {% endif %}
  316.                                     results
  317.                                 </h1>
  318.                                 <br>
  319.                             {% else %}
  320.                                 {% if noFound and app.user %}
  321.                                     <h3>
  322.                                         <i>
  323.                                             No result was found.
  324.                                             You can activate the <span class="text-blue">job alert</span>
  325.                                         </i>
  326.                                     </h3>
  327.                                     <br>
  328.                                 {% endif %}
  329.                                 {% if noFound and not app.user %}
  330.                                     <h3>
  331.                                         <i>
  332.                                             No result was found.
  333.                                         </i>
  334.                                     </h3>
  335.                                     <br>
  336.                                 {% endif %}
  337.                             {% endif %}
  338.                             {% if app.user %}
  339.                                 {% if highlightedMissions|length > 0 %}
  340.                                     <div class="highlight-container">
  341.                                         {% for offer in highlightedMissions %}
  342.                                             {% include 'search/_society_card.html.twig' %}
  343.                                         {% endfor %}
  344.                                     </div>
  345.                                 {% endif %}
  346.                                 {% if otherBoostMissions|length > 0 %}
  347.                                     {% for offer in otherBoostMissions %}
  348.                                         {% include 'search/_society_card.html.twig' %}
  349.                                     {% endfor %}
  350.                                 {% endif %}
  351.                                 {% for offer in offers %}
  352.                                     {% include 'search/_society_card.html.twig' %}
  353.                                 {% endfor %}
  354.                                 <div class="navigation">
  355.                                     {{ knp_pagination_render(offers) }}
  356.                                 </div>
  357.                             {% else %}
  358.                                 {% for offer in offers|slice(0, 1) %}
  359.                                         {% set isInFav = false %}
  360.                                         {% for favorite in offer.offerFavorites %}
  361.                                             {% if app.user %}
  362.                                                 {% if favorite.user.id == app.user.id %}
  363.                                                     {% set isInFav = true %}
  364.                                                 {% endif %}
  365.                                             {% endif %}
  366.                                         {% endfor %}
  367.                                         <div class="job-listing">
  368.                                             <div class="job-listing-details">
  369.                                                 <div class="job-listing-company-logo">
  370.                                                     {% if offer.society %}
  371.                                                         {{ user_macro.societyPhoto(offer.society.user.photo) }}
  372.                                                     {% else %}
  373.                                                         <img src="{{ asset('images/company-logo-05.png') }}"
  374.                                                              alt="">
  375.                                                     {% endif %}
  376.                                                 </div>
  377.                                                 <div class="job-listing-description" style="opacity: 0.4">
  378.                                                     <div class="row">
  379.                                                         <div class="col-md-9 col-sm-12">
  380.                                                             <a href="{{ path('public_mission',{slug: offer.slug}) }}">
  381.                                                                 <h3 class="job-listing-title text-blue">{{ offer.title }}</h3>
  382.                                                                 <h5 class="job-listing-company text-black">
  383.                                                                     {% if offer.society %}
  384.                                                                         {{ offer.society.name }}
  385.                                                                     {% else %}
  386.                                                                         {{ offer.societyExternName }}
  387.                                                                     {% endif %}
  388.                                                                     <br>
  389.                                                                 </h5>
  390.                                                                 <p class="job-listing-text">
  391.                                                                     {{ offer.description| u.truncate(90,'...') }}
  392.                                                                 </p>
  393.                                                             </a>
  394.                                                         </div>
  395.                                                         <div class="col-md-3 col-sm-12" style="padding-right: 0px;">
  396.                                                             <div class="row" style=" bottom: 0; margin-bottom: -15px;">
  397.                                                                 <div class="col-md-12">
  398.                                                                     {% if not app.user %}
  399.                                                                         <a href="{{ path('public_redirect_offer_apply', {'id' : offer.id}) }}"
  400.                                                                            class="button apply-btn" style="width: 100%">
  401.                                                                             Apply now
  402.                                                                             <i class="icon-material-outline-arrow-right-alt"></i>
  403.                                                                         </a>
  404.                                                                     {% else %}
  405.                                                                         {% if offer.id in offerCandidatureIds %}
  406.                                                                             <button type="button"
  407.                                                                                     class="button grey apply-btn"
  408.                                                                                     style="width: 100%; background-color: #66676b; color: #fff;">
  409.                                                                                 Applied <i
  410.                                                                                     class="icon-feather-check"></i>
  411.                                                                             </button>
  412.                                                                         {% else %}
  413.                                                                             {% if offer.linkExtern %}
  414.                                                                                 <a href="{{ offer.linkExtern }}"
  415.                                                                                    class="button apply-btn"
  416.                                                                                    target="_blank" style="width: 100%">
  417.                                                                                     Apply now
  418.                                                                                     <i class="icon-material-outline-arrow-right-alt"></i>
  419.                                                                                 </a>
  420.                                                                             {% elseif offer.questions|length > 0 %}
  421.                                                                                 <button
  422.                                                                                     href="#small-dialog-{{ offer.id }}"
  423.                                                                                     class="popup-with-zoom-anim button apply-btn"
  424.                                                                                     style="width: 100%">
  425.                                                                                     Apply now
  426.                                                                                     <i class="icon-material-outline-arrow-right-alt"></i>
  427.                                                                                 </button>
  428.                                                                             {% else %}
  429.                                                                                 <form method="POST"
  430.                                                                                       action="{{ path('public_mission', {'slug' : offer.slug}) }}">
  431.                                                                                     <button type="submit"
  432.                                                                                             class="button apply-btn"
  433.                                                                                             style="width: 100%">
  434.                                                                                         Apply now
  435.                                                                                         <i class="icon-material-outline-arrow-right-alt"></i>
  436.                                                                                     </button>
  437.                                                                                 </form>
  438.                                                                             {% endif %}
  439.                                                                         {% endif %}
  440.                                                                     {% endif %}
  441.                                                                 </div>
  442.                                                                 <div class="col-md-12 mobileshow">
  443.                                                                     <button
  444.                                                                         class="share-messenger button margin-bottom-2"
  445.                                                                         data-tippy-placement="top"
  446.                                                                         style="background-color: rgb(59, 89, 152); width: 100%">
  447.                                                                         <a href="fb-messenger://share/?link={{ url('public_mission', {'slug' : offer.slug}) }}"
  448.                                                                            style="color: inherit; width: 100%; display: block">
  449.                                                                             Share <i
  450.                                                                                 class="icon-brand-facebook-messenger"></i>
  451.                                                                         </a>
  452.                                                                     </button>
  453.                                                                 </div>
  454.                                                                 <div class="col-md-12">
  455.                                                                     <button
  456.                                                                         href="https://www.linkedin.com/sharing/share-offsite/?url={{ url('public_mission', {'slug' : offer.slug}) }}"
  457.                                                                         class="social-share-link button margin-bottom-2"
  458.                                                                         data-tippy-placement="top"
  459.                                                                         style="background-color: rgb(0, 119, 181); width: 100%">
  460.                                                                         Share <i class="icon-brand-linkedin-in"></i>
  461.                                                                     </button>
  462.                                                                 </div>
  463.                                                                 <div class="col-md-12">
  464.                                                                     <button
  465.                                                                         href="https://wa.me/?text={{ url('public_mission', {'slug' : offer.slug}) }}"
  466.                                                                         class="social-share-link button margin-bottom-2"
  467.                                                                         data-tippy-placement="top"
  468.                                                                         style="background-color: #25D366; width: 100%">
  469.                                                                         Share <i class="icon-brand-whatsapp"></i>
  470.                                                                     </button>
  471.                                                                 </div>
  472.                                                             </div>
  473.                                                         </div>
  474.                                                     </div>
  475.                                                 </div>
  476.                                             </div>
  477.                                             <div class="job-listing-footer" style="opacity: 0.2">
  478.                                                 <ul>
  479.                                                     {% if offer.id in offerViewed %}
  480.                                                         <li>
  481.                                                             <span class="txt-nlu">
  482.                                                                 <i class="icon-feather-eye"
  483.                                                                    style="color:white;"></i>
  484.                                                                 View
  485.                                                             </span>
  486.                                                         </li>
  487.                                                     {% endif %}
  488.                                                     <li>
  489.                                                         {{ offer.timeCreateString }}
  490.                                                     </li>
  491.                                                     <li>
  492.                                                         <i class="icon-material-outline-business-center text-blue"></i>
  493.                                                         {{ offer.getYearRequired }}
  494.                                                     </li>
  495.                                                     <li>
  496.                                                         <i class="icon-line-awesome-money text-blue"></i>
  497.                                                         {{ offer.salaryPeerMonthText }}
  498.                                                     </li>
  499.                                                     <li>
  500.                                                         <i class="icon-material-outline-business text-blue"></i> {{ offer.typeSearch }}
  501.                                                     </li>
  502.                                                     <li>
  503.                                                         <i class="icon-material-outline-location-on text-blue"></i>{{ offer.location }}
  504.                                                     </li>
  505.                                                 </ul>
  506.                                             </div>
  507.                                         </div>
  508.                                 {% endfor %}
  509.                                 <div class="col-12 wt-joincommunityholder "
  510.                                      style="margin-top: -60px; padding-right: 0px !important; padding-left: 0px !important;">
  511.                                     <div class="wt-joincommunity">
  512.                                         <img
  513.                                             src="{{ asset('images/img-rejoigner-nous.png') }}"
  514.                                             alt="Join now for fun!">
  515.                                         <h2>Join us!</h2>
  516.                                         <p>To view more, please login or register</p>
  517.                                         {#WEB#}
  518.                                         <a href="{{ path('register_freelance') }}"
  519.                                            class="button btn-lg ripple-effect margin-top-25 hide-on-mobile">
  520.                                             Register 100% free
  521.                                         </a>
  522.                                         {#MOBILE#}
  523.                                         <a href="{{ path('register_freelance_mobile') }}"
  524.                                            class="button btn-lg ripple-effect margin-top-25 mobileshow">
  525.                                             Register 100% free
  526.                                         </a>
  527.                                     </div>
  528.                                 </div>
  529.                                 <br><br>
  530.                             {% endif %}
  531.                         </div>
  532.                     </div>
  533.                     <div class="col-md-3"></div>
  534.                 </div>
  535.                 {% endif %}
  536.             </div>
  537.         </div>
  538.     </div>
  539.     {# FORM FOR NOT USER #}
  540.     {% if not app.user %}
  541.         {% include 'common/modal/sign_modal.html.twig' %}
  542.         {% include 'common/modal/reset_password_modal.html.twig' %}
  543.         {# ------- BTN LOGIN / REGISTER MOBILE ------ #}
  544.         {% include 'macro/notuser_floatant.html.twig' %}
  545.     {% endif %}
  546. {% endblock %}
  547. {% block javascripts %}
  548.     <script>
  549.         $(function () {
  550.             $('form input').on('keydown', function (e) {
  551.                 if (e.keyCode == 13) {
  552.                     e.preventDefault();
  553.                     return false;
  554.                 }
  555.             });
  556.             const regions = JSON.parse(`{% autoescape false %}{{ regionjson }}{% endautoescape %}`);
  557.             $('#location').change(function () {
  558.                 var location = $(this).val();
  559.                 var newLocation = location;
  560.                 if (location.length > 1) {
  561.                     newLocation = newLocation.filter((value) => value !== 'All UAE');
  562.                 }
  563.                 Object.entries(regions).forEach(([region, departement]) => {
  564.                     if (newLocation.includes(region)) {
  565.                         var dep = Object.keys(departement);
  566.                         newLocation = newLocation.filter((value) => !dep.includes(value));
  567.                     }
  568.                 });
  569.                 $(this).selectpicker('val', newLocation);
  570.             });
  571.             $('#alertSwitch').on('change', function () {
  572.                 const isActive = $('#alertSwitch').is(':checked');
  573.                 var $form = $('form');
  574.                 var data = $form.serialize();
  575.                 $.ajax({
  576.                     url: '/missions/alert',
  577.                     type: isActive ? 'POST' : 'DELETE',
  578.                     data: data
  579.                 });
  580.             });
  581.             var currentValue = JSON.parse('{{ keywordArray | json_encode | raw }}');
  582.             const keywordInput = $(".keyword-search");
  583.             const keywordsList = $(".keywords-list");
  584.             /*$('form').on('submit', function (e) {
  585.             if (keywordInput.val() !== "") {
  586.             e.preventDefault();
  587.             addKeyword();
  588.             return false;
  589.             }
  590.             });*/
  591.             keywordsList.trigger('resizeContainer');
  592.             // adding keyword
  593.             function addKeyword() {
  594.                 const newKeyword = $("<span class='keyword'><span class='keyword-remove'></span><span class='keyword-text'>" + keywordInput.val() + "</span></span>");
  595.                 currentValue.push(keywordInput.val());
  596.                 keywordsList.append(newKeyword).trigger('resizeContainer');
  597.                 keywordInput.val("");
  598.                 populateValue();
  599.                 $('form').submit();
  600.             }
  601.             function populateValue() {
  602.                 $('#searchHidden').val(currentValue.join(', '));
  603.             }
  604.             // add via enter key
  605.             /*keywordInput.on('keyup', function (e) {
  606.             if ((e.keyCode == 13) && (keywordInput.val() !== "")) {
  607.             addKeyword();
  608.             }
  609.             });*/
  610.             // add via button
  611.             /*$('.keyword-input-button').on('click', function () {
  612.             if ((keywordInput.val() !== "")) {
  613.             addKeyword();
  614.             }
  615.             });*/
  616.             // removing keyword
  617.             $(document).on("click", ".keyword-remove", function () {
  618.                 $(this).parent().addClass('keyword-removed');
  619.                 let removedValue = $(this).parent().find('.keyword-text').html();
  620.                 currentValue = currentValue.filter((f) => f !== removedValue);
  621.                 function removeFromMarkup() {
  622.                     $(".keyword-removed").remove();
  623.                 }
  624.                 setTimeout(removeFromMarkup, 500);
  625.                 keywordsList.css({'height': 'auto'}).height();
  626.                 populateValue();
  627.                 $('form').submit();
  628.             });
  629.             // animating container height
  630.             keywordsList.on('resizeContainer', function () {
  631.                 var heightnow = $(this).height();
  632.                 var heightfull = $(this).css({'max-height': 'auto', 'height': 'auto'}).height();
  633.                 $(this).css({'height': heightnow}).animate({
  634.                     'height': heightfull
  635.                 }, 200);
  636.             });
  637.             $(window).on('resize', function () {
  638.                 keywordsList.css({'height': 'auto'}).height();
  639.             });
  640.             // Auto Height for keywords that are pre-added
  641.             $(window).on('load', function () {
  642.                 var keywordCount = $('.keywords-list').children("span").length;
  643.                 // Enables scrollbar if more than 3 items
  644.                 if (keywordCount > 0) {
  645.                     keywordsList.css({'height': 'auto'}).height();
  646.                 }
  647.             });
  648.             $('.bookmark-icon').on('click', function () {
  649.                 let id = $(this).attr('data-id');
  650.                 $.ajax({
  651.                     url: "/offer/favorite/" + id,
  652.                     method: "POST",
  653.                     dataType: "json"
  654.                 })
  655.             });
  656.             {% if isComing %}
  657.             const countDownDate = new Date('{{ date_coming_soon }}').getTime();
  658.             setInterval(function () {
  659.                 let now = new Date().getTime();
  660.                 let distance = countDownDate - now;
  661.                 let days = Math.floor(distance / (1000 * 60 * 60 * 24));
  662.                 let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  663.                 let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  664.                 let seconds = Math.floor((distance % (1000 * 60)) / 1000);
  665.                 document.getElementById("timer").innerHTML = days + "d " + hours + "h " + minutes + "mn " + seconds + "s ";
  666.             }, 1000);
  667.             {% endif %}
  668.         });
  669.     </script>
  670.     {# ---- SCRICP FORMATAGE RECHERCHE --- #}
  671.     {% if app.user %}
  672.         {{ include('macro/_mission-search.html.twig') }}
  673.     {% endif %}
  674.     {# ---- SCRICP SHOW OTHER INPUT --- #}
  675.     <script>
  676.         function showMoreInputSearch() {
  677.             let otherInputSearchDivs = document.querySelectorAll('.other-input-search');
  678.             // Parcourez chaque div avec la classe .other-input-search
  679.             otherInputSearchDivs.forEach(function (div) {
  680.                 // Vérifiez si la classe .hide-on-mobile existe dans la div
  681.                 if (div.classList.contains('hide-on-mobile')) {
  682.                     // Si elle existe, retirez-la
  683.                     div.classList.remove('hide-on-mobile');
  684.                 } else {
  685.                     // Sinon, ajoutez-la
  686.                     div.classList.add('hide-on-mobile');
  687.                 }
  688.             })
  689.         }
  690.     </script>
  691. {% endblock %}