diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d14bccc4e..ad0fab173 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -372,7 +372,8 @@ class ApplicationController < ActionController::Base return true end - if allowed + + if allowed || (params[:type] && params[:type] == "wechat" ) true else if @project && @project.archived? diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 5d1345f24..3986acc0a 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -130,7 +130,12 @@ class AttachmentsController < ApplicationController def download # modify by nwb # 下载添加权限设置 - candown = attachment_candown @attachment + if (params[:type] && 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' @@ -710,7 +715,7 @@ class AttachmentsController < ApplicationController def has_login unless (@attachment && @attachment.container_type == "Organization").nil? unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil? - render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) + render_403 if (!User.current.logged? && !(params[:type] && params[:type] == "wechat")) && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 14ccb6dca..94b0b2c6e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -417,11 +417,11 @@ module ApplicationHelper end # status_id:3、已解决 5、已关闭 if issue.status_id == 3 - s = link_to text, issue_path(issue), :class => "text_line_s", :title => title + s = link_to text, issue_path(issue), :class => "text_line_s fl", :title => title elsif issue.status_id == 5 - s = link_to text, issue_path(issue), :class => "text_line_s del_line", :title => title + s = link_to text, issue_path(issue), :class => "text_line_s del_line fl", :title => title else - s = link_to text, issue_path(issue), :class => "c_blue", :title => title + s = link_to text, issue_path(issue), :class => "c_blue fl", :title => title end s << h("".html_safe) if subject s = h("#{issue.project} - ") + s if options[:project] @@ -840,7 +840,7 @@ module ApplicationHelper # 必须是项目成员,项目必须提交过代码 def allow_pull_request project - return false if project.gpid.nil? + return 0 if project.gpid.nil? g = Gitlab.client count = g.user_static(project.gpid, :rev => "master").count count diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index dd3d9d9b8..eec93c86c 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -47,7 +47,7 @@ <% issues.each do |issue| -%>
  • <%= link_to_issue_version(issue, :project => (@project != issue.project)) %> - 指派给:<%= link_to "#{User.find(issue.try(:assigned_to_id)).show_name}", user_path(issue.try(:assigned_to_id)), :class => "c_blue hidden" %> + 指派给:<%= link_to "#{User.find(issue.try(:assigned_to_id)).show_name}", user_path(issue.try(:assigned_to_id)), :class => "c_blue hidden fr", :style => "width:50px;" %>
  • <% end -%> diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html index f81b4f5f0..836575b90 100644 --- a/public/assets/wechat/class.html +++ b/public/assets/wechat/class.html @@ -230,7 +230,7 @@
    -
    {{r.filename}}发送
    +
    {{r.filename}}发送

    暂无课件,
    请登录Trustie网站,在PC浏览器中上传课件。

    diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html index 8bfa818de..1848dad60 100644 --- a/public/assets/wechat/myresource.html +++ b/public/assets/wechat/myresource.html @@ -12,7 +12,7 @@
    - {{r.filename}}发送
    + {{r.filename}}发送
    大小:{{r.attafile_size}}
    diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js index 1e9fbcb0e..ea394a1ff 100644 --- a/public/javascripts/wechat/controllers/class.js +++ b/public/javascripts/wechat/controllers/class.js @@ -6,6 +6,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location }; var vm = $scope; + + vm.g_localhost = window.g_localhost; + var courseid = $routeParams.id; var tag = $routeParams.tag; diff --git a/public/javascripts/wechat/controllers/myresource.js b/public/javascripts/wechat/controllers/myresource.js index d920b376a..f6bb1bb00 100644 --- a/public/javascripts/wechat/controllers/myresource.js +++ b/public/javascripts/wechat/controllers/myresource.js @@ -3,6 +3,9 @@ app.controller('MyResourceController', ['$scope', '$http', 'auth', 'config', '$l var vm = $scope; // vm.menus = ['课件', '作业', '测验']; + + vm.g_localhost = window.g_localhost; + vm.menus = ['课件', '作业']; vm.resources = [];