sort and date fixed
This commit is contained in:
parent
ff3dd3f7af
commit
4193303093
|
@ -28,6 +28,8 @@ class Research
|
||||||
|
|
||||||
before_validation :add_http
|
before_validation :add_http
|
||||||
|
|
||||||
|
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publish_date => "desc") }
|
||||||
|
|
||||||
def get_plugin_data(fields_to_show)
|
def get_plugin_data(fields_to_show)
|
||||||
plugin_datas = []
|
plugin_datas = []
|
||||||
fields_to_show.each do |field|
|
fields_to_show.each do |field|
|
||||||
|
@ -53,7 +55,7 @@ class Research
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
plugin_datas = datas.where(:is_hidden=>false).order_by(:year=>'desc').collect do |p|
|
plugin_datas = datas.sort_for_frontend.collect do |p|
|
||||||
|
|
||||||
pd_data = []
|
pd_data = []
|
||||||
fields_to_show.collect do |t|
|
fields_to_show.collect do |t|
|
||||||
|
|
|
@ -163,7 +163,7 @@
|
||||||
<div class="control-group big-group">
|
<div class="control-group big-group">
|
||||||
<label class="control-label muted"><%= t("personal_research.publication_date") %></label>
|
<label class="control-label muted"><%= t("personal_research.publication_date") %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.datetime_picker :publish_date, :no_label => true, :format=>"yyyy/MM" %>
|
<%= f.datetime_picker :publish_date, :no_label => true, :format=>"yyyy/MM", :value => @research.publish_date, :new_record => @research.new_record? %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue