diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index 14c2f3a11..efbb4ffab 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -296,7 +296,12 @@ class ForumsController < ApplicationController #检查forum的名字 def check_forum_name - forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false + forum_name_exist = true + if params[:forum_id] + forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false + else + forum_name_exist = Forum.where("name = '#{params[:forum_name]}' ").count >= 1 ? true : false + end render :text => forum_name_exist end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 35860c728..9a6f72e2e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -130,7 +130,7 @@ class UsersController < ApplicationController when 'apply' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc") when 'homework' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") + @message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage') and user_id =?", @user).order("created_at desc") when 'course_message' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc") # when 'forge_message' diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 4923c629e..f6b083b4d 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -464,7 +464,7 @@ module UsersHelper no_html = "message" arr = details_to_strings(journal.details, no_html) unless journal.notes.blank? - arr << "留言内容:" + journal.notes + arr << journal.notes end str = '' arr.each { |item| str = str+item } diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 47ab30cb1..f7fb9b1aa 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -73,7 +73,7 @@ class Attachment < ActiveRecord::Base cattr_accessor :thumbnails_storage_path @@thumbnails_storage_path = File.join(Rails.root, "tmp", "thumbnails") - before_save :files_to_final_location,:act_as_course_activity,:act_as_forge_activity + before_save :files_to_final_location,:act_as_course_activity after_create :office_conver, :be_user_score,:act_as_forge_activity after_update :office_conver, :be_user_score after_destroy :delete_from_disk,:down_user_score diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index 03c5c0ac4..f5e22002a 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -3,7 +3,7 @@ <% if tag_name && tag_name == k%> <%= k%>×<%= v%> <% else%> - <%= k%>×<%= v%> + <%= k%>×<%= v%> <% end%> <% end%> <% end%> \ No newline at end of file diff --git a/app/views/forums/_form_edit_mode.html.erb b/app/views/forums/_form_edit_mode.html.erb index 9c0ec27bd..ade5a24c4 100644 --- a/app/views/forums/_form_edit_mode.html.erb +++ b/app/views/forums/_form_edit_mode.html.erb @@ -9,10 +9,10 @@
- +
- +
确定
diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb index fbbe023a0..286219356 100644 --- a/app/views/forums/_forum_list.html.erb +++ b/app/views/forums/_forum_list.html.erb @@ -10,7 +10,7 @@ <%= link_to forum.name, forum_path(forum),:class=>"f16 linkBlue" %>
-
<%= textAreailizable forum.description%>
+
<%= textAreailizable forum.description%>
创建者:<%= forum.creator.name %>
创建时间:<%= format_date(forum.created_at) %>
diff --git a/app/views/forums/_forum_tag_list.html.erb b/app/views/forums/_forum_tag_list.html.erb index 2a0257d63..b074cbca3 100644 --- a/app/views/forums/_forum_tag_list.html.erb +++ b/app/views/forums/_forum_tag_list.html.erb @@ -1,6 +1,6 @@ <% forum.tag_list.each do |tag|%> - <%= tag %> + <%= tag %> <%if forum.creator.id == User.current.id%> × <% end %> diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb index ef1fbc12b..1fcbc6cab 100644 --- a/app/views/forums/edit.html.erb +++ b/app/views/forums/edit.html.erb @@ -1,23 +1,7 @@ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'new_user' %> \ No newline at end of file diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 8f5cb15cc..c31790f30 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -49,7 +49,7 @@ $("#reorder_popu").removeClass("sortArrowActiveD"); add_class("reorder_time"); }); - document.getElementById('forum_name').onkeydown = function() + $('#forum_name').keypress( function(e) { var n = 0; var str = this.value; @@ -61,9 +61,16 @@ n += 1;//英文,不多说了 } } - if(n >= 160 && event.keyCode != 8) - event.returnValue = false; - } + if(n >= 160 && e.keyCode != 8) + if(document.all) + { + e.returnValue = false; + } + else + { + e.preventDefault(); + } + }) }); function check_and_submit(doc){ $("#error").html('').hide(); @@ -89,7 +96,7 @@ if( name != ""){ $.get( '<%= check_forum_name_forums_path %>', - {"forum_name":name}, + {"forum_name":encodeURIComponent(name)}, function(data){ if( data == 'true'){ @@ -129,14 +136,14 @@ <%= form_tag({:controller => 'forums',:action=>'create',:format=>'js'},:method => 'post',:remote=>'true') do |f| %>
- +
- +
- + @@ -143,7 +149,7 @@
- +
<%= @forum.name%>
@@ -172,7 +178,8 @@ 编辑贴吧 - 删除贴吧 + 删除贴吧 + <% end %> diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index 0efa57ccc..4a515ee1f 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -1,11 +1,16 @@ <%= javascript_include_tag 'new_user'%> \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 4cafce30d..133a90547 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -56,7 +56,7 @@ <%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
-
+
<%= @memo.content.html_safe%>
@@ -75,7 +75,9 @@
回复(<%=@reply_count %>)
+ <% if @reply_count > 2%> 点击展开更多回复 + <% end %>
diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 550089627..d207150b8 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -397,25 +397,26 @@ <% end %> <% if ma.course_message_type == "JournalsForMessage" %> <% if ma.course_message.jour_type == 'Course' %> - - + <% if params[:type] != 'homework' %> + + <% end %> <% else %>