src/NCBS/WebsiteBundle/Resources/views/Exposition/multicolumn/exposition_text_column.html.twig line 1

Open in your IDE?
  1. {% if translation is not defined %}
  2.   {% if work is not defined %}
  3.     {% set work = passage.findWork() %}
  4.   {% endif %}
  5.   {% set translation = work.selectTranslation() %}
  6. {% elseif work is not defined %}
  7.   {% set work = translation.work %}
  8. {% endif %}
  9. {% if work.stories is not empty %}
  10.   {% set story = work.stories|first %}
  11. {% endif %}
  12. {% set work_id = '' %}
  13. {% if work is defined %}
  14.    {% set work_id = work.id %}
  15. {% endif %}
  16. {% set nColNum = 0 %}
  17. {% if column_num is defined %}
  18.     {% set nColNum = column_num %}
  19. {% endif %}
  20. {% set bHasPrevNextWordExp = false %}
  21. {% include 'NCBSWBundle:Exposition:search/search_in_work.html.twig' %}
  22. {% if (IsSwedenborgWork is not defined or IsSwedenborgWork == 0) and all_stories is defined and all_stories is not empty %}
  23.     <form style="display:inline;" class="noprint">
  24.         <div class="input-group col" style="padding: 0 0 10px 0; display:inline-flex; max-width:450px;">          
  25.                   <input class="form-control py-2" id="searchTerm" name="searchTerm" placeholder="{{ app.session.get('ui_str')["search.searchstoryexplanations"] }}" value=""  onKeyPress="return onEnterSearch(this.form)" />
  26.               <span class="input-group-append">
  27.               <button class="btn btn-primary" id="btnSearch" type="button" title="Search Explanations" onclick="onSearchStory()"><i class="fa fa-magnifying-glass">&nbsp;</i></button>
  28.               </span>
  29.             </div>    
  30.         </form>
  31.         <script>    
  32.             function onSearchStory()
  33.             {
  34.                 var sSearchTerm = $("#searchTerm").val();    
  35.                 if(sSearchTerm == '')
  36.                     alert("Please enter search text.");
  37.                 else
  38.                 {                    
  39.                     var sUrl = "{{ path('bible_stories') }}?st=" + encodeURIComponent(sSearchTerm);
  40.                     top.location=sUrl;
  41.                 }    
  42.             }
  43.         </script>
  44. {% endif %}
  45. <div style="clear:both"></div>
  46. <span style="display:inline-block;">
  47. <h1>
  48.     {% set passage_title = '' %}
  49.     {% if passage is not null and passage.swedenborgSection is not null %}        
  50.         {% set passage_title = app.session.get('ui_str')["exposition.passage.sectiontitle"]|replace({'_8100_': translation.translatedTitle, '_2000_': passage.swedenborgSection})|raw %}
  51.         {{ passage_title }}
  52.       {% else %}
  53.         {{ translation.translatedTitle }}
  54. {% endif %}
  55. </h1>
  56. </span>
  57. {% include 'NCBSWBundle:Exposition:sidrbuttonw.html.twig' %}
  58. <div style="clear:both"></div>
  59.       
  60. {% if IsSwedenborgWork is defined and IsSwedenborgWork == 1 %}
  61.     <span class="iconmenuspan">        
  62.         {% include 'NCBSWBundle:Default:toolbarstart.html.twig' %}{% include 'NCBSWBundle:Exposition:toc_link.html.twig' %}{% include 'NCBSWBundle:Exposition:interface/popup/work_add_popup.html.twig' %}
  63.     {% if translation.getUrl() is not null %}      
  64.         <li class="nav-item"><a href="{{ path('exposition_translation_index', {'translationUrl': translation.getUrl()}) }}" title="{{ app.session.get('ui_str')["generic.bibliographyicon"] }}" class="nav-link"><i class="fas fa-info-circle"></i><span class="mobile-only"> {{ app.session.get('ui_str')["generic.bibliographyicon"] }}</span></a></li>           
  65.     {% endif %}  
  66.     {% include 'NCBSWBundle:General:text_to_speech.html.twig' %}
  67.     {% include 'NCBSWBundle:Exposition:related_bible_ref.html.twig' %}
  68.     {% include 'NCBSWBundle:Exposition:show_scan_image.html.twig' %}
  69.     {% include 'NCBSWBundle:Default:askquestioninc.html.twig' %}
  70.     {% include 'NCBSWBundle:Exposition:edit_translation.html.twig' %}
  71.     {% include 'NCBSWBundle:Default:toolbarend.html.twig' %}
  72.     </span>
  73. {% else %}    
  74.          
  75.         <span class="iconmenuspan">
  76.             {% include 'NCBSWBundle:Default:toolbarstart.html.twig' %} 
  77.             <li class="nav-item"><a href="{{ path('exposition_translation_index', {'translationUrl': translation.getUrl()}) }}" title="{{ app.session.get('ui_str')["generic.bibliographyicon"] }}" class="nav-link"><i class="fas fa-info-circle"></i><span class="mobile-only"> {{ app.session.get('ui_str')["generic.bibliographyicon"] }}</span></a></li>
  78.         {% include 'NCBSWBundle:General:text_to_speech.html.twig' %}
  79.         {% include 'NCBSWBundle:Exposition:related_bible_ref.html.twig' %}
  80.         {% include 'NCBSWBundle:Exposition:show_scan_image.html.twig' %}
  81.         {% include 'NCBSWBundle:Default:askquestioninc.html.twig' %}
  82.         {% include 'NCBSWBundle:Exposition:edit_translation.html.twig' %}
  83.         {% include 'NCBSWBundle:Default:toolbarend.html.twig' %}
  84.       </span>  
  85.       
  86.       {% if authors is defined and authors != '' and concept_prev_next is not defined %}
  87.             <small><p>{{ app.session.get('ui_str')["generic.writtenby"] }} {{ authors }}</p></small>    
  88.                                
  89.         {% endif %}
  90.       
  91. {% endif %}
  92. {% set nColNum = 0 %}
  93. {% if column_num is defined %}
  94.     {% set nColNum = column_num %}
  95. {% endif %}
  96. {% set total_length = columns|length %}
  97. {% if nColNum > 1 %}
  98. {% set aPrevWordExplanation = null %}
  99. {% set aNextWordExplanation = null %}
  100. {% set queryParams = app.request.query.all %}
  101. {% set sLinkEnd = '' %}
  102. {% if queryParams['wep'] is defined and queryParams['wep'] == 2 %}  
  103.     {% set sLinkEnd = '?wep=2' %}
  104.     {% set aPrevWordExplanation = app.session.get('prev_word_explanation2')    %}
  105.     {% set aNextWordExplanation = app.session.get('next_word_explanation2')    %}
  106. {% else %}    
  107.     {% set aPrevWordExplanation = app.session.get('prev_word_explanation')    %}
  108.     {% set aNextWordExplanation = app.session.get('next_word_explanation')    %}
  109. {% endif %}    
  110.     
  111. {% if aPrevWordExplanation is not empty %}
  112.     {% if aPrevWordExplanation[work_id] is defined %}        
  113.         {% if nColNum == 2 %}
  114.             {% if total_length == 2 %}
  115.                 {% set prev_word_link = path('arbitrary_two_column', multicolumn_route_params|merge({'column2Details': aPrevWordExplanation[work_id]}) ) %}
  116.             {% elseif total_length == 3 %}
  117.                 {% set prev_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column2Details': aPrevWordExplanation[work_id]}) ) %}
  118.             {% endif %}        
  119.         {% elseif nColNum == 3 %}
  120.             {% set prev_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column3Details': aPrevWordExplanation[work_id]}) )~sLinkEnd %}
  121.         {% endif %}        
  122.         <a class="nav_link" href="{{ prev_word_link }}" title="&larr; {{ app.session.get('ui_str')["exposition.passage.prev"] }}"><i class="fa-duotone fa-circle-arrow-left" style="--fa-secondary-opacity: 0.3;"></i></a>&nbsp;&nbsp;
  123.         {% set bHasPrevNextWordExp = true %}    
  124.     {% endif %}
  125. {% endif %}
  126. {% if aNextWordExplanation is not empty %}
  127.     {% if aNextWordExplanation[work_id] is defined %}        
  128.         {% if nColNum == 2 %}
  129.             {% if total_length == 2 %}
  130.                 {% set next_word_link = path('arbitrary_two_column', multicolumn_route_params|merge({'column2Details': aNextWordExplanation[work_id]}) ) %}
  131.             {% elseif total_length == 3 %}
  132.                 {% set next_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column2Details': aNextWordExplanation[work_id]}) ) %}
  133.             {% endif %}
  134.         {% elseif nColNum == 3 %}
  135.             {% set next_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column3Details': aNextWordExplanation[work_id]}) )~sLinkEnd %}
  136.         {% endif %}        
  137.         <a class="nav_link" href="{{ next_word_link }}" title="{{ app.session.get('ui_str')["exposition.passage.next"] }} &rarr;"><i class="fa-duotone fa-circle-arrow-right" style="--fa-secondary-opacity: 0.3;"></i></a>
  138.         {% set bHasPrevNextWordExp = true %}
  139.     {% endif %}
  140. {% endif %}
  141. {% if not bHasPrevNextWordExp %}
  142.     {% if (concept_prev_next is defined and concept_prev_next is not null) %}
  143.         {% set sPrevConceptUrl = concept_prev_next['prev_concept_url'] %}
  144.           {% if sPrevConceptUrl != '' %}
  145.             {% set sPrevConceptUrl = 'explanation_'~sPrevConceptUrl %}
  146.             {% if nColNum == 2 %}
  147.                 {% if total_length == 2 %}
  148.                     {% set prev_word_link = path('arbitrary_two_column', multicolumn_route_params|merge({'column2Details': sPrevConceptUrl}) ) %}
  149.                 {% elseif total_length == 3 %}
  150.                     {% set prev_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column2Details': sPrevConceptUrl}) ) %}
  151.                 {% endif %}        
  152.             {% elseif nColNum == 3 %}
  153.                 {% set prev_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column3Details': sPrevConceptUrl}) )~sLinkEnd %}
  154.             {% endif %}        
  155.             <a class="nav_link" href="{{ prev_word_link }}" title="&larr; {{ app.session.get('ui_str')["exposition.passage.prev"] }}"><i class="fa-duotone fa-circle-arrow-left" style="--fa-secondary-opacity: 0.3;"></i></a>&nbsp;&nbsp;            
  156.         {% endif %}    
  157.         
  158.       {% set sNextConceptUrl = concept_prev_next['next_concept_url'] %}
  159.           {% if sNextConceptUrl != '' %}
  160.             {% set sNextConceptUrl = 'explanation_'~sNextConceptUrl %}
  161.             {% if nColNum == 2 %}
  162.                 {% if total_length == 2 %}
  163.                     {% set next_word_link = path('arbitrary_two_column', multicolumn_route_params|merge({'column2Details': sNextConceptUrl}) ) %}
  164.                 {% elseif total_length == 3 %}
  165.                     {% set next_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column2Details': sNextConceptUrl}) ) %}
  166.                 {% endif %}        
  167.             {% elseif nColNum == 3 %}
  168.                 {% set next_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column3Details': sNextConceptUrl}) )~sLinkEnd %}
  169.             {% else %}            
  170.                 {% if total_length == 2 %}
  171.                     {% set next_word_link = path('arbitrary_two_column', multicolumn_route_params|merge({'column1Details': sNextConceptUrl}) ) %}
  172.                 {% elseif total_length == 3 %}
  173.                     {% set next_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column1Details': sNextConceptUrl}) ) %}
  174.                 {% endif %}    
  175.             {% endif %}        
  176.             <a class="nav_link" href="{{ next_word_link }}" title="{{ app.session.get('ui_str')["exposition.passage.next"] }} &rarr;"><i class="fa-duotone fa-circle-arrow-right" style="--fa-secondary-opacity: 0.3;"></i></a>            
  177.         {% endif %}          
  178.     {% endif %}
  179. {% endif %}
  180.     {% if verse_explanations is defined and verse_explanations is not empty %}
  181.         <span id='prev_next_verse_explanation{{ nColNum }}'></span> 
  182.         <script>
  183.             if(aPrevNextVerseExplanation[{{ nColNum }}] != '')
  184.                 $("#prev_next_verse_explanation{{ nColNum }}").html(aPrevNextVerseExplanation[{{ nColNum }}]);
  185.         </script> 
  186.     {% endif %}
  187. {% else %}    
  188.         {% if (concept_prev_next is defined and concept_prev_next is not null) %}
  189.         {% set sPrevConceptUrl = concept_prev_next['prev_concept_url'] %}
  190.           {% if sPrevConceptUrl != '' %}
  191.             {% set sPrevConceptUrl = 'explanation_'~sPrevConceptUrl %}
  192.             {% if total_length == 2 %}
  193.                 {% set prev_word_link = path('arbitrary_two_column', multicolumn_route_params|merge({'column1Details': sPrevConceptUrl}) ) %}
  194.             {% elseif total_length == 3 %}
  195.                 {% set prev_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column1Details': sPrevConceptUrl}) ) %}
  196.             {% endif %}            
  197.             <a class="nav_link" href="{{ prev_word_link }}" title="&larr; {{ app.session.get('ui_str')["exposition.passage.prev"] }}"><i class="fa-duotone fa-circle-arrow-left" style="--fa-secondary-opacity: 0.3;"></i></a>&nbsp;&nbsp;            
  198.         {% endif %}    
  199.         
  200.       {% set sNextConceptUrl = concept_prev_next['next_concept_url'] %}
  201.           {% if sNextConceptUrl != '' %}
  202.             {% set sNextConceptUrl = 'explanation_'~sNextConceptUrl %}            
  203.             {% if total_length == 2 %}
  204.                 {% set next_word_link = path('arbitrary_two_column', multicolumn_route_params|merge({'column1Details': sNextConceptUrl}) ) %}
  205.             {% elseif total_length == 3 %}
  206.                 {% set next_word_link = path('arbitrary_three_column', multicolumn_route_params|merge({'column1Details': sNextConceptUrl}) ) %}
  207.             {% endif %}                    
  208.             <a class="nav_link" href="{{ next_word_link }}" title="{{ app.session.get('ui_str')["exposition.passage.next"] }} &rarr;"><i class="fa-duotone fa-circle-arrow-right" style="--fa-secondary-opacity: 0.3;"></i></a>            
  209.         {% endif %}           
  210.     {% endif %}    
  211. {% endif %}
  212. {% if not bHasPrevNextWordExp and (IsSwedenborgWork is not defined or IsSwedenborgWork != 1) %}
  213. <span id='prev_next_category{{ nColNum }}'></span>
  214. <script>
  215. if(sPrevNextCategory != '')
  216. {
  217.     $("#prev_next_category{{ nColNum }}").html(sPrevNextCategory);    
  218. }    
  219. </script>
  220. {% endif %}
  221. {% include 'NCBSWBundle:Exposition:passage_links.html.twig' with {'link_position': '1'} %}
  222. <div style="clear:both;">
  223. {% if story is defined and story is not null and story.illustrations is not empty %}
  224.   <p> {% include 'NCBSWBundle:Media:image_tag.html.twig' with {'image_entity': random(story.illustrations).image, 'border': 1} %}
  225.   <br><br>
  226. {% endif %}
  227. {% if story is defined and story is not null %}
  228.   {% set embed_options = story.getMultimedia() %}
  229.   {% for embed_entity in embed_options %}
  230.     {% include 'NCBSWBundle:Media:embed_iframe.html.twig' %}
  231.   {% endfor %}
  232. {% endif %}
  233. {% if image is defined and image is not null %}
  234.   {% include 'NCBSWBundle:Media:image_tag.html.twig' with {'image_entity': image, 'border': 1} %}  
  235. {% endif %}
  236. {% set text_style = '' %}
  237. {% if text_style_override is defined and text_style_override is not null %}
  238.     {% set text_style = 'style="'~text_style_override|replace({'"':"'"})~'"' %}
  239. {% endif %} 
  240. <div class="text-content" {{ text_style|trim|raw }}>
  241.   {% include 'NCBSWBundle:Exposition:passage_text.html.twig' %}
  242. </div>
  243. {% for media_item in passage.media %}
  244.   {% include 'NCBSWBundle:Media:embed_iframe.html.twig' with {'embed_entity': media_item.embed} %}
  245. {% endfor %}
  246. </div>     
  247. {% include 'NCBSWBundle:Exposition:passage_links.html.twig' with {'link_position': '2'} %}
  248. <span id="chapternav2"></span>
  249. <script>
  250.     //setTimeout(checkOtherLang, 1000);
  251.     
  252.     // Clone chapter nav from column 1
  253.     const originalSpan = document.getElementById("chapter_nav1");
  254.     if(originalSpan)
  255.     {
  256.         const clonedSpan = originalSpan.cloneNode(true);    
  257.         document.getElementById("chapternav2").appendChild(clonedSpan);
  258.     }
  259.     
  260.     function checkOtherLang()
  261.     {
  262.         var oIsOtherLang = document.getElementsByName("IsOtherLang");
  263.         var nLen = oIsOtherLang.length;
  264.         
  265.         for(var i=0;i<nLen;i++)
  266.         {
  267.             if(oIsOtherLang[i].value == "1")
  268.             {
  269.                 var oOtherLangLink = document.getElementsByName("OtherLangLink");
  270.                 var nLen2 = oOtherLangLink.length;
  271.                 
  272.                 for(var j=0;j<nLen2;j++)
  273.                 {
  274.                     oOtherLangLink[j].style.display = "";
  275.                 }
  276.                 break;
  277.             }
  278.         }
  279.     }
  280.     
  281. </script>
  282. {% if translation is defined %}
  283. <script>
  284.     sMsgNoSectionNum = "{{ app.session.get('ui_str')["exposition.passage.outofrange"]|replace({'_1000_': translation.translatedTitle})|raw }}";
  285. </script>
  286. {% endif %}