src/NCBS/WebsiteBundle/Resources/views/Default/index.html.twig line 1

Open in your IDE?
  1. {% extends 'NCBSWBundle::layout.html.twig' %}
  2. {% block title %}{{ app.session.get('ui_str')["meta.site.home.subtitle"] }} - {{ parent() }}{% endblock %}
  3. {% block content %}
  4. <div class="row home-tile" style="margin:25px 1px 0px 1px;">
  5.                         
  6.     <div class="col-sm-6" style="padding:0px; border:3px solid #fff;">
  7. <a style="display:block;color:#000;text-decoration:none;padding: 0px 10px 5px 10px;" href="javascript:openBibleIndex();" title="{{ app.session.get('ui_str')["homepage.quadrants.bible.mouseover"] }}"><span class="tile-title" style="color:#212529;"><i class="fad fa-book-bible" style="padding:right:25px;color:#c4122e;;"></i> {{ app.session.get('ui_str')["homepage.quadrants.bible.title"] }}</span><br>
  8. <span>{{ app.session.get('ui_str')["homepage.quadrants.bible.label"] }}</span></a>
  9.     </div>
  10.     <div class="col-sm-6" style="padding:0px; border:3px solid #fff;">
  11. <a style="display:block;color:#000;text-decoration:none;padding: 0px 10px 5px 10px;" href="{{ path('bible_stories') }}" title="{{ app.session.get('ui_str')["homepage.quadrants.stories.mouseover"] }}"><span class="tile-title" style="color:#212529;"><i class="fad fa-book-open-reader" style="padding:right:25px;color:#296e47;"></i> {{ app.session.get('ui_str')["homepage.quadrants.stories.title"] }}</span><br>
  12. <span>{{ app.session.get('ui_str')["homepage.quadrants.stories.label"] }}</span></a>
  13.     </div>                 
  14. </div>
  15. <div class="row home-tile" style="margin:0px 1px 25px 1px;">
  16.                         
  17.     <div class="col-sm-6" style="padding:0px; border:3px solid #fff;">
  18. <a style="display:block;color:#000;text-decoration:none;padding: 0px 10px 5px 10px;" href="{{ path('consider') }}" title="{{ app.session.get('ui_str')["homepage.quadrants.consider.mouseover"] }}"><span class="tile-title" style="color:#212529;"><i class="fad fa-sun" style="padding:right:25px;color:#ffc107;"></i> {{ app.session.get('ui_str')["homepage.quadrants.consider.title"] }}</span><br>
  19. <span>{{ app.session.get('ui_str')["homepage.quadrants.consider.label"] }}</span></a>
  20.     </div>
  21.     <div class="col-sm-6" style="padding:0px; border:3px solid #fff;">
  22. <a class="tile-link" style="display:block;color:#000;text-decoration:none;padding: 0px 10px 5px 10px;" href="{{ path('swedenborg') }}" title="{{ app.session.get('ui_str')["homepage.quadrants.swedenborg.mouseover"] }}"><span class="tile-title" style="color:#212529;"><i class="fad fa-feather-pointed" style="padding:right:25px;color:#6c3a2a;"></i> {{ app.session.get('ui_str')["homepage.quadrants.swedenborg.title"] }}</span><br>
  23. <span>{{ app.session.get('ui_str')["homepage.quadrants.swedenborg.label"] }}</span></a>
  24.     </div>                 
  25. </div>
  26. <hr />
  27.             <h4><i class="fas fa-message-bot" style="color:#2a836d;"></i> {{ app.session.get('ui_str')["chatbot.heading"]|raw }}</h4>
  28.         <div class="row">
  29.             <div class="input-group col">                
  30.             <textarea class="form-control" rows="1" id="sQuestion" style="display: block; overflow: hidden; resize: none; min-height:38px;" placeholder="{{ app.session.get('ui_str')["chatbot.questionplaceholder"]|raw }}"></textarea>    
  31.             <span class="input-group-append">
  32.             <button type="button" x class="btn btn-primary" onclick=AskBot() id="btnSubmit">{{ app.session.get('ui_str')["form.submitbutton"]|raw }}</button>
  33.             </span>
  34.             </div>
  35.         </div>
  36.         
  37. {% if feature_data is defined %}
  38.     <hr style="margin-top: 1.5rem;">
  39.     <h3 style="font-size:20px; display:inline;">{{ app.session.get('ui_str')["homepage.featuredcontent"] }}</h3> <small>
  40.     {% if see_more %}
  41.         (<a href="{{ path('landing_page') }}">{{ app.session.get('ui_str')["general.seeless"] }}</a>)
  42.     {% else %}
  43.         (<a href="{{ path('landing_page') }}?mfc=1">{{ app.session.get('ui_str')["general.seemore"] }}</a>)
  44.     {% endif %}
  45.     </small>
  46.     {% set feature_num = 0 %}
  47.     <div class="card-deck" style="margin-top:20px;">
  48.     {% for feature_record in feature_data %}
  49.         {% set feature_num = feature_num+1 %}
  50.         {% if feature_record.story_url != '' %}
  51.             {% set sLink = path('bible_translated_story_for_commentary', {'storyUrl': feature_record.story_url, 'bibleTranslationUrl': bible_translation_url, 'commentaryUrl': feature_record.url}) %}        
  52.         {% else %}
  53.             {% set sLink = path('exposition_translation', {'translationUrl': feature_record.url}) %}
  54.         {% endif %}
  55.        
  56.   <div class="card">
  57.     <a href="{{ sLink }}"><img class="card-img-top" src="{{ asset('/bundles/ncbsw/media/'~feature_record.image_file) }}" alt="{{ feature_record.image_title }}"></a>
  58.     <div class="card-body">
  59.         <a href="{{ sLink }}" class="card-body-link">
  60.       <h4 class="card-title">{{ feature_record.title }}</h4>
  61.       <p class="card-text text-content">{{ feature_record.description }}</p>
  62.             </a>
  63.     </div>
  64.   </div>
  65.       {% if feature_num == 3 %}
  66.           </div>
  67.         <div class="card-deck" style="margin-top:20px;">
  68.           {% set feature_num = 0 %}
  69.       {% endif %}        
  70.     {% endfor %}
  71.     </div>
  72.     <div style="clear:both;"></div>             
  73. <span class="see-more"><h4>
  74. {% if see_more %}
  75.         <a href="{{ path('landing_page') }}">{{ app.session.get('ui_str')["general.seeless"] }}...</a>
  76.     {% else %}
  77.         <a href="{{ path('landing_page') }}?mfc=1">{{ app.session.get('ui_str')["general.seemore"] }}...</a>
  78.     {% endif %}
  79. </h4></span>
  80. {% endif %}
  81. <script>    
  82.     var isCtrl = false;
  83.     var isShift = false;
  84.     var isAlt = false;
  85.     document.onkeyup=function(e){
  86.         if(e.keyCode == 17) isCtrl=false;
  87.         else if(e.keyCode == 16) isShift=false;
  88.         else if(e.keyCode == 18) isAlt=false;
  89.     }
  90.     document.onkeydown=function(e){
  91.         if(e.keyCode == 17) isCtrl=true;
  92.         else if(e.keyCode == 16) isShift=true;
  93.         else if(e.keyCode == 18) isAlt=true;
  94.         if(isChatbotFocused())
  95.         {           
  96.             if(e.keyCode == 13) {
  97.                 if(!isShift && !isCtrl && !isAlt) {
  98.                     e.preventDefault();
  99.                     AskBot();                
  100.                 }
  101.                 else
  102.                 {
  103.                     if(isCtrl || isAlt)
  104.                     {
  105.                         var textarea = document.querySelector('#sQuestion');
  106.                         textarea.value = textarea.value + "\r\n";
  107.                         autoHeight("sQuestion");
  108.                     }
  109.                 }
  110.             }
  111.         }
  112.     }
  113.     function AskBot()
  114.     {
  115.         var sQuestion = $("#sQuestion").val();
  116.         if(sQuestion.trim().length === 0)
  117.         {
  118.             alert("{{ app.session.get('ui_str')["chatbot.enter.question"] }}");
  119.         }
  120.         else
  121.         {            
  122.             localStorage.NCBSW_ChatbotQue = sQuestion;
  123.             var sUrl = "{{ path('chatbot') }}";    
  124.             window.location = sUrl;
  125.         }
  126.     }
  127.     function autoHeight(vOdj)
  128.     {
  129.         var oQue = document.getElementById(vOdj);
  130.         if(oQue)
  131.         {
  132.             oQue.style.height = 'auto';
  133.             oQue.style.height = (oQue.scrollHeight) + 'px';
  134.         }        
  135.     }
  136.     $('#sQuestion').on('input', function () {
  137.             autoHeight("sQuestion");            
  138.         });
  139.                 
  140.     function isChatbotFocused() {
  141.         const textarea = document.getElementById('sQuestion');
  142.           return document.activeElement === textarea;
  143.     }
  144. </script>    
  145. <script src="{{ asset('/bundles/ncbsw/js/lazyload.js') }}" type="text/javascript"></script>
  146. {% endblock %}