From c413ce1405f0140e160bf04bf514312e72755e4a Mon Sep 17 00:00:00 2001 From: whimlex Date: Sat, 31 Jan 2015 14:44:16 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=9B=BD=E9=99=85=E5=8C=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/_hot_projects_list.html.erb | 4 ++-- config/locales/zh.yml | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/views/welcome/_hot_projects_list.html.erb b/app/views/welcome/_hot_projects_list.html.erb index 9b941f420..92e1469cd 100644 --- a/app/views/welcome/_hot_projects_list.html.erb +++ b/app/views/welcome/_hot_projects_list.html.erb @@ -8,7 +8,7 @@ <%= l(:label_private) %> <% end %> <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%> - (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>) + (<%= link_to l(:label_project_member_amount, :count=>projectCount(project)), project_member_path(project) ,:course =>'0' %>)
<%=project.description.truncate(90, omission: '...')%> @@ -16,7 +16,7 @@
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s, :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;", - :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", + :title => l(:label_project_score_tips), :class => "tooltip", :id => "tooltip-#{project.id}" %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4527c8e5c..6afc95979 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2219,7 +2219,7 @@ zh: # 托管平台主页 # edit by meng - # 托管平台主页> 顶部菜单 + # 托管平台主页> 顶部菜单> field_homepage: 主页 label_project_deposit: 项目托管 label_course_practice: 课程实践 @@ -2229,6 +2229,10 @@ zh: label_software_user: 软件创客 label_requirement_enterprise: 软件众包 label_stores_index: 资源搜索 + + # 托管平台主页> 顶部菜单> + + # 托管平台主页 > 搜索提示信息 label_search_information: 请输入要搜索的关键字 @@ -2509,3 +2513,13 @@ zh: next: "下一页 »" truncate: "..." + + + # 项目企业模块 + + label_all_enterprises: 所有企业 + label_my_enterprise: 我的企业 + label_enterprise_tips: 暂时还没有该企业对应的项目,系统的其它项目您可能会感兴趣! + label_part_enterprise_tips: 系统的其它项目您可能也会感兴趣! + label_enterprise_nil: 该模块为最新上线模块,目前还未有项目关联到企业! + label_enterprises: 名企 From 280092366bb74094992a9e9fdfaf9e27796abbd8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 31 Jan 2015 14:54:37 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/css.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index a64d73832..2319d1f59 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -1,7 +1,5 @@ /* CSS Document */ -#content{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;} -#popbox{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;} -#popbox02{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;} +#content,#popbox,#popbox02{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;} div,img,tr,td,textarea{ border:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;} From 523af8b2a905cdb32056bd4eae0ad0822ac088a0 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 31 Jan 2015 15:43:35 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E7=89=88=E7=BB=93=E6=9E=84=E5=8F=8A=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/organizations_controller.rb | 6 +++++ app/controllers/originizations_controller.rb | 6 ----- app/controllers/welcome_controller.rb | 14 +++++------ ...ions_helper.rb => organizations_helper.rb} | 0 app/views/organizations/index.html.erb | 23 +++++++++++++++++ app/views/originizations/index.html.erb | 25 ------------------- app/views/welcome/index.html.erb | 10 ++++---- config/locales/zh.yml | 8 +++--- config/routes.rb | 4 +-- public/stylesheets/application.css | 9 +++++++ 10 files changed, 56 insertions(+), 49 deletions(-) create mode 100644 app/controllers/organizations_controller.rb delete mode 100644 app/controllers/originizations_controller.rb rename app/helpers/{originizations_helper.rb => organizations_helper.rb} (100%) create mode 100644 app/views/organizations/index.html.erb delete mode 100644 app/views/originizations/index.html.erb 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? %> -
      -
    • - <%= link_to enterprise.enterprise_name, home_path(:originization => enterprise.enterprise_name) %> -
    • -
    - <% 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 c53377134..07f99c89d 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 524494f45..d0be02253 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -275,7 +275,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: 学时 @@ -2205,7 +2205,7 @@ zh: label_course_practice: 课程实践 label_forum_all: 公共贴吧 label_school_all: 中国高校 - :label_enterprise_all: 名企 + label_enterprise_all: 组织 label_contest_innovate: 创新竞赛 label_software_user: 软件创客 label_requirement_enterprise: 软件众包 @@ -2454,6 +2454,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/stylesheets/application.css b/public/stylesheets/application.css index fb2b451fa..5a84c5005 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; From 9e36f9264c956b3ae4e83ba8df73d717e6b3d24a Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 31 Jan 2015 15:46:10 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E7=AB=9E?= =?UTF-8?q?=E8=B5=9B=E4=BD=9C=E4=B8=9A=E8=AF=84=E5=88=86=E3=80=8B=20Signed?= =?UTF-8?q?-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contests/show_attendingcontest.html.erb | 48 ++++++++++--------- config/locales/zh.yml | 2 +- 2 files changed, 26 insertions(+), 24 deletions(-) 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 %> -
      @@ -282,7 +284,7 @@ - <% 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 '评奖', c_softapplication.id.to_s %> diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 524494f45..13f609aef 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2204,7 +2204,7 @@ zh: label_project_deposit: 项目托管 label_course_practice: 课程实践 label_forum_all: 公共贴吧 - label_school_all: 中国高校 + :label_enterprise_all: 名企 label_contest_innovate: 创新竞赛 label_software_user: 软件创客 From 4ebd34722d336afc8712bdf16823cd0ed6631fde Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Sat, 31 Jan 2015 15:53:50 +0800 Subject: [PATCH 5/7] =?UTF-8?q?email=5Fverifier=20=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/email_verifier | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/email_verifier b/lib/email_verifier index 3cabcc643..222a9bdd7 160000 --- a/lib/email_verifier +++ b/lib/email_verifier @@ -1 +1 @@ -Subproject commit 3cabcc643f36939939685e6f55273dfbf89da545 +Subproject commit 222a9bdd72014f197baf2131ab71cc41660111ed From 1dd8724656bddea4a4fa053f59eac931a35770c8 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 31 Jan 2015 16:10:20 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/index.html.erb | 2 +- public/stylesheets/application.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/index.html.erb b/app/views/organizations/index.html.erb index a5773ba2f..3e0e507c5 100644 --- a/app/views/organizations/index.html.erb +++ b/app/views/organizations/index.html.erb @@ -9,7 +9,7 @@ <% unless project.enterprise_name.blank? %> <% end %> <% end %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index b11509e14..cbd383151 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -14,7 +14,7 @@ h4 {border-bottom: 1px dotted #bbb;} .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 { float:left;font-size:14px; color:#464646; height:30px; padding-top:4px; width: 175px; overflow:hidden; text-overflow:ellipsis;} .syqy_box ul li a:hover{color:#15bccf;} a.syqy_wenzi{ padding-bottom:10px; border:1px solid red;} /*current position*/ From 79d1a069c21ce6772663b39e8f52decde43747b1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 31 Jan 2015 16:19:13 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E8=BF=87=E9=95=BF=E9=A6=96=E9=A1=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/welcome/index.html.erb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 95efcdb0a..ff1841bd4 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -41,16 +41,19 @@ <%= image_tag '/images/avatars/Project/0', width:@first_page.image_width,height: @first_page.image_height %> <% end %>
      -
      +
      <% if @organization.nil? %> <% unless @first_page.nil? %> <%= @first_page.description.html_safe %> <% end %> <% else %> - - <%= link_to @organization, options={:action => 'index', :enterprise => @organization}, html_options={ :method => 'get', :style => "color: #E8770D"} %> -
      - <%= @first_page.title %> + + <%= link_to @organization, options={:action => 'index', :enterprise => @organization}, html_options={ :method => 'get', :style => "color: #E8770D"} %> + +
      + + <%= @first_page.title %> + <% end %>