课程讨论区发帖,添加附件,admin帐户删除附件报错,原因:判断attachment的containers是否为课程的时候少判断了课程讨论区的附件这种情况,解决:加上该判断。问题2 #1002 forge网站的主页项目列表登录前和登陆后,显示的不一样。 解决方法:项目列表、课程列表中的私有项目、私有课程添加私有标志
This commit is contained in:
parent
5cb1683332
commit
e0cdcc0211
|
@ -182,9 +182,11 @@ class AttachmentsController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
# modify by nwb
|
# modify by nwb
|
||||||
if !@attachment.container.nil? &&
|
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)
|
if @attachment.container.is_a?(News)
|
||||||
format.html { redirect_to_referer_or news_path(@attachment.container) }
|
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?
|
elsif @course.nil?
|
||||||
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
||||||
else
|
else
|
||||||
|
|
|
@ -175,9 +175,19 @@ module ProjectsHelper
|
||||||
render_project_nested_lists(projects) do |project|
|
render_project_nested_lists(projects) do |project|
|
||||||
#Modified by young
|
#Modified by young
|
||||||
if (project.try(:project_type) == Project::ProjectType_course )
|
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
|
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
|
end
|
||||||
#Ended by young
|
#Ended by young
|
||||||
if project.description.present?
|
if project.description.present?
|
||||||
|
|
|
@ -10,6 +10,9 @@
|
||||||
<div class="wiki-description">
|
<div class="wiki-description">
|
||||||
<p >
|
<p >
|
||||||
<%= content_tag('span',"#{l(:label_bid_show_course_name)}:", :class => "course-font")%>
|
<%= 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"))%>
|
<%= content_tag('span', link_to("#{@course.name}", course_path(@course), :class => "info"))%>
|
||||||
</p>
|
</p>
|
||||||
<p >
|
<p >
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
<!-- 上左下右 -->
|
<!-- 上左下右 -->
|
||||||
<div class='desc_item'>
|
<div class='desc_item'>
|
||||||
<span class=''>
|
<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>
|
||||||
<span class='font_bolder'>
|
<span class='font_bolder'>
|
||||||
|
|
|
@ -72,6 +72,9 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- 上左下右 -->
|
<!-- 上左下右 -->
|
||||||
<div style="float: left; margin-left: 10px; width: 380px;">
|
<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( 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' %>)
|
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1810,3 +1810,4 @@ en:
|
||||||
lable_unknow_type: Unknow type
|
lable_unknow_type: Unknow type
|
||||||
lable_score_less_than_zero: Score less than 0, revised to 0
|
lable_score_less_than_zero: Score less than 0, revised to 0
|
||||||
review_assignments: review assignments
|
review_assignments: review assignments
|
||||||
|
lable_private: private
|
|
@ -2118,4 +2118,4 @@ zh:
|
||||||
lable_unknow_type: 未知类型
|
lable_unknow_type: 未知类型
|
||||||
lable_score_less_than_zero: 得分小于0,修正为0
|
lable_score_less_than_zero: 得分小于0,修正为0
|
||||||
review_assignments: 评审任务
|
review_assignments: 评审任务
|
||||||
|
lable_private: 私有
|
||||||
|
|
|
@ -1618,6 +1618,8 @@ div.issue .next-prev-links {color:#999;}
|
||||||
div.issue table.attributes th {width:22%;}
|
div.issue table.attributes th {width:22%;}
|
||||||
div.issue table.attributes td {width:28%;}
|
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 table.issues, #relations table.issues { border: 0; }
|
||||||
#issue_tree td.checkbox, #relations td.checkbox {display:none;}
|
#issue_tree td.checkbox, #relations td.checkbox {display:none;}
|
||||||
#relations td.buttons {padding:0;}
|
#relations td.buttons {padding:0;}
|
||||||
|
|
Loading…
Reference in New Issue