diff --git a/app/controllers/organization_controller.rb b/app/controllers/organization_controller.rb new file mode 100644 index 000000000..ef0919ced --- /dev/null +++ b/app/controllers/organization_controller.rb @@ -0,0 +1,10 @@ +class OrganizationController < 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)") + @organizations = Organization.all + respond_to do |format| + format.html + end + end +end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb deleted file mode 100644 index c9cce5752..000000000 --- a/app/controllers/organizations_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -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/views/organization/index.html.erb b/app/views/organization/index.html.erb new file mode 100644 index 000000000..2f657831a --- /dev/null +++ b/app/views/organization/index.html.erb @@ -0,0 +1,31 @@ + + <%= l(:label_all_enterprises) %> + +
+
+ <%= l(:label_all_enterprises) %> +
+
+ <% if @organizations.empty? %> +

+ <%= l(:label_enterprise_nil) %> +

+ <% else %> + <% @organizations.each do |organization| %> + <% unless organization.name.blank? %> + + <% end %> + <% end %> + <% end %> +
+
+
+
+ +
+<% html_title(l(:label_enterprise_all)) -%> diff --git a/app/views/organizations/index.html.erb b/app/views/organizations/index.html.erb deleted file mode 100644 index 45813ced5..000000000 --- a/app/views/organizations/index.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<%= l(:label_all_enterprises) %> -
-
<%= l(:label_all_enterprises) %>
-
- <% if @projects.count == 0 %> -

<%= l(:label_enterprise_nil) %>

- <% else %> - <% @projects.each do |organization| %> - <% unless organization.enterprise_name.blank? %> - - <% end %> - <% end %> - <% end %> -
-
-
-
- -
-<% html_title(l(:label_enterprise_all)) -%> diff --git a/config/routes.rb b/config/routes.rb index bf0b73e8d..6756a713d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,9 +26,6 @@ # Example: :via => :get ====> :via => :get RedmineApp::Application.routes.draw do - get "organizations/index" - - #match '/contests/:id/contestnotifications', :controller => 'contestnotifications', :action => 'index' mount Mobile::API => '/api' @@ -39,6 +36,10 @@ RedmineApp::Application.routes.draw do resources :apply_project_masters delete 'apply_project_masters', :to => 'apply_project_masters#delete' + resources :organization, :only => [:index] do + + end + resources :homework_attach do collection do get 'get_homework_member_list' @@ -390,7 +391,6 @@ RedmineApp::Application.routes.draw do match '/statistics', :to => 'projects#statistics', :as => 'statistics', :via => :get # match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get match '/homework', :to => 'projects#homework', :as => 'homework', :via => :get - match 'organizations', :to => 'organizations#index', :as => 'index', :via => :get # match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get # match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get