diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js
index a0c575d92..cd6d57d34 100644
--- a/public/javascripts/wechat/controllers/class.js
+++ b/public/javascripts/wechat/controllers/class.js
@@ -5,29 +5,23 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
var courseid = $routeParams.id;
var tag = $routeParams.tag;
- vm.course_activities_page = rms.get('course_activities_page') || 0;
- vm.course_activities = rms.get("course_activities") || [];
- vm.course_has_more = rms.get("course_has_more");
-
- vm.course = rms.get("course") || null;
-
var getClassActivities = function(page){
$http({
method: 'POST',
- url: apiUrl + "courses/activities?id=" + courseid,
+ url: apiUrl + "projects/activities?id=" + projectid,
data:{token:auth.token(),page:page}
}).then(function successCallback(response) {
console.log(response.data);
if(response.data.status == 0){
- vm.class_activities_page = response.data.page;
+ vm.project_activities_page = response.data.page;
if(response.data.page > 0)
{
- vm.course_activities = vm.class_activities.concat(response.data.data);
+ vm.project_activities = vm.project_activities.concat(response.data.data);
}
else{
- vm.course_activities = response.data.data;
- vm.course_activities_page = 0;
- vm.course_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
+ vm.project_activities = response.data.data;
+ vm.project_activities_page = 0;
+ vm.project_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
}
}
else{
@@ -108,7 +102,6 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.currentTab = index;
vm.searchText = '';
- vm.showActivities = false;
vm.showClassMate = false;
vm.showResources = false;
vm.showHomework = false;
@@ -119,8 +112,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
if(vm.isTeacher){
if(index == 1){
- getClassActivities(0);
- vm.showActivities = true;
+ getClassActivities();
}
else if(index == 2){ //课件
getResources();
@@ -137,8 +129,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
} else {
if(index == 1){
- getClassActivities(0);
- vm.showActivities = true;
+ getClassActivities();
}
else if(index == 3){
getUsers();
@@ -154,7 +145,7 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.tabRecord = rms.get('tab_num') || 1;
-// vm.course = {};
+ vm.course = {};
vm.students = [];
vm.teachers = [];
vm.reviewers = []; //待审批
@@ -168,11 +159,6 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
vm.alertService = alertService.create();
vm.invite = 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("course",vm.course);
-
$location.path("/invite_code").search({id: courseid});
};
@@ -227,39 +213,5 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$location.path("/review_class_member").search({id: courseid,user_id: user.id});
};
- //跳到详情页
- vm.goDetail = function(type, act_id,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("course",vm.course);
-// $location.path('/'+type+'/'+act_id);
- $location.path("/"+type).search({id: act_id});
- };
-
- vm.addPraise = function(act){
- for(var i in vm.course_activities){
- if(vm.course_activities[i].act_id == act.act_id){
- vm.course_activities[i].praise_count += 1;
- vm.course_activities[i].has_praise = true;
- break;
- }
- }
-
- common.addCommonPraise(act);
- };
-
- vm.decreasePraise = function(act){
- for(var i in vm.course_activities){
- if(vm.course_activities[i].act_id == act.act_id){
- vm.course_activities[i].praise_count -= 1;
- vm.course_activities[i].has_praise = false;
- break;
- }
- }
-
- common.decreaseCommonPraise(act);
- };
}]);
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/project.js b/public/javascripts/wechat/controllers/project.js
index 826a16424..08987e491 100644
--- a/public/javascripts/wechat/controllers/project.js
+++ b/public/javascripts/wechat/controllers/project.js
@@ -114,7 +114,6 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
//跳到详情页
vm.goDetail = function(type, act_id,id){
rms.save("yoffset", document.documentElement.scrollTop || document.body.scrollTop);
- 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);
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 04/13] =?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 5d5bd88c88667d85ce6a77ddfd6198dde5b3494b Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 24 Aug 2016 09:30:57 +0800
Subject: [PATCH 05/13] =?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 078900088add679a86e4be15fe133befe839a91e Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 24 Aug 2016 14:41:26 +0800
Subject: [PATCH 06/13] =?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 07/13] 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 08/13] =?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 09/13] =?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 10/13] =?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 11/13] 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 @@
- <%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"]), :id => 'branch', :class => "analysis-option-box" %>
+ <%= select_tag :language, options_for_select(["java","python","c#"]), :id => 'branch', :class => "analysis-option-box" %>
From 0cc59260cda75ac5f110c46931dab22b828cede1 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 24 Aug 2016 17:35:04 +0800
Subject: [PATCH 12/13] modified sonar list form of language
---
app/views/quality_analysis/_edit.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/quality_analysis/_edit.html.erb b/app/views/quality_analysis/_edit.html.erb
index f508ee5de..b9a2c6efa 100644
--- a/app/views/quality_analysis/_edit.html.erb
+++ b/app/views/quality_analysis/_edit.html.erb
@@ -12,7 +12,7 @@
- <%= select_tag :language, options_for_select(["java","python","ruby","c++","c#","c"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %>
+ <%= select_tag :language, options_for_select(["java","python","c#"], "#{@quality_analysis.language}"), :id => 'branch', :class => "analysis-option-box" %>
From 21c48ea3831713f8af49afebc499cc75a0a5d19a Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 24 Aug 2016 17:46:18 +0800
Subject: [PATCH 13/13] =?UTF-8?q?at=E6=89=80=E6=9C=89=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/at_controller.rb | 2 +-
app/views/at/show.json.erb | 18 +++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb
index 0e48cd962..66cbf27b8 100644
--- a/app/controllers/at_controller.rb
+++ b/app/controllers/at_controller.rb
@@ -10,7 +10,7 @@ class AtController < ApplicationController
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }.sort{|x,y| to_pinyin(x.show_name) <=> to_pinyin(y.show_name)} if users
#加上all
- if @user && @users.size > 0
+ if User.current.logged? && @users.size > 0
allUser = Struct.new(:id, :name).new
allUser.id = @users.map{|u| u.id}.join(",")
allUser.name = "all"
diff --git a/app/views/at/show.json.erb b/app/views/at/show.json.erb
index 767c23835..3e49496f9 100644
--- a/app/views/at/show.json.erb
+++ b/app/views/at/show.json.erb
@@ -1,11 +1,11 @@
[
- <% @users && @users.each_with_index do |person,index| %>
- <% if index == 0 %>
- {"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%>"}
- <%= index != @users.size-1 ? ',' : '' %>
- <% end %>
- <% end %>
+ <% @users && @users.each_with_index do |person,index| %>
+ <% if index == 0 %>
+ {"id":<%=index%>, "userid": "<%=person.id%>", "name": "所有人", "login": "<%=person.name%>", "searchKey": "<%=person.name%>"}
+ <%= index != @users.size-1 ? ',' : '' %>
+ <% else %>
+ {"id":<%=index%>, "userid": "<%=person.id%>", "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
+ <%= index != @users.size-1 ? ',' : '' %>
+ <% end %>
+ <% end %>
]