diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index db77283cc..d87bc6d2c 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -180,9 +180,10 @@ class AttachmentsController < ApplicationController end respond_to do |format| - # modify by nwb if !@attachment.container.nil? && - (@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) ||@attachment.container.has_attribute?(:course_id) ) && @attachment.container.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && @attachment.container.board && @attachment.container.board.course ) ) + (@attachment.container.is_a?(Course) || ((@attachment.container.has_attribute?(:course) || @attachment.container.has_attribute?(:course_id) ) && + @attachment.container.course ) || ((@attachment.container.has_attribute?(:board) || @attachment.container.has_attribute?(:board_id)) && + @attachment.container.board && @attachment.container.board.course ) ) if @attachment.container.is_a?(News) format.html { redirect_to_referer_or news_path(@attachment.container) } elsif @attachment.container.is_a?(Message) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index 44496c3d7..e1af9ca34 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -156,17 +156,17 @@ class MessagesController < ApplicationController @subject = @message.subject @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:') - #@content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " - #@temp = Message.new - ##@temp.content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}> " - #@content << @message.content.to_s.strip.gsub(%r{
((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" - #@content_html = textilizable(@content) - #@temp.content = @content_html - @content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}
((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "\n\n
" << @content + @content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> " @temp = Message.new - @temp.content = @content + #@temp.content = "> #{ll(Setting.default_language, :text_user_wrote, @message.author)}> " + @content << @message.content.to_s.strip.gsub(%r{\n\n((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n" + @content_html = textilizable(@content) + @temp.content = @content_html + #@content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}
" + #@content << @message.content.to_s.strip.gsub(%r{((.|\s)*?)}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n") + "
" << @content + #@temp = Message.new + #@temp.content = @content end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index c0561bd1c..943718392 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -836,7 +836,7 @@ class ProjectsController < ApplicationController format.api { render_api_ok } end else - render :layout => "base" + render :layout => "project_base" end # hide project in layout @project = nil diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index ef4c9b061..a705d6934 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -372,7 +372,7 @@ class RepositoriesController < ApplicationController def revision respond_to do |format| - format.html + format.html{render :layout => 'project_base'} format.js {render :layout => false} end end diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 3641e0c61..5824848ff 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -107,7 +107,7 @@ class VersionsController < ApplicationController respond_to do |format| format.html do flash[:notice] = l(:notice_successful_create) - redirect_back_or_default settings_project_path(@project, :tab => 'versions') + redirect_to settings_project_path(@project, :tab => 'versions') end format.js format.api do diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 6849ba83d..9fcebe640 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -173,25 +173,14 @@ module ProjectsHelper # Renders the projects index def render_project_hierarchy(projects) render_project_nested_lists(projects) do |project| - #Modified by young - if (project.try(:project_type) == Project::ProjectType_course ) - unless project.is_public == 1 - s = "#{l(:lable_private)}".html_safe - else - s = "".html_safe - end - s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe - else - unless project.is_public - s = "#{l(:lable_private)}".html_safe - else - s = "".html_safe - end - s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") - end - #Ended by young + if (project.try(:project_type) == Project::ProjectType_course ) + s = project.is_public == 1 ? "".html_safe : "#{l(:label_private)}".html_safe + s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe + else + s = project.is_public ? "".html_safe : "#{l(:label_private)}".html_safe + s += link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}") + end if project.description.present? - #Delete by nie. # s << content_tag('td', textilizable(project.short_description, :project => project), :class => 'wiki description') end s diff --git a/app/models/project_status.rb b/app/models/project_status.rb index c3d306c58..7fd246234 100644 --- a/app/models/project_status.rb +++ b/app/models/project_status.rb @@ -12,7 +12,7 @@ class ProjectStatus < ActiveRecord::Base # 但是 如果超级用户删除其他用户的话会造成读取错误 这里是遗漏点 # 删除用户时 此表创建人员未作相应删除动作 def update_watchers_count(num) - if self.watchers_count >= 0 + if self.watchers_count||0 >= 0 self.update_attribute(:watchers_count, self.watchers_count.to_i + num) end end diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index bb043cd70..81dc5d939 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -27,7 +27,7 @@<%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %> + <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb index eb7ffffec..6c6e11791 100644 --- a/app/views/files/_sort_by_attachtypel.html.erb +++ b/app/views/files/_sort_by_attachtypel.html.erb @@ -37,7 +37,7 @@ <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %> + <%= file.attachmentstype.nil? ? l(:label_unknow_type):file.attachmentstype.typeName %> <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb index 993563954..c253e8d78 100644 --- a/app/views/forums/_form.html.erb +++ b/app/views/forums/_form.html.erb @@ -21,7 +21,7 @@ <%= f.text_area :description, :required => true, :id => 'editor01' %> - (<%= l(:lable_forums_max_length) %>)
+(<%= l(:label_forums_max_length) %>)
<%= submit_tag l(:button_submit) %> diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 48913a38d..1622bbe02 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -18,7 +18,7 @@-<%= call_hook :view_layouts_base_body_bottom %> +<%= f.text_field :subject, :required => true%>
<%= f.text_area :content, :required => true, :id => 'editor02' %>
-(<%= l(:lable_memos_max_length) %>)
+(<%= l(:label_memos_max_length) %>)
<%= l(:label_attachment_plural) %>
diff --git a/app/views/layouts/users_base.html.erb b/app/views/layouts/users_base.html.erb index bad051fc5..97db13193 100644 --- a/app/views/layouts/users_base.html.erb +++ b/app/views/layouts/users_base.html.erb @@ -45,6 +45,6 @@