sortable category
This commit is contained in:
parent
276d085a2c
commit
6dbfb239c3
|
@ -6,18 +6,6 @@ class Panel::Dictionary::FrontEnd::DictionaryVocabsController < OrbitWidgetContr
|
|||
@app_title = 'dictionary_vocabs'
|
||||
end
|
||||
|
||||
# def get_search_result
|
||||
# @search = ArchiveFileCategory.solr_search do
|
||||
# fulltext params[:search_query]
|
||||
# with(:frontend_search,true)
|
||||
# end
|
||||
|
||||
# search_result = @search.results.collect{|result| result.id}
|
||||
# params[:category_id] = @search.results.collect{|result| result.id}
|
||||
|
||||
# @archive_file_categorys = ArchiveFileCategory.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
||||
# end
|
||||
|
||||
def index
|
||||
@item = Page.find(params[:page_id])
|
||||
@title = @item.title
|
||||
|
@ -34,6 +22,15 @@ class Panel::Dictionary::FrontEnd::DictionaryVocabsController < OrbitWidgetContr
|
|||
fulltext params[:search_query]
|
||||
end.results
|
||||
end
|
||||
|
||||
if !params[:category_id].blank?
|
||||
@vocabs = DictionaryVocab.default_sort(params[:sort]).can_display.where(:dictionary_vocab_category_id.in => params[:category_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num)
|
||||
@current_category = DictionaryVocabCategory.from_id(params[:category_id]) rescue nil
|
||||
end
|
||||
|
||||
if params[:sort]
|
||||
@vocabs = get_sorted_and_filtered('dictionary_vocab', nil, @vocabs)
|
||||
end
|
||||
# @item = Page.find(params[:page_id])
|
||||
# @title = @item.title
|
||||
# if !@item.frontend_data_count.blank?
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span2"><%= t :category, :scope => :dictionary %></th>
|
||||
<th class="span2"><%= sortable(:category, t("dictionary.category"))%></th>
|
||||
<th class="span2"><%= t :word, :scope => :dictionary %></th>
|
||||
<th class="span2"><%= t :definition, :scope => :dictionary %></th>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue