微信课件下载不需要登录

This commit is contained in:
yuanke 2016-09-09 15:14:24 +08:00
parent 5f77c97c9d
commit 9997de0d96
3 changed files with 8 additions and 3 deletions

View File

@ -130,7 +130,12 @@ class AttachmentsController < ApplicationController
def download
# modify by nwb
# 下载添加权限设置
candown = attachment_candown @attachment
if params[:type] == "wechat"
candown = true
else
candown = attachment_candown @attachment
end
if candown || User.current.admin? || User.current.id == @attachment.author_id
if stale?(:etag => @attachment.digest)
if params[:preview] == 'true'

View File

@ -230,7 +230,7 @@
</div>
<div ng-class="{'undis': !showResources}">
<div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /><a ng-href="{{g_localhost}}/attachments/download/{{r.id}}/{{r.filename}}" target="_blank" class="fl ml10 resource-width">{{r.filename}}</a><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2" ng-click="sendFile(r,1)">发送</a><div class="cl"></div></div>
<div ng-repeat="r in resources|filter:searchText" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]"><img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /><a ng-href="{{g_localhost}}/attachments/download/{{r.id}}/{{r.filename}}?type=wechat" target="_blank" class="fl ml10 resource-width">{{r.filename}}</a><a ng-show="isTeacher" herf="javascript:void(0);" class="fr mr10 link-blue2" ng-click="sendFile(r,1)">发送</a><div class="cl"></div></div>
<p ng-show="resources_tag == true && resources.length<=0" class="class-test-tip">暂无课件,<br />
请登录Trustie网站在PC浏览器中上传课件。</p>
</div>

View File

@ -12,7 +12,7 @@
<div ng-class="{'undis': currentTab!=1}">
<div ng-repeat="r in resources|filter:{filename:searchText}" ng-class="['class-detail-row', 'f13', 'c-grey3', {'border-top': $first}]">
<img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /> <a ng-href="{{g_localhost}}/attachments/download/{{r.id}}/{{r.filename}}" target="_blank" class="fl ml10 resource-width">{{r.filename}}</a><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,1)" class="fr mr10 link-blue2">发送</a><div class="cl"></div>
<img src="/images/wechat/courseware.png" width="15" class="ml10 fl" /> <a ng-href="{{g_localhost}}/attachments/download/{{r.id}}/{{r.filename}}?type=wechat" target="_blank" class="fl ml10 resource-width">{{r.filename}}</a><a ng-show="r.current_user_is_teacher" ng-click="sendFile(r,1)" class="fr mr10 link-blue2">发送</a><div class="cl"></div>
<span class="f12 mt5 ml35 c-grey4 fl courseware-from-width hidden">课件来源:{{r.coursename}}</span><span class="f12 ml10 mt5 c-grey4 fl">大小:{{r.attafile_size}}</span><div class="cl"></div>
</div>
<div ng-if="has_more">