diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb deleted file mode 100644 index c15b6dc8f..000000000 --- a/app/controllers/enterprises_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -class EnterprisesController < ApplicationController - layout 'project_base' - def index - @enterprises = Project.find_by_sql("select enterprise_name from projects") - end -end diff --git a/app/controllers/originizations_controller.rb b/app/controllers/originizations_controller.rb new file mode 100644 index 000000000..033f9d8ec --- /dev/null +++ b/app/controllers/originizations_controller.rb @@ -0,0 +1,6 @@ +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 6c28ec502..b1138f964 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -25,10 +25,10 @@ class WelcomeController < ApplicationController before_filter :entry_select, :only => [:index] def index - unless params[:enterprise].nil? - @enterprise = params[:enterprise] - @enterprise_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @enterprise]) - @e_count = @enterprise_projects.count + 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 # @part_projects = find_all_hot_project part_count, order diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/originizations_helper.rb similarity index 100% rename from app/helpers/enterprises_helper.rb rename to app/helpers/originizations_helper.rb diff --git a/app/views/enterprises/index.html.erb b/app/views/originizations/index.html.erb similarity index 83% rename from app/views/enterprises/index.html.erb rename to app/views/originizations/index.html.erb index 9db8d99ab..002ea84f8 100644 --- a/app/views/enterprises/index.html.erb +++ b/app/views/originizations/index.html.erb @@ -10,7 +10,7 @@ <% unless enterprise.enterprise_name.blank? %>
<%= l(:label_enterprise_tips) %>
<% @projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> - <% end; reset_cycle %> + <% end %> <% elsif @e_count < 10 %> - <% @enterprise_projects.map do |project| %> + <% @originization_projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> <% end %><%= l(:label_part_enterprise_tips) %>
@@ -100,8 +100,8 @@ <% @part_projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> <% end %> - <% end; reset_cycle %> - <% end; reset_cycle %> + <% end %> + <% end %>