From ab29dd43352b91fbeeb21a100809d687f49df395 Mon Sep 17 00:00:00 2001 From: Bernie Chiu Date: Sun, 25 Aug 2013 18:11:19 +0800 Subject: [PATCH] Order the vocabs --- .../front_end/dictionary_vocabs_controller.rb | 2 +- .../front_end/dictionary_vocabs/index.html.erb | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/vendor/built_in_modules/dictionary/app/controllers/panel/dictionary/front_end/dictionary_vocabs_controller.rb b/vendor/built_in_modules/dictionary/app/controllers/panel/dictionary/front_end/dictionary_vocabs_controller.rb index 030316b87..b7aa6b11f 100644 --- a/vendor/built_in_modules/dictionary/app/controllers/panel/dictionary/front_end/dictionary_vocabs_controller.rb +++ b/vendor/built_in_modules/dictionary/app/controllers/panel/dictionary/front_end/dictionary_vocabs_controller.rb @@ -28,7 +28,7 @@ class Panel::Dictionary::FrontEnd::DictionaryVocabsController < OrbitWidgetContr end if params[:search_query].empty? - @vocabs = DictionaryVocab.page(params[:page_main]).per(@page_num) + @vocabs = DictionaryVocab.desc(:created_at).page(params[:page_main]).per(@page_num) else @vocabs = DictionaryVocab.solr_search do fulltext params[:search_query] diff --git a/vendor/built_in_modules/dictionary/app/views/panel/dictionary/front_end/dictionary_vocabs/index.html.erb b/vendor/built_in_modules/dictionary/app/views/panel/dictionary/front_end/dictionary_vocabs/index.html.erb index f9cbd9a1c..0331dc01c 100644 --- a/vendor/built_in_modules/dictionary/app/views/panel/dictionary/front_end/dictionary_vocabs/index.html.erb +++ b/vendor/built_in_modules/dictionary/app/views/panel/dictionary/front_end/dictionary_vocabs/index.html.erb @@ -15,18 +15,19 @@ <%= vocab.dictionary_vocab_category.title %> <%= link_to truncate(vocab.word,length: 25), panel_dictionary_front_end_dictionary_vocab_path(vocab) %> - <% if vocab.created_at > Time.now.beginning_of_day %> - <%="#{time_ago_in_words(vocab.created_at)}"%> - <%=t :ago,:scope => :dictionary%> - <% else %> - <%= vocab.created_at.strftime("%Y/%m/%d") %> - <% end %> + + <% if vocab.created_at > Time.now.beginning_of_day %> + <%="#{time_ago_in_words(vocab.created_at)}"%> + <%=t :ago,:scope => :dictionary%> + <% else %> + <%= vocab.created_at.strftime("%Y/%m/%d") %> + <% end %> + <% end %> - -<%= paginate( @vocabs, :param_name => :page_main, :params => {:inner => 'false'} ) rescue nil %> \ No newline at end of file +<%= paginate(@vocabs, :param_name => :page_main, :params => {:inner => 'false'} ) rescue nil %> \ No newline at end of file