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%>
创建时间:<%= 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 @@
error
<%= form_tag({:controller => 'forums',:action=>'create',:format=>'js'},:method => 'post',:remote=>'true') do |f| %>
-
+
-
+
-
+
@@ -143,7 +149,7 @@
@@ -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' %>
-
- -
- <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
-
- - <%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
- ">在课程中留言了:
-
- -
- <%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
- :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
- :onmouseover => "message_titile_show($(this),event)",
- :onmouseout => "message_titile_hide($(this))" %>
-
-
- <%= ma.course_message.notes.html_safe %>
-
- - <%= time_tag(ma.created_at).html_safe %>
-
-
+ <% if params[:type] != 'homework' %>
+
+ -
+ <%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+
+ - <%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">在课程中留言了:
+
+ -
+ <%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
+ :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
+ :onmouseover => "message_titile_show($(this),event)",
+ :onmouseout => "message_titile_hide($(this))" %>
+
+
+ <%= ma.course_message.notes.html_safe %>
+
+ - <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
<% else %>
-
@@ -542,7 +543,7 @@
更新了问题状态:
-
- <%= link_to get_issue_des_update(ma.forge_message).html_safe,
+ <%= link_to ma.forge_message.journalized.subject,
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js
index d2b67be5e..22c049ecc 100644
--- a/public/javascripts/new_user.js
+++ b/public/javascripts/new_user.js
@@ -337,7 +337,7 @@ var autoTextarea = function (elem, extra, maxHeight) {
};
function limitStrsize(id,length){
- document.getElementById(id).onkeydown = function()
+ $('#'+id).keypress(function(e)
{
var n = 0;
var str = this.value;
@@ -350,9 +350,16 @@ function limitStrsize(id,length){
}
}
- if(n >= length && event.keyCode !== 8)
- event.returnValue = false;
- }
+ if(n >= length && e.keyCode !== 8)
+ if(document.all)
+ {
+ e.returnValue = false;
+ }
+ else
+ {
+ e.preventDefault();
+ }
+ })
}
/////////////////////////////////////////////////////////////////////////////////////创建项目
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 57541e149..8817dd325 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -555,7 +555,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageNewsContent {width:355px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageSystenMessageContent {width:291px; max-width:291px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden;text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
-.homepageHomeworkContent {width:245px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
+.homepageHomeworkContent {width:235px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;}
a.homepageWhite {color:#ffffff;}