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

Open in your IDE?
  1. {% if translation_text is not defined %}
  2.   {% if translation is not defined %}
  3.     {% set translation = text_unit.findWork().selectTranslation() %}
  4.   {% endif %}
  5.   {% set translation_text = text_unit.findTranslatedVersion(translation) %}
  6. {% elseif translation_text is not null %}
  7.   {% if text_unit is not defined %}
  8.     {% set text_unit = translation_text.placement %}
  9.   {% endif %}
  10.   {% if translation is not defined %}
  11.     {% set translation = translation_text.translation %}
  12.   {% endif %}
  13. {% endif %}
  14. {% set bOnMobile = app.session.get('is_on_mobile') %}
  15. {% set bHas2Columns = (columns is defined and columns|length >= 2) %} 
  16. {% set nColNum = 0 %}
  17. {% set nTargetColNum = 2 %}
  18. {% if column_num is defined %}
  19.     {% set nColNum = column_num %}
  20.     {% if bHas2Columns %}        
  21.         {% set nTargetColNum = 3 %}        
  22.     {% endif %}    
  23. {% endif %}
  24. {% if text_unit.illustrations is not empty %}
  25.       {% set nLanguageID = translation.language.id %}
  26.     {% set aMedia = text_unit.illustrations %}
  27.     {% if aMedia is not empty %}
  28.           {% set audio_file = null %}
  29.           {% for media in aMedia if media.mediatype_id == 2 and audio_file == null %}      
  30.           {% if media.language_id == nLanguageID %}
  31.             {% set audio_file = media %}
  32.           {% endif %}
  33.         {% endfor %}
  34.         
  35.         {% if audio_file == null %}
  36.               {% for media in aMedia if media.mediatype_id == 2 and audio_file == null %}      
  37.               {% if media.language_id == null %}
  38.                 {% set audio_file = media %}
  39.               {% endif %}
  40.             {% endfor %}
  41.         {% endif %}
  42.         
  43.         {% if audio_file == null %}
  44.               {% for media in aMedia if media.mediatype_id == 2 and audio_file == null %}      
  45.               {% if media.language_id == 123 %}
  46.                 {% set audio_file = media %}
  47.               {% endif %}
  48.             {% endfor %}
  49.         {% endif %}
  50.         
  51.         {% if audio_file != null %}          
  52.                   <p>          
  53.             {% include "NCBSWBundle:Media:image_tag.html.twig" with {'image_entity': audio_file, 'border': 1} %}        
  54.                   <br /><br />          
  55.         {% endif %}
  56.         
  57.         {% if category_concept is not defined %}
  58.             {% set image_file = null %}
  59.               {% for media in aMedia if media.mediatype_id == 1 and image_file == null %}              
  60.               {% if media.language_id == nLanguageID %}         
  61.                 {% set image_file = media %}
  62.               {% endif %}
  63.             {% endfor %}
  64.             
  65.             {% if image_file == null %}
  66.                   {% for media in aMedia if media.mediatype_id == 1 and image_file == null %}      
  67.                   {% if media.language_id == null %}
  68.                     {% set image_file = media %}
  69.                   {% endif %}
  70.                 {% endfor %}
  71.             {% endif %}
  72.             
  73.             {% if image_file == null %}
  74.                   {% for media in aMedia if media.mediatype_id == 1 and image_file == null %}      
  75.                   {% if media.language_id == 123 %}
  76.                     {% set image_file = media %}
  77.                   {% endif %}
  78.                 {% endfor %}
  79.             {% endif %}
  80.             
  81.             {% if image_file != null %}     
  82.                 {% include "NCBSWBundle:Media:image_tag.html.twig" with {'image_entity': image_file, 'border': 1} %}        
  83.                       <p>          
  84.             {% endif %}  
  85.         {% endif %}  
  86.     {% endif %}
  87. {% endif %}
  88. {% if translation_text is null %}
  89.   <p><i>{{ app.session.get('ui_str')["exposition.passage.missingsubsection"] }}</i></p>
  90. {% else %}
  91.   <p{% if text_unit.subsection is not empty %} class="anchor" id="subsection-{{ nColNum }}-{{ text_unit.subsection }}"{% endif %}>
  92.   
  93.   {% if ref_column_spec is not defined %}  
  94.       {% set ref_column_spec = column_replace_uri(text_unit.getPassage()) %}
  95.   {% endif %}
  96.   {% set bShowTranslatorNote = text_unit.getPassage().getSwedenborgSection() == '0' %}
  97.     {% set aColumn1 = ref_column_spec|split('_') %}    
  98.     {% set bHasNote = false %}
  99.     {% set bSetItalic = false %}
  100.     {% for item in translation_text.displayItems %}{# 
  101.   #}{% if not bHasNote and item.type_id in [4,5,6] %}
  102.             <p>
  103.             <strong>
  104.                  {% if bShowTranslatorNote %}
  105.                     {{ app.session.get('ui_str')["translators.notes"] }}:
  106.                  {% else %}
  107.                      {{ app.session.get('ui_str')["exposition.footnote.heading"] }}:
  108.                  {% endif %}
  109.             </strong>
  110.             <br>
  111.             <div class="footnote-section">            
  112.             <p>
  113.             {% set bHasNote = true %}{# 
  114.   #}{% endif %}{# 
  115.       #}{% include "NCBSWBundle:Exposition:display_behaviors/behaviors.html.twig" with {'type_id' : item.type_id} %}{% else %}{# 
  116.           #}{% include 'NCBSWBundle:Exposition:show_text.html.twig' with {'vText': translation_text.text} %}{# 
  117.   #}{% endfor %}
  118.   </p>  
  119.   {% if bHasNote %}
  120.             </div><p>
  121.   {% endif %}
  122.     
  123.   {% if passage_ref is defined and passage_ref is not empty %}
  124.       {% set textunit_id = text_unit.id %}
  125.       {% set bHasRef = false %}
  126.       {% set aRef = passage_ref %}
  127.       {% for reference in aRef if not bHasRef %}
  128.           {% if reference["textunit_id"] == textunit_id %}
  129.               {% set bHasRef = true %}
  130.           {% endif %}
  131.       {% endfor %}
  132.       
  133.       {% set story_translation_str = '' %}
  134.       {% if story_translation_url is defined and story_translation_url != null %}
  135.           {% set story_translation_str = '_'~story_translation_url %}
  136.       {% endif %}
  137.       
  138.       {% if bHasRef %}
  139.         <p><i>({{ app.session.get('ui_str')["exposition.passage.refs"] }} 
  140.         {% set sCurrBookID = '' %}{# 
  141.           #}{% set bHasRef = false %}{# 
  142.           #}{% for reference in aRef %}{# 
  143.             #}{% if reference["textunit_id"] == textunit_id %}{#
  144.               #}{% if bOnMobile %}{% set link_target = reference['singlelink'] %}{% else %}{% set multi_column_spec = reference["multilink_text"] %}{# 
  145.               #}{% if story is defined and story.getLevelId() == 1 %}{# 
  146.                   #}{% set exp_column_spec = ref_column_spec %}{# 
  147.                   #}{% set link_target = path('arbitrary_three_column', {'column1Details': 'biblestory_'~story.url~story_translation_str, 'column2Details': exp_column_spec, 'column3Details': multi_column_spec}) %}{# 
  148.               #}{% elseif bHas2Columns and multi_column_spec != '' %}{# 
  149.                   #}{% set link_target = path('arbitrary_three_column', multicolumn_route_params|merge({('column3Details'): multi_column_spec}) ) %}{# 
  150.               #}{% elseif compare_to is defined and compare_to is not null and multi_column_spec != '' and (aColumn1|length == 3)%}{# 
  151.                   #}{% set sTransUrl = compare_to.getUrl() %}{# 
  152.                   #}{% set ref_column_spec2 = aColumn1[0] ~ '_' ~ sTransUrl ~ '_' ~ aColumn1[2] %}{# 
  153.                   #}{% set link_target = path('arbitrary_three_column', {'column1Details': ref_column_spec, 'column2Details': ref_column_spec2,  'column3Details': multi_column_spec}) %}{# 
  154.               #}{% elseif ref_column_spec != '' and multi_column_spec != '' %}{# 
  155.                   #}{% if bible_col_spec is defined and bible_col_spec != '' %}{% set link_target = path('arbitrary_three_column', {'column1Details': bible_col_spec, 'column2Details': ref_column_spec, 'column3Details': multi_column_spec}) %}{% else %}{% set link_target = path('arbitrary_two_column', {'column1Details': ref_column_spec, 'column2Details': multi_column_spec}) %}{% endif %}{# 
  156.               #}{% else %}{# 
  157.                   #}{#% set link_target = uri(reference) %#}{# 
  158.               #}{% endif %}{% endif %}{#               
  159.               #}{% set sLink = reference["link_text"] %}{#               
  160.               #}{% set sDivider = ';' %}{# 
  161.               #}{% if sCurrBookID != '' and sCurrBookID == reference["book_id"] %}{#                   
  162.                   #}{% set sDivider = ',' %}{# 
  163.               #}{% else %}{# 
  164.                   #}{% set sCurrBookID = reference["book_id"] %}{# 
  165.               #}{% endif %}{# 
  166.               #}{% if not reference["is_bibleref"] and reference["ordering2"] > 1 %}{# 
  167.                   #}{% set link_target = link_target ~ '#subsection-' ~ nTargetColNum ~ '-' ~ reference["ordering2"] %}{# 
  168.               #}{% endif %}{# 
  169.               #}{% if bHasRef %}{{ sDivider }}{% endif %} <a href="{{ link_target }}" target=_top >{{ sLink }}</a>{% set bHasRef = true %}{% endif %}{% endfor %})</i></p>{% if not loop.last %}<br />{% endif %}
  170.     {% endif %}
  171.   {% endif %}  
  172. {% endif %}