{% if translation is not defined %}
{% set translation = passage.findWork().selectTranslation() %}
{% endif %}
{% if passage.emptyInTranslation(translation) %}
{% if translation.getId() == 1283 %}
<p><i>{{ app.session.get('ui_str')["exposition.passage.missingarcanos"] }}</i></p>
<p><i>{{ app.session.get('ui_str')["exposition.passage.missingarcanosportuguese"] }}</i></p>
{% else %}
{% set sMsg = app.session.get('ui_str')["exposition.passage.missing"] %}
{% if last_passage_num is defined %}
{% set sMsg = sMsg|replace({'_6001_': last_passage_num}) %}
{% endif %}
<p><i>{{ sMsg|raw }}</i></p>
{% endif %}
{% else %}
{% set nColNum = 0 %}
{% if column_num is defined %}
{% set nColNum = column_num %}
{% endif %}
{% set bOnMobile = app.session.get('is_on_mobile') %}
{% set sDivProp = "" %}
{% if bOnMobile and is_ipad is defined and is_ipad %}
{% set sDivProp = " contenteditable=true style=\"outline: 0px solid transparent;\" " %}
<script>
$("#tts{{ nColNum }}").keydown(function(){
this.blur();
});
</script>
{% endif %}
<div id="tts{{ nColNum }}" {{ sDivProp|raw }} >
{% for text_unit in passage.textUnits %}
{% set translation_text = text_unit.findTranslatedVersion(translation) %}
{% if translation_text is not null %}
{% include "NCBSWBundle:Exposition:display_framework/textunit.html.twig" %}
{% endif %}
{% endfor %}
</div>
{% if cchapter_id is defined and cchapter_id > 0 %}
<script>
showElemByID('ExplainChapter');
</script>
{% endif %}
{% set bHasSearchText = false %}
{% if work_searchterm is defined and work_searchterm is not empty %}
{% set bHasSearchText = true %}
<span class="hidden" data-highlight-this="true">{{ work_searchterm|trim|raw }}</span>
{% endif %}
{% if work_search_phrase is defined and work_search_phrase is not empty %}
{% set bHasSearchText = true %}
{% set aPhrase = work_search_phrase %}
{% for search_word in aPhrase %}
{% if search_word|trim != "" %}
<span class="hidden" data-highlight-this="true">{{ search_word|replace({'*': ''})|trim|raw }}</span>
{% endif %}
{% endfor %}
{% endif %}
{% if bHasSearchText %}
<script>
$( document ).ready(function() {
$("[data-highlight-this='true']").each(function(){
$("#tts{{ nColNum }}").highlight($(this).text());
});
});
</script>
{% endif %}
{% if work_search_internal_amb is defined and work_search_internal_amb is not empty %}
{% for search_word in work_search_internal_amb %}
{% if search_word|trim != "" %}
<span class="hidden" data-highlight-int-amb="true">{{ search_word|replace({'*': ''})|trim|raw }}</span>
{% endif %}
{% endfor %}
<script>
$( document ).ready(function() {
$("[data-highlight-int-amb='true']").each(function(){
$("#tts{{ nColNum }}").highlight($(this).text(), { element: 'span', className: 'highlight internal-amb' });
});
});
</script>
{% endif %}
{% if work_search_external_amb is defined and work_search_external_amb is not empty %}
{% for search_word in work_search_external_amb %}
{% if search_word|trim != "" %}
<span class="hidden" data-highlight-ext-amb="true">{{ search_word|replace({'*': ''})|trim|raw }}</span>
{% endif %}
{% endfor %}
<script>
$( document ).ready(function() {
$("[data-highlight-int-amb='true']").each(function(){
$("#tts{{ nColNum }}").highlight($(this).text(), { element: 'span', className: 'highlight internal-amb' });
});
});
</script>
{% endif %}
{% if work_search_int_ext_amb is defined and work_search_int_ext_amb is not empty %}
{% for search_word in work_search_int_ext_amb %}
{% if search_word|trim != "" %}
<span class="hidden" data-highlight-int-ext-amb="true">{{ search_word|replace({'*': ''})|trim|raw }}</span>
{% endif %}
{% endfor %}
<script>
$( document ).ready(function() {
$("[data-highlight-int-ext-amb='true']").each(function(){
$("#tts{{ nColNum }}").highlight($(this).text(), { element: 'span', className: 'highlight int-ext-amb' });
});
});
</script>
{% endif %}
<script>
sMsgNoSectionNum = "{{ app.session.get('ui_str')["exposition.passage.outofrange"]|replace({'_1000_': translation.translatedTitle})|raw }}";
</script>
{% endif %}