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

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