From 9905f912284c4e635420de6b4fa6b9e9a1a57d89 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 09:46:22 +0800
Subject: [PATCH 01/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9TAG=E4=BA=91=E7=9A=84?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/courses.css | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 1e67e5f8d..b24c9d366 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -508,8 +508,13 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px
.vi_zan{color:#28be6c;}
.newwork_btn a{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; display:block; text-align:center; float:right;}
.newwork_btn a:hover{ background:#329cbd;}
-a.files_tag_icon{ background:#dcdcdc; color:#fff; border:1px solid #c8c8c8; padding:1px 10px; float:left; margin-right:10px; margin-bottom:10px;}
-a:hover.files_tag_icon{ background:#64bdd9; color:#fff; border:1px solid #54aeca; }
+.files_tag{ width:670px; height:22px; overflow:hidden; margin-bottom:10px;}
+a.files_tag_icon{ background:#64bdd9; color:#fff; border:1px solid #54aeca; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
+a:hover.files_tag_icon{ background:#54aeca;}
+
+
+
+
From 94ca6cd2f9d305c2504509a4a39142fd3ccdc0f4 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 10:49:58 +0800
Subject: [PATCH 02/21] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E6=97=B6=E5=A2=9E=E5=8A=A0=E5=AF=86=E7=A0=81=E4=B8=8E=E8=AF=BE?=
=?UTF-8?q?=E6=97=B6=E7=9A=84=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 4 +--
app/services/courses_service.rb | 2 +-
app/views/courses/new.html.erb | 3 +-
public/javascripts/course.js | 40 ++++++++++++++++++++++++---
4 files changed, 41 insertions(+), 8 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 8710b624e..c12f59f21 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -423,7 +423,7 @@ class CoursesController < ApplicationController
@course = cs.create_course(params,User.current)[:course]
if @course.new_record?
respond_to do |format|
- format.html { render :action => 'new', :layout => 'base' } #Added by young
+ format.html { render :action => 'new', :layout => 'new_base' } #Added by young
format.api { render_validation_errors(@course) }
end
else
@@ -493,7 +493,7 @@ class CoursesController < ApplicationController
respond_to do |format|
format.html {
- render :layout => 'base'
+ render :layout => 'new_base'
}
format.api {
}
diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb
index aa216d755..95bf5feba 100644
--- a/app/services/courses_service.rb
+++ b/app/services/courses_service.rb
@@ -198,7 +198,7 @@ class CoursesService
@course.school_id = current_user.user_extensions.school_id
@course.setup_time = params[:setup_time]
@course.endup_time = params[:endup_time]
- @course.class_period = params[:class_period]
+ @course.class_period = params[:class_period].to_i
params[:course][:is_public] ? @course.is_public = 1 : @course.is_public = 0
params[:course][:open_student] ? @course.open_student = 1 : @course.open_student = 0
end
diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb
index 0ea51d5f4..75979d9f3 100644
--- a/app/views/courses/new.html.erb
+++ b/app/views/courses/new.html.erb
@@ -25,8 +25,9 @@
-
+
显示明码
+
学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index c2a5da03d..74ec4f362 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -80,9 +80,18 @@ function regex_course_class_period()
return false;
}
else if (regex.test(class_period)) {
- $("#course_class_period_notice").html("");
- $("#course_class_period_notice").hide();
- return true;
+ if(parseInt(class_period) > 0)
+ {
+ $("#course_class_period_notice").html("");
+ $("#course_class_period_notice").hide();
+ return true;
+ }
+ else
+ {
+ $("#course_class_period_notice").html("学时总数必须大于0");
+ $("#course_class_period_notice").show();
+ return false;
+ }
}
else
{
@@ -91,10 +100,33 @@ function regex_course_class_period()
return false;
}
}
+
+function regex_course_password()
+{
+ var class_period = $.trim($("#course_course_password").val());
+ var regex = /^\w+$/;
+ if(class_period.length == 0)
+ {
+ $("#course_course_password_notice").html("课程密码不能为空");
+ $("#course_course_password_notice").show();
+ return false;
+ }
+ else if (regex.test(class_period)) {
+ $("#course_course_password_notice").html("");
+ $("#course_course_password_notice").hide();
+ return true;
+ }
+ else
+ {
+ $("#course_course_password_notice").html("课程密码有非法字符");
+ $("#course_course_password_notice").show();
+ return false;
+ }
+}
//提交新建课程
function submit_new_course()
{
- if(regex_course_name()&®ex_course_class_period())
+ if(regex_course_name()&®ex_course_class_period()&®ex_course_class_period()&®ex_course_password())
{
$("#new_course").submit();
}
From 2db3ab9d1385a01a310de5b408dcd8e321edc671 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 10:56:48 +0800
Subject: [PATCH 03/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E6=97=B6=E5=A2=9E=E5=8A=A0=E5=AF=86=E7=A0=81=E4=B8=8E=E8=AF=BE?=
=?UTF-8?q?=E6=97=B6=E7=9A=84=E9=AA=8C=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/courses_service.rb | 2 +-
app/views/courses/settings.html.erb | 3 ++-
public/javascripts/course.js | 6 +++---
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb
index 95bf5feba..6f207d76d 100644
--- a/app/services/courses_service.rb
+++ b/app/services/courses_service.rb
@@ -245,7 +245,7 @@ class CoursesService
#course.safe_attributes = params[:course]
course.time = params[:time]
course.term = params[:term]
- course.class_period = params[:class_period]
+ course.class_period = params[:class_period].to_i
params[:course][:is_public] ? course.is_public = 1 : course.is_public = 0
params[:course][:open_student] ? course.open_student = 1 : course.open_student = 0
if course.save
diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb
index acc6c12a5..2907ee0ac 100644
--- a/app/views/courses/settings.html.erb
+++ b/app/views/courses/settings.html.erb
@@ -39,8 +39,9 @@
-
+
显示明码
+
学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 74ec4f362..8a16def1d 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -100,7 +100,7 @@ function regex_course_class_period()
return false;
}
}
-
+//验证密码
function regex_course_password()
{
var class_period = $.trim($("#course_course_password").val());
@@ -126,7 +126,7 @@ function regex_course_password()
//提交新建课程
function submit_new_course()
{
- if(regex_course_name()&®ex_course_class_period()&®ex_course_class_period()&®ex_course_password())
+ if(regex_course_name()&®ex_course_class_period()&®ex_course_password())
{
$("#new_course").submit();
}
@@ -134,7 +134,7 @@ function submit_new_course()
function submit_edit_course(id)
{
- if(regex_course_name()&®ex_course_class_period())
+ if(regex_course_name()&®ex_course_class_period()&®ex_course_password())
{
$("#edit_course_"+id).submit();
}
From e334dd69f8852ebf61de5b91357b0149d795a6cd Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 11:14:06 +0800
Subject: [PATCH 04/21] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=AF=BE=E4=BB=B6?=
=?UTF-8?q?=E5=90=8ETAG=E4=BA=91=E6=B6=88=E5=A4=B1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 12d1f6856..1e51d7dd2 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -387,6 +387,7 @@ class FilesController < ApplicationController
@containers = [Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
show_attachments @containers
+ @tag_list = attachment_tag_list @all_attachments
@attachtype = 0
@contenttype = 0
From b7e9442800ea2f4f931fca5e7b8556507189fbb5 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 14:01:58 +0800
Subject: [PATCH 05/21] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=81=E5=88=A0?=
=?UTF-8?q?=E9=99=A4TAG=E4=BA=91=E6=97=B6TAG=E4=BA=91=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=88=B7=E6=96=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/tags_controller.rb | 17 +++++++++++++++++
app/helpers/application_helper.rb | 9 +++++++++
app/helpers/files_helper.rb | 8 --------
app/views/files/_course_list.html.erb | 8 ++------
app/views/files/_tag_yun.html.erb | 5 +++++
app/views/tags/remove_tag_new.js.erb | 2 ++
app/views/tags/tag_save.js.erb | 12 +++++++-----
7 files changed, 42 insertions(+), 19 deletions(-)
create mode 100644 app/views/files/_tag_yun.html.erb
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index e26901320..d4399e464 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -220,6 +220,15 @@ class TagsController < ApplicationController
@tag = ActsAsTaggableOn::Tag.find_by_id(@tag_id)
@tag.delete unless @tag.nil?
end
+
+ if @obj && @object_flag == '6' && @obj.container.kind_of?(Course)
+ @course = @obj.container
+ all_attachments = @course.attachments.select{|attachment| attachment.is_public? ||
+ (attachment.container_type == "Course" && User.current.member_of_course?(@course))||
+ attachment.author_id == User.current.id
+ }
+ @tag_list = attachment_tag_list all_attachments
+ end
# end
end
end
@@ -263,6 +272,14 @@ class TagsController < ApplicationController
else
logger.error "#{__FILE__}:#{__LINE__} ===> #{@obj.errors.try(:full_messages)}"
end
+ if @obj && @obj_flag == '6' && @obj.container.kind_of?(Course)
+ @course = @obj.container
+ all_attachments = @course.attachments.select{|attachment| attachment.is_public? ||
+ (attachment.container_type == "Course" && User.current.member_of_course?(@course))||
+ attachment.author_id == User.current.id
+ }
+ @tag_list = attachment_tag_list all_attachments
+ end
respond_to do |format|
format.js
format.html
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 095d0ada5..5782d4bc8 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2097,4 +2097,13 @@ module ApplicationHelper
request.env["HTTP_USER_AGENT"] =~ /MSIE 8.0/
end
+
+ #获取指定资源列表的TAG的集合以及每个TAG的数量,降序排序
+ def attachment_tag_list attachments
+ tag_list = Hash.new
+ attachments.each do |attachment|
+ attachment.tag_list.map{|tag| tag_list.has_key?(tag) ? tag_list[tag] = tag_list[tag] + 1 : tag_list[tag] = 1}
+ end
+ tag_list.sort {|a,b| b[1]<=>a[1]}
+ end
end
diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb
index 0be59c0da..d69f13a29 100644
--- a/app/helpers/files_helper.rb
+++ b/app/helpers/files_helper.rb
@@ -120,14 +120,6 @@ module FilesHelper
result
end
- def attachment_tag_list attachments
- tag_list = Hash.new
- attachments.each do |attachment|
- attachment.tag_list.map{|tag| tag_list.has_key?(tag) ? tag_list[tag] = tag_list[tag] + 1 : tag_list[tag] = 1}
- end
- tag_list.sort {|a,b| b[1]<=>a[1]}
- end
-
def get_attachments_by_tag attachments,tag
attachments.each do |attachment|
attachment.tag_list.include?(tag)
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb
index 5bbb8757d..c726d63e7 100644
--- a/app/views/files/_course_list.html.erb
+++ b/app/views/files/_course_list.html.erb
@@ -15,12 +15,8 @@
-
- <% unless @tag_list.nil?%>
- <% @tag_list.each do |k,v|%>
-
<%= k%>(<%= v%>)
- <% end%>
- <% end%>
+
+ <%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course}%>
diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb
new file mode 100644
index 000000000..f78ea6cdf
--- /dev/null
+++ b/app/views/files/_tag_yun.html.erb
@@ -0,0 +1,5 @@
+<% unless tag_list.nil?%>
+ <% tag_list.each do |k,v|%>
+
<%= k%>(<%= v%>)
+ <% end%>
+<% end%>
\ No newline at end of file
diff --git a/app/views/tags/remove_tag_new.js.erb b/app/views/tags/remove_tag_new.js.erb
index 01edf3e1c..35361fc7d 100644
--- a/app/views/tags/remove_tag_new.js.erb
+++ b/app/views/tags/remove_tag_new.js.erb
@@ -3,6 +3,8 @@
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
+
+$("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course}) %>");
<% end %>
<% if @object_flag == "10"%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
diff --git a/app/views/tags/tag_save.js.erb b/app/views/tags/tag_save.js.erb
index c7dbec65d..31ee40a42 100644
--- a/app/views/tags/tag_save.js.erb
+++ b/app/views/tags/tag_save.js.erb
@@ -5,11 +5,13 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
<% elsif @obj_flag == '6'%>
-$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
-$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
- :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
-$("#tags_name_<%=@obj.id%>").val("");
-$("#add_tag_<%=@obj.id%>").hide();
+ $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
+ $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
+ :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
+ $("#tags_name_<%=@obj.id%>").val("");
+ $("#add_tag_<%=@obj.id%>").hide();
+
+ $("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course}) %>");
<% elsif @obj_flag == '9'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
From a2b529b38bf918bf750aba2f8f86a6f1ec62170c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 14:12:37 +0800
Subject: [PATCH 06/21] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=B7=BB=E5=8A=A0TAG?=
=?UTF-8?q?=E5=90=8E=E5=88=A0=E9=99=A4TAG=E6=8C=89=E9=92=AE=E6=B6=88?=
=?UTF-8?q?=E5=A4=B1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/tags/tag_save.js.erb | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/app/views/tags/tag_save.js.erb b/app/views/tags/tag_save.js.erb
index 31ee40a42..2c0c398f4 100644
--- a/app/views/tags/tag_save.js.erb
+++ b/app/views/tags/tag_save.js.erb
@@ -5,13 +5,19 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
<% elsif @obj_flag == '6'%>
- $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
- $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
- :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
+ <%if @course%>
+ $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
+ $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list',
+ :locals => {:obj => @obj,:object_flag => @obj_flag}) %>');
+ $("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course}) %>");
+ <%else%>
+ $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
+ $("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
+ :locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
+ <%end%>
+
$("#tags_name_<%=@obj.id%>").val("");
$("#add_tag_<%=@obj.id%>").hide();
-
- $("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course}) %>");
<% elsif @obj_flag == '9'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
From 5649f4c5a166afac906ca5b5b1b2eefdf0635b6a Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 14:21:05 +0800
Subject: [PATCH 07/21] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E4=B9=8B=E5=90=8E?=
=?UTF-8?q?=E7=8E=B0=E5=9C=A8=E6=89=80=E6=9C=89=E7=9A=84TAG=E4=BA=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 5 +++--
app/controllers/tags_controller.rb | 12 ++----------
app/helpers/application_helper.rb | 10 ++++++++++
3 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index 1e51d7dd2..8b1c8ba32 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -79,7 +79,8 @@ class FilesController < ApplicationController
@result = find_course_attache q,@course,sort
@result = visable_attachemnts @result
@searched_attach = paginateHelper @result,10
- @tag_list = attachment_tag_list @result
+
+ @tag_list = get_course_tag_list @course
end
#rescue Exception => e
# #render 'stores'
@@ -541,7 +542,7 @@ class FilesController < ApplicationController
@result = visable_attachemnts @result
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)}
@searched_attach = paginateHelper @result,10
- @tag_list = attachment_tag_list @result
+ @tag_list = get_course_tag_list @course
respond_to do |format|
format.js
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index d4399e464..f1c9451bf 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -223,11 +223,7 @@ class TagsController < ApplicationController
if @obj && @object_flag == '6' && @obj.container.kind_of?(Course)
@course = @obj.container
- all_attachments = @course.attachments.select{|attachment| attachment.is_public? ||
- (attachment.container_type == "Course" && User.current.member_of_course?(@course))||
- attachment.author_id == User.current.id
- }
- @tag_list = attachment_tag_list all_attachments
+ @tag_list = get_course_tag_list @course
end
# end
end
@@ -274,11 +270,7 @@ class TagsController < ApplicationController
end
if @obj && @obj_flag == '6' && @obj.container.kind_of?(Course)
@course = @obj.container
- all_attachments = @course.attachments.select{|attachment| attachment.is_public? ||
- (attachment.container_type == "Course" && User.current.member_of_course?(@course))||
- attachment.author_id == User.current.id
- }
- @tag_list = attachment_tag_list all_attachments
+ @tag_list = @tag_list = get_course_tag_list @course
end
respond_to do |format|
format.js
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 5782d4bc8..9c9c96ce5 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2106,4 +2106,14 @@ module ApplicationHelper
end
tag_list.sort {|a,b| b[1]<=>a[1]}
end
+
+ #获取课程资源的TAG云
+ def get_course_tag_list course
+ all_attachments = course.attachments.select{|attachment| attachment.is_public? ||
+ (attachment.container_type == "Course" && User.current.member_of_course?(course))||
+ attachment.author_id == User.current.id
+ }
+ tag_list = attachment_tag_list all_attachments
+ tag_list
+ end
end
From 05c74960a8f2773eaefb6e26fc3338f1bf264337 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 15:01:37 +0800
Subject: [PATCH 08/21] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0=E5=BD=93?=
=?UTF-8?q?=E5=89=8D=E9=80=89=E6=8B=A9=E7=9A=84TAG=E4=BA=91=E7=9A=84?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=202=E3=80=81=E5=BD=93=E9=80=89=E6=8B=A9TAG?=
=?UTF-8?q?=E4=BA=91=E8=BF=87=E6=BB=A4=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=AF=B9?=
=?UTF-8?q?TAG=E8=BF=9B=E8=A1=8C=E6=B7=BB=E5=8A=A0=E3=80=81=E5=88=A0?=
=?UTF-8?q?=E9=99=A4=E6=93=8D=E4=BD=9C=E6=97=B6=E7=BB=A7=E7=BB=AD=E9=80=89?=
=?UTF-8?q?=E4=B8=AD=E8=AF=A5TAG?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/tags_controller.rb | 2 ++
app/views/files/_course_list.html.erb | 6 +++---
app/views/files/_tag_yun.html.erb | 6 +++++-
app/views/tags/_tag_add.html.erb | 2 ++
app/views/tags/_tag_list.html.erb | 3 ++-
app/views/tags/_tag_new.html.erb | 3 ++-
app/views/tags/remove_tag_new.js.erb | 4 ++--
app/views/tags/tag_save.js.erb | 4 ++--
8 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index f1c9451bf..253faa2b1 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -224,12 +224,14 @@ class TagsController < ApplicationController
if @obj && @object_flag == '6' && @obj.container.kind_of?(Course)
@course = @obj.container
@tag_list = get_course_tag_list @course
+ @select_tag_name = params[:select_tag_name]
end
# end
end
end
def tag_save
+ @select_tag_name = params[:tag_for_save][:tag_name]
@tags = params[:tag_for_save][:name]
@obj_id = params[:tag_for_save][:object_id]
@obj_flag = params[:tag_for_save][:object_flag]
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb
index c726d63e7..42f51e07a 100644
--- a/app/views/files/_course_list.html.erb
+++ b/app/views/files/_course_list.html.erb
@@ -16,7 +16,7 @@
- <%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course}%>
+ <%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course,:tag_name => @tag_name}%>
@@ -52,8 +52,8 @@
- <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
- <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
+ <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
+ <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb
index f78ea6cdf..c9ac1999f 100644
--- a/app/views/files/_tag_yun.html.erb
+++ b/app/views/files/_tag_yun.html.erb
@@ -1,5 +1,9 @@
<% unless tag_list.nil?%>
<% tag_list.each do |k,v|%>
- <%= k%>(<%= v%>)
+ <% if tag_name && tag_name == k%>
+ <%= k%>(<%= v%>)
+ <% else%>
+ <%= k%>(<%= v%>)
+ <% end%>
<% end%>
<% end%>
\ No newline at end of file
diff --git a/app/views/tags/_tag_add.html.erb b/app/views/tags/_tag_add.html.erb
index f8cac7c0d..ad97cd693 100644
--- a/app/views/tags/_tag_add.html.erb
+++ b/app/views/tags/_tag_add.html.erb
@@ -9,6 +9,8 @@
<%= f.text_field :name ,:id => "tags_name_#{obj.id}",:size=>"28",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class => "isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
+ <% tag_name ||= ""%>
+ <%= f.text_field :tag_name,:value=> tag_name,:style=>"display:none"%>
<%= f.submit "",:class => "submit f_l" %>
<% end %>
diff --git a/app/views/tags/_tag_list.html.erb b/app/views/tags/_tag_list.html.erb
index e18dafd7d..b512f1ef3 100644
--- a/app/views/tags/_tag_list.html.erb
+++ b/app/views/tags/_tag_list.html.erb
@@ -12,8 +12,9 @@
<% end %>
<% when '6' %>
<% if obj.author_id == User.current.id || User.current.admin?%>
+ <% select_tag_name ||= ""%>
<%= link_to 'x', :controller => "tags", :action => "remove_tag_new", :remote => true, :tag_name => tag,
- :taggable_id => obj.id, :taggable_type => object_flag %>
+ :taggable_id => obj.id, :taggable_type => object_flag, :select_tag_name => select_tag_name %>
<% end %>
<% end %>
diff --git a/app/views/tags/_tag_new.html.erb b/app/views/tags/_tag_new.html.erb
index 0d5d371e3..bbedaff78 100644
--- a/app/views/tags/_tag_new.html.erb
+++ b/app/views/tags/_tag_new.html.erb
@@ -21,7 +21,8 @@
<% elsif object_flag == '6' %>
- <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag} %>
+ <% tag_name ||= ""%>
+ <%= render :partial => "tags/tag_list",:locals => {:obj => obj,:object_flag => object_flag,:select_tag_name => tag_name} %>
<%= render :partial => "courses/course_resources_html", :locals => {:obj => obj ,:object_flag => object_flag } %>
diff --git a/app/views/tags/remove_tag_new.js.erb b/app/views/tags/remove_tag_new.js.erb
index 35361fc7d..9a43dd9b4 100644
--- a/app/views/tags/remove_tag_new.js.erb
+++ b/app/views/tags/remove_tag_new.js.erb
@@ -2,9 +2,9 @@
<% if @object_flag == "6"%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list',
- :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
+ :locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag,:select_tag_name => @select_tag_name}) %>');
-$("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course}) %>");
+$("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @select_tag_name}) %>");
<% end %>
<% if @object_flag == "10"%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
diff --git a/app/views/tags/tag_save.js.erb b/app/views/tags/tag_save.js.erb
index 2c0c398f4..74a38c99d 100644
--- a/app/views/tags/tag_save.js.erb
+++ b/app/views/tags/tag_save.js.erb
@@ -8,8 +8,8 @@ $('#name-issue').val("");
<%if @course%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list',
- :locals => {:obj => @obj,:object_flag => @obj_flag}) %>');
- $("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course}) %>");
+ :locals => {:obj => @obj,:object_flag => @obj_flag,:select_tag_name => @select_tag_name}) %>');
+ $("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @select_tag_name}) %>");
<%else%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
From 4202ec4bad486c956d7b03ec777892cb7e24f90c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 15:27:49 +0800
Subject: [PATCH 09/21] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/application.css | 6 ------
1 file changed, 6 deletions(-)
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index b42efdabd..4b6b681c7 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -641,7 +641,6 @@ span.forums-avatar-right{
/*added by bai*/
.user_underlinescore{
margin: 1px;
- padding: 1px;
width:700px;
height:1px;
background-color:#15bccf;
@@ -1106,7 +1105,6 @@ ul.user_course_sort li{list-style-type:none;
}
.user_underline{
margin:1px;
- padding:1px;
width:240px;
height:1px;
background-color:#15bccf;
@@ -1126,7 +1124,6 @@ ul.user_course_sort li{list-style-type:none;
.user_underline2{
margin:1px;
- padding:1px;
width:240px;
height:1px;
background-color:#c6e9fe;
@@ -1134,7 +1131,6 @@ ul.user_course_sort li{list-style-type:none;
}
.user_underline3{
margin: 1px;
- padding:1px;
width:120px;
height:1px;
background-color:#c6e9fe;
@@ -1143,7 +1139,6 @@ ul.user_course_sort li{list-style-type:none;
}
.homepage_underline{
margin:1px;
- padding:1px;
width:240px;
height:1px;
background-color:#c6e9fe;
@@ -3063,7 +3058,6 @@ div.repos_explain{
/* new linchun compitition */
.contest_underline{
margin:1px;
- padding:1px;
width:900px;
height:0.5px;
background-color:#aaa;
From 6983764c445600847c7a80560056e7b44d18c4d3 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 15:41:50 +0800
Subject: [PATCH 10/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=90=8D=E7=A7=B0=E8=BF=87=E9=95=BF=E6=97=B6=E7=9A=84=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_courses.html.erb | 4 ++--
public/stylesheets/public.css | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index dec4a5f4d..dc384834c 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -35,7 +35,7 @@
<%= l(:label_courses_community)%>
-
+
<%= l(:label_user_location) %> :
<%= link_to l(:field_homepage), home_path %>
>
@@ -80,7 +80,7 @@
-
+
<%= @course.name %>
<% if @course.is_public == 0%>
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 45568c913..9d714b1de 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -279,6 +279,7 @@ a:hover.close_btn {background-position:-66px 0;}
.show_btn {background-position:-119px 0;}
.msgserver a {color:#15bccf; }
.break_word{word-break: break-all;word-wrap: break-word;}
+.hiddent{ overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.break_word_firefox{white-space: pre-wrap;word-break: break-all;}
From 45d5f9e58b1c01023141379cf51cf0040c6a442c Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Thu, 16 Apr 2015 15:48:15 +0800
Subject: [PATCH 11/21] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=90=9C=E7=B4=A2?=
=?UTF-8?q?=E6=8C=89=E6=97=B6=E9=97=B4=E5=80=92=E5=BA=8F=E6=8E=92=E5=BA=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/courses_service.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb
index 6f207d76d..e91883bee 100644
--- a/app/services/courses_service.rb
+++ b/app/services/courses_service.rb
@@ -40,9 +40,9 @@ class CoursesService
end
@courses = courses_all.visible(current_user)
if params[:name].present?
- @courses_all = @courses.like(params[:name])
+ @courses_all = @courses.like(params[:name]).order("created_at desc")
else
- @courses_all = @courses;
+ @courses_all = @courses.order("created_at desc");
end
@courses_all
course_list = []
From e4597f9ccc6d5ea3f878595076c1188ffde1af0b Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Thu, 16 Apr 2015 15:48:34 +0800
Subject: [PATCH 12/21] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9C=9F=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/users_service.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/services/users_service.rb b/app/services/users_service.rb
index 63dd725cd..c1f716fd1 100644
--- a/app/services/users_service.rb
+++ b/app/services/users_service.rb
@@ -77,7 +77,7 @@ class UsersService
gender = @user.user_extensions.gender.nil? ? 0 : @user.user_extensions.gender
work_unit = get_user_work_unit @user
location = get_user_location @user
- {:id => @user.id, :img_url => img_url, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction}
+ {:id => @user.id, :img_url => img_url,:realname => @user.realname, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction}
end
#忘记密码
From 61a938ef39a636bea141be413f15f95676dd218b Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Thu, 16 Apr 2015 15:48:53 +0800
Subject: [PATCH 13/21] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9C=9F=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/api/mobile/entities/user.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/api/mobile/entities/user.rb b/app/api/mobile/entities/user.rb
index 9112e7ec5..6b0064036 100644
--- a/app/api/mobile/entities/user.rb
+++ b/app/api/mobile/entities/user.rb
@@ -34,6 +34,8 @@ module Mobile
user_expose :img_url
#昵称
expose :nickname
+ #真名
+ expose :realname
#性别
user_expose :gender
#我的二维码
From ca1e902a8f66a9ef49ddadd8abb62dffd83b31c2 Mon Sep 17 00:00:00 2001
From: whimlex
Date: Thu, 16 Apr 2015 16:39:52 +0800
Subject: [PATCH 14/21] =?UTF-8?q?#2279=20=E6=90=9C=E7=B4=A2=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E8=BF=9B=E5=85=A5=E7=BB=93=E6=9E=9C=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=EF=BC=8C=E5=A6=82=E5=9B=BE=EF=BC=8C=E5=BB=BA=E8=AE=AE=E5=B0=86?=
=?UTF-8?q?=E2=80=9C=E6=8E=88=E8=AF=BE=E6=97=B6=E9=97=B4=E2=80=9D=E4=B8=8E?=
=?UTF-8?q?=E2=80=9C=E8=AF=BE=E7=A8=8B=E7=AE=80=E4=BB=8B=E2=80=9D=E4=B8=8E?=
=?UTF-8?q?=E4=B8=8A=E9=9D=A2=E7=9A=84=E2=80=9C=E8=AF=BE=E7=A8=8B=E5=90=8D?=
=?UTF-8?q?=E7=A7=B0=E2=80=9D=E7=AD=89=E4=BF=A1=E6=81=AF=E5=AF=B9=E9=BD=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/courses/_course.html.erb | 19 +++++---
app/views/courses/show.html.erb | 2 +-
app/views/welcome/course.html.erb | 43 ++++++++++++-------
.../stylesheets/application.css | 8 ++--
4 files changed, 45 insertions(+), 27 deletions(-)
diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb
index abcbbfe5b..8974c3089 100644
--- a/app/views/courses/_course.html.erb
+++ b/app/views/courses/_course.html.erb
@@ -33,6 +33,15 @@
<% end %>
+
+ <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%>
+ <%= get_course_term @course %>
+
+
+ <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %>
+ <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
+
+
@@ -71,15 +80,13 @@
-
- <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%>
- <%= get_course_term @course %>
-
+ <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%>
+ <%= get_course_term @course %>
- <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %>
- <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
+ <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %>
+ <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index a764c6eb8..5c57a5ba1 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -39,21 +39,12 @@
+ <% if User.current.login? %>
- <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %>
- ,
-
- <%= l(:label_welcome_trustie_course_description) %>
-
- <% else %>
- <% if @school_id == "0" %>
-
+ <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %>
<% else %>
+ <% if @school_id == "0" %>
+ <% else %>
<% if @school_id.nil? %>
<%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
@@ -61,10 +52,20 @@
<%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<% end %>
+ <% end %>
<% end %>
- <% end %>
- <% unless @course_page.nil? %>
+
+
+ <%= l(:label_welcome_trustie_course) %>
+
+ <% else %>
+ <% unless @course_page.nil? %>
<%= l(:label_welcome_trustie_course) %>
-
+ ,
+
+ <%= l(:label_welcome_trustie_course_description) %>
+
+ <% end %>
<% end %>
+
<%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course} %>
diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css
index 6d4cc658e..1e50e41ca 100644
--- a/public/themes/redpenny-master/stylesheets/application.css
+++ b/public/themes/redpenny-master/stylesheets/application.css
@@ -1057,7 +1057,7 @@ display: block;
float: left;
margin-left: 20px;
margin-top: 10px;
-width: 470px;
+width: 540px;
font-family: '微软雅黑'; /*modify by men*/
color: rgb(0, 0, 0);
font-size: 13px;
@@ -1085,7 +1085,7 @@ float: left;
}*/
.information_for_course {
margin-top: 20px;
- margin-left: 507px;
+ margin-left: 550px;
float: left;
height: auto;
width: 300px;
@@ -2008,10 +2008,10 @@ div.tableline{
text-align: justify;
}
.brief_introduction {
- margin-top: -18px;
+ margin-top: -30px;
margin-left: 60px;
/*display: inline-block;*/
- width: 500px;
+ width: 480px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
From 65bcaef911418ca1bfb771a0042b38c57c20a631 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 16:39:58 +0800
Subject: [PATCH 15/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9TAG=E4=BA=91=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/files/_tag_yun.html.erb | 4 ++--
public/stylesheets/courses.css | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb
index c9ac1999f..9db34ece4 100644
--- a/app/views/files/_tag_yun.html.erb
+++ b/app/views/files/_tag_yun.html.erb
@@ -1,9 +1,9 @@
<% unless tag_list.nil?%>
<% tag_list.each do |k,v|%>
<% if tag_name && tag_name == k%>
-
<%= k%>(<%= v%>)
+
<%= k%>×<%= v%>
<% else%>
-
<%= k%>(<%= v%>)
+
<%= k%>×<%= v%>
<% end%>
<% end%>
<% end%>
\ No newline at end of file
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index b24c9d366..5bdc21e92 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -117,9 +117,9 @@ a:hover.re_fabu{background:#55a1b9;}
.re_con{ margin:5px; width:665px;}
.re_con_top{color:#494949; }
.re_con_top span{ color:#999999; font-weight:bold;}
-a.re_select{ display:block; height:20px; border:1px solid #ff9900; color:#ff9900; margin-left:10px; padding:2px 5px 1px;}
+a.re_select{ display:block; border:1px solid #ff9900; color:#ff9900; margin-left:10px; padding:1px 5px;}
a:hover.re_select{ background:#ff9900; color:#fff; text-decoration:none;}
-a.re_open{display:block; width:46px; height:19px; border:1px solid #64bdd9; color:#64bdd9; margin-left:10px;padding-top:3px;}
+a.re_open{display:block; width:46px; border:1px solid #64bdd9; color:#64bdd9; margin-left:10px;padding:1px 5px;}
a:hover.re_open{ background:#64bdd9; color:#fff; text-decoration:none;}
a.re_de{ color:#6883b6; margin-left:15px;}
.re_con_box{ border-bottom:1px dashed #dadada; padding-bottom:10px; margin-bottom:10px;}
@@ -509,8 +509,8 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px
.newwork_btn a{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 10px; display:block; text-align:center; float:right;}
.newwork_btn a:hover{ background:#329cbd;}
.files_tag{ width:670px; height:22px; overflow:hidden; margin-bottom:10px;}
-a.files_tag_icon{ background:#64bdd9; color:#fff; border:1px solid #54aeca; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
-a:hover.files_tag_icon{ background:#54aeca;}
+a.files_tag_icon{ background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
+a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
From 57a5191fe560d1a16b6f5fb692dec39f03ff7fa6 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 16:55:24 +0800
Subject: [PATCH 16/21] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/files/_course_list.html.erb | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb
index 42f51e07a..888910ac1 100644
--- a/app/views/files/_course_list.html.erb
+++ b/app/views/files/_course_list.html.erb
@@ -25,27 +25,27 @@
<% if file.is_public? || User.current.member_of_course?(course) %>
- <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
+ <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %>
<% if User.current.logged? %>
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
- <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %>
+ <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
- <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
+ <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %>
<% else %>
<% end %>
<% else %>
- <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %>
+ <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% end %>
<% else %>
<% end %>
-
文件大小:<%= number_to_human_size(file.filesize) %>
+
文件大小:<%= number_to_human_size(file.filesize) %>
<%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>
<%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %>
From 11a4febecb521eb9f47ad1c614481f16e992555f Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 17:01:47 +0800
Subject: [PATCH 17/21] =?UTF-8?q?=E8=B0=83=E6=95=B4course.css?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/courses.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 5bdc21e92..3307d26e7 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -510,7 +510,7 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px
.newwork_btn a:hover{ background:#329cbd;}
.files_tag{ width:670px; height:22px; overflow:hidden; margin-bottom:10px;}
a.files_tag_icon{ background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
-a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
+a.files_tag_select{ background:#64bdd9; color:#fff; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
From b040981c2264442ae72af01971bd5cba8c9f1cb5 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 16 Apr 2015 17:07:43 +0800
Subject: [PATCH 18/21] =?UTF-8?q?=E8=B0=83=E6=95=B4course.css?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/courses.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 3307d26e7..246622b78 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -510,7 +510,7 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px
.newwork_btn a:hover{ background:#329cbd;}
.files_tag{ width:670px; height:22px; overflow:hidden; margin-bottom:10px;}
a.files_tag_icon{ background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
-a.files_tag_select{ background:#64bdd9; color:#fff; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
+a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #64bdd9; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
From 8a26fd4343bc4dd0ef78c7b56c78bb0e1d82b0d7 Mon Sep 17 00:00:00 2001
From: z9hang
Date: Thu, 16 Apr 2015 17:28:08 +0800
Subject: [PATCH 19/21] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=EF=BC=9A=E6=88=90=E5=91=98=E9=85=8D=E7=BD=AE=E5=A4=84=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E6=90=9C=E7=B4=A0=E6=88=90=E5=91=98=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 17 ++++++++++++++-
app/views/courses/_course_members.html.erb | 11 ++++++++++
app/views/courses/search_member.js.erb | 1 +
config/locales/courses/zh.yml | 6 +++++-
config/routes.rb | 1 +
lib/redmine.rb | 2 +-
public/javascripts/course.js | 25 ++++++++++++++++++++++
public/stylesheets/courses.css | 2 ++
8 files changed, 62 insertions(+), 3 deletions(-)
create mode 100644 app/views/courses/search_member.js.erb
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index c12f59f21..c4ef0fe60 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -20,7 +20,7 @@ class CoursesController < ApplicationController
before_filter :can_show_course, :except => []
before_filter :logged_user_by_apptoken,:only => [:show,:new_homework,:feedback]
before_filter :find_course, :except => [ :index, :search,:list, :new,:join,:unjoin, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_private_courses]
- before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course]
+ before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course,:search_member]
before_filter :authorize_course_global, :only => [:view_homework_attaches, :new,:create]
before_filter :require_admin, :only => [:copy, :archive, :unarchive, :destroy, :calendar]
before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
@@ -418,6 +418,21 @@ class CoursesController < ApplicationController
end
+ def search_member
+ if User.current.allowed_to?(:as_teacher,@course)
+ q = "#{params[:q].strip}"
+ @roles = Role.givable.all[3..5]
+ if q.nil? || q == ""
+ @members = @course.member_principals.includes(:roles, :principal).all.sort
+ else
+ @members = searchmember_by_name(@course.member_principals.includes(:roles, :principal).all.sort,q)
+ end
+
+ else
+ render_403
+ end
+ end
+
def create
cs = CoursesService.new
@course = cs.create_course(params,User.current)[:course]
diff --git a/app/views/courses/_course_members.html.erb b/app/views/courses/_course_members.html.erb
index 38ef7e9db..db6ec4b55 100644
--- a/app/views/courses/_course_members.html.erb
+++ b/app/views/courses/_course_members.html.erb
@@ -1,3 +1,14 @@
+
+ <%= form_tag({:controller => 'courses', :action => 'search_member'},:id => "course_member_search_form", :method => :get, :class => "search_form_course",:remote => true) do %>
+
+ <%= text_field_tag 'q', params[:q], :placeholder => l(:label_user_name), :class => "search_text fl" %>
+
+ <%= l(:label_search)%>
+
+
+
+ <% end %>
+
-
diff --git a/app/views/courses/search_member.js.erb b/app/views/courses/search_member.js.erb
new file mode 100644
index 000000000..a8fa0b986
--- /dev/null
+++ b/app/views/courses/search_member.js.erb
@@ -0,0 +1 @@
+$("#course_member_list").html("<%= escape_javascript(render :partial => "courses/member") %>");
\ No newline at end of file
diff --git a/config/locales/courses/zh.yml b/config/locales/courses/zh.yml
index 30144bf1d..e0a39f51d 100644
--- a/config/locales/courses/zh.yml
+++ b/config/locales/courses/zh.yml
@@ -86,4 +86,8 @@ zh:
#boards
label_course_momes_count: "个帖子"
- #boards count
\ No newline at end of file
+ #boards count
+
+ #setting
+ label_user_name: "用户名称"
+ #setting end
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 911a45848..b3fd769a2 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -677,6 +677,7 @@ RedmineApp::Application.routes.draw do
resources :courses do
member do
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
+ get 'search_member', :action => 'search_member'
get 'homework', :action => 'homework', :as => 'homework'
get 'new_homework', :action => 'new_homework', :as => 'new_homework'
get 'file', :action => 'file', :as => 'file'
diff --git a/lib/redmine.rb b/lib/redmine.rb
index b8284ddc5..ad73c2db1 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -110,7 +110,7 @@ Redmine::AccessControl.map do |map|
map.permission :view_course, {:courses => [:show], :activities => [:index]}, :public => true, :read => true
map.permission :search_course, {:search => :index}, :public => true, :read => true
map.permission :add_course, {:courses => [:new, :create]}, :require => :loggedin ,:belong_to_course => true
- map.permission :edit_course, {:courses => [:settings, :edit, :update]}, :require => :member ,:belong_to_course => true
+ map.permission :edit_course, {:courses => [:settings, :edit, :update,:search_member]}, :require => :member ,:belong_to_course => true
map.permission :close_course, {:courses => [:close, :reopen]}, :require => :member, :read => true ,:belong_to_course => true
map.permission :select_course_modules, {:courses => :modules}, :require => :member ,:belong_to_course => true
map.permission :view_course_journals_for_messages, {:courses => :feedback}, :require => :member,:read => true ,:belong_to_course => true
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index 8a16def1d..fe9ea965c 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -300,6 +300,31 @@ function submitSerch(content)
{
if(regexName(content)){$("#course_search_form").submit();}
}
+
+//验证搜索时输入名字
+function regexQ(content)
+{
+ var name = $.trim($("#q").val());
+ if(name.length == 0)
+ {
+ $("#course_member_name_span").text(content);
+ $("#course_member_name_span").css('color','#ff0000');
+ $("#course_member_name_span").focus();
+ return false;
+ }
+ else
+ {
+ $("#course_member_name_span").text("");
+ return true;
+ }
+}
+//提交课程成员搜索
+function submitMemberSerch(content)
+{
+ //if(regexQ(content)){$("#course_member_search_form").submit();}
+ $("#course_member_search_form").submit();
+}
+
//课程描述显示更多信息
function show_more_msg()
{
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index b24c9d366..5b4067699 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -273,6 +273,8 @@ a:hover.tijiao{ background:#0f99a9;}
a.member_btn{ padding: 3px 5px; background:#15bccf; color:#fff;}
a:hover.member_btn{ background:#329cbd;}
.hol{display: none;}
+.search_course{margin-top:8px;margin-left:8px;}
+.search_form_course{margin-top:8px;margin-left:8px;}
/* 新建项目 */
.pro_new{ }
From a8b1ca10b34476ed3257bd4c5cb63bb83e5b3614 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 17 Apr 2015 10:36:32 +0800
Subject: [PATCH 20/21] =?UTF-8?q?1=E3=80=81=E5=AD=A6=E7=94=9F=E4=BD=9C?=
=?UTF-8?q?=E4=B8=9A=20=20-->=20=20=E4=BD=9C=E5=93=81=202=E3=80=81?=
=?UTF-8?q?=E5=AD=A6=E7=94=9F=E4=BA=A4=E4=BA=86=E4=BD=9C=E5=93=81=E4=B9=8B?=
=?UTF-8?q?=E5=90=8E=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9=E4=BD=9C=E5=93=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_attach_controller.rb | 4 ++--
app/helpers/application_helper.rb | 8 ++++----
app/helpers/courses_helper.rb | 6 +++++-
app/views/bids/_homework_list.html.erb | 2 +-
app/views/homework_attach/_homework.html.erb | 6 +++---
app/views/homework_attach/_homeworks_list.html.erb | 4 ++--
config/locales/zh.yml | 6 +++---
7 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb
index c90d078e2..a589ce144 100644
--- a/app/controllers/homework_attach_controller.rb
+++ b/app/controllers/homework_attach_controller.rb
@@ -314,7 +314,7 @@ class HomeworkAttachController < ApplicationController
def edit
bid = @homework.bid
- if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0) && (User.current.admin? || User.current.member_of_course?(bid.courses.first))
+ if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 2) && (User.current.admin? || User.current.member_of_course?(bid.courses.first))
get_homework_member @homework
else
render_403 :message => :notice_not_authorized
@@ -347,7 +347,7 @@ class HomeworkAttachController < ApplicationController
def destroy
bid = @homework.bid
- if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0) && (User.current.admin? || User.current == @homework.user)
+ if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 0) && (User.current.admin? || User.current == @homework.user)
if @homework.destroy
#respond_to do |format|
# format.html { redirect_to course_for_bid_url @homework.bid }
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 9c9c96ce5..15c34c6ee 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2036,12 +2036,12 @@ module ApplicationHelper
def anonymous_comment_link(bid, course)
link = case bid.comment_status
when 0
- confirm_info = "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n"
+ confirm_info = "开启匿评后学生将不能对作品进行提交、修改、删除等操作\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定开启匿评?'
link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => confirm_info, disable_with: '加载中...'
when 1
- confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作业列表\n"
+ confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作品列表\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定关闭匿评?'
link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => confirm_info
@@ -2057,7 +2057,7 @@ module ApplicationHelper
@student_size ||= searchStudent(course).size
@homework_size = bid.homeworks.size
percent = @homework_size.to_f / (@student_size == 0 ? 1 : @student_size)
- confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
+ confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n"
when 1
@homework_evaluations = 0
bid.homeworks.map { |homework| @homework_evaluations += homework.homework_evaluations.count}
@@ -2074,7 +2074,7 @@ module ApplicationHelper
bid.homeworks.map { |homework| @has_evaluations += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count}
percent = @has_evaluations.to_f / (@homework_evaluations == 0 ? 1 : @homework_evaluations)
- confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作业,已评价#{@has_evaluations}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
+ confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作品,已评价#{@has_evaluations}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n"
end
confirm_info
end
diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb
index 5b311acd7..2e06e3a43 100644
--- a/app/helpers/courses_helper.rb
+++ b/app/helpers/courses_helper.rb
@@ -762,7 +762,11 @@ module CoursesHelper
if user_homework && user_homework.empty?
link_to l(:label_commit_homework), new_exercise_book_path(bid),:class => 'fr mr10 work_edit'
else
- "作业已交".html_safe
+ if bid.comment_status == 1 && bid.open_anonymous_evaluation == 1
+ "#{l(:label_edit_homework)}".html_safe
+ else
+ link_to l(:label_edit_homework), edit_homework_attach_path(user_homework.first.id),:class => 'fr mr10 work_edit'
+ end
end
end
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index a7e337a60..c0ae219a5 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -70,7 +70,7 @@
diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb
index fca25e8ee..0b81bb138 100644
--- a/app/views/homework_attach/_homework.html.erb
+++ b/app/views/homework_attach/_homework.html.erb
@@ -15,7 +15,7 @@
-
<% if homework.name == nil || homework.name == "" %>
- <% homework_filename = homework.user.name + "提交的作业" %>
+ <% homework_filename = homework.user.name + "提交的作品" %>
<% else %>
<% homework_filename = homework.name %>
<% end %>
@@ -55,7 +55,7 @@
<% if is_my_homework %>
- <% if bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 %>
+ <% if bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 2 %>
-
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
<% if homework.user == User.current || User.current.admin? %>
@@ -69,7 +69,7 @@
<% end %>
<% else %>
- -
+
-
<%= l(:button_edit) %>
<% if homework.user == User.current || User.current.admin? %>
diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb
index d2121c85f..4f15b9204 100644
--- a/app/views/homework_attach/_homeworks_list.html.erb
+++ b/app/views/homework_attach/_homeworks_list.html.erb
@@ -47,9 +47,9 @@
<%= link_to User.current.login, user_path(User.current), :title => User.current.login%>
- - 您还没交作业,请创建作业!
+ - 您还没交作品,请创建作品
-
- <%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
+ <%= link_to "提交作品", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index b6f45f084..8318e0068 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -497,14 +497,14 @@ zh:
label_teacher_list: 教师列表
label_student_list: 学生列表
label_limit_time: 截止日期
- label_commit_homework: 提交作业
+ label_commit_homework: 提交作品
+ label_edit_homework: 修改作品
label_course_homework: 对应课程
label_course_doing: 进行中
label_course_done: 已结束
label_homework_response: 作业咨询
- label_bidding_homework: 提交作业
+ label_bidding_homework: 提交作品
label_add_homework: 添加作业
- label_edit_homework: 修改作业
label_delete_homework: 删除作业
label_new_homework: 创建作业
From cdbe95f6ec0bdf72722c0f5d3a20c2d4f69649b3 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 17 Apr 2015 11:48:47 +0800
Subject: [PATCH 21/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E6=88=90=E5=91=98=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 6 +++---
app/views/courses/_course_members.html.erb | 5 +++--
app/views/courses/search_member.js.erb | 2 +-
public/stylesheets/courses.css | 2 ++
public/stylesheets/css.css | 19 ++-----------------
5 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index c4ef0fe60..c0e99d546 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -20,7 +20,7 @@ class CoursesController < ApplicationController
before_filter :can_show_course, :except => []
before_filter :logged_user_by_apptoken,:only => [:show,:new_homework,:feedback]
before_filter :find_course, :except => [ :index, :search,:list, :new,:join,:unjoin, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_private_courses]
- before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course,:search_member]
+ before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course]
before_filter :authorize_course_global, :only => [:view_homework_attaches, :new,:create]
before_filter :require_admin, :only => [:copy, :archive, :unarchive, :destroy, :calendar]
before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
@@ -419,8 +419,8 @@ class CoursesController < ApplicationController
end
def search_member
- if User.current.allowed_to?(:as_teacher,@course)
- q = "#{params[:q].strip}"
+ if User.current.allowed_to?(:as_teacher,@course) || User.current.admin
+ q = "#{params[:name].strip}"
@roles = Role.givable.all[3..5]
if q.nil? || q == ""
@members = @course.member_principals.includes(:roles, :principal).all.sort
diff --git a/app/views/courses/_course_members.html.erb b/app/views/courses/_course_members.html.erb
index db6ec4b55..a6a3594de 100644
--- a/app/views/courses/_course_members.html.erb
+++ b/app/views/courses/_course_members.html.erb
@@ -1,14 +1,15 @@
<%= form_tag({:controller => 'courses', :action => 'search_member'},:id => "course_member_search_form", :method => :get, :class => "search_form_course",:remote => true) do %>
- <%= text_field_tag 'q', params[:q], :placeholder => l(:label_user_name), :class => "search_text fl" %>
-
+ <%= text_field_tag 'name', params[:name], :placeholder => "昵称、学号、姓名搜索", :class => "search_text fl" %>
+
<%= l(:label_search)%>
<% end %>
+
-
diff --git a/app/views/courses/search_member.js.erb b/app/views/courses/search_member.js.erb
index a8fa0b986..2068363ea 100644
--- a/app/views/courses/search_member.js.erb
+++ b/app/views/courses/search_member.js.erb
@@ -1 +1 @@
-$("#course_member_list").html("<%= escape_javascript(render :partial => "courses/member") %>");
\ No newline at end of file
+$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
\ No newline at end of file
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 59c43cd86..97dea5203 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -469,6 +469,8 @@ blockquote {
font-family: "Microsoft YaHei";
background: url('../images/requirements/reference.jpg');
}
+a.member_search_edit {width: 43px;background: #15bccf;color: #fff;text-align: center;text-decoration: none;padding: 2px;}
+.min_search_edit {width: 150px;height: 20px;border: 1px solid #d0d0d0 !important;color: #666;}
a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; color:#64bdd9; }
a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css
index 2b820381e..8f43077f4 100644
--- a/public/stylesheets/css.css
+++ b/public/stylesheets/css.css
@@ -167,23 +167,8 @@ a:hover.tijiao{ background:#0f99a9 !important;}
.c_grey{ color:#A7A7A7;}
/*新增*/
-.min_search {
- width: 150px;
- height: 15px;
- border: 1px solid #d0d0d0 !important;
- color: #666;
- /*background: url(../images/course/public_icon.png) 135px -193px no-repeat;*/
- /*cursor: pointer;*/
-}
-a.member_search {
- width: 43px;
- height: 22px;
- background: #15bccf;
- color: #fff;
- text-align: center;
- padding: 4px 6px;
- text-decoration: none;
-}
+.min_search {width: 150px;height: 15px;border: 1px solid #d0d0d0 !important;color: #666;}
+a.member_search {width: 43px;height: 22px;background: #15bccf;color: #fff;text-align: center;padding: 4px 6px;text-decoration: none;}
/*上传图片处理*/
.upload_img img{max-width: 100%;}