课程讨论区发帖,添加附件,admin帐户删除附件报错,原因:判断attachment的containers是否为课程的时候少判断了课程讨论区的附件这种情况,解决:加上该判断。问题2 #1002 forge网站的主页项目列表登录前和登陆后,显示的不一样。 解决方法:项目列表、课程列表中的私有项目、私有课程添加私有标志

This commit is contained in:
z9hang 2014-09-01 14:41:11 +08:00
parent 5cb1683332
commit e0cdcc0211
8 changed files with 30 additions and 6 deletions

View File

@ -182,9 +182,11 @@ class AttachmentsController < ApplicationController
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.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)
format.html { redirect_to_referer_or new_board_message_path(@attachment.container) }
elsif @course.nil?
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
else

View File

@ -175,9 +175,19 @@ module ProjectsHelper
render_project_nested_lists(projects) do |project|
#Modified by young
if (project.try(:project_type) == Project::ProjectType_course )
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}").html_safe
unless project.is_public == 1
s = "<span class='private_project'>#{l(:lable_private)}</span>".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
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'my-project' : nil}")
unless project.is_public
s = "<span class='private_project'>#{l(:label_private)}</span>".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.description.present?

View File

@ -10,6 +10,9 @@
<div class="wiki-description">
<p >
<%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%>
<% unless @course.is_public == 1 %>
<span class='private_project'><%= l(:lable_private) %></span>
<% end %>
<%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%>
</p>
<p >

View File

@ -6,7 +6,10 @@
<!-- 上左下右 -->
<div class='desc_item'>
<span class=''>
<%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
<% unless course.is_public == 1 %>
<span class="private_project"><%= l(:lable_private) %></span>
<% end %>
<%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
</span>
<span class='font_bolder'>

View File

@ -72,6 +72,9 @@
</div>
<!-- 上左下右 -->
<div style="float: left; margin-left: 10px; width: 380px;">
<% unless project.is_public %>
<span class="private_project"><%= l(:lable_private) %></span>
<% end %>
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
</div>

View File

@ -1809,4 +1809,5 @@ en:
notice_account_invalid_creditentials_new: You have not to the mailbox activation
lable_unknow_type: Unknow type
lable_score_less_than_zero: Score less than 0, revised to 0
review_assignments: review assignments
review_assignments: review assignments
lable_private: private

View File

@ -2118,4 +2118,4 @@ zh:
lable_unknow_type: 未知类型
lable_score_less_than_zero: 得分小于0修正为0
review_assignments: 评审任务
lable_private: 私有

View File

@ -1618,6 +1618,8 @@ div.issue .next-prev-links {color:#999;}
div.issue table.attributes th {width:22%;}
div.issue table.attributes td {width:28%;}
.private_project { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;}
#issue_tree table.issues, #relations table.issues { border: 0; }
#issue_tree td.checkbox, #relations td.checkbox {display:none;}
#relations td.buttons {padding:0;}