+
-
From 7d671c77583c2135c14e0fb39b7f70e5110dc2a9 Mon Sep 17 00:00:00 2001
From: Tim
Date: Tue, 23 Aug 2016 15:04:48 +0800
Subject: [PATCH 22/73] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BE=93=E5=85=A5?=
=?UTF-8?q?=E6=A1=86padding=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/weui/weixin.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css
index 7375fc80c..52125b768 100644
--- a/public/stylesheets/weui/weixin.css
+++ b/public/stylesheets/weui/weixin.css
@@ -220,7 +220,7 @@ a.underline {text-decoration:underline;}
.amount-arrow {height:14px; line-height:14px; vertical-align:middle; margin-top:12px;}
.new-class-btn {font-size:15px; color:#fff; background-color:#3b94d6; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;}
.join-class-btn {font-size:15px; color:#444; background-color:#ccc; padding:10px 40px; border-radius:20px; display:inline-block; margin:0 auto;}
-.new-class-input {width:60%; color:#555; height:16px; line-height:16px; border:none; outline:none; padding:11px 0;}
+.new-class-input {width:60%; color:#555; height:16px; line-height:16px; border:none; outline:none; padding:10px 0;}
.class-list-setting {position:absolute; top:11px; right:10px;}
.class-setting-wrap {width:38px; height:38px; position:absolute; top:0; right:0;}
From 5088770214e5b9abe43a4fc68905efc88d182151 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Tue, 23 Aug 2016 16:34:11 +0800
Subject: [PATCH 23/73] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=96=87?=
=?UTF-8?q?=E7=AB=A0=E9=99=84=E4=BB=B6=E5=92=8C=E8=B5=84=E6=BA=90=E6=A0=8F?=
=?UTF-8?q?=E7=9B=AE=E4=B8=8B=E8=BD=BD=E6=9D=83=E9=99=90=E4=B8=80=E8=87=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 2 +-
.../attachments/_activity_attach.html.erb | 2 +-
app/views/files/_org_subfield_list.html.erb | 6 +-
app/views/organizations/setting.html.erb | 90 +++++++++----------
4 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b225c3099..942016976 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2169,7 +2169,7 @@ module ApplicationHelper
candown= User.current.member_of_course?(course) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
elsif attachment.container.is_a?(OrgSubfield)
org = attachment.container.organization
- candown = User.current.member_of_org?(org) || (attachment.is_public == 1) || attachment.get_status_by_attach(User.current.id) == 2
+ candown = User.current.member_of_org?(org) || ((attachment.is_public == 1 || attachment.get_status_by_attach(User.current.id) == 2) && org.allow_guest_download == true)
elsif attachment.container.is_a?(OrgDocumentComment)
org = attachment.container.organization
candown = User.current.member_of_org?(org) || (org.is_public && attachment.is_public == 1)
diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb
index 3cc429185..b37c80dad 100644
--- a/app/views/attachments/_activity_attach.html.erb
+++ b/app/views/attachments/_activity_attach.html.erb
@@ -3,7 +3,7 @@
- <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw380', :download => true -%>
+ <%= link_to_short_attachment attachment,:length=> 58, :class => 'hidden link_file_a fl newsBlue mw380', :download => true %>
(
diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb
index 1bbdc0e93..e567435a5 100644
--- a/app/views/files/_org_subfield_list.html.erb
+++ b/app/views/files/_org_subfield_list.html.erb
@@ -11,9 +11,9 @@
<%# 如果有历史版本则提供历史版本下载 %>
<% if file.attachment_histories.count == 0 %>
- <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
- download_named_attachment_path(file.id, file.filename),
- :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
+ <%= link_to file.is_public? ? truncate(file.filename, length: 45) : truncate(file.filename,length: 35, omission: '...'),
+ download_named_attachment_path(file.id, file.filename),
+ :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
<% else %>
<%= link_to truncate(file.filename,length: 35, omission: '...'), attachment_history_download_path(file.id),
:title => file.filename+"\n"+file.description.to_s,
diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb
index a2f8a8f29..f1a8da8e4 100644
--- a/app/views/organizations/setting.html.erb
+++ b/app/views/organizations/setting.html.erb
@@ -47,52 +47,52 @@
<%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %>
<%= labelled_form_for @organization do |f|%>
- <%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
-
-
-
+ <%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
+
+
+
-
-
-
组织URL:
-
http://
-
- .trustie.net
申请
- <% record = OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first %>
- <% if domain.present? and record.present? and record.content == domain.subname %>
-
(已批准)
- <% elsif record %>
-
(您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准)
- <% end %>
-
-
-
-
-
- 显示模式 :
- />
- 简洁模式
- />
- 门户模式
-
-
公开 :
- class="ml3" />
-
-
下载支持 :
- name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
- 允许游客下载
- <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
-
-
-
-
-
-
-
保存
+
+
+
组织URL:
+
http://
+
+ .trustie.net
申请
+ <% record = OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first %>
+ <% if domain.present? and record.present? and record.content == domain.subname %>
+
(已批准)
+ <% elsif record %>
+
(您申请了子域名<%= OrgMessage.where("organization_id=? and message_type='ApplySubdomain'", @organization.id).order("updated_at desc").first.content %>,还未批准)
+ <% end %>
+
+
+
+
+
+ 显示模式 :
+ />
+ 简洁模式
+ />
+ 门户模式
+
+
公开 :
+ class="ml3" />
+
+
下载支持 :
+ name="organization[allow_guest_download]" <%= @organization.allow_guest_download ? 'checked': ''%> class="ml3" />
+ 允许游客下载
+ <%= @organization.is_public? ? "" : "(私有组织不允许游客下载资源)" %>
+
+
+
+
+
+
+
保存
<% end %>
From c8c5f5d415b25d87ab17a7d6a291e03de9f563b2 Mon Sep 17 00:00:00 2001
From: Tim
Date: Tue, 23 Aug 2016 16:36:59 +0800
Subject: [PATCH 24/73] =?UTF-8?q?iphone=E4=B8=8Bflex=E6=97=A0=E6=95=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/weui/weixin.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css
index 52125b768..25293a027 100644
--- a/public/stylesheets/weui/weixin.css
+++ b/public/stylesheets/weui/weixin.css
@@ -92,14 +92,14 @@ a.underline {text-decoration:underline;}
/*tab*/
.tab-wrap {position:relative; width:100%; line-height:38px; display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display:flex; font-size:13px; background-color:#fff;}
-.tab-wrap a {position:relative; display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; flex:1;}
+.tab-wrap a {position:relative; display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; -webkit-flex:1; flex:1;}
.tab-wrap a:first-child:after {display:none;}
.tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;}
.weixin-tab {text-align:center; border-bottom:1px solid #ccc;}
/*bottom-tab*/
.bottom-tab-wrap {position:fixed; width:100%; bottom:0; line-height:38px; display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display:flex; font-size:13px; background-color:#fff;}
-.bottom-tab-wrap a {display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; flex:1; position:relative;}
+.bottom-tab-wrap a {display:block; -webkit-box-flex:1; -moz-box-flex:1; -ms-flex:1; -webkit-flex:1; flex:1; position:relative;}
.bottom-tab-wrap a:after {content:" "; position:absolute; left:0; top:0; width:1px; height:100%; border-left:1px solid #ccc; color:#707070;}
/*动态样式*/
From c612104fabf9fcd4c620e015aee55fb2ac468dee Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 23 Aug 2016 16:52:35 +0800
Subject: [PATCH 25/73] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E5=8F=91=E5=B8=96=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/api/mobile/apis/courses.rb | 79 +++++++++++++++
app/api/mobile/apis/projects.rb | 39 ++++++++
public/assets/wechat/class.html | 4 +-
public/assets/wechat/class_publishissue.html | 14 +++
public/assets/wechat/class_publishnotice.html | 14 +++
public/assets/wechat/project.html | 2 +-
public/assets/wechat/project_publishnote.html | 14 +++
.../javascripts/wechat/controllers/class.js | 96 ++++++++++++++-----
.../wechat/controllers/class_list.js | 5 +
.../wechat/controllers/class_publishissue.js | 73 ++++++++++++++
.../wechat/controllers/class_publishnotice.js | 72 ++++++++++++++
.../javascripts/wechat/controllers/project.js | 15 +++
.../wechat/controllers/project_publishnote.js | 74 ++++++++++++++
public/javascripts/wechat/others/routes.js | 3 +
14 files changed, 475 insertions(+), 29 deletions(-)
create mode 100644 public/assets/wechat/class_publishissue.html
create mode 100644 public/assets/wechat/class_publishnotice.html
create mode 100644 public/assets/wechat/project_publishnote.html
create mode 100644 public/javascripts/wechat/controllers/class_publishissue.js
create mode 100644 public/javascripts/wechat/controllers/class_publishnotice.js
create mode 100644 public/javascripts/wechat/controllers/project_publishnote.js
diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb
index b28d3eca0..bfd559402 100644
--- a/app/api/mobile/apis/courses.rb
+++ b/app/api/mobile/apis/courses.rb
@@ -582,6 +582,85 @@ module Mobile
end
end
+ desc "发布班级通知"
+ params do
+ requires :id, type: Integer
+ requires :token, type: String
+ requires :text, type: String
+ requires :title, type: String
+ end
+ post ':id/publishnotice' do
+ authenticate!
+
+ #老师或教辅才能发通知
+ c = Course.find("#{params[:id]}")
+
+ my_member = c.member_principals.where("users.id=#{current_user.id}").first
+
+ roles_ids = []
+ my_member.roles.each do |role|
+ roles_ids << role.id
+ end
+ if my_member && (roles_ids.include?(7)|| roles_ids.include?(9) || roles_ids.include?(3))
+
+ tmpparams = {}
+ tmpparams['title'] = params[:title]
+ tmpparams['description'] = params[:text]
+ tmpparams['sticky'] = 0
+
+ news = News.new(:course => c, :author => current_user)
+ #render :layout => 'base_courses'
+ news.safe_attributes = tmpparams
+
+ news.save!
+
+ present :status, 0
+ else
+ present :status, -1
+ present :message,"学生不能发布通知"
+ end
+ end
+
+ desc "发布班级问题"
+ params do
+ requires :id, type: Integer
+ requires :token, type: String
+ requires :text, type: String
+ end
+ post ':id/publishissue' do
+ authenticate!
+
+ c = Course.find("#{params[:id]}")
+
+ boards = c.boards.includes(:last_message => :author).all
+ if c.boards.empty?
+ board = c.boards.build
+ board.name = "班级问答区"
+ board.description = c.name.to_s
+ board.project_id = -1
+ if board.save
+ boards = c.boards.includes(:last_message => :author).all
+ end
+ end
+
+ board = boards.first
+
+ message = Message.new
+ message.author = current_user
+ message.board = board
+
+ tmpparams = {}
+ tmpparams['subject'] = params[:title]
+ tmpparams['content'] = params[:text]
+
+ message.safe_attributes = tmpparams
+
+ message.save!
+
+ present :status, 0
+
+ end
+
end
end
end
diff --git a/app/api/mobile/apis/projects.rb b/app/api/mobile/apis/projects.rb
index 05d4036f9..2202fbd13 100644
--- a/app/api/mobile/apis/projects.rb
+++ b/app/api/mobile/apis/projects.rb
@@ -229,6 +229,45 @@ module Mobile
present :message, result[:message]
end
+ desc "发布项目帖子"
+ params do
+ requires :id, type: Integer
+ requires :token, type: String
+ requires :text, type: String
+ end
+ post ':id/publishnote' do
+ authenticate!
+
+ project = Project.find("#{params[:id]}")
+
+ boards = project.boards.includes(:last_message => :author).all
+ if project.boards.empty?
+ board = project.boards.build
+ board.name = "项目讨论区"
+ board.description = project.name.to_s
+ board.course_id = -1
+ if board.save
+ boards = project.boards.includes(:last_message => :author).all
+ end
+ end
+
+ board = boards.first
+
+ message = Message.new
+ message.author = current_user
+ message.board = board
+
+ tmpparams = {}
+ tmpparams['subject'] = params[:title]
+ tmpparams['content'] = params[:text]
+
+ message.safe_attributes = tmpparams
+
+ message.save!
+
+ present :status, 0
+
+ end
end
end
end
diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html
index 764bff0a5..d60aed1bd 100644
--- a/public/assets/wechat/class.html
+++ b/public/assets/wechat/class.html
@@ -147,8 +147,8 @@
更多
diff --git a/public/assets/wechat/class_publishissue.html b/public/assets/wechat/class_publishissue.html
new file mode 100644
index 000000000..1d840239c
--- /dev/null
+++ b/public/assets/wechat/class_publishissue.html
@@ -0,0 +1,14 @@
+
+
+
+
{{current_course.name}}
+
标题
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/assets/wechat/class_publishnotice.html b/public/assets/wechat/class_publishnotice.html
new file mode 100644
index 000000000..25c485737
--- /dev/null
+++ b/public/assets/wechat/class_publishnotice.html
@@ -0,0 +1,14 @@
+
+
+
+
{{current_course.name}}
+
标题
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/assets/wechat/project.html b/public/assets/wechat/project.html
index 5da7a68c7..5b460ecad 100644
--- a/public/assets/wechat/project.html
+++ b/public/assets/wechat/project.html
@@ -99,7 +99,7 @@
更多
diff --git a/public/assets/wechat/project_publishnote.html b/public/assets/wechat/project_publishnote.html
new file mode 100644
index 000000000..5da49397c
--- /dev/null
+++ b/public/assets/wechat/project_publishnote.html
@@ -0,0 +1,14 @@
+
+
+
+
{{current_project.name}}
+
标题
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js
index a0c575d92..91641ddcd 100644
--- a/public/javascripts/wechat/controllers/class.js
+++ b/public/javascripts/wechat/controllers/class.js
@@ -1,4 +1,4 @@
-app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms','common', function($scope, config, $http, auth, $location, $routeParams,alertService,rms,common){
+app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms','common','$timeout', function($scope, config, $http, auth, $location, $routeParams,alertService,rms,common,$timeout){
// common.checkLogin();
var vm = $scope;
@@ -103,7 +103,10 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.isTeacher = false;
- vm.currentTab = 1;
+// vm.currentTab = 1;
+
+ vm.currentTab = rms.get('tab_num');
+
vm.tab = function(index){
vm.currentTab = index;
vm.searchText = '';
@@ -119,7 +122,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
if(vm.isTeacher){
if(index == 1){
- getClassActivities(0);
+ if(vm.course_activities.length <= 0){
+ getClassActivities(0);
+ }
vm.showActivities = true;
}
else if(index == 2){ //课件
@@ -137,7 +142,9 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
} else {
if(index == 1){
- getClassActivities(0);
+ if(vm.course_activities.length <= 0){
+ getClassActivities(0);
+ }
vm.showActivities = true;
}
else if(index == 3){
@@ -149,10 +156,10 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.showResources = true;
}
}
- rms.save("tab_num",index);
+ rms.save("tab_num",vm.currentTab);
};
- vm.tabRecord = rms.get('tab_num') || 1;
+// vm.tabRecord = rms.get('tab_num') || 1;
// vm.course = {};
vm.students = [];
@@ -182,48 +189,61 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$location.path("/send_class_list").search({id: r.id});
};
- $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
- function(response) {
- console.log(response.data);
+ if(!vm.currentTab){
+ $http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
+ function(response) {
+ console.log(response.data);
- if (response.data.status == 0){
- vm.course = response.data.data;
- resetMenu(vm.course.current_user_is_teacher,vm.tabRecord);
- if(tag){
- vm.tab(4);
- tag = null;
+ if (response.data.status == 0){
+ vm.course = response.data.data;
+ resetMenu(vm.course.current_user_is_teacher,vm.currentTab);
+ if(tag){
+ vm.tab(4);
+ tag = null;
+ vm.currentTab = 4;
+ }
+ else{
+ vm.currentTab = 1;
+ vm.tab(vm.currentTab);
+ }
}
else{
- vm.tab(vm.tabRecord);
+ vm.alertService.showMessage('提示', response.data.message);
}
+
}
- else{
- vm.alertService.showMessage('提示', response.data.message);
- }
+ );
+ }else {
+ $timeout(function(){
+ window.scrollTo(0, rms.get("yoffset"));
+ });
+ }
- }
- );
-
-
- var resetMenu = function(is_teacher){
+ var resetMenu = function(is_teacher,index){
vm.isTeacher = is_teacher;
if(is_teacher){
vm.menus = ["动态", "课件", "作业", "成员管理"];
} else {
vm.menus = ['动态','课件', "我的同学"];
}
-
+ vm.tab(index);
};
+ if(vm.course){
+ resetMenu(vm.course.current_user_is_teacher,vm.currentTab);
+ }
+
+
vm.onSetting = function(user){
rms.save('current_edit_member', user);
+ rms.save("tab_num",vm.currentTab);
$location.path("/edit_class_member").search({id: courseid,user_id: user.id});
};
vm.review = function(user){
rms.save('current_review_member', user);
rms.save('current_course', vm.course);
-
+ rms.save("tab_num",vm.currentTab);
$location.path("/review_class_member").search({id: courseid,user_id: user.id});
};
@@ -233,6 +253,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
rms.save('course_activities_page',vm.course_activities_page);
rms.save("course_activities",vm.course_activities);
rms.save('course_has_more', vm.course_has_more);
+ rms.save("tab_num",vm.currentTab);
rms.save("course",vm.course);
// $location.path('/'+type+'/'+act_id);
$location.path("/"+type).search({id: act_id});
@@ -262,4 +283,27 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
common.decreaseCommonPraise(act);
};
+ vm.goPublishNotice = function(){
+ if(!vm.isTeacher){
+ return;
+ }
+ rms.save('course_activities_page',vm.course_activities_page);
+ rms.save("course_activities",vm.course_activities);
+ rms.save('course_has_more', vm.course_has_more);
+ rms.save("tab_num",vm.currentTab);
+ rms.save("course",vm.course);
+ rms.save('current_course', vm.course);
+ $location.path("/class_publishnotice").search({id:courseid});
+ };
+
+ vm.goPublishIssue = function(){
+ rms.save('course_activities_page',vm.course_activities_page);
+ rms.save("course_activities",vm.course_activities);
+ rms.save('course_has_more', vm.course_has_more);
+ rms.save("tab_num",vm.currentTab);
+ rms.save("course",vm.course);
+ rms.save('current_course', vm.course);
+ $location.path("/class_publishissue").search({id:courseid});
+ };
+
}]);
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/class_list.js b/public/javascripts/wechat/controllers/class_list.js
index cc5250970..5d3ca5b93 100644
--- a/public/javascripts/wechat/controllers/class_list.js
+++ b/public/javascripts/wechat/controllers/class_list.js
@@ -49,6 +49,11 @@ app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$lo
}
vm.goClass = function (course_id) {
+ rms.save('course_activities_page',0);
+ rms.save("course_activities",[]);
+ rms.save("course_has_more",false);
+ rms.save("course",null);
+ rms.save("tab_num",null);
console.log(course_id);
$location.path("/class").search({id: course_id});
}
diff --git a/public/javascripts/wechat/controllers/class_publishissue.js b/public/javascripts/wechat/controllers/class_publishissue.js
new file mode 100644
index 000000000..1cd7f1285
--- /dev/null
+++ b/public/javascripts/wechat/controllers/class_publishissue.js
@@ -0,0 +1,73 @@
+app.controller('ClassPublishIssueController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
+ var vm = $scope;
+ vm.current_course = rms.get('current_course');
+
+ vm.issuetitle = "";
+ vm.issue = "";
+ var course_id = $routeParams.id;
+
+ vm.alertService = alertService.create();
+
+ if(!vm.current_course){
+ $http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
+ function(response) {
+ console.log(response.data);
+ if (response.data.status == 0){
+ vm.current_course = response.data.data;
+ console.log("courses");
+ console.log(response.data.data);
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message);
+ }
+ if(!vm.current_course){
+ vm.tip_1 = "该班级不存在或已被删除";
+ }
+
+ }
+ );
+ }
+
+ vm.cancel = function(){
+ window.history.back();
+ };
+
+ //发布问题 即项目讨论区
+ vm.publishIssue = function(){
+ if(vm.issuetitle.length == 0)
+ {
+ vm.alertService.showMessage('提示', '标题不能为空');
+ return;
+ }
+
+ if(vm.issue.length == 0)
+ {
+ vm.alertService.showMessage('提示', '内容不能为空');
+ return;
+ }
+
+ var text = vm.issue.replace(/\n/g,'
');
+
+ $http.post(config.apiUrl + "courses/"+course_id+"/publishissue",
+ {token: auth.token(),title: vm.issuetitle, text: text}
+ ).then(function(response){
+ if(response.data.status == 0)
+ {
+ vm.alertService.showMessage('提示', '您已成功发布问题',function(){
+ rms.save('course_activities_page',0);
+ rms.save("course_activities",[]);
+ rms.save("course_has_more",false);
+ $location.path("/class").search({id: course_id});
+ });
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message);
+
+ }
+ });
+
+ };
+
+}] );
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/class_publishnotice.js b/public/javascripts/wechat/controllers/class_publishnotice.js
new file mode 100644
index 000000000..a0b9ab676
--- /dev/null
+++ b/public/javascripts/wechat/controllers/class_publishnotice.js
@@ -0,0 +1,72 @@
+app.controller('ClassPublishNoticeController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
+ var vm = $scope;
+ vm.current_course = rms.get('current_course');
+
+ var course_id = $routeParams.id;
+
+ vm.alertService = alertService.create();
+
+ vm.noticetitle = "";
+ vm.notice = "";
+
+ if(!vm.current_course){
+ $http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
+ function(response) {
+ console.log(response.data);
+ if (response.data.status == 0){
+ vm.current_course = response.data.data;
+ console.log("courses");
+ console.log(response.data.data);
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message);
+ }
+ if(!vm.current_course){
+ vm.tip_1 = "该班级不存在或已被删除";
+ }
+
+ }
+ );
+ }
+ vm.cancel = function(){
+ window.history.back();
+ };
+
+ //发布通知 只有老师能发布
+ vm.publishNotice = function(){
+ if(vm.noticetitle.length == 0)
+ {
+ vm.alertService.showMessage('提示', '标题不能为空');
+ return;
+ }
+
+ if(vm.notice.length == 0)
+ {
+ vm.alertService.showMessage('提示', '内容不能为空');
+ return;
+ }
+
+ var text = vm.notice.replace(/\n/g,'
');
+
+ $http.post(config.apiUrl + "courses/"+course_id+"/publishnotice",
+ {token: auth.token(),title: vm.noticetitle, text: text}
+ ).then(function(response){
+ if(response.data.status == 0)
+ {
+ vm.alertService.showMessage('提示', '您已成功发布通知',function(){
+ rms.save('course_activities_page',0);
+ rms.save("course_activities",[]);
+ rms.save("course_has_more",false);
+ $location.path("/class").search({id: course_id});
+ });
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message);
+ }
+ });
+
+ };
+
+}] );
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/project.js b/public/javascripts/wechat/controllers/project.js
index 826a16424..c45696668 100644
--- a/public/javascripts/wechat/controllers/project.js
+++ b/public/javascripts/wechat/controllers/project.js
@@ -238,4 +238,19 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
$location.path("/review_project_member").search({id: projectid,user_id: user.id});
}
+ vm.goPublishNote = function(){
+ rms.save('project_activities_page',vm.project_activities_page);
+ rms.save("project_activities",vm.project_activities);
+ rms.save("project_has_more",vm.project_has_more);
+
+ rms.save("project",vm.project);
+ rms.save("project_master_members",vm.project_master_members);
+ rms.save("project_develop_members",vm.project_develop_members);
+ rms.save("project_report_members",vm.project_report_members);
+ rms.save("review_master_members",vm.review_master_members);
+ rms.save("review_develop_members",vm.review_develop_members);
+ rms.save('current_project', vm.project);
+ $location.path("/project_publishnote").search({id:projectid});
+ };
+
}]);
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/project_publishnote.js b/public/javascripts/wechat/controllers/project_publishnote.js
new file mode 100644
index 000000000..231faaea6
--- /dev/null
+++ b/public/javascripts/wechat/controllers/project_publishnote.js
@@ -0,0 +1,74 @@
+app.controller('ProjectPublishNoteController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
+ var vm = $scope;
+ vm.current_project = rms.get('current_project');
+
+ var project_id = $routeParams.id;
+
+ vm.alertService = alertService.create();
+
+ vm.notetitle = "";
+ vm.note = "";
+
+ if(!vm.current_project){
+ $http.get(config.apiUrl+ 'projects/'+project_id+"?token="+auth.token()).then(
+ function(response) {
+ console.log(response.data);
+ if (response.data.status == 0){
+ vm.current_project = response.data.data;
+ console.log("projects");
+ console.log(response.data.data);
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message);
+ }
+
+ if(!vm.current_project){
+ vm.tip_1 = "该项目不存在或已被删除";
+ }
+
+ }
+ );
+ }
+ vm.cancel = function(){
+ window.history.back();
+ };
+
+ //发布通知 只有老师能发布
+ vm.publishNote = function(){
+ if(vm.notetitle.length == 0)
+ {
+ vm.alertService.showMessage('提示', '标题不能为空');
+ return;
+ }
+
+ if(vm.note.length == 0)
+ {
+ vm.alertService.showMessage('提示', '内容不能为空');
+ return;
+ }
+
+ var text = vm.note.replace(/\n/g,'
');
+
+ $http.post(config.apiUrl + "projects/"+project_id+"/publishnote",
+ {token: auth.token(),title: vm.notetitle, text: text}
+ ).then(function(response){
+ if(response.data.status == 0)
+ {
+ vm.alertService.showMessage('提示', '您已成功发布帖子',function(){
+ rms.save('project_activities_page',0);
+ rms.save("project_activities",[]);
+ rms.save("project_has_more",false);
+ rms.save('tab_num',null);
+ $location.path("/project").search({id: project_id});
+ });
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message);
+ }
+ });
+
+ };
+
+}] );
\ No newline at end of file
diff --git a/public/javascripts/wechat/others/routes.js b/public/javascripts/wechat/others/routes.js
index 7311c66c1..2182e16ee 100644
--- a/public/javascripts/wechat/others/routes.js
+++ b/public/javascripts/wechat/others/routes.js
@@ -40,6 +40,8 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
.when('/send_class_list', makeRoute('send_class_list.html', 'SendClassListController'))
.when('/join_class', makeRoute('join_class.html', 'JoinClassController'))
.when('/review_class_member', makeRoute('review_class_member.html', 'ReviewClassMemberController'))
+ .when('/class_publishnotice', makeRoute('class_publishnotice.html', 'ClassPublishNoticeController'))
+ .when('/class_publishissue', makeRoute('class_publishissue.html', 'ClassPublishIssueController'))
.when('/project_list', makeRoute('project_list.html', 'ProjectListController'))
.when('/project', makeRoute('project.html', 'ProjectController'))
.when('/edit_project_member', makeRoute('edit_project_member.html', 'EditProjectMemberController'))
@@ -47,6 +49,7 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
.when('/project_invite_code', {templateUrl: rootPath + 'project_invite_code.html', controller: 'ProjectInviteCodeController'})
.when('/join_project', makeRoute('join_project.html', 'JoinProjectController'))
.when('/review_project_member', makeRoute('review_project_member.html', 'ReviewProjectMemberController'))
+ .when('/project_publishnote', makeRoute('project_publishnote.html', 'ProjectPublishNoteController'))
.when('/login_tip', makeRoute('login_tip.html', 'LoginTipController'))
.otherwise({
redirectTo: '/activites'
From c5cedbfcc26d1a8beb88517216904010bf69ef0a Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 23 Aug 2016 17:37:23 +0800
Subject: [PATCH 26/73] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8F=AD=E7=BA=A7?=
=?UTF-8?q?=E5=92=8C=E9=A1=B9=E7=9B=AE=E5=AE=A1=E6=A0=B8=E6=A8=A1=E7=89=88?=
=?UTF-8?q?=E6=B6=88=E6=81=AF=E5=9C=B0=E5=9D=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/wechats_controller.rb | 8 ++++++--
app/services/wechat_service.rb | 12 ++++++------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb
index cfa5f4414..b21d82e87 100644
--- a/app/controllers/wechats_controller.rb
+++ b/app/controllers/wechats_controller.rb
@@ -435,8 +435,12 @@ class WechatsController < ActionController::Base
session[:wechat_openid] = open_id
if params[:code]
- if params[:userid]
- redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}" and return
+ if params[:state].match("review_class_member") || params[:state].match("review_project_member")
+ useridstr = params[:state].split('/')[1]
+ end
+
+ if useridstr
+ redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}{useridstr}" and return
elsif params[:id]
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
else
diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb
index 3b6cfe930..c28c5f7b2 100644
--- a/app/services/wechat_service.rb
+++ b/app/services/wechat_service.rb
@@ -115,8 +115,8 @@ class WechatService
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
- tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- # tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+ "&user_id="+uid.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
+ # tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
touser:openid,
@@ -149,8 +149,8 @@ class WechatService
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
- tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- # tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+ "&user_id="+uid.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
+ # tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
@@ -188,8 +188,8 @@ class WechatService
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
- tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- # tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+ "&user_id="+uid.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
+ # tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
From 3af5bc581321575e4e78a53062eae363bc6c5904 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 23 Aug 2016 17:42:48 +0800
Subject: [PATCH 27/73] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=AE=A1=E6=A0=B8?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/wechat_service.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb
index c28c5f7b2..a9a62bc66 100644
--- a/app/services/wechat_service.rb
+++ b/app/services/wechat_service.rb
@@ -116,7 +116,7 @@ class WechatService
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/userid="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
touser:openid,
@@ -150,7 +150,7 @@ class WechatService
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/userid="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
@@ -189,7 +189,7 @@ class WechatService
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/userid="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
From e0ab93b739936740f0fb1129a1d051c784b97e97 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 24 Aug 2016 09:30:28 +0800
Subject: [PATCH 28/73] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=AE=A1=E6=A0=B8?=
=?UTF-8?q?=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/wechats_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb
index b21d82e87..b06a72137 100644
--- a/app/controllers/wechats_controller.rb
+++ b/app/controllers/wechats_controller.rb
@@ -436,6 +436,7 @@ class WechatsController < ActionController::Base
session[:wechat_openid] = open_id
if params[:code]
if params[:state].match("review_class_member") || params[:state].match("review_project_member")
+ @path = params[:state].split('/')[0]
useridstr = params[:state].split('/')[1]
end
From 5d5bd88c88667d85ce6a77ddfd6198dde5b3494b Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 24 Aug 2016 09:30:57 +0800
Subject: [PATCH 29/73] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=EF=BC=9A=E7=94=A8=E6=88=B7=E4=B8=8D=E5=BA=94=E6=9C=89=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E4=BB=96=E4=BA=BA=E5=A4=B4=E5=83=8F=E7=9A=84=E6=9D=83?=
=?UTF-8?q?=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/new_base_user.html.erb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb
index f98585b77..66ee71f8a 100644
--- a/app/views/layouts/new_base_user.html.erb
+++ b/app/views/layouts/new_base_user.html.erb
@@ -102,8 +102,10 @@
- <% if User.current.logged?%>
+ <% if User.current.logged? && User.current == @user%>
<%=link_to image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx'), my_clear_user_avatar_temp_path, :class => "user_leftinfo_img", :remote => true%>
+ <% elsif User.current.logged? %>
+
<%=image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx') %>
<% else %>
<% end %>
From 2e1e9391b6600772951a4f4088d64ea082bbb4cd Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 24 Aug 2016 09:39:41 +0800
Subject: [PATCH 30/73] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=AE=A1=E6=A0=B8?=
=?UTF-8?q?=E9=93=BE=E6=8E=A5=E8=B7=AF=E5=BE=84=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/wechat_service.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb
index a9a62bc66..c28c5f7b2 100644
--- a/app/services/wechat_service.rb
+++ b/app/services/wechat_service.rb
@@ -116,7 +116,7 @@ class WechatService
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/userid="+uid.to_s+Wechat.config.auto_openid_url_3
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
touser:openid,
@@ -150,7 +150,7 @@ class WechatService
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/userid="+uid.to_s+Wechat.config.auto_openid_url_3
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
@@ -189,7 +189,7 @@ class WechatService
tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+Wechat.config.auto_openid_url_3
if uid && uid != 0
# tmpurl = "#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/#{type}?id=#{id}"+ "&user_id="+uid.to_s
- tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/userid="+uid.to_s+Wechat.config.auto_openid_url_3
+ tmpurl = Wechat.config.auto_openid_url_1+"?id="+id.to_s+Wechat.config.auto_openid_url_2+type+"/user_id="+uid.to_s+Wechat.config.auto_openid_url_3
end
data = {
From 0eb1c1a392e4283941a7025b41ac18cd0793918d Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 24 Aug 2016 09:45:18 +0800
Subject: [PATCH 31/73] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=AE=A1=E6=A0=B8?=
=?UTF-8?q?=E9=93=BE=E6=8E=A5=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/wechats_controller.rb | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb
index b06a72137..54486221e 100644
--- a/app/controllers/wechats_controller.rb
+++ b/app/controllers/wechats_controller.rb
@@ -435,11 +435,10 @@ class WechatsController < ActionController::Base
session[:wechat_openid] = open_id
if params[:code]
- if params[:state].match("review_class_member") || params[:state].match("review_project_member")
+ # if params[:state].match("review_class_member") || params[:state].match("review_project_member")
@path = params[:state].split('/')[0]
useridstr = params[:state].split('/')[1]
- end
-
+ # end
if useridstr
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}{useridstr}" and return
elsif params[:id]
From f8dfe85156ffd19ea38a6cc6834e8342408819d6 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 24 Aug 2016 11:03:38 +0800
Subject: [PATCH 32/73] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E6=A8=A1=E7=89=88=E6=B6=88=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 21 ++++++++++++++++
app/services/projects_service.rb | 24 +++++++++++++++++++
app/services/wechat_service.rb | 13 +++++++++-
config/wechat.yml.template | 1 +
config/wechat.yml.test | 1 +
public/assets/wechat/class.html | 2 +-
public/assets/wechat/send_class_list.html | 2 +-
.../javascripts/wechat/controllers/class.js | 13 +++++++++-
.../wechat/controllers/send_class_list.js | 1 +
9 files changed, 74 insertions(+), 4 deletions(-)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 63ef30b35..b0c83e869 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -189,6 +189,15 @@ class IssuesController < ApplicationController
# 给该issue在它所在的项目中所有的issues中所在的位置给一个序号
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
if @issue.save
+
+ senduser = User.find(params[:issue][:assigned_to_id])
+ issue_id = @issue.id
+ issue_title = params[:issue][:subject]
+ priority_id = params[:issue][:priority_id]
+
+ ps = ProjectsService.new
+ ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
+
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
respond_to do |format|
format.html {
@@ -581,6 +590,18 @@ class IssuesController < ApplicationController
end
end
@issue.safe_attributes = issue_attributes
+
+ senduser = User.find(params[:issue][:assigned_to_id])
+
+ if senduser.id != User.current.id
+ issue_id = @issue.id
+ issue_title = params[:issue][:subject]
+ priority_id = params[:issue][:priority_id]
+
+ ps = ProjectsService.new
+ ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
+ end
+
@priorities = IssuePriority.active
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
true
diff --git a/app/services/projects_service.rb b/app/services/projects_service.rb
index 56dfaceff..8de96fff4 100644
--- a/app/services/projects_service.rb
+++ b/app/services/projects_service.rb
@@ -331,4 +331,28 @@ class ProjectsService
{:status => status,:message => message}
end
+ def send_wechat_project_issue_notice user,project,issue_id,issue_title,priority_id
+ count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count
+ if count == 0
+ title = "您有新的issue需要解决"
+ remark = "点击详情查看issue"
+
+ case priority_id
+ when 1
+ priority = "低"
+ when
+ priority = "正常"
+ when
+ priority = "高"
+ when
+ priority = "紧急"
+ when
+ priority = "立刻"
+ end
+
+ ws = WechatService.new
+ ws.project_issue_notice user.id, "issues", issue_id,title, issue_title,priority, remark
+ end
+ end
+
end
diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb
index c28c5f7b2..e1b849c13 100644
--- a/app/services/wechat_service.rb
+++ b/app/services/wechat_service.rb
@@ -417,8 +417,19 @@ class WechatService
end
Rails.logger.info "send over. #{req}"
end
+ end
-
+ def project_issue_notice(user_id, type, id, first, key1, key2,remark="")
+ uw = UserWechat.where(user_id: user_id).first
+ unless uw.nil?
+ data = two_keys_template uw.openid,Wechat.config.project_issue_notice, type, id, first, key1, key2,remark
+ begin
+ req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
+ rescue Exception => e
+ Rails.logger.error "[project_issue_notice] ===> #{e}"
+ end
+ Rails.logger.info "send over. #{req}"
+ end
end
end
\ No newline at end of file
diff --git a/config/wechat.yml.template b/config/wechat.yml.template
index e6b942f09..adda8e7e8 100644
--- a/config/wechat.yml.template
+++ b/config/wechat.yml.template
@@ -24,6 +24,7 @@ default: &default
create_project_notice: "jYu0iimbDpgWYZaTLXioZe2lvqoWTdKnUPyphTJ1mxs"
project_review_notice: "kdb-8UlMjTc3z51Qcf8g2vY4i_nE4OGKZAucdQma_2E"
join_project_notice: "TtXvy0XMIQyCgpnXHhoB8t-x0QIfy-78gAJXsGf9afg"
+ project_issue_notice: "HP8JejOnkzmvFopTarc0l1Tp4bU9qnxzdH27x3186lI"
auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities"
auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="
diff --git a/config/wechat.yml.test b/config/wechat.yml.test
index c0676cc26..8c0dafc2f 100644
--- a/config/wechat.yml.test
+++ b/config/wechat.yml.test
@@ -24,6 +24,7 @@ default: &default
create_project_notice: "R2ZaQKJfDJgujPcHWPzadKHIRkIyj2CjX2o_qIuRqig"
project_review_notice: "ip192wVXTav3qchgUn9_7B6lFfTlCZjwL7A1tncTOuc"
join_project_notice: "3KnMQEMUCmQWkB5JvzrpmguEwnN8bvUHUdpOTudxv_M"
+ project_issue_notice: "HAF2aCta7BtnaOd_cotGvU4tErGWwCd9I9aiClFN7w8"
auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities"
auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="
diff --git a/public/assets/wechat/class.html b/public/assets/wechat/class.html
index d60aed1bd..8ab2a7d03 100644
--- a/public/assets/wechat/class.html
+++ b/public/assets/wechat/class.html
@@ -190,7 +190,7 @@
-
{{r.homework_name}} 发送
+
{{r.homework_name}} 发送
暂无作业,
请登录Trustie网站,在PC浏览器中上传作业。
diff --git a/public/assets/wechat/send_class_list.html b/public/assets/wechat/send_class_list.html
index b6d250d5d..1fe699a20 100644
--- a/public/assets/wechat/send_class_list.html
+++ b/public/assets/wechat/send_class_list.html
@@ -8,7 +8,7 @@
{{syllabus.title}}
- {{course.name}}
+ {{course.name}}
diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js
index 91641ddcd..95d108151 100644
--- a/public/javascripts/wechat/controllers/class.js
+++ b/public/javascripts/wechat/controllers/class.js
@@ -186,7 +186,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.sendFile = function(r,index){
vm.myresource_sendIndex = index;
rms.save('myresource_sendIndex',index);
- $location.path("/send_class_list").search({id: r.id});
+ $location.path("/send_class_list").search({id: r.id,course_id: courseid});
};
if(!vm.currentTab){
@@ -306,4 +306,15 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$location.path("/class_publishissue").search({id:courseid});
};
+ vm.goHomeworkDetail = function(id){
+ rms.save("yoffset", document.documentElement.scrollTop || document.body.scrollTop);
+ rms.save('course_activities_page',vm.course_activities_page);
+ rms.save("course_activities",vm.course_activities);
+ rms.save('course_has_more', vm.course_has_more);
+ rms.save("tab_num",vm.currentTab);
+ rms.save("course",vm.course);
+// $location.path('/'+type+'/'+act_id);
+ $location.path("/homework").search({id: id});
+ }
+
}]);
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/send_class_list.js b/public/javascripts/wechat/controllers/send_class_list.js
index ead0860f5..815d0d4b3 100644
--- a/public/javascripts/wechat/controllers/send_class_list.js
+++ b/public/javascripts/wechat/controllers/send_class_list.js
@@ -3,6 +3,7 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co
var vm = $scope;
var send_id = $routeParams.id;
+ vm.course_id = $routeParams.course_id;
//发送类别 1课件 2作业 3测验
vm.myresource_sendIndex = rms.get('myresource_sendIndex') || 1;
From bd3911c072fb457fcd74f42212ebc812a4254f7a Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 24 Aug 2016 11:22:34 +0800
Subject: [PATCH 33/73] .
---
app/controllers/issues_controller.rb | 34 ++++++++++----------
app/services/projects_service.rb | 46 ++++++++++++++--------------
app/services/wechat_service.rb | 24 +++++++--------
config/wechat.yml.test | 1 -
4 files changed, 52 insertions(+), 53 deletions(-)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index b0c83e869..1e79f64bf 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -190,13 +190,13 @@ class IssuesController < ApplicationController
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
if @issue.save
- senduser = User.find(params[:issue][:assigned_to_id])
- issue_id = @issue.id
- issue_title = params[:issue][:subject]
- priority_id = params[:issue][:priority_id]
-
- ps = ProjectsService.new
- ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
+ # senduser = User.find(params[:issue][:assigned_to_id])
+ # issue_id = @issue.id
+ # issue_title = params[:issue][:subject]
+ # priority_id = params[:issue][:priority_id]
+ #
+ # ps = ProjectsService.new
+ # ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
respond_to do |format|
@@ -591,16 +591,16 @@ class IssuesController < ApplicationController
end
@issue.safe_attributes = issue_attributes
- senduser = User.find(params[:issue][:assigned_to_id])
-
- if senduser.id != User.current.id
- issue_id = @issue.id
- issue_title = params[:issue][:subject]
- priority_id = params[:issue][:priority_id]
-
- ps = ProjectsService.new
- ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
- end
+ # senduser = User.find(params[:issue][:assigned_to_id])
+ #
+ # if senduser.id != User.current.id
+ # issue_id = @issue.id
+ # issue_title = params[:issue][:subject]
+ # priority_id = params[:issue][:priority_id]
+ #
+ # ps = ProjectsService.new
+ # ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
+ # end
@priorities = IssuePriority.active
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
diff --git a/app/services/projects_service.rb b/app/services/projects_service.rb
index 8de96fff4..5f8d5323a 100644
--- a/app/services/projects_service.rb
+++ b/app/services/projects_service.rb
@@ -331,28 +331,28 @@ class ProjectsService
{:status => status,:message => message}
end
- def send_wechat_project_issue_notice user,project,issue_id,issue_title,priority_id
- count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count
- if count == 0
- title = "您有新的issue需要解决"
- remark = "点击详情查看issue"
-
- case priority_id
- when 1
- priority = "低"
- when
- priority = "正常"
- when
- priority = "高"
- when
- priority = "紧急"
- when
- priority = "立刻"
- end
-
- ws = WechatService.new
- ws.project_issue_notice user.id, "issues", issue_id,title, issue_title,priority, remark
- end
- end
+ # def send_wechat_project_issue_notice user,project,issue_id,issue_title,priority_id
+ # count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count
+ # if count == 0
+ # title = "您有新的issue需要解决"
+ # remark = "点击详情查看issue"
+ #
+ # case priority_id
+ # when 1
+ # priority = "低"
+ # when
+ # priority = "正常"
+ # when
+ # priority = "高"
+ # when
+ # priority = "紧急"
+ # when
+ # priority = "立刻"
+ # end
+ #
+ # ws = WechatService.new
+ # ws.project_issue_notice user.id, "issues", issue_id,title, issue_title,priority, remark
+ # end
+ # end
end
diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb
index e1b849c13..429c95f60 100644
--- a/app/services/wechat_service.rb
+++ b/app/services/wechat_service.rb
@@ -419,17 +419,17 @@ class WechatService
end
end
- def project_issue_notice(user_id, type, id, first, key1, key2,remark="")
- uw = UserWechat.where(user_id: user_id).first
- unless uw.nil?
- data = two_keys_template uw.openid,Wechat.config.project_issue_notice, type, id, first, key1, key2,remark
- begin
- req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
- rescue Exception => e
- Rails.logger.error "[project_issue_notice] ===> #{e}"
- end
- Rails.logger.info "send over. #{req}"
- end
- end
+ # def project_issue_notice(user_id, type, id, first, key1, key2,remark="")
+ # uw = UserWechat.where(user_id: user_id).first
+ # unless uw.nil?
+ # data = two_keys_template uw.openid,Wechat.config.project_issue_notice, type, id, first, key1, key2,remark
+ # begin
+ # req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
+ # rescue Exception => e
+ # Rails.logger.error "[project_issue_notice] ===> #{e}"
+ # end
+ # Rails.logger.info "send over. #{req}"
+ # end
+ # end
end
\ No newline at end of file
diff --git a/config/wechat.yml.test b/config/wechat.yml.test
index 8c0dafc2f..c0676cc26 100644
--- a/config/wechat.yml.test
+++ b/config/wechat.yml.test
@@ -24,7 +24,6 @@ default: &default
create_project_notice: "R2ZaQKJfDJgujPcHWPzadKHIRkIyj2CjX2o_qIuRqig"
project_review_notice: "ip192wVXTav3qchgUn9_7B6lFfTlCZjwL7A1tncTOuc"
join_project_notice: "3KnMQEMUCmQWkB5JvzrpmguEwnN8bvUHUdpOTudxv_M"
- project_issue_notice: "HAF2aCta7BtnaOd_cotGvU4tErGWwCd9I9aiClFN7w8"
auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities"
auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="
From e0957113d811d9b1be025bc5691a6db2975d7faf Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 24 Aug 2016 11:28:50 +0800
Subject: [PATCH 34/73] =?UTF-8?q?=E9=A1=B9=E7=9B=AEissue=E6=A8=A1=E7=89=88?=
=?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/issues_controller.rb | 34 ++++++++++----------
app/services/projects_service.rb | 46 ++++++++++++++--------------
app/services/wechat_service.rb | 24 +++++++--------
config/wechat.yml.test | 1 +
4 files changed, 53 insertions(+), 52 deletions(-)
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 1e79f64bf..b0c83e869 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -190,13 +190,13 @@ class IssuesController < ApplicationController
@issue.project_issues_index = @issue.project.issues.last.nil? ? 1 : @issue.project.issues.last.project_issues_index + 1
if @issue.save
- # senduser = User.find(params[:issue][:assigned_to_id])
- # issue_id = @issue.id
- # issue_title = params[:issue][:subject]
- # priority_id = params[:issue][:priority_id]
- #
- # ps = ProjectsService.new
- # ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
+ senduser = User.find(params[:issue][:assigned_to_id])
+ issue_id = @issue.id
+ issue_title = params[:issue][:subject]
+ priority_id = params[:issue][:priority_id]
+
+ ps = ProjectsService.new
+ ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
call_hook(:controller_issues_new_after_save, { :params => params, :issue => @issue})
respond_to do |format|
@@ -591,16 +591,16 @@ class IssuesController < ApplicationController
end
@issue.safe_attributes = issue_attributes
- # senduser = User.find(params[:issue][:assigned_to_id])
- #
- # if senduser.id != User.current.id
- # issue_id = @issue.id
- # issue_title = params[:issue][:subject]
- # priority_id = params[:issue][:priority_id]
- #
- # ps = ProjectsService.new
- # ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
- # end
+ senduser = User.find(params[:issue][:assigned_to_id])
+
+ if senduser.id != User.current.id
+ issue_id = @issue.id
+ issue_title = params[:issue][:subject]
+ priority_id = params[:issue][:priority_id]
+
+ ps = ProjectsService.new
+ ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id
+ end
@priorities = IssuePriority.active
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
diff --git a/app/services/projects_service.rb b/app/services/projects_service.rb
index 5f8d5323a..8de96fff4 100644
--- a/app/services/projects_service.rb
+++ b/app/services/projects_service.rb
@@ -331,28 +331,28 @@ class ProjectsService
{:status => status,:message => message}
end
- # def send_wechat_project_issue_notice user,project,issue_id,issue_title,priority_id
- # count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count
- # if count == 0
- # title = "您有新的issue需要解决"
- # remark = "点击详情查看issue"
- #
- # case priority_id
- # when 1
- # priority = "低"
- # when
- # priority = "正常"
- # when
- # priority = "高"
- # when
- # priority = "紧急"
- # when
- # priority = "立刻"
- # end
- #
- # ws = WechatService.new
- # ws.project_issue_notice user.id, "issues", issue_id,title, issue_title,priority, remark
- # end
- # end
+ def send_wechat_project_issue_notice user,project,issue_id,issue_title,priority_id
+ count = ShieldWechatMessage.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count
+ if count == 0
+ title = "您有新的issue需要解决"
+ remark = "点击详情查看issue"
+
+ case priority_id
+ when 1
+ priority = "低"
+ when
+ priority = "正常"
+ when
+ priority = "高"
+ when
+ priority = "紧急"
+ when
+ priority = "立刻"
+ end
+
+ ws = WechatService.new
+ ws.project_issue_notice user.id, "issues", issue_id,title, issue_title,priority, remark
+ end
+ end
end
diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb
index 429c95f60..423676983 100644
--- a/app/services/wechat_service.rb
+++ b/app/services/wechat_service.rb
@@ -419,17 +419,17 @@ class WechatService
end
end
- # def project_issue_notice(user_id, type, id, first, key1, key2,remark="")
- # uw = UserWechat.where(user_id: user_id).first
- # unless uw.nil?
- # data = two_keys_template uw.openid,Wechat.config.project_issue_notice, type, id, first, key1, key2,remark
- # begin
- # req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
- # rescue Exception => e
- # Rails.logger.error "[project_issue_notice] ===> #{e}"
- # end
- # Rails.logger.info "send over. #{req}"
- # end
- # end
+ def project_issue_notice(user_id, type, id, first, key1, key2,remark="",uid=0)
+ uw = UserWechat.where(user_id: user_id).first
+ unless uw.nil?
+ data = two_keys_template uw.openid,Wechat.config.project_issue_notice, type, id, first, key1, key2,remark,0
+ begin
+ req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
+ rescue Exception => e
+ Rails.logger.error "[project_issue_notice] ===> #{e}"
+ end
+ Rails.logger.info "send over. #{req}"
+ end
+ end
end
\ No newline at end of file
diff --git a/config/wechat.yml.test b/config/wechat.yml.test
index c0676cc26..8c0dafc2f 100644
--- a/config/wechat.yml.test
+++ b/config/wechat.yml.test
@@ -24,6 +24,7 @@ default: &default
create_project_notice: "R2ZaQKJfDJgujPcHWPzadKHIRkIyj2CjX2o_qIuRqig"
project_review_notice: "ip192wVXTav3qchgUn9_7B6lFfTlCZjwL7A1tncTOuc"
join_project_notice: "3KnMQEMUCmQWkB5JvzrpmguEwnN8bvUHUdpOTudxv_M"
+ project_issue_notice: "HAF2aCta7BtnaOd_cotGvU4tErGWwCd9I9aiClFN7w8"
auto_openid_url_1: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.forge.trustie.net/wechat/user_activities"
auto_openid_url_2: "&response_type=code&scope=snsapi_base&state="
From 078900088add679a86e4be15fe133befe839a91e Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 24 Aug 2016 14:41:26 +0800
Subject: [PATCH 35/73] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=96=B0?=
=?UTF-8?q?=E5=BB=BA=E7=BB=84=E7=BB=87=E5=85=B3=E8=81=94trustie-forge?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=EF=BC=8C=E7=82=B9=E5=87=BB=E7=BB=84=E7=BB=87?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=E7=9A=84=E8=AE=BA=E5=9D=9B=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E6=8A=A5500?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/organizations_helper.rb | 6 ++++++
app/views/users/_project_message.html.erb | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb
index 48b5f068b..048d92458 100644
--- a/app/helpers/organizations_helper.rb
+++ b/app/helpers/organizations_helper.rb
@@ -18,6 +18,12 @@ module OrganizationsHelper
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
end
+ # 获取项目动态更新时间
+ def get_forge_act_message(act, type)
+ forge_act = ForgeActivity.where(:forge_act_id => act.id, :forge_act_type => type).first
+ format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
+ end
+
def get_default_name field
case field.name
when 'activity' then
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
index 0a5c18a9b..9727b685c 100644
--- a/app/views/users/_project_message.html.erb
+++ b/app/views/users/_project_message.html.erb
@@ -29,7 +29,7 @@
发帖时间:<%= format_time(activity.created_on) %>
- 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
+ 更新时间:<%= get_forge_act_message(activity, activity.class) %>
<% if activity.parent_id.nil? %>
From bafb3e98a710b819599da5981765f5ff823aad75 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 24 Aug 2016 15:05:10 +0800
Subject: [PATCH 36/73] tip for sonar results
---
app/controllers/quality_analysis_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb
index 11aa57c9f..163b32f03 100644
--- a/app/controllers/quality_analysis_controller.rb
+++ b/app/controllers/quality_analysis_controller.rb
@@ -238,7 +238,7 @@ class QualityAnalysisController < ApplicationController
@quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)}
else
languate_arr = ['ruby', 'c#', 'c++', 'c']
- qa_language = QualityAnalysis.where(:sonar_name => @resource_id).first.try(language)
+ qa_language = QualityAnalysis.where(:sonar_name => @resource_id).first.try(:language)
if !qa_language.blank? && languate_arr.include?(qa_language)
@language_flag = true
end
From a3ec35c008c9a37e2618134c29e918dd85cf4318 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 24 Aug 2016 15:56:03 +0800
Subject: [PATCH 37/73] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E6=8A=A5500?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 6 ++++++
app/helpers/organizations_helper.rb | 6 ------
app/views/users/_project_message.html.erb | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 4a1033a31..0c0e0919e 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -3436,3 +3436,9 @@ def course_syllabus_option user = User.current
end
type
end
+
+# 获取项目动态更新时间
+def get_forge_act_message(act, type)
+ forge_act = ForgeActivity.where(:forge_act_id => act.id, :forge_act_type => type).first
+ format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
+end
diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb
index 048d92458..48b5f068b 100644
--- a/app/helpers/organizations_helper.rb
+++ b/app/helpers/organizations_helper.rb
@@ -18,12 +18,6 @@ module OrganizationsHelper
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
end
- # 获取项目动态更新时间
- def get_forge_act_message(act, type)
- forge_act = ForgeActivity.where(:forge_act_id => act.id, :forge_act_type => type).first
- format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
- end
-
def get_default_name field
case field.name
when 'activity' then
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
index 9727b685c..afc45efde 100644
--- a/app/views/users/_project_message.html.erb
+++ b/app/views/users/_project_message.html.erb
@@ -29,7 +29,7 @@
发帖时间:<%= format_time(activity.created_on) %>
- 更新时间:<%= get_forge_act_message(activity, activity.class) %>
+ 更新时间:<%= get_forge_act_message(activity, activity.class.to_s) %>
<% if activity.parent_id.nil? %>
From ea7f65308ee8de8cbc744a7c8d74e1e7883bd05f Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 24 Aug 2016 16:02:02 +0800
Subject: [PATCH 38/73] =?UTF-8?q?at=E6=89=80=E6=9C=89=E4=BA=BA=E5=90=8E?=
=?UTF-8?q?=E4=B8=8D=E5=BA=94=E5=B8=A6=E6=9C=89=E7=94=A8=E6=88=B7=E7=99=BB?=
=?UTF-8?q?=E5=BD=95=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/at/show.json.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/at/show.json.erb b/app/views/at/show.json.erb
index 6e2a244e4..767c23835 100644
--- a/app/views/at/show.json.erb
+++ b/app/views/at/show.json.erb
@@ -1,10 +1,10 @@
[
<% @users && @users.each_with_index do |person,index| %>
<% if index == 0 %>
- {"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
+ {"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "", "searchKey": ""}
<%= index != @users.size-1 ? ',' : '' %>
<% else %>
- {"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
+ {"id":<%=index%>, "userid": "<%=person.id%>", "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
<%= index != @users.size-1 ? ',' : '' %>
<% end %>
<% end %>
From a13ec60173f56166a33dfd6276c7b192d02b8202 Mon Sep 17 00:00:00 2001
From: Tim
Date: Wed, 24 Aug 2016 17:02:59 +0800
Subject: [PATCH 39/73] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=95=88?=
=?UTF-8?q?=E7=9A=84css?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/css/common.css | 2 +-
public/stylesheets/css/project.css | 2 +-
public/stylesheets/css/structure.css | 6 ++----
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css
index f704a3f0d..fbce13354 100644
--- a/public/stylesheets/css/common.css
+++ b/public/stylesheets/css/common.css
@@ -4,7 +4,7 @@
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;}
div,img,tr,td,table{ border:0;}
-table,tr,td{border:0;cellspacing:0; cellpadding:0;}
+table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
blockquote {
border:1px solid #d4d4d4;
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index 95891d365..1c7563a58 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -372,7 +372,7 @@ tr.entry td.filename_no_report { width: 40%; }
tr.entry td.size { text-align: right; font-size: 90%; }
tr.entry td.revision, tr.entry td.author { text-align: center; }
tr.entry td.age { text-align: right; }
-tr.entry.file td.filename a { margin-center: 16px; }
+tr.entry.file td.filename a { }
tr.entry.file td.filename_no_report a { margin-left: 16px; }
tr span.expander {background-image: url(/images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}
diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css
index c9a4059e0..1d2c106e2 100644
--- a/public/stylesheets/css/structure.css
+++ b/public/stylesheets/css/structure.css
@@ -1,5 +1,3 @@
-/*将header.css文件和public.css,new_user.css中的内容统一*/
-
@charset "utf-8";
/* CSS Document */
@@ -34,7 +32,7 @@ a:hover.search_btn{ background: #0fa9bb;}
a.parent {background: url(/images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;}
a.parent:hover {background: url(/images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;}
a.linkToOrange:hover {color:#fe7d68;}
-#userInfo ul li {positon: relative;}
+#userInfo ul li {position: relative;}
#userInfo ul li ul {display:none;}
#userInfo ul li:hover ul {display:block; position:absolute;}
#userInfo ul li:hover ul li ul {display:none;}
@@ -383,7 +381,7 @@ ul.subNavArrow:hover li ul {display:block;}
.currentDd{color:#0781b4;}
.currentDt{background-color:#fff;}
.navContent{display: none;border-bottom:solid 1px #e5e3da; }
-.navContent li a{display:block;width:240px;heigh:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
+.navContent li a{display:block;width:240px;height:28px;text-align:center;font-size:12px;line-height:28px;color:#333}
.navContent li a:hover{color:#fff;background-color:#b3e0ee}
a.subnav_num{ font-weight:normal; color:#ff7143; font-size:12px;}
a.subnav_green{ background:#28be6c; color:#fff; font-size:12px; font-weight:normal;height:18px; padding:0px 5px; padding-top:2px; display:block; margin-top:2px; margin-bottom:5px; float:right; margin-right:5px;line-height:1.4 !important;}
From 8cc60ef1e86388dca7ea8334c3b0b350f2edd4f6 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 24 Aug 2016 17:28:55 +0800
Subject: [PATCH 40/73] delete some language of quality_analysis
---
app/controllers/quality_analysis_controller.rb | 5 -----
app/views/quality_analysis/_show.html.erb | 7 -------
app/views/repositories/_quality_analysis.html.erb | 2 +-
3 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb
index 163b32f03..a0b275dc7 100644
--- a/app/controllers/quality_analysis_controller.rb
+++ b/app/controllers/quality_analysis_controller.rb
@@ -237,11 +237,6 @@ class QualityAnalysisController < ApplicationController
arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
@quality_analyses = QualityAnalysis.where(:project_id => @project.id).select{|qa| arr.include?(qa.sonar_name)}
else
- languate_arr = ['ruby', 'c#', 'c++', 'c']
- qa_language = QualityAnalysis.where(:sonar_name => @resource_id).first.try(:language)
- if !qa_language.blank? && languate_arr.include?(qa_language)
- @language_flag = true
- end
filter = "sqale_rating,function_complexity,duplicated_lines_density,comment_lines_density,sqale_index,lines,files,functions,classes,directories,blocker_violations,critical_violations,major_violations,minor_violations,info_violations,violations"
complexity_date = open(@sonar_address + "/api/resources/index?resource=#{@resource_id}&depth=0&metrics=#{filter}").read
@complexity =JSON.parse(complexity_date).first
diff --git a/app/views/quality_analysis/_show.html.erb b/app/views/quality_analysis/_show.html.erb
index 81447f81b..f07225cc7 100644
--- a/app/views/quality_analysis/_show.html.erb
+++ b/app/views/quality_analysis/_show.html.erb
@@ -3,13 +3,6 @@
质量分析
-<% if @language_flag %>
-
- 本平台使用的代码质量分析工具是sonar开源质量数据报告工具,目前ruby、c++、c#语言的分析结果可能存在一定的偏差,
- 建议结合其他数据质量分析工具进行综合判断。
-
-<% end %>
-
当前分支:<%= params[:branch] %>
项目代码质量分析报告
diff --git a/app/views/repositories/_quality_analysis.html.erb b/app/views/repositories/_quality_analysis.html.erb
index 936e513f5..d1c78abb5 100644
--- a/app/views/repositories/_quality_analysis.html.erb
+++ b/app/views/repositories/_quality_analysis.html.erb
@@ -12,7 +12,7 @@