diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 770c36a58..4088d4156 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -34,20 +34,20 @@ class CommentsController < ApplicationController ids = params[:asset_id].split(',') update_kindeditor_assets_owner ids,@comment.id,OwnerTypeHelper::COMMENT end - # ������ض�̬�ļ�¼add start - if( @comment.id && @news.course ) - if(@news.author_id != User.current.id) - notify = ActivityNotify.new() - notify.activity_container_id = @news.course.id - notify.activity_container_type = 'Course' - notify.activity_id = @comment.id - notify.activity_type = 'Comment' - notify.notify_to = @news.author_id - notify.is_read = 0 - notify.save() - end - end - # ������ض�̬�ļ�¼add end + # # ������ض�̬�ļ�¼add start + # if( @comment.id && @news.course ) + # if(@news.author_id != User.current.id) + # notify = ActivityNotify.new() + # notify.activity_container_id = @news.course.id + # notify.activity_container_type = 'Course' + # notify.activity_id = @comment.id + # notify.activity_type = 'Comment' + # notify.notify_to = @news.author_id + # notify.is_read = 0 + # notify.save() + # end + # end + # # ������ض�̬�ļ�¼add end flash[:notice] = l(:label_comment_added) end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index b9f762f69..269630ec3 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -544,6 +544,10 @@ module UsersHelper #获取指定用户作为老师的课程 def get_as_teacher_courses user type = [] + option = [] + option << "请选择发布作业的课程" + option << -1 + type << option user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course| option = [] option << course.name+"("+course.time.to_s+course.term+")" diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index a2ff03dd2..f622ad20c 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -50,16 +50,15 @@
<% count=0 %>
回复( - <% if activity.parent_id.nil? %> - <% count=activity.replies_count%> - <%=count %> - <% else %> - <% count=activity.parent.replies_count%> - <%=count %> + <% if activity.parent %> + <% count=activity.parent.children.count%> + <% else %> + <% count=activity.children.count%> <% end %> + <%= count %> )
<%#=format_date(activity.updated_on)%>
- <%if count>2 %> + <%if count > 2 %>
点击展开更多回复(<%= count.to_s%>) @@ -83,9 +82,9 @@
- <% activity= activity.parent_id.nil? ? activity:activity.parent%> + <% activity= activity.parent ? activity.parent : activity%> <% replies_all_i = 0 %> - <% unless activity.children.empty? %> + <% if count > 0 %>
    <% activity.children.reorder("created_on desc").each do |reply|%> @@ -102,17 +101,10 @@ <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_date(reply.created_on) %> - <%#= link_to( - l(:button_delete), - {:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:button_delete), - :class => 'replyGrey fr ml10' - ) if reply.course_destroyable_by?(User.current) %> -
-
<%= reply.content.html_safe %>
+
+ <%= reply.content.html_safe %> +
diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 42475fde1..7edc19681 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -18,29 +18,26 @@
发布时间:<%= format_date(activity.created_on) %>
-
通知描述:<%= activity.description.html_safe %>
- -
- +
+ 通知描述: + <%= activity.description.html_safe %>
- <% count=activity.comments_count %> -
回复(<%= count %>)
+ <% count=activity.comments.count %> +
+ 回复(<%= count %>) +
<%#= format_date(activity.updated_on) %>
<%if count>2 %> - + <% end %>
@@ -59,12 +56,12 @@
<% replies_all_i = 0 %> - <% unless activity.comments.empty? %> + <% if count > 0 %>
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %> - <%= get_issue_priority(activity.priority_id)[1] %> + + <%= get_issue_priority(activity.priority_id)[1] %> +
指派给   @@ -26,7 +28,10 @@ <% end %> <% end %>
-
时间:<%=format_date(activity.created_on) %>
+
+ 时间: + <%=format_date(activity.created_on) %> +
缺陷描述: <% if activity.description? %> @@ -55,30 +60,21 @@ <% end %> <% end %>
-
- <% count=activity.journals.count %> + <% count = activity.journals.count %>
回复(<%= count %>)
<%#= format_date(activity.updated_on) %>
- <% if count>2 %> + <% if count > 2 %> + + 点击展开更多回复(<%= count.to_s %>) + +
<% end %>
@@ -97,11 +93,11 @@ <% replies_all_i = 0 %> - <% unless activity.journals.empty? %> + <% if count > 0 %>
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 7d563bdf7..ebf3d0ad2 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -33,30 +33,19 @@ <%= activity.parent.content.to_s.html_safe%> <% end %> -
-
<% count=0 %> +
+ <% count = 0 %>
回复( - <% if activity.parent_id.nil? %> - <% count=activity.replies_count%> - <%=count %> + <% if activity.parent %> + <% count=activity.parent.children.count%> <% else %> - <% count=activity.parent.replies_count%> - <%=count %> + <% count=activity.children.count%> <% end %> + <%=count %> )
<%#=format_date(activity.updated_on)%>
<%if count>2 %> @@ -81,7 +70,7 @@ <% activity= activity.parent_id.nil? ? activity : activity.parent %> <% replies_all_i = 0 %> - <% unless activity.children.empty? %> + <% if count > 0 %>
    <% activity.children.reorder("created_on desc").each do |reply| %> @@ -98,15 +87,6 @@ <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> <% end %> <%= format_date(reply.created_on) %> - <%#= link_to( - l(:button_delete), - {:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:button_delete), - :class => 'replyGrey fr ml10' - ) if reply.course_destroyable_by?(User.current) %> -
<%= reply.content.html_safe %>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 661e0eade..2eba84efa 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -61,4 +61,4 @@ <% end %> <% end %> -<%= link_to "点击展开更多",user_activities_path(@user.id),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> +<%= link_to "点击展开更多",user_activities_path(@user.id,:type => type),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index b636f267e..4a38e630b 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -1,6 +1,6 @@ <% content_for :header_tags do %> - <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> - <%= javascript_include_tag 'homework','baiduTemplate' %> + <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> + <%= javascript_include_tag 'homework','baiduTemplate' %> <% end %>
@@ -18,7 +18,7 @@
- +
+
- - diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index aa2c02ce2..c1cd3723f 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -37,4 +37,4 @@ -<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0} %> \ No newline at end of file +<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %> diff --git a/app/views/users/show.js.erb b/app/views/users/show.js.erb index f870b38b9..bf7443f8c 100644 --- a/app/views/users/show.js.erb +++ b/app/views/users/show.js.erb @@ -1,4 +1,4 @@ -$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page} )%>"); +$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page,:type => @type} )%>"); <% if @user_activities.count < 10%> $("#show_more_activities").hide(); <% end%> diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 9d93ad0fd..e925ccd6b 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -12,15 +12,13 @@ } +
+
作业
+
+
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> -
-
发布作业
-
- -
-
<% homework = HomeworkCommon.new %> <%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %> @@ -29,12 +27,6 @@
<% end%> - -<%else%> -
-
作业
-
-
<% end%> <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0} %> diff --git a/app/views/users/user_select_homework.js.erb b/app/views/users/user_select_homework.js.erb index 945da4c9a..a18fdacc8 100644 --- a/app/views/users/user_select_homework.js.erb +++ b/app/views/users/user_select_homework.js.erb @@ -5,3 +5,4 @@ $("#homework_end_time").val("<%= @homework.end_time%>"); $("#course_id").val("<%= @homework.course_id%>"); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework })%>"); homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>"); +$("#homework_editor").show();