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/organizations/index.html.erb b/app/views/organizations/index.html.erb new file mode 100644 index 000000000..a5773ba2f --- /dev/null +++ b/app/views/organizations/index.html.erb @@ -0,0 +1,23 @@ +<%= l(:label_all_enterprises) %> +
+
<%= l(:label_all_enterprises) %>
+
+ <% if @projects.count == 0 %> +

<%= l(:label_enterprise_nil) %>

+ <% else %> + <% @projects.each do |project| %> + <% unless project.enterprise_name.blank? %> + + <% end %> + <% end %> + <% end %> +
+
+
+
+ +
+<% html_title(l(:label_enterprise_all)) -%> diff --git a/app/views/originizations/index.html.erb b/app/views/originizations/index.html.erb deleted file mode 100644 index 7e31a2e75..000000000 --- a/app/views/originizations/index.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -
-

- <%= link_to l(:label_all_enterprises) %> -

-

- <% if @enterprises.count == 0 %> -

<%= l(:label_enterprise_nil) %>

- <% else %> - <% @enterprises.each do |enterprise| %> - <% unless enterprise.enterprise_name.blank? %> - - <% end %> - <% end %> - <% end %> -

-
-
-
- -
-<% html_title(l(:label_enterprise_all)) -%> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 821ac4e1c..95efcdb0a 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -31,7 +31,7 @@
- <% if @enterprise.nil? %> + <% if @organization.nil? %> <% if get_avatar?(@first_page) %> <%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %> <% else %> @@ -42,13 +42,13 @@ <% end %>
- <% if @enterprise.nil? %> + <% if @organization.nil? %> <% unless @first_page.nil? %> <%= @first_page.description.html_safe %> <% end %> <% else %> - <%= link_to @enterprise, options={:action => 'index', :enterprise => @enterprise}, html_options={ :method => 'get', :style => "color: #E8770D"} %> + <%= link_to @organization, options={:action => 'index', :enterprise => @organization}, html_options={ :method => 'get', :style => "color: #E8770D"} %>
<%= @first_page.title %> <% end %> @@ -77,7 +77,7 @@
    - <% if @originization.nil? %> + <% if @organization.nil? %> <% @projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> <% end; reset_cycle %> @@ -89,7 +89,7 @@ <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> <% end %> <% elsif @e_count < 10 %> - <% @originization_projects.map do |project| %> + <% @organization_projects.map do |project| %> <%= render :partial => 'hot_projects_list', :locals => {:project => project} %> <% end %>

    <%= l(:label_part_enterprise_tips) %>

    diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 6afc95979..227d50d5a 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -247,7 +247,7 @@ zh: label_course_closed_tips: "确定要%{desc}课程?" # end field_name: 名称 - field_enterprise_name: 企业名 + field_enterprise_name: 组织名称 #added by huang field_tea_name: 教师 field_couurse_time: 学时 @@ -2224,7 +2224,8 @@ zh: label_project_deposit: 项目托管 label_course_practice: 课程实践 label_forum_all: 公共贴吧 - label_school_all: 中国高校 + label_school_all: 中国高校 + label_enterprise_all: 组织 label_contest_innovate: 创新竞赛 label_software_user: 软件创客 label_requirement_enterprise: 软件众包 @@ -2520,6 +2521,6 @@ zh: label_all_enterprises: 所有企业 label_my_enterprise: 我的企业 label_enterprise_tips: 暂时还没有该企业对应的项目,系统的其它项目您可能会感兴趣! - label_part_enterprise_tips: 系统的其它项目您可能也会感兴趣! + label_part_enterprise_tips: 您可能对系统的其它项目会感兴趣! label_enterprise_nil: 该模块为最新上线模块,目前还未有项目关联到企业! - label_enterprises: 名企 + label_enterprises: 组织 diff --git a/config/routes.rb b/config/routes.rb index 97d603242..81dea18ff 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,7 +26,7 @@ # Example: :via => :get ====> :via => :get RedmineApp::Application.routes.draw do - get "originizations/index" + get "organizations/index" #match '/contests/:id/contestnotifications', :controller => 'contestnotifications', :action => 'index' @@ -390,7 +390,7 @@ 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 'originizations', :to => 'originizations#index', :as => 'index', :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 diff --git a/public/images/organization_logo.jpg b/public/images/organization_logo.jpg new file mode 100644 index 000000000..cb46e70a4 Binary files /dev/null and b/public/images/organization_logo.jpg differ diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index c1c7a8cc1..b11509e14 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -8,6 +8,15 @@ h3, .wiki h2 {font-size: 15px; padding-left: 5px} h4, .wiki h3 {font-size: 13px;} h4 {border-bottom: 1px dotted #bbb;} /*huang*/ +/*企业版样式*/ +.content_syqy{ width:940px; height:400px; border:1px;} +.content_syqy .list{ font-size:14px; font-weight:normal; margin-left:10px; font-weight:bold; padding-top:10px} +.syqy_box{ margin-left:-30px; margin-top:5px;} +.syqy_box ul li{ float:left; margin-right:10px; border:1px solid #e3e3e3; width:215px; height:30px; padding:5px; padding-right:0px; margin-bottom:10px; overflow:hidden; text-overflow:ellipsis;font-size:14px; color:#464646;white-space: nowrap; } +.syqy_box ul li img{ float:left; margin-right:3px; } +.syqy_box ul li a { font-size:14px; color:#464646; height:30px; padding-top:500px;} +.syqy_box ul li a:hover{color:#15bccf;} +a.syqy_wenzi{ padding-bottom:10px; border:1px solid red;} /*current position*/ .enterprise_all{ padding-left: 20px;