diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 4ee5ddbf1..290af0068 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -28,7 +28,7 @@ class WelcomeController < ApplicationController # 企业版定制: params[:project]为传过来的参数 unless params[:organization].nil? @organization = Organization.find params[:organization] - @organization_projects = Project.visible.joins(:project_status).joins("LEFT JOIN project_scores ON projects.id = project_scores.project_id").where("projects.organization_id = ?", 1).order("score DESC").limit(10).all + @organization_projects = Project.visible.joins(:project_status).joins("LEFT JOIN project_scores ON projects.id = project_scores.project_id").where("projects.organization_id = ?", @organization.id).order("score DESC").limit(10).all @part_projects = @organization_projects.count < 9 ? find_miracle_project( 9 - @organization_projects.count, 3,"score desc") : [] # @cur_projects = Project.find(params[:organization]) # @organization = @cur_projects.enterprise_name diff --git a/app/views/admin/organization.html.erb b/app/views/admin/organization.html.erb index 9d07aa0df..582b8b44a 100644 --- a/app/views/admin/organization.html.erb +++ b/app/views/admin/organization.html.erb @@ -1 +1,43 @@ -111 \ No newline at end of file +
+ <%= link_to l(:label_organization_new), new_organization_path, :class => 'icon icon-add' %> +
+ +

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

+ +
+ + + + + + + + + + <% @organizations.each do |org|%> + "> + + + + + <% end%> + +
+ <%=l(:label_organization)%> + + <%=l(:field_created_on)%> +
+ + <%= link_to org.name,home_path(:organization => org.id) %> + + + <%= format_date(org.created_at) %> + + <%= link_to(l(:button_change), edit_organization_path(org.id), :class => 'icon icon-copy') %> + <%= link_to(l(:button_delete), organization_path(org.id), :method => :delete,:confirm => l(:text_are_you_sure), :class => 'icon icon-del') %> +
+
+ +<% html_title(l(:label_project_plural)) -%> diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index 762ceae9e..4c9479a6d 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -2,16 +2,25 @@ <%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %> -

<%=l(:label_project_plural)%>

+

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

<%= form_tag({}, :method => :get) do %> -
<%= l(:label_filter_plural) %> - -<%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> - -<%= text_field_tag 'name', params[:name], :size => 30 %> -<%= submit_tag l(:button_apply), :class => "small", :name => nil %> -<%= link_to l(:button_clear), {:controller => 'admin', :action => 'projects'}, :class => 'icon icon-reload' %> +
+ + <%= l(:label_filter_plural) %> + + + <%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> + + <%= text_field_tag 'name', params[:name], :size => 30 %> + <%= submit_tag l(:button_apply), :class => "small", :name => nil %> + <%= link_to l(:button_clear), {:controller => 'admin', :action => 'projects'}, :class => 'icon icon-reload' %>
<% end %>   @@ -19,17 +28,31 @@
- - - + + + <% project_tree(@projects) do |project, level| %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> - - - + + +
<%=l(:label_project)%><%=l(:field_is_public)%><%=l(:field_created_on)%> + <%=l(:label_project)%> + + <%=l(:field_is_public)%> + + <%=l(:field_created_on)%> +
<%= link_to_project_settings(project, {}) %><%= checked_image project.is_public? %><%= format_date(project.created_on) %> + + <%= link_to_project_settings(project, {}) %> + + + <%= checked_image project.is_public? %> + + <%= format_date(project.created_on) %> + <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %> <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 362838800..231339a8e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -538,7 +538,9 @@ zh: label_project: 项目 label_activity_project: '项目: ' #added by bai + label_organization: 组织 label_organization_list: 组织列表 + label_organization_new: 新建组织 label_project_plural: 项目列表 label_first_page_made: 首页定制 label_project_first_page: 项目托管平台首页 diff --git a/config/routes.rb b/config/routes.rb index fb4e40e49..53f6f6a4b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -36,7 +36,7 @@ RedmineApp::Application.routes.draw do resources :apply_project_masters delete 'apply_project_masters', :to => 'apply_project_masters#delete' - resources :organization, :only => [:index] do + resources :organization, :except => [:show] do end