templates/pages/homepage.html.twig line 40

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block content %}
  3.     <!-- Load Facebook SDK for JavaScript -->
  4.     <div id="fb-root"></div>
  5.     <script>
  6.         (function(d, s, id) {
  7.             var js, fjs = d.getElementsByTagName(s)[0];
  8.             if (d.getElementById(id)) return;
  9.             js = d.createElement(s); js.id = id;
  10.             js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0";
  11.             fjs.parentNode.insertBefore(js, fjs);
  12.         }(document, 'script', 'facebook-jssdk'));
  13.     </script>
  14.        <div class="container container-home">
  15.             {% for message in app.flashes('success') %}
  16.                 <div class="alert alert-success alert-dismissible alert-success-journal w-100 mx-auto d-flex p-2 mb-4" role="alert">
  17.                     <span class="">{{ message }}</span>
  18.                     <span type="button" class="close position-static ml-auto" data-dismiss="alert" aria-label="Close" style="padding: 0 !important;"><span aria-hidden="true">&times;</span></span>
  19.                 </div>
  20.             {% endfor %}
  21.            {% for message in app.flashes('warning') %}
  22.                <div class="alert alert-warning alert-dismissible alert-warning-journal w-100 mx-auto d-flex p-2 mb-4" role="alert">
  23.                    <span class="">{{ message }}</span>
  24.                    <span type="button" class="close position-static ml-auto" data-dismiss="alert" aria-label="Close" style="padding: 0 !important;"><span aria-hidden="true">&times;</span></span>
  25.                </div>
  26.            {% endfor %}
  27.            {% for message in app.flashes('error') %}
  28.                <div class="alert alert-error alert-dismissible alert-error-journal w-100 mx-auto d-flex p-2 mb-4" role="alert">
  29.                    <span class="">{{ message }}</span>
  30.                    <span type="button" class="close position-static ml-auto" data-dismiss="alert" aria-label="Close" style="padding: 0 !important;"><span aria-hidden="true">&times;</span></span>
  31.                </div>
  32.            {% endfor %}
  33.             {% include 'pages/parts/form-search.html.twig' %}
  34.             <div class="page-content">
  35.                 {{ render(path('latestJournals')) }}
  36.                <div class="page-title">
  37.                    <h2>Find Journals or Authors</h2>
  38.                    <p>
  39.                         Your research is easier with a journal that you can save.
  40.                         Follow the author to stay up-to-date on new articles as they are published!
  41.                    </p>
  42.                </div>
  43.                <div class="row icons-homepage px-1 mx-0">
  44.                    <div class="col-md-3 block-intro">
  45.                        <a href="{{ path('journalSearch') }}" >
  46.                            <img class="img-fluid logo-gj" src="{{ asset('assets/images/refonte/homepage/search.svg') }}" alt="researchguide"  />
  47.                            <h5>Journal Search</h5>
  48.                            <p>Find the best journal for your research, depending on various criteria (Title, article keywords).</p>
  49.                        </a>
  50.                    </div>
  51.                    <div class="col-md-3 block-intro">
  52.                        <a href="{{ path('get_authors') }}">
  53.                            <img class="img-fluid logo-gj" src="{{ asset('assets/images/refonte/homepage/lamp.svg') }}" alt="researchguide"  />
  54.                            <h5>Author Search</h5>
  55.                            <p> Find your authors with their published articles and corresponding journals.</p>
  56.                        </a>
  57.                    </div>
  58.                    <div class="col-md-3 block-intro">
  59.                        <a href="{{ path('registre_user') }}" >
  60.                            <img class="img-fluid logo-gj" src="{{ asset('assets/images/refonte/homepage/save_icon.svg') }}" alt="researchguide"  />
  61.                            <h5>Save journal </h5>
  62.                            <p>Save your favorite journals for easy reference. Stay up-to-date on recent and updated journals.</p>
  63.                        </a>
  64.                    </div>
  65.                    <div class="col-md-3 block-intro">
  66.                        <a href="{{ path('registre_user') }}">
  67.                            <img class="img-fluid logo-gj" src="{{ asset('assets/images/refonte/homepage/follow_author_icon.svg') }}" alt="researchguide"  />
  68.                            <h5>Follow author </h5>
  69.                            <p>Follow your author to receive new journals and latest journal developments in your field.</p>
  70.                        </a>
  71.                    </div>
  72.                </div>
  73.                <div class="row description-block  mx-0">
  74.                    <div class="col-md-6 right-content">
  75.                        <h5>Find your Journal easily</h5>
  76.                        <p class="paragraphe">You can choose to filter by Author or Journal title in order to find the perfect fit for your needs! </p>
  77.                        <div class="row check-bloc">
  78.                            <div class="col-2 col-md-2 img-check">
  79.                                <img class="img-fluid" src="{{ asset('assets/images/refonte/homepage/Author.svg') }}" alt="researchguide"  />
  80.                            </div>
  81.                            <div class="col-10 col-md-10">
  82.                                <p class="check-bloc-title">Search for a Journal by title or related keywords.</p>
  83.                                <p class="check-bloc-text"></p>
  84.                            </div>
  85.                        </div>
  86.                        <div class="row check-bloc">
  87.                            <div class="col-2 col-md-2 img-check">
  88.                                <img class="img-fluid" src="{{ asset('assets/images/refonte/homepage/Author.svg') }}" alt="researchguide"  />
  89.                            </div>
  90.                            <div class="col-10 col-md-10">
  91.                                <p class="check-bloc-title">Search for the author's name to find their publications</p>
  92.                                <p class="check-bloc-text"></p>
  93.                            </div>
  94.                        </div>
  95.                        {% if app.user== null %}
  96.                            <div class="row block-connexion">
  97.                                <div class="col-md-5 p-0">
  98.                                    <a href="{{ path('journalSearch')}}">
  99.                                        <button class="btn btn-connexion btn-journal btn-block">Find a Journal</button>
  100.                                    </a>
  101.                                </div>
  102.                                <div class="col-md-5 pl-3" >
  103.                                    <a href="{{ path('get_authors')}}">
  104.                                        <button class="btn btn-connexion btn-author btn-block">Find an Author</button>
  105.                                    </a>
  106.                                </div>
  107.                            </div>
  108.                        {% endif %}
  109.                    </div>
  110.                    <div class="col-md-6 left-content find-journal-bg" style="background: url({{ asset("assets/images/desk-rg.webp") }})">
  111.                        <div class="row">
  112.                            <div class="col-md-6 img-sample">
  113.                               {#<img class="img-fluid" src="{{ asset('assets/images/refonte/homepage/sample.svg') }}" alt="GuideJournal"  />#}
  114.                            </div>
  115.                            <div class="col-md-6 img-sample">
  116.                                {#<img class="img-fluid" src="{{ asset('assets/images/refonte/homepage/sample.svg') }}" alt="GuideJournal"  />#}
  117.                            </div>
  118.                        </div>
  119.                    </div>
  120.                </div>
  121.                {#<div class="container my-5 ad-banner">
  122.                     researchguide ad
  123.                     <ins class="adsbygoogle"
  124.                         style="display:block"
  125.                         data-ad-client="ca-pub-9897811061542650"
  126.                         data-ad-slot="3798275752"
  127.                         data-ad-format="auto"
  128.                         data-full-width-responsive="true"></ins>
  129.                     <script>
  130.                         (adsbygoogle = window.adsbygoogle || []).push({});
  131.                     </script>
  132.                </div>#}
  133.                <div class="row recent-articles mx-0" style="padding-top:10%">
  134.                    <div class="col-md-12 last-articles">
  135.                        <h5 class="title">Blog Posts</h5>
  136.                    </div>
  137.                    <div class="col-md-6 left-content"><p>Browse the latest Articles</p></div>
  138.                        <div class="container c-carousel">
  139.                            <div class="row row-carousel">
  140.                                <div class="col-md-12 col-carousel mb-4">
  141.                                    <div class="carousel-articles">
  142.                                        {% set articles= [] %}
  143.                                        {% for post in posts %}
  144.                                            <div class="col-md-4 article-infos">
  145.                                                {% if post.image %}
  146.                                                    {% set media = post.image ?  post.image.filePath : null  %}
  147.                                                    {% if media and  media is not null %}
  148.                                                        <a href="{{ path('blog_post',{'slug':post.slug}) }}">
  149.                                                            <img class="card-img-top" data-src="{{ asset('uploads/blog/' ~ media)  }}" src="{{ asset('uploads/blog/' ~ media)  }}" data-holder-rendered="true" alt="{{ post.title }}">
  150.                                                        </a>
  151.                                                    {% else %}
  152.                                                        <a href="{{ path('blog_post',{'slug':post.slug}) }}">
  153.                                                            <img class="card-img-top img-responsive" data-src="{{ asset('assets/images/refonte/homepage/article.svg') }}" src="{{ asset('assets/images/refonte/homepage/article.svg') }}" data-holder-rendered="true" alt="{{ post.title }}">
  154.                                                        </a>
  155.                                                    {% endif %}
  156.                                                {% else %}
  157.                                                    <a href="{{ path('blog_post',{'slug':post.slug}) }}">
  158.                                                        <img class="card-img-top" data-src="{{ asset('assets/images/refonte/homepage/article.svg') }}" src="{{ asset('assets/images/refonte/homepage/article.svg') }}" data-holder-rendered="true" alt="researchguide">
  159.                                                    </a>
  160.                                                {% endif %}
  161.                                             <div class="fav-img">
  162.                                                 <a href="{{ path('blog_post',{'slug':post.slug}) }}"> <img class="img-fluid" src="{{ asset('assets/images/refonte/homepage/favoris.svg') }}" alt="researchguide"  /></a>
  163.                                             </div>
  164.                                             <div class="content">
  165.                                                 <h6 class="title-article"> <a href="{{ path('blog_post',{'slug':post.slug}) }}">{{ post.title }}</a></h6>
  166.                                                     <p>
  167.                                                         {{ post.content|slice(0,60)|raw  }}...   <br><a href="{{ path('blog_post',{'slug':post.slug}) }}" style="float: right;font-weight: 400" class="text-warning">Read More →</a>
  168.                                                     </p>
  169.                                             </div>
  170.                                         </div>
  171.                                     {% endfor %}
  172.                                 </div>
  173.                             </div>
  174.                         </div>
  175.                     </div>
  176.             </div>
  177.             
  178.         </div>
  179.     </div>
  180.         {# should check if !catgories  #}
  181.     {% if app.user and app.user.categories.values is empty and app.request.cookies.get('skip-categories') != "true" %}
  182.         <form action="{{ path('save_favorite_categories') }}" method="post">
  183.             <div id="choose-categories-modal" class="modal registre-modal" style="display:flex; z-index: 100;">
  184.                 <div class="modal-content animate register-modal-content p-3" style="box-shadow: none !important;border: 0 !important;">
  185.                     <span class="close skip-check-categories d-flex justify-content-end" title="Close Modal" style="margin-left:0 !important;left:20px;top:20px;cursor: pointer;">
  186.                         <svg width="35" height="35" viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg" style="float: right">
  187.                             <path fill-rule="evenodd" clip-rule="evenodd" d="M21.4898 25.1794L0.521973 46.1519L4.0579 49.687L25.0249 28.7154L45.9919 49.687L49.5279 46.1519L28.5601 25.1794L49.5279 4.20702L45.9919 0.671875L25.0249 21.6435L4.0579 0.671875L0.521973 4.20702L21.4898 25.1794Z" fill="#58595B"/>
  188.                         </svg>
  189.                     </span>        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
  190.                     <h2 class="skip-check-categories modal-register-title w-100 mx-0 text-center my-2" style="margin-top: 60px; color:black">
  191.                         Select your favorite categories:
  192.                     </h2>
  193.                     <p class="text-center"> <i>This help us recommend the most useful journals</i></p>
  194.                     <div id="register-step-2" style="">
  195.                         <div class="d-flex flex-wrap register-categories">
  196.                             {% set categories = publicationManager.getAllCategories()  %}
  197.                             {% for category in categories|sort((a, b) => a.name <=> b.name) %}
  198.                                 {% if category.name != '' and category.name != ' ' %}
  199.                                     <div class="category-item">
  200.                                         <svg xmlns="http://www.w3.org/2000/svg" style="display:none" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"/></svg>
  201.                                         <span id="{{ category.id }}">{{category.name}}</span>
  202.                                     </div>
  203.                                 {% endif %}
  204.                             {% endfor %}
  205.                         </div>
  206.                     </div>
  207.                     <div class="d-flex px-4 px-sm-5 my-2">
  208.                         <input type="hidden" id="selected-categories" name="selected-categories">
  209.                         <button type="submit" id="register-btn-2" class="btn form-register-btn mx-auto mt-0" style=" width: 100% !important;" disabled>
  210.                             <p id="register-btn-text" class="form-register-btn-text my-auto">Validate</p>
  211.                         </button>
  212.                     </div>
  213.                     <br><a  href="/" class="skip-check-categories text-center form-register-btn-text my-auto text-dark"  style="font-weight: 300 !important;width: 100% !important;">Skip</a>
  214.                 </div>
  215.             </div>
  216.         </form>
  217.     {% endif %}
  218.     <div class="container-fluid container-banner">
  219.         <div class="banner py-5">
  220.             <h6 class="pt-0">Trusted by great companies</h6>
  221.             <div class="container">
  222.             <div class="row partenaires">
  223.                 <div class="col-sm-4 mt-4 mt-lg-0">
  224.                     <a href="https://monarkit.net" target="_blank"><img class="img-fluid" src="{{ asset('assets/images/refonte/homepage/monark.svg') }}" alt="monarkIt"  /></a>
  225.                 </div>
  226.                 <div class="col-sm-4 mt-4 mt-lg-0">
  227.                     <a href="https://aion-lab.com" target="_blank"><img class="img-fluid" src="{{ asset('assets/images/refonte/homepage/aion.svg') }}" alt="aion"  /></a>
  228.                 </div>
  229.                 <div class="col-sm-4 mt-4 mt-lg-0">
  230.                     <a href="https://app-estimator.com" target="_blank"><img class="img-fluid" width="190" src="{{ asset('assets/images/refonte/homepage/estimitor.svg') }}" alt="estimator"  /></a>
  231.                 </div>
  232.             </div>
  233.             </div>
  234.         </div>
  235.     </div>
  236.    <div class="suggest-articles container">
  237.         <div class="d-flex flex-column flex-lg-row justify-content-center mx-0">
  238.             <div class="left-content mr-0 mr-lg-5">
  239.                 {% if app.user and app.user.categories is not empty %}
  240.                     {% set favoriteUserCategories = publicationManager.showJournalByFavoriteUserCategories(app.user) %}
  241.                     {% if favoriteUserCategories %}
  242.                         <div class="row line-1">
  243.                             {% for ind,favorite in favoriteUserCategories|slice(0,4) %}
  244.                                 {% set id = ind + 1 %}
  245.                                 <div class="col-12 col-sm-6 text-center home-categorie-card">
  246.                                     <a href="{{ path('journal_show',{'id':favorite.id}) }}">
  247.                                         <div class="img-journal" >
  248.                                             <p>{{ favorite.title }}</p>
  249.                                           {%  set categories=favorite.categories.values %}
  250.                                             <div class="badge-journal" >
  251.                                                 {% for category in categories %}
  252.                                                     <span class="badge">{{ category.name }}</span>
  253.                                                 {% endfor %}
  254.                                             </div>
  255.                                         </div>
  256.                                     </a>
  257.                                 </div>
  258.                             {% endfor %}
  259.                         </div>
  260.                     {% endif %}
  261.                 {% else %}
  262.                     <div class="row line-1">
  263.                         <div class="col-6 col-md-6 text-center">
  264.                             <img class="img-fluid" src="{{ asset('assets/images/refonte/journal-selected-1.jpg') }}" alt="suggest-article"  />
  265.                         </div>
  266.                         <div class="col-6 col-md-6 text-center s-img">
  267.                             <img class="img-fluid" src="{{ asset('assets/images/refonte/journal-selected-2.jpg') }}" alt="suggest-article"  />
  268.                         </div>
  269.                     </div>
  270.                     <div class="row line-2 mt-3">
  271.                         <div class="col-6 col-md-6 text-center">
  272.                             <img class="img-fluid" src="{{ asset('assets/images/refonte/journal-selected-3.jpg') }}" alt="suggest-article"  />
  273.                         </div>
  274.                         <div class="col-6 col-md-6 text-center f-img">
  275.                             <img class="img-fluid" src="{{ asset('assets/images/refonte/journal-selected-4.jpg') }}" alt="suggest-article"  />
  276.                         </div>
  277.                     </div>
  278.                 {% endif %}
  279.             </div>
  280.             <div class="right-content d-flex flex-column text-center text-lg-left">
  281.                 <h6 class="selected-journals">Journals selected <br> for you</h6>
  282.                 {% if app.user %}
  283.                 <p>
  284.                     Discover these recommended journals tailored to your favorite categories.<br><br>
  285.                     We believe you'll find them highly valuable for your research, ensuring comprehensive coverage in your field<br><br>
  286.                       Because you selected :<br><br>
  287.                 </p>
  288.                 <div class="badge-journal-user" >
  289.                         {% for category in app.user.categories %}
  290.                             <span class="badge">{{ category.name }}</span>
  291.                         {% endfor %}
  292.                 </div>
  293.                 {% else %}
  294.                 <p>
  295.                     Explore these  recommended journals that we think you'll find most useful.<br><br>
  296.                     With these, you will be sure to have a complete research.
  297.                 </p>
  298.                 {% endif %}
  299.                <button class="btn"> <a href="{{ path('journalSearch') }}" class="text-white">Find a Journal </a></button>
  300.             </div>
  301.         </div>
  302.     </div>
  303.     <!-- Exemple de div pour un emplacement publicitaire -->
  304.     <div id="banner-ad-1">
  305.         <!-- L'espace réservé pour l'annonce sera rempli ici par Prebid -->
  306.     </div>
  307.     <section class="newsletter-section px-3 container">
  308.         <div class="newsletter-container" style="background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),url({{ asset('assets/images/refonte/header-2.jpg') }})">
  309.             <div class="newsletter-content">
  310.                 <p class="newsletter-title">Sign up to our newsletter!</p>
  311.                 <p class="newsletter-description">so you can be the first to find out the latest articles and journals. </p>
  312.                 <div class="newsletter-btn-subscribe-container">
  313.                     <form action="{{ path('newsletter') }}" method="post" class="d-flex">
  314.                         <input type="hidden" name="newsletter" value="true" class="newsletter-input-hidden">
  315.                         <input name="email" type="email" class="newsletter-btn-submit" placeholder="Subscribe to our newsletter" required/>
  316.                         <input type="submit" value="Submit" class="newsletter-input-submit">
  317.                     </form>
  318.                 </div>
  319.             </div>
  320.         </div>
  321.     </section>
  322.     <!-- Pubi 0001-->
  323.     <!-- /21831250958/guidejournal_home_pub0001 -->
  324. {#    <div id='div-gpt-ad-1563781924570-0' style="align-content: center">#}
  325. {#        <script>#}
  326. {#            googletag.cmd.push(function() { googletag.display('div-gpt-ad-1563781924570-0'); });#}
  327. {#        </script>#}
  328. {#    </div>#}
  329.     <!-- Fin pub 0001-->
  330. {% endblock %}
  331.     
  332. {% block vignetteAd %}
  333.     <div class="fixed-pub-area w-100"></div>
  334.     {% include '_includes/pubs/custom-vignette-ad.html.twig' %}
  335. {% endblock %}
  336. {% block javascripts %}
  337.     <script>
  338.         $('.category-item').click(function (e) {
  339.             $('#register-btn-2').prop( "disabled", false );
  340.             let svg = e.currentTarget.firstElementChild;
  341.             let span = e.currentTarget.lastElementChild;
  342.             var categoryInput = document.getElementById('selected-categories')
  343.             svg.style.display === 'block' ? svg.style.display = 'none' : svg.style.display = 'block'
  344.             if(svg.style.display === 'block') {
  345.               // remove category
  346.                 let spanValue = span.id;
  347.                 // put span value in input
  348.                 if(categoryInput.value){
  349.                     categoryInput.value = categoryInput.value+","+spanValue;
  350.                 } else {
  351.                     categoryInput.value = spanValue;
  352.                 }
  353.             }else{
  354.                 // add category
  355.                 let spanValue = span.id;
  356.                 if(categoryInput.value){
  357.                     let categories = categoryInput.value.split(",");
  358.                     let index = categories.indexOf(spanValue);
  359.                     if (index > -1) {
  360.                         categories.splice(index, 1);
  361.                     }
  362.                     categoryInput.value = categories.join(",");
  363.                 }
  364.             }
  365.             e.currentTarget.classList.toggle('active');
  366.         })
  367.     </script>
  368. {% endblock %}