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

Open in your IDE?
  1. {% if IsSwedenborgWork is defined and IsSwedenborgWork == 1 %}
  2.     {% set sDisplayStr = "" %}
  3.     {% if bInFrame %}
  4.         {% set sDisplayStr = "display:none;" %}
  5.     {% else %}
  6.         {% set sDisplayStr = "display:inline;" %}
  7.     {% endif %}
  8. <form style="{{ sDisplayStr }}" class="noprint">                  
  9.         <div class="input-group col" style="padding: 0 0 10px 0; display:inline-flex; max-width:450px;">
  10.             <input class="form-control form-control-sm py-2" type="search" id="searchTerm" name="searchTerm" placeholder="{{ app.session.get('ui_str')["search.searchtranslation"] }}" value="" onKeyPress="return onEnterSearch(this.form)" />
  11.             <span class="input-group-append">
  12.                 <button class="btn btn-sm btn-primary" name="btnSearch" id="btnSearch" type="button" title="Search this translation" onclick="onQuickSearchWork(this.form,{{ work.getId() }},{{ translation.getId() }},{{ translation.language.getId() }},'{{ current_locale_code }}')">
  13.                     <i class="fa fa-magnifying-glass"></i>
  14.                 </button>
  15.             </span>
  16.         </div>
  17. </form>
  18. {% else %}        
  19.     {% set nColNum = 0 %}
  20.     {% if column_num is defined %}
  21.         {% set nColNum = column_num %}
  22.     {% endif %}
  23.     {% if category is not defined %}
  24.       {% if work is not null and work.swedenborgType is not null %}
  25.         {% set category='swedenborg' %}
  26.       {% elseif work is not null and work.stories is not empty %}
  27.         {% set category='story' %}
  28.       {% else %}
  29.         {% set category=null %}
  30.       {% endif %}
  31.     {% endif %}
  32.     {% if category is null and collection is defined and collection is not null %}
  33.       {% for coll_category in collection.categories if coll_category.indexPage is not null %}
  34.         {% set category=coll_category %}
  35.       {% endfor %}
  36.     {% endif %}
  37.     {% if category is null and translation is not null %}
  38.       {% for tr_category in translation.categories if tr_category.indexPage is not null %}
  39.         {% set category=tr_category %}
  40.       {% endfor %}
  41.     {% endif %}
  42.     {% if category is null and work is not null %}
  43.       {% for work_category in work.categories if work_category.indexPage is not null %}
  44.         {% set category=work_category %}
  45.       {% endfor %}
  46.     {% endif %}
  47.     {% set sCategory = '' %}
  48.     {% set sSearchBoxText = '' %}    
  49.     {% if category is defined and category is not null and category != 'swedenborg' %}
  50.         {% if category == 'story' %}
  51.             {% set sCategory = 'story' %}
  52.             {#% if all_stories is defined and all_stories is not empty %}
  53.                 {% set sSearchBoxText = app.session.get('ui_str')["search.searchstoryexplanations"] %}
  54.             {% endif %#}    
  55.         {% else %}
  56.             {% set sCategory = category.id %}
  57.             {% if sCategory == '13' %}                
  58.                 {% set sSearchBoxText = app.session.get('ui_str')["search.searchspiritualtopics"] %}
  59.             {% elseif sCategory == '12' %}
  60.                 {% set sSearchBoxText = app.session.get('ui_str')["search.searchconcepts"] %}
  61.             {% elseif sCategory == '14' %}
  62.                 {% set sSearchBoxText = app.session.get('ui_str')["search.searchbiblestudies"] %}    
  63.             {% elseif sCategory == '47' %}
  64.                 {% set sSearchBoxText = app.session.get('ui_str')["search.searchqa"] %}    
  65.             {% elseif sCategory == '53' %}
  66.                 {% set sSearchBoxText = app.session.get('ui_str')["search.concordance"] %}        
  67.             {% endif %}
  68.         {% endif %}            
  69.     {% endif %}
  70.     
  71.     
  72.     {% if sCategory == 12 %}        
  73.         <form style="display:inline;" class="noprint">
  74.             <div class="input-group col" style="padding: 0 0 10px 0; display:inline-flex; max-width:450px;">          
  75.                   <input class="form-control py-2" id="searchTerm" name="searchTerm" placeholder="{{ sSearchBoxText }}" value=""  onKeyPress="return onEnterSearch(this.form)" />
  76.               <span class="input-group-append">
  77.               <button class="btn btn-primary" id="btnSearch" type="button" title="Search Bible word meanings" onclick="onSearchConcept()"><i class="fa fa-magnifying-glass">&nbsp;</i></button>
  78.               </span>
  79.             </div>    
  80.         </form>
  81.         <script>    
  82.             function onSearchConcept()
  83.             {
  84.                 var sSearchTerm = $("#searchTerm").val();    
  85.                 if(sSearchTerm == '')
  86.                     alert("Please enter search text.");
  87.                 else
  88.                 {                    
  89.                     var sUrl = "{{ path('concepts') }}?st=" + encodeURIComponent(sSearchTerm);
  90.                     window.location=sUrl;
  91.                 }    
  92.             }
  93.         </script>    
  94.     {% elseif sCategory == 13 %}        
  95.         <form style="display:inline;" class="noprint">
  96.             <div class="input-group col" style="padding: 0 0 10px 0; display:inline-flex; max-width:450px;">          
  97.                   <input class="form-control py-2" id="searchTerm" name="searchTerm" placeholder="{{ sSearchBoxText }}" value=""  onKeyPress="return onEnterSearch(this.form)" />
  98.               <span class="input-group-append">
  99.               <button class="btn btn-primary" id="btnSearch" type="button" title="{{ app.session.get('ui_str')["search.searchspiritualtopics"] }}"  onclick="onSearchTopic()"><i class="fa fa-magnifying-glass">&nbsp;</i></button>
  100.               </span>
  101.             </div>    
  102.         </form>
  103.         <script>    
  104.             function onSearchTopic()
  105.             {
  106.                 var sSearchTerm = $("#searchTerm").val();    
  107.                 if(sSearchTerm == '')
  108.                     alert("Please enter search text.");
  109.                 else
  110.                 {                    
  111.                     var sUrl = "{{ path('consider') }}?st=" + encodeURIComponent(sSearchTerm);
  112.                     window.location=sUrl;
  113.                 }    
  114.             }
  115.         </script>    
  116.     {% elseif sCategory == 47 %}        
  117.         <form style="display:inline;" class="noprint">
  118.             <div class="input-group col" style="padding: 0 0 10px 0; display:inline-flex; max-width:450px;">          
  119.                   <input class="form-control py-2" id="searchTerm" name="searchTerm" placeholder="{{ sSearchBoxText }}" value=""  onKeyPress="return onEnterSearch(this.form)" />
  120.               <span class="input-group-append">
  121.               <button class="btn btn-primary" id="btnSearch" type="button" title="Q and A search" onclick="onSearchQA()"><i class="fa fa-magnifying-glass">&nbsp;</i></button>
  122.               </span>
  123.             </div>    
  124.         </form>
  125.         <script>    
  126.             function onSearchQA()
  127.             {
  128.                 var sSearchTerm = $("#searchTerm").val();    
  129.                 if(sSearchTerm == '')
  130.                     alert("Please enter search text.");
  131.                 else
  132.                 {                    
  133.                     var sUrl = "{{ path('q_and_a') }}?st=" + encodeURIComponent(sSearchTerm);
  134.                     window.location=sUrl;
  135.                 }    
  136.             }
  137.         </script>
  138.     {% elseif sCategory == 53 %}        
  139.         <form style="display:inline;" class="noprint">
  140.             <div class="input-group col" style="padding: 0 0 10px 0; display:inline-flex; max-width:450px;">          
  141.                   <input class="form-control py-2" id="searchTerm" name="searchTerm" placeholder="{{ sSearchBoxText }}" value=""  onKeyPress="return onEnterSearch(this.form)" />
  142.               <span class="input-group-append">
  143.               <button class="btn btn-primary" id="btnSearch" type="button" title="{{ app.session.get('ui_str')["search.concordance"] }}" onclick="onSearchConcordance()"><i class="fa fa-magnifying-glass">&nbsp;</i></button>
  144.               </span>
  145.             </div>
  146.             {% if nColNum == 0 %}
  147.                 <div class="noprint findinpage"> <input type=text class="form-control py-2" id="txtHighlight" onkeyup="onChangeHighlight()" onchange="onChangeHighlight()" data-lpignore="true" placeholder="{{ app.session.get('ui_str')["search.boxtext.findinpage"] }}"></div> 
  148.             {% endif %}   
  149.         </form>
  150.         <script>    
  151.             function onSearchConcordance()
  152.             {
  153.                 var sSearchTerm = $("#searchTerm").val();    
  154.                 if(sSearchTerm == '')
  155.                     alert("Please enter search text.");
  156.                 else
  157.                 {                    
  158.                     var sUrl = "{{ path('concordance') }}?st=" + encodeURIComponent(sSearchTerm);
  159.                     window.location=sUrl;
  160.                 }    
  161.             }
  162.             
  163.         {% if nColNum == 0 %}        
  164.             function scrollToClass(vClassName)
  165.             {                
  166.                 var $scrollTo = $('.'+vClassName+':visible:first');                
  167.                 if($scrollTo != 'undefined')
  168.                 {                    
  169.                     window.scrollTo(0, $scrollTo.offset().top);
  170.                 }    
  171.             }
  172.             
  173.             function scrollToClassElm(vClassName)
  174.             {        
  175.                 var oHightlight = document.getElementsByClassName(vClassName).length;
  176.                 if(oHightlight)
  177.                 {
  178.                     scrollToClass(vClassName);
  179.                 }
  180.             }
  181.             
  182.             function onResetHighlight()
  183.             {
  184.                 $("#tts{{ nColNum }}").unhighlight({ element: 'span', className: 'highlight2' });
  185.             }
  186.             
  187.             function onHighlightText()
  188.             {
  189.                 var sText = $("#txtHighlight").val();
  190.                 if(sText != '')
  191.                 {
  192.                     $("#tts{{ nColNum }}").highlight(sText, { element: 'span', className: 'highlight2', wordsOnly: false });
  193.                     
  194.                     scrollToClassElm("highlight2");        
  195.                 }                
  196.             }
  197.             
  198.             function onChangeHighlight()
  199.             {
  200.                 onResetHighlight();
  201.                 onHighlightText();
  202.             }
  203.         {% endif %}      
  204.         </script>    
  205.     {% elseif sSearchBoxText != '' %}        
  206.         <form style="display:inline;" class="noprint" action="{{ path('advanced_search') }}" method="POST" onsubmit="return onExpanationPageSearch(this,'{{ sCategory }}')">
  207.     <div class="input-group col" style="padding: 0 0 10px 0; display:inline-flex; max-width:450px;">
  208.           <input class="form-control form-control-sm py-2" type="hidden" id="quicksearch-domain-explanations" name="searchDomain" value="explanations" />
  209.           <input class="form-control form-control-sm py-2" type="search" name="searchTerm" placeholder="{{ sSearchBoxText }}" value="" />
  210.   <span class="input-group-append">
  211.   <button class="btn btn-sm btn-primary" id="btnSearch" type="submit" title="Search" ><i class="fa fa-magnifying-glass">&nbsp;</i></button>
  212.   </span>
  213.         </div>    
  214.         </form>
  215.     {% endif %}
  216. {% endif %}