From 5f77c97c9ddc4fbdecc5f402418c751f8fc4082a Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Fri, 9 Sep 2016 15:01:46 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E8=AF=BE=E4=BB=B6=E4=B8=8B=E8=BD=BD?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/assets/wechat/class.html | 2 +-
public/assets/wechat/myresource.html | 2 +-
public/javascripts/wechat/controllers/class.js | 3 +++
public/javascripts/wechat/controllers/myresource.js | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html
index f81b4f5f0..88ef967e9 100644
--- a/public/assets/wechat/class.html
+++ b/public/assets/wechat/class.html
@@ -230,7 +230,7 @@
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 = [];
From 9997de0d9626ad8dd3acd78c7f9536ef40085e56 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Fri, 9 Sep 2016 15:14:24 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=AF=BE=E4=BB=B6?=
=?UTF-8?q?=E4=B8=8B=E8=BD=BD=E4=B8=8D=E9=9C=80=E8=A6=81=E7=99=BB=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/attachments_controller.rb | 7 ++++++-
public/assets/wechat/class.html | 2 +-
public/assets/wechat/myresource.html | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 5d1345f24..2e85d8a72 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] == "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'
diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html
index 88ef967e9..836575b90 100644
--- a/public/assets/wechat/class.html
+++ b/public/assets/wechat/class.html
@@ -230,7 +230,7 @@
-
+
暂无课件,
请登录Trustie网站,在PC浏览器中上传课件。
diff --git a/public/assets/wechat/myresource.html b/public/assets/wechat/myresource.html
index 718e3c278..1848dad60 100644
--- a/public/assets/wechat/myresource.html
+++ b/public/assets/wechat/myresource.html
@@ -12,7 +12,7 @@
From 564da2ed72fc535b917f9d8d2129588340776301 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Fri, 9 Sep 2016 15:36:15 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=AF=BE=E4=BB=B6?=
=?UTF-8?q?=E4=B8=8B=E8=BD=BD=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/application_controller.rb | 3 ++-
app/controllers/attachments_controller.rb | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
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 2e85d8a72..3986acc0a 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -130,7 +130,7 @@ class AttachmentsController < ApplicationController
def download
# modify by nwb
# 下载添加权限设置
- if params[:type] == "wechat"
+ if (params[:type] && params[:type] == "wechat" )
candown = true
else
candown = attachment_candown @attachment
@@ -715,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
From 3a6237a6e4800d4f3e2ea090e3a6439593c4e0b8 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 9 Sep 2016 16:32:15 +0800
Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8C=E7=A8=8B?=
=?UTF-8?q?=E7=A2=91=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
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(": #{subject}".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
From 502bd9f451eed8cbeb72b425e1d65b2ff248cab1 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 9 Sep 2016 16:37:24 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E9=87=8C=E7=A8=8B=E7=A2=91=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F=E8=BF=87=E9=95=BF=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/versions/index.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 -%>