<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
From 6037421c7ded5579ab56fc00ca6063c1c62ad050 Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Fri, 8 Aug 2014 15:45:06 +0800
Subject: [PATCH 03/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B2=A1=E6=9C=89?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E5=AD=A6=E6=A0=A1=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/course.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index d48f11774..7cab331b6 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -101,7 +101,7 @@
<% end %>
- <% find_all_new_hot_course(10, @school_id).map do |course| %>
+ <% find_all_new_hot_course(9, @school_id).map do |course| %>
/,"") %>>
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
From 0028c1142640b49ba78f0a339b79fede7d8016be Mon Sep 17 00:00:00 2001
From: linhk <304431313@.com>
Date: Fri, 8 Aug 2014 16:43:34 +0800
Subject: [PATCH 04/14] =?UTF-8?q?=E9=80=80=E5=87=BA=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/account_controller.rb | 4 ++--
app/controllers/projects_controller.rb | 13 ++++++++++++
app/helpers/watchers_helper.rb | 5 ++++-
app/views/layouts/_join_exit_project.html.erb | 20 +++++++++++++++++++
app/views/layouts/base_projects.html.erb | 15 ++------------
app/views/projects/exit_project.js.erb | 1 +
config/locales/en.yml | 1 +
config/locales/zh.yml | 1 +
config/routes.rb | 1 +
9 files changed, 45 insertions(+), 16 deletions(-)
create mode 100644 app/views/layouts/_join_exit_project.html.erb
create mode 100644 app/views/projects/exit_project.js.erb
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb
index c1b38fa39..4174f427e 100644
--- a/app/controllers/account_controller.rb
+++ b/app/controllers/account_controller.rb
@@ -119,8 +119,8 @@ class AccountController < ApplicationController
@user = User.new
@user.safe_attributes = user_params
if params[:identity] == "2" # 2 企业
- #@user.firstname = params[:enterprise_name]
- #@user.lastname = l(:field_enterprise)
+ @user.firstname = params[:enterprise_name]
+ @user.lastname = l(:field_enterprise)
end
@user.admin = false
@user.register
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 3f6827159..1bc75d9d1 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -892,6 +892,18 @@ class ProjectsController < ApplicationController
end
end
+ def exit_project
+ @project = Project.find params[:id]
+ if User.current.login?
+ members = Member.where(:user_id => User.current.id, :project_id=>params[:id]).first
+ if members != nil
+ members.destroy
+ end
+ respond_to do |format|
+ format.js
+ end
+ end
+ end
private
def memberAccess
@@ -1038,4 +1050,5 @@ class ProjectsController < ApplicationController
end
#gcmend
+
end
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index ea72e8184..be5609d7c 100644
--- a/app/helpers/watchers_helper.rb
+++ b/app/helpers/watchers_helper.rb
@@ -246,4 +246,7 @@ module WatchersHelper
link_to text, url, :remote => true, :method => method ,:class=>css
end
- end
+ def exit_project_link(project)
+ link_to("退出项目",exit_cur_project_path(project.id),:remote => true )
+ end
+ end
diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb
new file mode 100644
index 000000000..c43ad55a2
--- /dev/null
+++ b/app/views/layouts/_join_exit_project.html.erb
@@ -0,0 +1,20 @@
+
+
+ <% if ( !(User.current.member_of? @project) && User.current.login?) %>
+ <%= watcher_link(@project, User.current) %>
+ <% end %>
+
+
+
+ <% if ( !(User.current.member_of? @project) && User.current.login?) %>
+
+ <%= applied_link(@project, User.current) %>
+ <% end %>
+
+
+
+
+ <% if ((User.current.member_of? @project) && User.current.login?) %>
+ <%= exit_project_link(@project) %>
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 004aabc51..eea7a0f61 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -74,20 +74,9 @@
<% end %>
-
-
- <% if ( !(User.current.member_of? @project) && User.current.login?) %>
- <%= watcher_link(@project, User.current) %>
- <% end %>
-
-
-
- <% if ( !(User.current.member_of? @project) && User.current.login?) %>
-
- <%= applied_link(@project, User.current) %>
- <% end %>
+
+ <%= render 'layouts/join_exit_project' %>
-
diff --git a/app/views/projects/exit_project.js.erb b/app/views/projects/exit_project.js.erb
new file mode 100644
index 000000000..709f878be
--- /dev/null
+++ b/app/views/projects/exit_project.js.erb
@@ -0,0 +1 @@
+$('#join_exit_project_div').html("<%= escape_javascript(render(:partial => 'layouts/join_exit_project')) %>");
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 1d7b01d4f..367624f89 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1197,6 +1197,7 @@ en:
label_tags_issue_description: issue description
label_tags_all_objects: all objects
label_apply_project: Apply Project
+ label_exit_project: Exit Project
label_apply_project_waiting: "Application has been submitted, please wait for administrator review."
label_unapply_project: Unsubscribe
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 572862174..cdd0ee9b7 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -1409,6 +1409,7 @@ zh:
label_tags_issue_description: 问题描述
label_tags_all_objects: 所有
label_apply_project: 申请加入
+ label_exit_project: 退出项目
label_apply_project_waiting: 已处理申请,请等待管理员审核
label_unapply_project: 取消申请
diff --git a/config/routes.rb b/config/routes.rb
index 1e75ac23a..9d9b9d13b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -510,6 +510,7 @@ RedmineApp::Application.routes.draw do
get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
get 'projects/:id/repository', :to => 'repositories#show', :path => nil
+ get 'projects/:id/exit', :to => 'projects#exit_project', :as => 'exit_cur_project'
# additional routes for having the file name at the end of url
get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
From e3ab21e4095fa40d9b4be816bed6de11f9def637 Mon Sep 17 00:00:00 2001
From: chenmin <19763783@qq.com>
Date: Mon, 11 Aug 2014 09:19:40 +0800
Subject: [PATCH 05/14] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E7=99=BB?=
=?UTF-8?q?=E9=99=86=E7=9A=84=E7=94=A8=E6=88=B7=E7=9A=84=E5=AD=A6=E6=A0=A1?=
=?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=AF=BE=E7=A8=8B=E6=97=B6=E7=9A=84=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BAbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/course.html.erb | 34 ++++++++++++++++++++++++++++---
1 file changed, 31 insertions(+), 3 deletions(-)
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index 7cab331b6..c33f846e7 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -99,9 +99,36 @@
该学校未开设任何课程,您可以查看其他学校课程
- <% end %>
-
- <% find_all_new_hot_course(9, @school_id).map do |course| %>
+ <% find_all_new_hot_course(9, @school_id).map do |course| %>
+
/,"") %>>
+
+ <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
+
+
+
+
+ <% if (course.school == nil) %>
+
+ <% else %>
+ <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
+ <% end %>
+
+
+ <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
+ <%#=course.try(:teacher).try(:name)%>
+
+
+
+ [<%= get_course_term course %>]
+ <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
+ (<%= "#{memberCount(course)}人" %>)
+ <% files_count = course.attachments.count.to_s %>
+ (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
+
+
+ <% end %>
+ <% else %>
+ <% find_all_new_hot_course(10, @school_id).map do |course| %>
/,"") %>>
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
@@ -129,6 +156,7 @@
<% end %>
+ <% end %>
<% else %>
From 8724b79296a8dc766536bcdb404ce0713474fe4f Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 11 Aug 2014 13:37:54 +0800
Subject: [PATCH 06/14] =?UTF-8?q?=E6=B8=85=E7=90=86=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/_course_list.html.erb | 28 ++++
app/views/welcome/_no_course_title.html.erb | 5 +
app/views/welcome/course.html.erb | 141 +-------------------
3 files changed, 39 insertions(+), 135 deletions(-)
create mode 100644 app/views/welcome/_course_list.html.erb
create mode 100644 app/views/welcome/_no_course_title.html.erb
diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb
new file mode 100644
index 000000000..a72ed1764
--- /dev/null
+++ b/app/views/welcome/_course_list.html.erb
@@ -0,0 +1,28 @@
+<% course_list.map do |course| %>
+ /,"") %>>
+
+ <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
+
+
+
+
+ <% if (course.school == nil) %>
+
+ <% else %>
+ <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
+ <% end %>
+
+
+ <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
+ <%#=course.try(:teacher).try(:name)%>
+
+
+
+ [<%= get_course_term course %>]
+ <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
+ (<%= "#{memberCount(course)}人" %>)
+ <% files_count = course.attachments.count.to_s %>
+ (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
+
+
+<% end %>
diff --git a/app/views/welcome/_no_course_title.html.erb b/app/views/welcome/_no_course_title.html.erb
new file mode 100644
index 000000000..7e6e09520
--- /dev/null
+++ b/app/views/welcome/_no_course_title.html.erb
@@ -0,0 +1,5 @@
+
+
+ 该学校未开设任何课程,您可以查看其他学校课程
+
+
\ No newline at end of file
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index c33f846e7..5fa76174c 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -88,74 +88,13 @@
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %>
-
<% if User.current.logged? %>
-
-
- 该学校未开设任何课程,您可以查看其他学校课程
-
-
- <% find_all_new_hot_course(9, @school_id).map do |course| %>
- - /,"") %>>
-
- <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
-
-
-
-
- <% if (course.school == nil) %>
-
- <% else %>
- <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
- <% end %>
-
-
- <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
- <%#=course.try(:teacher).try(:name)%>
-
-
-
- [<%= get_course_term course %>]
- <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
- (<%= "#{memberCount(course)}人" %>)
- <% files_count = course.attachments.count.to_s %>
- (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
-
-
- <% end %>
+ <%= render "welcome/no_course_title"%>
+ <%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(9, @school_id)} %>
<% else %>
- <% find_all_new_hot_course(10, @school_id).map do |course| %>
- - /,"") %>>
-
- <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
-
-
-
-
- <% if (course.school == nil) %>
-
- <% else %>
- <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
- <% end %>
-
-
- <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
- <%#=course.try(:teacher).try(:name)%>
-
-
-
- [<%= get_course_term course %>]
- <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
- (<%= "#{memberCount(course)}人" %>)
- <% files_count = course.attachments.count.to_s %>
- (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
-
-
- <% end %>
+ <%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(10, @school_id)} %>
<% end %>
@@ -171,80 +110,12 @@
<% end %>
-
- <% school_course.map do |course| %>
- <% if course.school%>
- - /,"") %>>
-
- <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
-
-
-
-
- <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
-
-
- <%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
-
-
-
- [<%= get_course_term course %>]
- <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
- (<%= "#{memberCount(course)}人" %>)
- <% files_count = course.attachments.count.to_s %>
- (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
-
-
-
-
- <%end%>
- <% end; reset_cycle %>
+ <%= render :partial => 'course_list', :locals => {:course_list => school_course} %>
<% if school_course.count < 10 %>
-
-
-
-
- 该学校开设课程较少,您可以查看其他学校课程
-
+ <%= render "welcome/no_course_title"%>
- <% find_all_new_hot_course(10 - school_course.count, @school_id).map do |course| %>
- - /,"") %>>
-
- <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
-
-
-
-
- <% if (course.school == nil) %>
-
- <% else %>
-
- <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
- <% end %>
-
-
- <%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %>
-
-
-
- [<%= get_course_term course %>]
- <%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
- (<%= "#{memberCount(course)}人" %> )
- <% files_count = course.attachments.count.to_i.to_s %>
- (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
-
-
- <% end %>
+ <%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(10 - school_course.count - 1, @school_id)} %>
<% end %>
From f7635370d7a739f30e657acbe417493172e653a1 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 11 Aug 2014 14:49:58 +0800
Subject: [PATCH 07/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=95=88=E7=8E=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/welcome_helper.rb | 6 +++---
app/views/welcome/_course_list.html.erb | 6 +++---
app/views/welcome/_no_course_title.html.erb | 2 +-
app/views/welcome/course.html.erb | 8 +++++---
config/locales/zh.yml | 3 +++
5 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb
index 8ee7f42d8..c60d18537 100644
--- a/app/helpers/welcome_helper.rb
+++ b/app/helpers/welcome_helper.rb
@@ -231,12 +231,12 @@ module WelcomeHelper
# modif by nwb
def find_all_new_hot_course limit = 9 ,school_id = 0
#sort_project_by_hot_rails 1, 'course_ac_para DESC', limit
- time_now = Time.new.strftime("%Y");
+ time_now = Time.new.strftime("%Y")
if school_id
- courses = Course.visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id <>
+ courses = Course.includes(:school).visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id <>
?", school_id).order("course_ac_para DESC").limit(limit).all
else
- courses = Course.visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id is not NULL
+ courses = Course.includes(:school).visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id is not NULL
").order("course_ac_para DESC").limit(limit).all
end
courses
diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb
index a72ed1764..f590cf868 100644
--- a/app/views/welcome/_course_list.html.erb
+++ b/app/views/welcome/_course_list.html.erb
@@ -20,9 +20,9 @@
[<%= get_course_term course %>]
<%= link_to(course.name.truncate(30, omission: '...'), course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
- (<%= "#{memberCount(course)}人" %>)
- <% files_count = course.attachments.count.to_s %>
- (<%= link_to "#{files_count}份", course_files_path(course) %>资料)
+ (<%= course.members.count %>人)
+ <%# files_count = course.attachments.count.to_s %>
+ (<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料)
<% end %>
diff --git a/app/views/welcome/_no_course_title.html.erb b/app/views/welcome/_no_course_title.html.erb
index 7e6e09520..f16b91dba 100644
--- a/app/views/welcome/_no_course_title.html.erb
+++ b/app/views/welcome/_no_course_title.html.erb
@@ -1,5 +1,5 @@
- 该学校未开设任何课程,您可以查看其他学校课程
+ <%= course_title%>
\ No newline at end of file
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index 5fa76174c..c979807b9 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -91,7 +91,9 @@
<% if User.current.logged? %>
- <%= render "welcome/no_course_title"%>
+ -
+ <%= render :partial => 'no_course_title', :locals => {:course_title => l(:lable_school_no_course)} %>
+
<%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(9, @school_id)} %>
<% else %>
<%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(10, @school_id)} %>
@@ -113,9 +115,9 @@
<%= render :partial => 'course_list', :locals => {:course_list => school_course} %>
<% if school_course.count < 10 %>
-
- <%= render "welcome/no_course_title"%>
+ <%= render :partial => 'no_course_title', :locals => {:course_title => l(:lable_school_less_course)} %>
- <%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(10 - school_course.count - 1, @school_id)} %>
+ <%= render :partial => 'course_list', :locals => {:course_list => find_all_new_hot_course(9 - school_course.count, @school_id)} %>
<% end %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index cdd0ee9b7..62a5649a3 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2101,4 +2101,7 @@ zh:
# ajax异步验证
modal_valid_passing: 可以使用
label_bug: 漏洞
+
+ lable_school_no_course: 该学校未开设任何课程,您可以查看其他学校课程
+ lable_school_less_course: 该学校开设课程较少,您可以查看其他学校课程
\ No newline at end of file
From 33855f721d69425024dcdc4482b4b7504a9d2052 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 11 Aug 2014 15:07:56 +0800
Subject: [PATCH 08/14] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=95=88=E7=8E=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/welcome_helper.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb
index c60d18537..48d590c4b 100644
--- a/app/helpers/welcome_helper.rb
+++ b/app/helpers/welcome_helper.rb
@@ -233,10 +233,10 @@ module WelcomeHelper
#sort_project_by_hot_rails 1, 'course_ac_para DESC', limit
time_now = Time.new.strftime("%Y")
if school_id
- courses = Course.includes(:school).visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id <>
+ courses = Course.includes(:school, :members).visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id <>
?", school_id).order("course_ac_para DESC").limit(limit).all
else
- courses = Course.includes(:school).visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id is not NULL
+ courses = Course.includes(:school, :members).visible.joins(:course_status).where("#{Course.table_name}.created_at like '%#{time_now}%' and #{Course.table_name}.school_id is not NULL
").order("course_ac_para DESC").limit(limit).all
end
courses
From b9ee7fe00d25952e9898c78a925c3de9a6434710 Mon Sep 17 00:00:00 2001
From: zhanghaitao <562681745@qq.com>
Date: Mon, 11 Aug 2014 16:39:18 +0800
Subject: [PATCH 09/14] =?UTF-8?q?1.#878=20=E7=BC=BA=E9=99=B7=E8=BE=93?=
=?UTF-8?q?=E5=85=A5=E8=AE=A1=E5=88=92=E5=AE=8C=E6=88=90=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E5=B0=8F=E4=BA=8E=E5=BC=80=E5=A7=8B=E6=97=B6=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=202.=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E9=80=89=E6=8B=A9=E7=9A=84=E6=9C=80=E5=B0=8F=E9=BB=98=E8=AE=A4?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 4 +--
app/views/issues/_attributes.html.erb | 37 +++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 9f8b8fff5..b1006d239 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1300,10 +1300,10 @@ module ApplicationHelper
start_of_week = start_of_week.to_i % 7
tags = javascript_tag(
- "var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: #{start_of_week}, " +
+ "var datepickerOptions={dateFormat: 'yy-mm-dd',minDate: new Date(), firstDay: #{start_of_week}, " +
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
path_to_image('/images/calendar.png') +
- "', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};")
+ "', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true, onClose: function(dateText, inst) {TimeClose(dateText,inst);}, beforeShow : function(input){TimeBeforeShow(input);} };")
jquery_locale = l('jquery.locale', :default => current_language.to_s)
unless jquery_locale == 'en'
tags << javascript_include_tag("i18n/jquery.ui.datepicker-#{jquery_locale}.js")
diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb
index b17283f3b..ebf6dbc91 100644
--- a/app/views/issues/_attributes.html.erb
+++ b/app/views/issues/_attributes.html.erb
@@ -46,6 +46,43 @@
<%= f.text_field :estimated_hours, :size => 3, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('estimated_hours') %> <%= l(:field_hours) %>
<% end %>
-<%= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25,
+<%#= text_area_tag 'content[text]', @text, :cols => 100, :rows => 25,
:class => 'wiki-edit', :accesskey => accesskey(:edit) %>