下载资源只有贴吧资源可以下载,原因:其他资源的权限控制暂未实现,解决先直接返回true,讨论区主题...显示过早,解决:多显示几个数字

This commit is contained in:
z9hang 2014-09-28 16:09:23 +08:00
parent 045a09e2ed
commit 24cdea1f34
2 changed files with 7 additions and 5 deletions

View File

@ -258,11 +258,13 @@ class ApplicationController < ActionController::Base
if @attachment.container_type == "Memo"
allowed = User.current.allowed_to?(:memos_attachments_download,nil,:global => true)
elsif @attachment.container_type == "Project"
return true
elsif @attachment.container_type == "course"
return true
elsif @attachment.container_type == "contest"
return true
else
return true
end
if allowed

View File

@ -98,9 +98,9 @@
<div class="memo-section" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<div class="memo-title <%= @topic.sticky? ? 'sticky' : '' %> <%= @topic.locked? ? 'locked' : '' %>" style="width: 83%;word-break: break-all;">
<% if @project %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(29, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %>
<% elsif @course %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(24,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %>
<%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(29,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %>
<% end %>
</div>
<div class="memo-content">