Fix bug.
This commit is contained in:
parent
2eeb0efce4
commit
4141d95eae
|
@ -20,7 +20,7 @@ class Admin::NccuComVnccuProgramsController < OrbitAdminController
|
|||
@filter_fields = filter_fields(@categories)
|
||||
@table_fields = [:category, 'nccu_com_vnccu_program.year', 'nccu_com_vnccu_program.semester', 'nccu_com_vnccu_program.program_name', 'nccu_com_vnccu_program.week', 'nccu_com_vnccu_program.hour', 'nccu_com_vnccu_program.host']
|
||||
|
||||
!params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:postdate=>"desc"}
|
||||
!params[:sort].blank? ? sort = {params[:sort].to_sym=>params[:order]} : sort = {:year=>"desc",:id=>"desc"}
|
||||
|
||||
@nccu_com_vnccu_programs = ComVnccuProgram.order_by(sort).with_categories(filters("category"))
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class ComVnccuProgram
|
|||
|
||||
@role = Role.where(:key=>"host").first
|
||||
for i in 1..5
|
||||
@nickname_field = AttributeField.where(:key => 'nickname'+i.to_s, :role_id => @role).first
|
||||
@nickname_field = AttributeField.where(:key => i.to_s, :role_id => @role).first
|
||||
@values_data = AttributeValue.where(:attribute_field_id => @nickname_field, :val.ne => "").collect{|t|t[:val]}.join('-').split('-')
|
||||
|
||||
@values.concat(@values_data)
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<div class="control-group">
|
||||
<label class="control-label muted"><%= t("nccu_com_vnccu_program.year") %></label>
|
||||
<div class="controls">
|
||||
<%= select_year((@nccu_com_vnccu_program.year ? @nccu_com_vnccu_program.year.to_i : DateTime.now.year), {:start_year => (DateTime.now.year - 1911), :end_year => (2014 - 1911)}, {:name => 'com_vnccu_program[year]', :class => "span1"} ) %>
|
||||
<%= select_year((@nccu_com_vnccu_program.year ? @nccu_com_vnccu_program.year.to_i : (DateTime.now.year - 1911)), {:start_year => (DateTime.now.year + 2 - 1911), :end_year => (DateTime.now.year - 6 - 1911)}, {:name => 'com_vnccu_program[year]', :class => "span1"} ) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue