瀏覽代碼

HUE-1811 [search] Alert message when using a demo collection without a valid Solr

Romain Rigaux 11 年之前
父節點
當前提交
38da4f377e
共有 2 個文件被更改,包括 133 次插入3 次删除
  1. 126 3
      apps/search/src/search/examples.py
  2. 7 0
      apps/search/src/search/templates/search.mako

文件差異過大導致無法顯示
+ 126 - 3
apps/search/src/search/examples.py


+ 7 - 0
apps/search/src/search/templates/search.mako

@@ -113,6 +113,13 @@ ${ commonheader(_('Search'), "search", user, "90px") | n,unicode }
 </div>
 </div>
 % else:
 % else:
 <div class="container results">
 <div class="container results">
+
+% if 'is_demo' in response['responseHeader']:
+ <div class="alert alert-warn">
+  ${ _('A demo index is used. In order to be interactive, please ') } <a href="">${ _('create the indexes') }</a> ${ _(' in Solr.') }
+ </div>
+% endif 
+
   <div id="mainContent" class="row hide">
   <div id="mainContent" class="row hide">
     % if response and 'response' in response and 'docs' in response['response'] and len(response['response']['docs']) > 0 and 'normalized_facets' in response:
     % if response and 'response' in response and 'docs' in response['response'] and len(response['response']['docs']) > 0 and 'normalized_facets' in response:
       <% shown_facets = 0 %>
       <% shown_facets = 0 %>

部分文件因文件數量過多而無法顯示