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

Open in your IDE?
  1. {% if division is not defined %}
  2.   {% set division=null %}
  3. {% endif %}
  4. {% if division is null and passage is defined and passage is not empty %}
  5.   {% set division=passage.division %}
  6. {% endif %}
  7. {% if translation is not defined %}
  8.   {% set translation=null %}
  9. {% endif %}
  10. {% if translation is null and excerpt is defined and excerpt is not null %}
  11.   {% set translation=excerpt.startArea.translation %}
  12. {% endif %}
  13. {% if work is not defined %}
  14.   {% set work=null %}
  15. {% endif %}
  16. {% if work is null %}
  17.   {% if translation is not null %}
  18.     {% set work=translation.work %}
  19.   {% elseif division is not null %}
  20.     {% set work=division.work %}
  21.   {% endif %}
  22. {% endif %}
  23. {% set sCategoryIndex = '' %}
  24. {% set nCategoryID = '' %}
  25. {% if category is not defined or category is null %}
  26.   {% if work is not null and work.swedenborgType is not null %}
  27.     {% set category='swedenborg' %}
  28.   {% elseif all_stories is defined %}
  29.     {% set category='story' %}
  30.   {% else %}
  31.     {% set category=null %}
  32.   {% endif %}
  33. {% endif %}
  34. {% if category is null and collection is defined and collection is not null %}
  35.   {% for coll_category in collection.categories if coll_category.indexPage is not null %}
  36.     {% set category=coll_category %}
  37.   {% endfor %}
  38. {% endif %}
  39. {% if category is null and translation is not null %}
  40.   {% for tr_category in translation.categories if tr_category.indexPage is not null %}
  41.     {% set category=tr_category %}  
  42.     {% set sCategoryIndex = category.indexPage %}
  43.   {% endfor %}
  44. {% endif %}
  45. {% if category is null and work is not null %}
  46.   {% for work_category in work.categories if work_category.indexPage is not null %}
  47.     {% set category=work_category %}
  48.     {% set sCategoryIndex = work_category.indexPage %}   
  49.   {% endfor %}
  50. {% endif %}
  51. {% set nColNum = 0 %}
  52. {% if column_num is defined %}
  53.     {% set nColNum = column_num %}
  54. {% endif %}
  55. {% if category is not null and category != 'swedenborg' and category != 'story' %}
  56.     {% set nCategoryID = category.id %}
  57. {% endif %}
  58. {% set bConcept = (nCategoryID == 12) %}
  59. {% set bBookSummary = false %}
  60. {% if is_book_summary is defined %}
  61.     {% set bBookSummary = true %}
  62. {% endif %}
  63. {% set bChapterExplanation = false %}
  64. {% if is_chapter_explanation is defined %}
  65.     {% set bChapterExplanation = true %}
  66. {% endif %}
  67. {% set bVerseExplanation = false %}
  68. {% if is_verse_explanation is defined %}
  69.     {% set bVerseExplanation = true %}
  70. {% endif %}
  71. {% set sLink = '' %}
  72. {% set first_crumb = true %}
  73. <ol class="breadcrumb" id="breadcrumb{{ nColNum }}">
  74.     
  75.   {% if type_id is defined and type_id != 1 %}
  76.     <li class="breadcrumb-item">
  77.       {% if first_crumb %}
  78.         {% set first_crumb = false %}      
  79.       {% endif %}
  80.                    
  81.       {% if type_id == 2 %} 
  82.           {% set sLink = asset('/bundles/ncbsw/translation/' ~ file) %}
  83.       {% elseif type_id == 3 %} 
  84.           {% set sLink = doc_link %}
  85.       {% endif %}
  86.             
  87.       <a href="{{ sLink }}">{% if translation is not null and translation.translatedTitle is not empty %}{{ translation.translatedTitle }}{% else %}{{ work.title }}{% endif %}</a>
  88.       
  89.     </li>    
  90.   {% elseif category == 'swedenborg' %}
  91.       {% if not bInFrame %}
  92.         <li class="breadcrumb-item">
  93.           {% if first_crumb %}
  94.             {% set first_crumb = false %}          
  95.           {% endif %}
  96.           <a href="{{ path('swedenborg') }}" title="{{ app.session.get('ui_str')["linktitle.short.swedenborg.main"] }}"><i class="fad fa-feather-pointed"></i></a>
  97.         </li>
  98.     {% endif %}    
  99.   {% elseif category == 'story' and all_stories is defined %}
  100.     {% if all_stories is defined %}
  101.       <li class="breadcrumb-item">
  102.         {% if first_crumb %}
  103.           {% set first_crumb = false %}        
  104.         {% endif %}
  105.         <a href="{{ path('bible_stories') }}" title="{{ app.session.get('ui_str')["linktitle.short.bible.storyexplanations"] }}"><i class="fad fa-book-open-reader"></i></a>
  106.       </li>
  107.     {% endif %}
  108.   {% elseif category is not null and category != 'story' and category != 'swedenborg' %}
  109.     <li class="breadcrumb-item">
  110.       {% if first_crumb %}
  111.         {% set first_crumb = false %}   
  112.       {% endif %}
  113.       {% if category.indexPage is not null and (index_path is not defined or index_path is null) %}       
  114.         <a href="{{ path(category.indexPage) }}">{% if category.indexPage == 'consider' %}<i class='fad fa-sun'></i>&nbsp;{% elseif category.indexPage == 'concepts' or category.indexPage == 'concordance' %}<i class='fas fa-key'></i>&nbsp;{% elseif category.indexPage == 'q_and_a' %}<i class='fad fa-comments'></i>&nbsp;{% endif %}{{ app.session.get('ui_str')["linktitle.short."~index_page_title_paths[category.indexPage]] }}
  115.         {% if concordance_has_searched_list is defined %}
  116.             <i class="fa-kit fa-solid-filter-magnifying-glass"></i>
  117.           {% endif %}
  118.         </a>
  119.       {% else %}
  120.         <a href="{{ uri(category) }}">{{ category.name }}</a>         
  121.       {% endif %}
  122.     </li>
  123.   {% elseif bBookSummary %}
  124.     <li class="breadcrumb-item">
  125.       {% if first_crumb %}
  126.         {% set first_crumb = false %}      
  127.       {% endif %}
  128.       <button type="button" class="btn btn-text" >{{ app.session.get('ui_str')["linktitle.short.bible.booksummaries"] }}</button>
  129.     </li>   
  130.   {% elseif bChapterExplanation %}
  131.     <li class="breadcrumb-item">
  132.       {% if first_crumb %}
  133.         {% set first_crumb = false %}     
  134.       {% endif %}
  135.       {%  include 'NCBSWBundle:Exposition:interface/popup/chapter_summary_popup.html.twig' %}
  136.     </li> 
  137.    {% elseif bVerseExplanation %}
  138.     <li class="breadcrumb-item">    
  139.       {% if first_crumb %}
  140.         {% set first_crumb = false %}      
  141.       {% endif %}
  142.       <button type="button" class="btn btn-text" >{{ app.session.get('ui_str')["linktitle.short.bible.verseexplanations"] }}</button>
  143.     </li>      
  144.   {% elseif index_path is defined %}
  145.     <li class="breadcrumb-item">
  146.       {% if first_crumb %}
  147.         {% set first_crumb = false %}
  148.       {% endif %}
  149.       <a href="{{ path(index_path) }}">{{ app.session.get('ui_str')["linktitle.short."~index_page_title_paths[index_path]] }}</a>
  150.     </li>   
  151.   {% endif %} 
  152.   {% if chapter_explanations_for_combo is defined and chapter_explanations_for_combo is not empty %}
  153.           <li class="breadcrumb-item">
  154.           {% if first_crumb %}
  155.             {% set first_crumb = false %}                        
  156.           {% endif %}
  157.         {% include 'NCBSWBundle:Exposition:interface/popup/chapter_summary_work_popup.html.twig' %}
  158.         </li>
  159.   {% endif %}      
  160.   {% if sLink == '' %}
  161.       {% if collection is defined and collection is not null %}      
  162.         <li class="breadcrumb-item">
  163.           {% if first_crumb %}
  164.             {% set first_crumb = false %}
  165.           {% endif %}
  166.           <a href="{{ uri(collection) }}">{{ collection.name }}</a>
  167.         </li>
  168.       {% endif %}
  169.       {% if work is not null and not bConcept and not bVerseExplanation and not bChapterExplanation and not bBookSummary and category != 'story' and nCategoryID != 47 and nCategoryID != 52 %}      
  170.         <li class="breadcrumb-item">
  171.           {% if first_crumb %}
  172.             {% set first_crumb = false %}                        
  173.           {% endif %}
  174.           {% if category == 'swedenborg' %}            
  175.             {% include 'NCBSWBundle:Exposition:interface/popup/work_popup.html.twig' %}    
  176.           {% elseif category == 'story' and all_stories is defined %}              
  177.             {% if all_stories is defined %}              
  178.               {% include 'NCBSWBundle:Exposition:interface/popup/story_popup.html.twig' %}             
  179.             {% elseif story is defined %}
  180.               <a href="{{ uri(story) }}">{% if story.name is not empty %}{{ story.name }}{% else %}{{ work.title }}{% endif %}</a>
  181.             {% else %}
  182.               <a href="{{ uri(work) }}">{% if translation is not null and translation.translatedTitle is not empty %}{{ translation.translatedTitle }}{% else %}{{ work.title }}{% endif %}</a>
  183.             {% endif %} 
  184.           {% elseif category is not null and category != 'story' %}
  185.               {% if nCategoryID == 13 %}                 
  186.                 {% include 'NCBSWBundle:Exposition:interface/popup/topic_popup.html.twig' %} 
  187.             {% elseif nCategoryID == 14 %}                
  188.                 {% include 'NCBSWBundle:Exposition:interface/popup/biblestudy_popup.html.twig' %}             
  189.             {% else %}
  190.                   <button type="button" class="btn btn-text" style="font-weight:400;">{{ translation.translatedtitle }}
  191. </button>
  192.             {% endif %}
  193.           {% else %}
  194.             <a href="{{ uri(work) }}">{% if translation is not null and translation.translatedTitle is not empty %}{{ translation.translatedTitle }}{% else %}{{ work.title }}{% endif %}</a>         
  195.           {% endif %}
  196.         </li>
  197.       {% endif %}
  198.       {% if translation is not null and compare_to is defined and compare_to is not null %}     
  199.         <li class="breadcrumb-item">
  200.           {% if first_crumb %}
  201.             {% set first_crumb = false %}          
  202.           {% endif %}
  203.     
  204.           <button type="button" class="btn btn-text" >{{ app.session.get('ui_str')["exposition.breadcrumbs.translationslabel"] }}</button>          
  205.           {% include 'NCBSWBundle:Exposition:interface/popup/work_translation_popup.html.twig' with {'dropdown_target': 'left'} %}
  206.           ~          
  207.           {% include 'NCBSWBundle:Exposition:interface/popup/work_translation_popup.html.twig' with {'dropdown_target': 'right'} %}
  208.           
  209.           {% if compare_to2 is defined and compare_to2 is not null %}
  210.               ~          
  211.           {% include 'NCBSWBundle:Exposition:interface/popup/work_translation_popup.html.twig' with {'dropdown_target': '3col'} %}
  212.           {% endif %}
  213.           
  214.         </li>
  215.       {% elseif translation is not null and (work.translations|length > 1 or not translation.isOriginal) %}     
  216.         {% set force_translation = translation %}
  217.         <li class="breadcrumb-item">
  218.           {% if first_crumb %}
  219.             {% set first_crumb = false %}
  220.           {% endif %}
  221.           
  222.           {% if sCategoryIndex != 'consider' and category != 'story' and not bChapterExplanation %}    
  223.               <button type="button" class="btn btn-text" >{{ app.session.get('ui_str')["exposition.breadcrumbs.translationlabel"] }}</button>
  224.           {% endif %}          
  225.           {% include 'NCBSWBundle:Exposition:interface/popup/work_translation_popup.html.twig'  with {'dropdown_target': (passage is defined) ? null : 'index', 'is_concept': bConcept } %}
  226.         </li>
  227.       {% endif %}
  228.       {% if division is not null and division.name is not null and ((division.work is not null and division.work.divisions|length > 1) or (division.superdivision is not null and division.superdivision.subdivisions|length > 1)) %}     
  229.         <li class="breadcrumb-item">
  230.           {% if first_crumb %}
  231.             {% set first_crumb = false %}          
  232.           {% endif %}
  233.           <a href="{{ uri(division) }}{% if compare_to is defined and compare_to is not null %}?compareTo={{ compare_to.url }}{% endif %}">{{ division.name }}</a>
  234.         </li>
  235.       {% endif %}    
  236.   {% endif %}  
  237. </ol>