diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb new file mode 100644 index 000000000..c9cce5752 --- /dev/null +++ b/app/controllers/organizations_controller.rb @@ -0,0 +1,6 @@ +class OrganizationsController < ApplicationController + layout 'project_base' + def index + @projects = Project.find_by_sql("SELECT * FROM projects WHERE id IN (select MAX(id) from projects GROUP BY enterprise_name)") + end +end diff --git a/app/controllers/originizations_controller.rb b/app/controllers/originizations_controller.rb deleted file mode 100644 index 033f9d8ec..000000000 --- a/app/controllers/originizations_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -class OriginizationsController < ApplicationController - layout 'project_base' - def index - @enterprises = Project.find_by_sql("select distinct(enterprise_name) from projects") - end -end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index b1138f964..6704346a5 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -25,15 +25,15 @@ class WelcomeController < ApplicationController before_filter :entry_select, :only => [:index] def index - unless params[:originization].nil? - @originization = params[:originization] - @originization_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @originization]) - @e_count = @originization_projects.count - if @e_count < 10 - part_count = 10 -@e_count + unless params[:project].nil? + @cur_projects = Project.find(params[:project]) + @organization = @cur_projects.enterprise_name + @organization_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @organization]) + @e_count = @organization_projects.count + if @e_count < 9 + part_count = 9 - @e_count # @part_projects = find_all_hot_project part_count, order @part_projects = find_miracle_project(part_count, 3,"score desc") - limit = 10 - @e_count end end if @first_page.nil? || @first_page.sort_type.nil? diff --git a/app/helpers/originizations_helper.rb b/app/helpers/organizations_helper.rb similarity index 100% rename from app/helpers/originizations_helper.rb rename to app/helpers/organizations_helper.rb diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb index f8c231550..3f8ef4264 100644 --- a/app/views/contests/show_attendingcontest.html.erb +++ b/app/views/contests/show_attendingcontest.html.erb @@ -136,34 +136,35 @@ <% else %> <%= l(:label_noawards_current) %> <% end %> - <% else %> - <% case get_prize(c_project) %> - <% when '-1' %> - <%= image_tag("/images/bid/special_reward.png") %> - <% when '0' %> - <%= image_tag("/images/bid/first_reward.png") %> - <% when '1' %> - <%= image_tag("/images/bid/second_reward.png") %> - <% when '2' %> - <%= image_tag("/images/bid/third_reward.png") %> - <% when '3' %> - <%= image_tag("/images/bid/forth_reward.png") %> - <% when '4' %> - <%= image_tag("/images/bid/fifth_reward.png") %> - <% when '5' %> - <%= image_tag("/images/bid/qualified.png") %> - <% end %> - <% end %> + <% else %> + <% case get_prize(c_project) %> + <% when '-1' %> + <%= image_tag("/images/bid/special_reward.png") %> + <% when '0' %> + <%= image_tag("/images/bid/first_reward.png") %> + <% when '1' %> + <%= image_tag("/images/bid/second_reward.png") %> + <% when '2' %> + <%= image_tag("/images/bid/third_reward.png") %> + <% when '3' %> + <%= image_tag("/images/bid/forth_reward.png") %> + <% when '4' %> + <%= image_tag("/images/bid/fifth_reward.png") %> + <% when '5' %> + <%= image_tag("/images/bid/qualified.png") %> + <% end %> + <% end %> - <% if ((User.current.id == @contest.author_id) && (@contest.deadline > Date.today))||User.current.admin %> + <% if ((User.current.id == @contest.author_id) && (@contest.deadline >= Date.today))||User.current.admin %> + <%= toggle_link l(:label_reward), c_project.id.to_s %> -