diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index be6543be2..14c2f3a11 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -296,7 +296,7 @@ class ForumsController < ApplicationController #检查forum的名字 def check_forum_name - forum_name_exist = Forum.where("name = '#{params[:forum_name]}'").count >= 1 ? true : false + forum_name_exist = Forum.where("name = '#{params[:forum_name]}' and id != #{params[:forum_id]}").count >= 1 ? true : false render :text => forum_name_exist end diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb index 769e62209..a38bd4096 100644 --- a/app/controllers/journals_controller.rb +++ b/app/controllers/journals_controller.rb @@ -73,7 +73,7 @@ class JournalsController < ApplicationController text = text.to_s.strip.gsub(%r{
((.|\s)*?)
}m, '[...]') @content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n" @content << text.gsub(/(\r?\n|\r\n?)/, "\n ") + "\n" - @content = "
" << @content << "
" + @content = "
" << @content << "
\n\n
" @id = user.id rescue ActiveRecord::RecordNotFound render_404 diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 07b2a345c..b820e6d54 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -71,7 +71,7 @@ class Mailer < ActionMailer::Base recipients ||= [] course.student.each do |student| user = User.find(student.student_id) - @subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}" + @subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_anonymous_comment_open)}" @token = Token.get_token_from_user(user, 'autologin') @anonymous_comment_close_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value)) @anonymous_comment_close_name = homework_common.name @@ -255,7 +255,7 @@ class Mailer < ActionMailer::Base # 作业截止时间邮件提醒 def homework_endtime__added(homework_common, user_id) user = User.find(user_id) - @subject = "#{l(:mail_homework)}#{homework_common.name}#{l(:mail_homework_endtime)} " + @subject = "#{l(:mail_homework)}#{homework_common.name} #{l(:mail_homework_endtime)} " @token = Token.get_token_from_user(user, 'autologin') @homework_endtime_url = url_for(student_work_index_url(:homework => homework_common.id, :token => @token.value)) @homework_endtime_name = homework_common.name diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index b2c7ab79f..03c5c0ac4 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/files/index.html.erb b/app/views/files/index.html.erb index 489c0357d..34f7452a7 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -223,6 +223,7 @@ }); } + <% if @course %> var tagNameHtml; //当前双击的链接的父节点的html var tagName; //标签的值 var parentCssBorder; //当前双击的链接的父节点 @@ -271,6 +272,7 @@ } } }); + <%end %> diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb index 030c8ff0e..560afc6d9 100644 --- a/app/views/forums/_file_form.html.erb +++ b/app/views/forums/_file_form.html.erb @@ -47,7 +47,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> <%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'AnnexBtn fl mt3' %> - 上传附件 + 上传附件 <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/app/views/forums/edit.html.erb b/app/views/forums/edit.html.erb index 24130e727..ef1fbc12b 100644 --- a/app/views/forums/edit.html.erb +++ b/app/views/forums/edit.html.erb @@ -43,13 +43,10 @@ function check_forum_name(){ check_pass = true; name = $("textarea[name='forum[name]']").val().trim(); - if(name == '<%= @forum.name%>'){ - return; - } if( name != ""){ $.get( '<%= check_forum_name_forums_path %>', - {"forum_name":name}, + {"forum_name":name,"forum_id":<%= @forum.id%>}, function(data){ if( data == 'true'){ diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index 2643c93e7..ae2a848e0 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -3,4 +3,4 @@ <%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %> <%= link_to l(:button_edit), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> -<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> +<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index c6b805d0a..f6b41f36d 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -1,3 +1,4 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> <%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %> <%= error_messages_for 'issue', 'time_entry' %> <%= render :partial => 'conflict' if @conflict %> @@ -19,7 +20,7 @@
回复 - <%= f.text_area :notes, :style => "width:99%;", :rows => "5", :no_label => true %> + <%= f.kindeditor :notes, :style => "width:99%;",:height=>'100px', :cssData =>"blockquote { padding:0px}", :rows => "5", :no_label => true, :editor_id=>'issue_journal_kind_reply' %>
diff --git a/app/views/issues/_history.html.erb b/app/views/issues/_history.html.erb index 68e991594..8befaf37e 100644 --- a/app/views/issues/_history.html.erb +++ b/app/views/issues/_history.html.erb @@ -12,9 +12,9 @@

<% if journal.details.any? %> <% details_to_strings(journal.details).each do |string| %> -

<%= string %>

+

<%= string.html_safe %>

<% end %> - <% end %> + <% end %>

diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 67867e2c6..0eb779a23 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -64,7 +64,7 @@

<%#--引用时不能修改,剥离出引用内容--%> - + <%= l(:button_submit) %> <% end %> diff --git a/app/views/journals/new.js.erb b/app/views/journals/new.js.erb index b24b5ffb6..9c5d87079 100644 --- a/app/views/journals/new.js.erb +++ b/app/views/journals/new.js.erb @@ -1,4 +1,4 @@ -$('#issue_notes').val("<%= raw escape_javascript(@content) %>"); +issue_journal_kind_reply.html("<%= raw escape_javascript(@content) %>"); <% # when quoting a private journal, check the private checkbox if @journal && @journal.private_notes? diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 81758ff97..4cafce30d 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%>
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 971794699..22317dc91 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -34,7 +34,7 @@ :id => act.id}, :class => "problem_tit fl fb " %>
-

<%= textAreailizable act,:description %>
+

<%= act.description.html_safe %>
<%= l :label_activity_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>

@@ -51,7 +51,7 @@ <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"}, :class => "problem_tit fl fb" %>
-

<%= textilizable act,:notes %>
+

<%= act.notes.html_safe %>
<%= l :label_activity_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>

diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 6ee5f729a..550089627 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -118,44 +118,39 @@ <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>