From 6261b92c7f75386c965757bd4e62cdc4142fa3a3 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Mon, 14 Nov 2016 17:04:26 +0800
Subject: [PATCH 01/20] =?UTF-8?q?=E5=BF=BD=E7=95=A5oneapm?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 9d33b264c..601f691a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,3 +39,4 @@ public/javascripts/wechat/node_modules/
.access_token
tmux*.log
config/wechat.yml
+config/oneapm.yml
From e33146813d260db65ddfd1a985ed31562e43a283 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 15 Nov 2016 09:25:58 +0800
Subject: [PATCH 02/20] =?UTF-8?q?=E5=8A=A0=E6=97=A5=E5=BF=97=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/message.rb | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/app/models/message.rb b/app/models/message.rb
index 1d76c8ef6..6b2e29428 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -147,6 +147,7 @@ class Message < ActiveRecord::Base
# 删除帖子的时候更新帖子总数, 删除回复的时候总数不减少
def decrease_boards_count
+ tStarttime = Time.now
if self.project && !project.project_score.nil?
# 讨论区
if self.parent_id.nil?
@@ -157,13 +158,22 @@ class Message < ActiveRecord::Base
self.project.project_score.update_attribute(:board_message_num, count < 0 ? 0 : count)
end
end
+
+ tEndtime = Time.now
+ tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
+ logger.info "message_time decrease_boards_count! user wait time = #{tUsedtime} ms"
end
def reset_counters!
+ tStarttime = Time.now
if parent && parent.id
Message.update_all({:last_reply_id => parent.children.maximum(:id)}, {:id => parent.id})
end
board.reset_counters!
+
+ tEndtime = Time.now
+ tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
+ logger.info "message_time reset_counters! user wait time = #{tUsedtime} ms"
end
def sticky=(arg)
@@ -358,6 +368,7 @@ class Message < ActiveRecord::Base
#减少用户分数
def down_user_score
+ tStarttime = Time.now
if self.parent_id.nil? && !self.board.project.nil?
UserScore.joint(:delete_message, self.author,nil,self, { message_id: self.id })
update_memo_number(User.current,1)
@@ -371,6 +382,10 @@ class Message < ActiveRecord::Base
update_replay_for_memo(self.author,2,self.board.project)
end
end
+
+ tEndtime = Time.now
+ tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
+ logger.info "message_time down_user_score! user wait time = #{tUsedtime} ms"
end
def send_mail
@@ -381,7 +396,13 @@ class Message < ActiveRecord::Base
# Author lizanle
# Description 删除对应消息的图片资源
def delete_kindeditor_assets
+ tStarttime = Time.now
+
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::MESSAGE
+
+ tEndtime = Time.now
+ tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
+ logger.info "message_time delete_kindeditor_assets! user wait time = #{tUsedtime} ms"
end
# 课程成员得分(活跃度)
@@ -399,6 +420,7 @@ class Message < ActiveRecord::Base
# 删除帖子的时候更新课程帖子总数, 删除回复的时候减少总数
def down_course_score
+ tStarttime = Time.now
if self.course
if self.parent_id.nil? # 发帖
down_course_score_num(self.course.id, self.author_id, "Message")
@@ -407,6 +429,9 @@ class Message < ActiveRecord::Base
down_course_score_num(self.course.id, self.author_id, "MessageReply")
end
end
+ tEndtime = Time.now
+ tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
+ logger.info "message_time down_course_score! user wait time = #{tUsedtime} ms"
end
def delete_org_activities
From 85938bf3f1fb2ff069ea5ee24b44a2fa0e12e2a2 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 15 Nov 2016 09:28:42 +0800
Subject: [PATCH 03/20] =?UTF-8?q?=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/message.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/models/message.rb b/app/models/message.rb
index 6b2e29428..0ae8d442b 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -147,6 +147,7 @@ class Message < ActiveRecord::Base
# 删除帖子的时候更新帖子总数, 删除回复的时候总数不减少
def decrease_boards_count
+ logger.info 'decrease_boards_count! start'
tStarttime = Time.now
if self.project && !project.project_score.nil?
# 讨论区
@@ -165,6 +166,7 @@ class Message < ActiveRecord::Base
end
def reset_counters!
+ logger.info 'reset_counters! start'
tStarttime = Time.now
if parent && parent.id
Message.update_all({:last_reply_id => parent.children.maximum(:id)}, {:id => parent.id})
@@ -368,6 +370,7 @@ class Message < ActiveRecord::Base
#减少用户分数
def down_user_score
+ logger.info 'down_user_score start'
tStarttime = Time.now
if self.parent_id.nil? && !self.board.project.nil?
UserScore.joint(:delete_message, self.author,nil,self, { message_id: self.id })
@@ -396,6 +399,7 @@ class Message < ActiveRecord::Base
# Author lizanle
# Description 删除对应消息的图片资源
def delete_kindeditor_assets
+ logger.info 'delete_kindeditor_assets start'
tStarttime = Time.now
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::MESSAGE
@@ -420,6 +424,7 @@ class Message < ActiveRecord::Base
# 删除帖子的时候更新课程帖子总数, 删除回复的时候减少总数
def down_course_score
+ logger.info 'down_course_score start'
tStarttime = Time.now
if self.course
if self.parent_id.nil? # 发帖
From 19e2c349177e6334be556c63f35f7c0bf230fd49 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 15 Nov 2016 10:33:28 +0800
Subject: [PATCH 04/20] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E8=BF=98=E5=8E=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/message.rb | 30 ------------------------------
1 file changed, 30 deletions(-)
diff --git a/app/models/message.rb b/app/models/message.rb
index 0ae8d442b..1d76c8ef6 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -147,8 +147,6 @@ class Message < ActiveRecord::Base
# 删除帖子的时候更新帖子总数, 删除回复的时候总数不减少
def decrease_boards_count
- logger.info 'decrease_boards_count! start'
- tStarttime = Time.now
if self.project && !project.project_score.nil?
# 讨论区
if self.parent_id.nil?
@@ -159,23 +157,13 @@ class Message < ActiveRecord::Base
self.project.project_score.update_attribute(:board_message_num, count < 0 ? 0 : count)
end
end
-
- tEndtime = Time.now
- tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
- logger.info "message_time decrease_boards_count! user wait time = #{tUsedtime} ms"
end
def reset_counters!
- logger.info 'reset_counters! start'
- tStarttime = Time.now
if parent && parent.id
Message.update_all({:last_reply_id => parent.children.maximum(:id)}, {:id => parent.id})
end
board.reset_counters!
-
- tEndtime = Time.now
- tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
- logger.info "message_time reset_counters! user wait time = #{tUsedtime} ms"
end
def sticky=(arg)
@@ -370,8 +358,6 @@ class Message < ActiveRecord::Base
#减少用户分数
def down_user_score
- logger.info 'down_user_score start'
- tStarttime = Time.now
if self.parent_id.nil? && !self.board.project.nil?
UserScore.joint(:delete_message, self.author,nil,self, { message_id: self.id })
update_memo_number(User.current,1)
@@ -385,10 +371,6 @@ class Message < ActiveRecord::Base
update_replay_for_memo(self.author,2,self.board.project)
end
end
-
- tEndtime = Time.now
- tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
- logger.info "message_time down_user_score! user wait time = #{tUsedtime} ms"
end
def send_mail
@@ -399,14 +381,7 @@ class Message < ActiveRecord::Base
# Author lizanle
# Description 删除对应消息的图片资源
def delete_kindeditor_assets
- logger.info 'delete_kindeditor_assets start'
- tStarttime = Time.now
-
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::MESSAGE
-
- tEndtime = Time.now
- tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
- logger.info "message_time delete_kindeditor_assets! user wait time = #{tUsedtime} ms"
end
# 课程成员得分(活跃度)
@@ -424,8 +399,6 @@ class Message < ActiveRecord::Base
# 删除帖子的时候更新课程帖子总数, 删除回复的时候减少总数
def down_course_score
- logger.info 'down_course_score start'
- tStarttime = Time.now
if self.course
if self.parent_id.nil? # 发帖
down_course_score_num(self.course.id, self.author_id, "Message")
@@ -434,9 +407,6 @@ class Message < ActiveRecord::Base
down_course_score_num(self.course.id, self.author_id, "MessageReply")
end
end
- tEndtime = Time.now
- tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
- logger.info "message_time down_course_score! user wait time = #{tUsedtime} ms"
end
def delete_org_activities
From 14552abd5611e6cc00c07946c67b67cbd856375c Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Mon, 21 Nov 2016 10:08:27 +0800
Subject: [PATCH 05/20] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E4=BA=BA=E6=B0=94?=
=?UTF-8?q?=E6=8E=92=E5=BA=8F=E4=BF=AE=E6=94=B9=EF=BC=8C=E4=B8=AA=E4=BA=BA?=
=?UTF-8?q?=E4=B8=BB=E9=A1=B5=E5=85=B3=E6=B3=A8BUG=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/blogs_controller.rb | 2 +-
app/controllers/watchers_controller.rb | 7 ++++++-
app/views/layouts/new_base_user.html.erb | 2 +-
app/views/users/_user_fans_item.html.erb | 12 +++++++++++-
app/views/users/user_fanslist.html.erb | 9 ---------
app/views/watchers/_set_watcher.js.erb | 4 +++-
6 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb
index eeea2d01a..8c6cc4f0c 100644
--- a/app/controllers/blogs_controller.rb
+++ b/app/controllers/blogs_controller.rb
@@ -26,7 +26,7 @@ class BlogsController < ApplicationController
@type = 2
@topics.each do |topic|
- topic[:infocount] = get_praise_num(topic) + (topic.parent ? topic.parent.children.count : topic.children.count)
+ topic[:infocount] = get_praise_num(topic) + BlogComment.where("root_id = #{topic.id}").count
if topic[:infocount] < 0
topic[:infocount] = 0
end
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index da0c5733a..6f0d96dfa 100644
--- a/app/controllers/watchers_controller.rb
+++ b/app/controllers/watchers_controller.rb
@@ -37,7 +37,9 @@ class WatchersController < ApplicationController
@list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@action = 'fans'
else
-
+ if params[:target_id]
+ @user = User.find(params[:target_id])
+ end
end
if params[:object_type] == 'project'
@@ -78,6 +80,9 @@ class WatchersController < ApplicationController
@list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all();
@action = 'fans'
else
+ if params[:target_id]
+ @user = User.find(params[:target_id])
+ end
end
if params[:object_type] == 'project'
@project = Project.find(params[:object_id])
diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb
index 783aade75..b27f144e9 100644
--- a/app/views/layouts/new_base_user.html.erb
+++ b/app/views/layouts/new_base_user.html.erb
@@ -148,7 +148,7 @@
粉丝
- <%= @user.watcher_users.count %>
+ <%= @user.watcher_users.count %>
diff --git a/app/views/users/_user_fans_item.html.erb b/app/views/users/_user_fans_item.html.erb
index b3fc7905c..8614e0b61 100644
--- a/app/views/users/_user_fans_item.html.erb
+++ b/app/views/users/_user_fans_item.html.erb
@@ -52,4 +52,14 @@
<% end %>
-<% end %>
\ No newline at end of file
+
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true%>
+
+
+
+
+<% else %>
+ <%= l(:label_no_data) %>
+<% end %>
diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb
index 47bdc9126..77d85565e 100644
--- a/app/views/users/user_fanslist.html.erb
+++ b/app/views/users/user_fanslist.html.erb
@@ -26,16 +26,7 @@
<%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %>
<%# end %>
- <%= l(:label_no_data) %>
-
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%>
-
-
-
-
diff --git a/app/views/watchers/_set_watcher.js.erb b/app/views/watchers/_set_watcher.js.erb
index fee58c15c..83358b049 100644
--- a/app/views/watchers/_set_watcher.js.erb
+++ b/app/views/watchers/_set_watcher.js.erb
@@ -1,7 +1,9 @@
<% if( params[:object_type] == 'user') %>
//点击头像下面的添加关注按钮
<% if( params[:target_id] == params[:object_id] ) %>
- $("#watch_user_btn_div").html("<%= escape_javascript render(:partial => "layouts/user_watch_btn", :locals => {:target => watched.first}) %>");
+ <% if @user %>
+ $("#watch_user_btn_div").html("<%= escape_javascript render(:partial => "layouts/user_watch_btn", :locals => {:target => watched.first}) %>");
+ <% end %>
$("#user_fans_number").html("<%= watched.first.watcher_users.count.to_s%>");
$(".add_cancel_watch_<%= watched.first.id %>").html("<%= escape_javascript (render :partial => 'users/watch_btn_for_picture', :locals => {:user => watched.first}) %>");
$(".fans_count_<%= watched.first.id %>").text("<%= watched.first.watcher_users.count.to_s %>");
From 3099b37f5eeae84c6bdf5163e2adea3c82fd0082 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Mon, 21 Nov 2016 12:07:14 +0800
Subject: [PATCH 06/20] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?=
=?UTF-8?q?=E5=85=B3=E6=B3=A8BUG=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_fans_item.html.erb | 114 +++++++++++------------
app/views/users/user_fanslist.html.erb | 43 +++++----
2 files changed, 78 insertions(+), 79 deletions(-)
diff --git a/app/views/users/_user_fans_item.html.erb b/app/views/users/_user_fans_item.html.erb
index 8614e0b61..36d1b1b73 100644
--- a/app/views/users/_user_fans_item.html.erb
+++ b/app/views/users/_user_fans_item.html.erb
@@ -1,65 +1,55 @@
<% unless list.nil?%>
-<% for item in list %>
-
-
-
-
<%= item.show_name %>
-
-
- <% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
-
个性签名:<%= item.user_extensions.brief_introduction %>
+ <% for item in list %>
+
+
+
+
<%= item.show_name %>
+
+
+ <% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
+
个性签名:<%= item.user_extensions.brief_introduction %>
+ <% end %>
+
+ 加入时间:
+ <%= format_date(item.created_on) %>
+ <% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
+ 工作单位:
+
+
+ <%= item.user_extensions.school.name %>
+
+
+ <% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
+ 工作单位:
+
+
+ <%= item.user_extensions.occupation %>
+
+
+ <% elsif item.user_extensions.identity == 2 %>
+ 工作单位:
+
+
+ <%= item.show_name %>
+
+
+ <% end %>
+
+
+
+
+ <% if(User.current.logged? && User.current != item )%>
+ <%if(item.watched_by?(User.current))%>
+
取消关注
+ <% else %>
+
添加关注
+ <% end %>
<% end %>
-
- 加入时间:
- <%= format_date(item.created_on) %>
- <% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
- 工作单位:
-
-
- <%= item.user_extensions.school.name %>
-
-
- <% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
- 工作单位:
-
-
- <%= item.user_extensions.occupation %>
-
-
- <% elsif item.user_extensions.identity == 2 %>
- 工作单位:
-
-
- <%= item.show_name %>
-
-
- <% end %>
-
+
-
-
- <% if(User.current.logged? && User.current != item )%>
- <%if(item.watched_by?(User.current))%>
-
取消关注
- <% else %>
-
添加关注
- <% end %>
- <% end %>
-
-
-<% end %>
-
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true%>
-
-
-
-
-<% else %>
-
<%= l(:label_no_data) %>
-<% end %>
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb
index 77d85565e..041dabd03 100644
--- a/app/views/users/user_fanslist.html.erb
+++ b/app/views/users/user_fanslist.html.erb
@@ -7,30 +7,39 @@
}
-
-
- <% if @action == 'fans' %>
+
+
+ <% if @action == 'fans' %>
粉丝
共有<%=@obj_count%> 名粉丝
- <% elsif @action == 'visitor' %>
+ <% elsif @action == 'visitor' %>
访客
共有<%=@obj_count%> 访客
- <% else %>
+ <% else %>
关注
一共关注<%=@obj_count%> 人
- <% end %>
+ <% end %>
+
+
+
+ <%# for item in @list %>
+ <%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %>
+ <%# end %>
+
+
<%= l(:label_no_data) %>
+
+
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%>
+
-
- <%# for item in @list %>
- <%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %>
- <%# end %>
-
-
-
-
-
-
-
+
+
+
+
+
+
From c40288b8c39ca307f3de3056260d96bebbbcabeb Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Mon, 21 Nov 2016 16:26:14 +0800
Subject: [PATCH 07/20] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?=
=?UTF-8?q?=EF=BC=8C=E8=BE=93=E5=85=A5=E5=8E=9F=E5=AF=86=E7=A0=81=E6=97=B6?=
=?UTF-8?q?=E7=9A=84=E4=B8=8B=E6=8B=89=E6=A1=86=E8=A6=81=E5=8E=BB=E6=8E=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/my/account.html.erb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index 2a4b3b480..fd7425aab 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -214,7 +214,8 @@
确认密码 :
-
+
+
请输入8-12个字符
diff --git a/app/views/users/_user_fans_item.html.erb b/app/views/users/_user_fans_item.html.erb
index 8614e0b61..36d1b1b73 100644
--- a/app/views/users/_user_fans_item.html.erb
+++ b/app/views/users/_user_fans_item.html.erb
@@ -1,65 +1,55 @@
<% unless list.nil?%>
-<% for item in list %>
-
-
-
-
<%= item.show_name %>
-
-
- <% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
-
个性签名:<%= item.user_extensions.brief_introduction %>
+ <% for item in list %>
+
+
+
+
<%= item.show_name %>
+
+
+ <% if item.user_extensions && !item.user_extensions.brief_introduction.nil? && !item.user_extensions.brief_introduction.empty? %>
+
个性签名:<%= item.user_extensions.brief_introduction %>
+ <% end %>
+
+ 加入时间:
+ <%= format_date(item.created_on) %>
+ <% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
+ 工作单位:
+
+
+ <%= item.user_extensions.school.name %>
+
+
+ <% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
+ 工作单位:
+
+
+ <%= item.user_extensions.occupation %>
+
+
+ <% elsif item.user_extensions.identity == 2 %>
+ 工作单位:
+
+
+ <%= item.show_name %>
+
+
+ <% end %>
+
+
+
+
+ <% if(User.current.logged? && User.current != item )%>
+ <%if(item.watched_by?(User.current))%>
+
取消关注
+ <% else %>
+
添加关注
+ <% end %>
<% end %>
-
- 加入时间:
- <%= format_date(item.created_on) %>
- <% if (item.user_extensions.identity == 0 || item.user_extensions.identity == 1) && !item.user_extensions.school.nil? %>
- 工作单位:
-
-
- <%= item.user_extensions.school.name %>
-
-
- <% elsif item.user_extensions.identity == 3 && !item.user_extensions.occupation.nil? && !item.user_extensions.occupation.empty? %>
- 工作单位:
-
-
- <%= item.user_extensions.occupation %>
-
-
- <% elsif item.user_extensions.identity == 2 %>
- 工作单位:
-
-
- <%= item.show_name %>
-
-
- <% end %>
-
+
-
-
- <% if(User.current.logged? && User.current != item )%>
- <%if(item.watched_by?(User.current))%>
-
取消关注
- <% else %>
-
添加关注
- <% end %>
- <% end %>
-
-
-<% end %>
-
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true%>
-
-
-
-
-<% else %>
-
<%= l(:label_no_data) %>
-<% end %>
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb
index 77d85565e..041dabd03 100644
--- a/app/views/users/user_fanslist.html.erb
+++ b/app/views/users/user_fanslist.html.erb
@@ -7,30 +7,39 @@
}
-
-
- <% if @action == 'fans' %>
+
+
+ <% if @action == 'fans' %>
粉丝
共有<%=@obj_count%> 名粉丝
- <% elsif @action == 'visitor' %>
+ <% elsif @action == 'visitor' %>
访客
共有<%=@obj_count%> 访客
- <% else %>
+ <% else %>
关注
一共关注<%=@obj_count%> 人
- <% end %>
+ <% end %>
+
+
+
+ <%# for item in @list %>
+ <%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %>
+ <%# end %>
+
+
<%= l(:label_no_data) %>
+
+
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true%>
+
-
- <%# for item in @list %>
- <%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %>
- <%# end %>
-
-
-
-
-
-
-
+
+
+
+
+
+
From 8d980b16dba84b107f6007f2714e7af814a967fb Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 22 Nov 2016 10:10:53 +0800
Subject: [PATCH 09/20] =?UTF-8?q?=E6=8D=A2=E8=A1=8C=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index f9a88baf8..3467214c9 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -1,5 +1,5 @@
-
+
<%= render :partial => 'projects/invite_code' %>
<% if @project.description.blank? %>
From c571d195483065c15af0aaf02d3571d12c1357b4 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 22 Nov 2016 10:16:09 +0800
Subject: [PATCH 10/20] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=80=E4=BB=8B?=
=?UTF-8?q?=E5=8D=95=E8=AF=8D=E4=B8=8D=E6=8D=A2=E8=A1=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/show.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 09ed2216a..5a38e3b38 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -1,5 +1,5 @@
-
+
<%= render :partial => 'projects/invite_code' %>
<% if @project.description.blank? %>
From 9720f84fce12e57da1373718c1c6f0792e2b8313 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 23 Nov 2016 13:29:02 +0800
Subject: [PATCH 11/20] =?UTF-8?q?js=E7=9A=84=E8=87=AA=E5=8A=A8=E8=BD=AC?=
=?UTF-8?q?=E6=8D=A2URL=E5=87=BD=E6=95=B0autoUrl=E5=8A=A0=E4=B8=8A?=
=?UTF-8?q?=E4=B8=AA=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/javascripts/application.js | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 3f5a739f9..ac8dfcc44 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1706,7 +1706,14 @@ function autoUrl(id){
}
return reStr ;
});
- $(this).html(html);
+ try{
+ $(this).html(html);
+ }
+ catch (e)
+ {
+ console.log(e.name + ": " + e.message);
+ }
+
}
});
}
@@ -1725,7 +1732,13 @@ function autoUrl(id){
}
return reStr ;
});
- $("#"+id).html(html);
+ try{
+ $("#"+id).html(html);
+ }
+ catch (e)
+ {
+ console.log(e.name + ": " + e.message);
+ }
}
if(!(!!window.ActiveXObject || "ActiveXObject" in window)){
autoMedia(id);
From 2dc6171b480d55edef70cf73a11e51312c242476 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Wed, 23 Nov 2016 16:40:31 +0800
Subject: [PATCH 12/20] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=8F=8D=E9=A6=88?=
=?UTF-8?q?=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA=E8=AF=AD=E5=8A=A0=E5=85=A5?=
=?UTF-8?q?www.trustie.net?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/wechats_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb
index a082d72ff..654f83855 100644
--- a/app/controllers/wechats_controller.rb
+++ b/app/controllers/wechats_controller.rb
@@ -137,7 +137,7 @@ class WechatsController < ActionController::Base
on :fallback, respond: 'fallback message'
on :click, with: 'FEEDBACK' do |request, key|
- request.reply.text "如有问题反馈,请您:\n1、直接切换至输入框,发微信给我们。\n2、加入QQ群:373967360,直接互动。\n\n如您有合作事宜洽谈,请联系:\n王林春 老师\n手机:13467631747\nQQ:494496321"
+ request.reply.text "如有问题反馈,请您:\n1、直接切换至输入框,发微信给我们。\n2、加入QQ群:373967360,直接互动。\n3、登录网站:www.trustie.net,给我们留言。\n\n如您有合作事宜洽谈,请联系:\n王林春 老师\n手机:13467631747\nQQ:494496321"
end
on :click, with: 'MY_NEWS' do |request, key|
From 67a9d04a642332f58fdc50f6a68acb0318dd14ed Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 23 Nov 2016 17:14:49 +0800
Subject: [PATCH 13/20] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 27 ++++++++++++++++++-
app/helpers/projects_helper.rb | 10 +++++++
.../_reposistory_destory_pop.html.erb | 22 +++++++++++++++
app/views/projects/destroy_repository.js.erb | 6 +++++
.../settings/_new_repositories.html.erb | 14 +++++++---
config/routes.rb | 1 +
public/stylesheets/css/common.css | 1 +
7 files changed, 77 insertions(+), 4 deletions(-)
create mode 100644 app/views/projects/_reposistory_destory_pop.html.erb
create mode 100644 app/views/projects/destroy_repository.js.erb
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 2bdaddb25..304ab8e02 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -739,7 +739,7 @@ class ProjectsController < ApplicationController
rescue Exception => e
puts e
end
- # 删除Trustie班额本库记录
+ # 删除Trustie版本库记录
repoisitory = Repository.where(:project_id => @project.id, :type => GITLABTYPE).first
repoisitory.delete
@project.update_column(:gpid, nil)
@@ -799,6 +799,31 @@ class ProjectsController < ApplicationController
@project = nil
end
+ REP_TYPE = "Repository::Gitlab"
+ # Delete @project's repository
+ def destroy_repository
+ if is_project_manager?(User.current.id, @project.id)
+ @gitlab_repository = Repository.where(:project_id => @project, :type => REP_TYPE).first
+ @is_true = params[:is_true]
+ if @is_true
+ begin
+ g = Gitlab.client
+ @gitlab_repository.destroy
+ @gitlab_repository = nil
+ @project.update_attribute(:gpid, nil)
+ scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
+ @repository = Repository.factory(scm)
+ @repository.is_default = @project.repository.nil?
+ g.delete_project(@project.gpid)
+ rescue Exception => e
+ puts e
+ end
+ end
+ else
+ return render_403
+ end
+ end
+
def show_projects_score
respond_to do |format|
format.html { render :layout => "base_projects"}
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 3dff9c414..fb757665f 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -302,6 +302,16 @@ module ProjectsHelper
type << option2
end
+ # 判断用户是否为项目管理员
+ def is_project_manager?(user_id, project_id)
+ @result = false
+ mem = Member.where("user_id = ? and project_id = ?",user_id, project_id)
+ unless mem.blank?
+ @result = mem.first.roles.to_s.include?("Manager") ? true : false
+ end
+ return @result
+ end
+
# 用来判断用户是否是项目的管理员
# added by william
def is_manager?(user_id,project_id)
diff --git a/app/views/projects/_reposistory_destory_pop.html.erb b/app/views/projects/_reposistory_destory_pop.html.erb
new file mode 100644
index 000000000..1f8dd06f2
--- /dev/null
+++ b/app/views/projects/_reposistory_destory_pop.html.erb
@@ -0,0 +1,22 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/views/projects/destroy_repository.js.erb b/app/views/projects/destroy_repository.js.erb
new file mode 100644
index 000000000..3bc1d727b
--- /dev/null
+++ b/app/views/projects/destroy_repository.js.erb
@@ -0,0 +1,6 @@
+<% if @is_true %>
+$("#pro_st_tbc_06").html('<%= escape_javascript( render :partial => 'projects/settings/new_repositories') %>');
+<% else %>
+var htmlvalue = "<%= escape_javascript(render :partial => 'projects/reposistory_destory_pop') %>";
+pop_box_new(htmlvalue,460,316);
+<% end %>
diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb
index a531e904a..1fb4f7b7a 100644
--- a/app/views/projects/settings/_new_repositories.html.erb
+++ b/app/views/projects/settings/_new_repositories.html.erb
@@ -14,7 +14,7 @@
* 版本库名称 :
- <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false, :label=>"", :no_label => true, :class => "w650 fl", :style => "height: 28px;", :id => "project_setting_repository" %>
+ <%= f.text_field :identifier, :disabled => @repository.nil? || @repository.identifier_frozen? ? true:false, :label=>"", :no_label => true, :class => "w650 fl", :style => "height: 28px;", :id => "project_setting_repository" %>
版本库名是无效的
@@ -35,14 +35,22 @@
版本库名
管理系统
- 库路径
+ 库路径
+
<%= @gitlab_repository.identifier %>
Git
- <%=h @repos_url %>
+ <%=h @repos_url %>
+
+ <% if is_project_manager?(User.current.id, @project.id) %>
+ <%= link_to "删除", destroy_repository_project_path(@project), :class => "c_blue", :remote => true %>
+ <% else %>
+ <%= "删除" %>
+ <% end %>
+
diff --git a/config/routes.rb b/config/routes.rb
index 3848c4b46..db1ad27e3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -783,6 +783,7 @@ RedmineApp::Application.routes.draw do
get 'file', :action => 'file', :as => 'file'
get 'statistics', :action => 'statistics', :as => 'statistics'
get 'repository_tree_changes', :action => 'repository_tree_changes', :as => 'repository_tree_changes'
+ get 'destroy_repository', :action => 'destroy_repository', :as => 'destroy_repository'
get 'feedback', :action => 'feedback', :as => 'project_feedback'
get 'watcherlist', :action=> 'watcherlist'
diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css
index bbc85f3ce..fad7e766a 100644
--- a/public/stylesheets/css/common.css
+++ b/public/stylesheets/css/common.css
@@ -233,6 +233,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w20{ width:20px;}
.w40{width: 40px;}
.w45{ width: 45px;}
+.w46{ width: 46px;}
.w48{width:48px;}
.w50 {width:50px;}
.w56 {width:56px;}
From 7713fba2f8627edb00d1f5e09a55c0936fb4347b Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Thu, 24 Nov 2016 14:30:24 +0800
Subject: [PATCH 14/20] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E7=95=99=E8=A8=80?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 7 ++++---
app/models/journals_for_message.rb | 5 +++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 56b536d30..049789115 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1369,9 +1369,10 @@ class UsersController < ApplicationController
@jour = jours.limit(10).offset(@page * 10)
@type = params[:type]
if User.current == @user
- jours.update_all(:is_readed => true, :status => false)
- jours.each do |journal|
- fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
+ @jour.update_all(:is_readed => true, :status => false)
+ @jour.each do |journal|
+ # fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
+ journal.delay.set_children_readed_delay
end
end
@state = false
diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb
index 4a9601d07..aa83c2210 100644
--- a/app/models/journals_for_message.rb
+++ b/app/models/journals_for_message.rb
@@ -344,4 +344,9 @@ class JournalsForMessage < ActiveRecord::Base
def content_detail
self.notes
end
+
+ def set_children_readed_delay
+ # fetch_user_leaveWord_reply(self).update_all(:is_readed => true, :status => false)
+ end
+
end
From 45bbd7b293eb59601e41798f68dd1de06657bfd5 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 24 Nov 2016 14:47:02 +0800
Subject: [PATCH 15/20] =?UTF-8?q?pull=20request=20=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=9A=84=E6=97=B6=E5=80=99JS=E6=8E=A7?=
=?UTF-8?q?=E5=88=B6=E5=88=86=E6=94=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/pull_requests_controller.rb | 2 +-
app/views/pull_requests/_form.html.erb | 6 ++--
public/javascripts/project.js | 34 ++++++++++++++-------
3 files changed, 27 insertions(+), 15 deletions(-)
diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index ec9f98ccf..6bfe72c21 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -92,7 +92,7 @@ class PullRequestsController < ApplicationController
if compare_pull_request(source_branch, target_project_id, target_branch)
# 如果传送了目标项目ID即向fork源项目发送请求
# if params[:forked_project_id] && params[:source_project] == "forked_project_name"
- if params[:target_project_id]
+ if params[:target_project_id].to_i != @project.id
target_project_id = params[:forked_project_id].to_i
request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch, :target_project_id => target_project_id)
@fork_project_name = Project.find(params[:target_project_id]).try(:name)
diff --git a/app/views/pull_requests/_form.html.erb b/app/views/pull_requests/_form.html.erb
index 43b3bf4d9..d76c3e8a8 100644
--- a/app/views/pull_requests/_form.html.erb
+++ b/app/views/pull_requests/_form.html.erb
@@ -12,9 +12,9 @@
<% if @forked_project.nil? %>
<%= select_tag :branch, options_for_select(@source_rev), :id => "pull_request_branch", :name => "target_branch", :value => "target_branch",:class => "fl PullReques_minselect ml5" %>
<% else %>
-
- <%= @source_project_name %>
- <%= @forked_project_name %>
+
+ <%= @source_project_name %>
+ <%= @forked_project_name %>
<% @source_rev.each do |rev| %>
diff --git a/public/javascripts/project.js b/public/javascripts/project.js
index be3327985..10dfbd9bb 100644
--- a/public/javascripts/project.js
+++ b/public/javascripts/project.js
@@ -665,18 +665,30 @@ function search_tag_attachment(url,tag_name,q,course_id,sort)
}
-function choice_branch(name, branch, source_rev, forked_rev) {
- switch (name) {
- case "source_project_name" :
- var branchOptions = source_rev;
- break;
- case "forked_project_name" :
- var branchOptions = forked_rev;
- break;
- default:
- var branchOptions = source_rev;
- break;
+function choice_branch(name, branch, source_rev, forked_rev, project_id, project_forked_from_id) {
+ if (name==project_id){
+ var branchOptions = source_rev;
}
+ else if (name == project_forked_from_id){
+ var branchOptions = forked_rev;
+ }
+ else{
+ var branchOptions = source_rev;
+ }
+
+// switch (name) {
+// case project_id :
+// alert("project_id" + project_id);
+// var branchOptions = source_rev;
+// break;
+// case project_forked_from_id :
+// alert("project_forked_from_id"+project_forked_from_id);
+// var branchOptions = forked_rev;
+// break;
+// default:
+// var branchOptions = source_rev;
+// break;
+// }
branch.options.length = 0;
for (var i = 0; i < branchOptions.length; i++) {
From 4fcddf743d3817a283439f0c1a236c420ebfe0e6 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Thu, 24 Nov 2016 15:15:52 +0800
Subject: [PATCH 16/20] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=80=E4=BB=8B?=
=?UTF-8?q?=E5=8D=95=E8=AF=8D=E4=B8=8D=E6=8D=A2=E8=A1=8C=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/projects/show.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index 5a38e3b38..74a4878b8 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -3,9 +3,9 @@
<%= render :partial => 'projects/invite_code' %>
<% if @project.description.blank? %>
-
<%= @project.name %>
+
<%= @project.name %>
<% else %>
-
<%=h @project.description.html_safe %>
+
<%=h @project.description.html_safe %>
<% end %>
From abc6eafdb4ce526ed81ad64468e03833bd4fe3e7 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 24 Nov 2016 16:04:29 +0800
Subject: [PATCH 17/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 304ab8e02..5ad31c771 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -810,12 +810,12 @@ class ProjectsController < ApplicationController
g = Gitlab.client
@gitlab_repository.destroy
@gitlab_repository = nil
- @project.update_attribute(:gpid, nil)
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
@repository = Repository.factory(scm)
@repository.is_default = @project.repository.nil?
g.delete_project(@project.gpid)
rescue Exception => e
+ @project.update_attribute(:gpid, nil)
puts e
end
end
From 30a0347cd6f1465ced846fc05d679a3958d4234e Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 24 Nov 2016 17:40:33 +0800
Subject: [PATCH 18/20] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A4=B4=E9=83=A8?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=8F=8A=E5=85=B6=E6=88=90=E5=91=98?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E5=85=B3=E6=B3=A8=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E6=96=B0=E7=89=88=E6=A0=B7=E5=BC=8F=EF=BC=88=E6=9C=AA=E5=AE=8C?=
=?UTF-8?q?=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/watchers_helper.rb | 10 ++++-
app/views/projects/_applied_status.html.erb | 26 ++++++++---
.../projects/_project_member_list.html.erb | 37 +++++++--------
app/views/projects/member.html.erb | 9 ++--
app/views/projects/member_forked.html.erb | 2 +-
app/views/projects/watcherlist.html.erb | 45 +++++++------------
config/locales/commons/zh.yml | 2 +-
config/locales/projects/zh.yml | 2 +-
public/stylesheets/css/project.css | 3 +-
9 files changed, 75 insertions(+), 61 deletions(-)
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index acece2307..09d9115b4 100644
--- a/app/helpers/watchers_helper.rb
+++ b/app/helpers/watchers_helper.rb
@@ -333,6 +333,7 @@ module WatchersHelper
return '' unless user && user.logged?
objects = Array.wrap(objects)
watched = objects.any? {|object| object.watched_by?(user)}
+ watched = true if user.id == @project.user_id
@watch_flag = objects.first.instance_of?(Project)
id = watcher_css(objects)
text = @watch_flag ?
@@ -340,8 +341,13 @@ module WatchersHelper
url = watch_path(:object_type => objects.first.class.to_s.underscore,
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort))
method = watched ? 'delete' : 'post'
- link_to text, url, :remote => true, :method => method,
- :class => "pro_new_topbtn_left fl" ,:id=>id
+ if user.id != @project.user_id
+ link_to text, url, :remote => true, :method => method,
+ :class => "pro_new_topbtn_left fl" ,:id => id
+ else
+ link_to "关注", "javascript:void(0)", :remote => true, :method => method,
+ :class => "pro_new_grey_topbtn_left fl" , :id => id
+ end
end
def store_project_link project_id, user_id
diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb
index ec64a08ae..55190c613 100644
--- a/app/views/projects/_applied_status.html.erb
+++ b/app/views/projects/_applied_status.html.erb
@@ -3,7 +3,8 @@
<%= watcher_link_for_project(@project, User.current) %>
- <%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id},:id=>"fans_num", :class => 'pro_new_topbtn fl' %>
+ <%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "watcherlist",
+ :id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
@@ -12,15 +13,21 @@
<% else %>
等待审批
<% end %>
- <%= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>
+ <%= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员列表" %>
<% end %>
<% else %>
- <% if User.current.id != @project.user_id %>
+ <% if User.current.login? %>
+
+ <%= watcher_link_for_project(@project, User.current) %>
+ <%= link_to "#{@project.watcher_users.count}", {:controller => "projects", :action => "watcherlist",
+ :id => @project.id}, :id => "fans_num", :class => 'pro_new_topbtn fl', :title => "关注成员列表" %>
+
已加入
- <%= Member.where(:project_id => @project.id).count %>
+
+ <%= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员列表" %>
<%#= link_to "#{Member.where(:project_id => @project.id).count}", project_member_path(@project), :class => 'pro_new_topbtn fl', :title => "项目成员" %>
<% end %>
@@ -35,8 +42,17 @@
<%= link_to " ".html_safe+"Fork", forked_pop_project_path(@project),
:class=>"pro_new_topbtn_left fl", :remote => true %>
- <%= @project.forked_count.to_i %>
+ <%= @project.forked_count.to_i %>
+
+<% else%>
+
+ <%#= link_to " ".html_safe+"Fork","#",
+ :class=>"pro_new_grey_topbtn_left fl"%>
+
+ Fork
+
+ <%= @project.forked_count.to_i %>
<% end %>
diff --git a/app/views/projects/_project_member_list.html.erb b/app/views/projects/_project_member_list.html.erb
index eb2573d03..31a86e8c9 100644
--- a/app/views/projects/_project_member_list.html.erb
+++ b/app/views/projects/_project_member_list.html.erb
@@ -1,30 +1,31 @@
-
-
加入时间
-
+
<% members.each do |member| %>
-
-
- <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
-
-
<%= l(:label_user_for_project_grade) %>:<%= format("%.2f" ,read_user_project_scores(member.user,@project)).to_i %>
+
+ <%= link_to image_tag(url_to_avatar(member.user), :width => "50", :height => "50"), user_path(member.user), :alt => "用户头像", :class => "pro_new_users fl mr5" %>
+
+ <%= link_to member.user.try(:show_name), user_path(member.user), :class => "pro_new_users mt5 fl" %>
+
+
+ <%= h time_tag(member.created_on) %>
+
+
+ <% end %>
+
-
<%= l(:label_username)%>
- <%= link_to(member.user.name, user_path(member.user),:class => "ml10 c_blue02") %>(<%= rolesToLanguage(member.roles.sort.collect(&:to_s)).join(', ') %>)
+
-
- <%= format_date(member.created_on)%>
-
-
- <% end%>
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
+
diff --git a/app/views/projects/member.html.erb b/app/views/projects/member.html.erb
index e24dab160..49ab1ac68 100644
--- a/app/views/projects/member.html.erb
+++ b/app/views/projects/member.html.erb
@@ -1,11 +1,12 @@
-
-
-
<%= @subPage_title %>
+
+
+
<%= @subPage_title %>
<% if is_project_manager?(User.current, @project) %>
- <%=link_to "成员管理", :controller => 'projects', :action => 'settings', :id => @project.id, :tab => 'members' %>
+ <%=link_to "成员管理", {:controller => 'projects', :action => 'settings'}, :id => @project.id, :tab => 'members', :class => "sy_cblue", :style => "font-weight: normal;" %>
<% end %>
+
<%= error_messages_for 'member' %>
diff --git a/app/views/projects/member_forked.html.erb b/app/views/projects/member_forked.html.erb
index 488952057..5ea62b4c9 100644
--- a/app/views/projects/member_forked.html.erb
+++ b/app/views/projects/member_forked.html.erb
@@ -9,7 +9,7 @@
/
<%= link_to project.name, project_path(project), :class => "pro_new_users mt5 fl" %>
- <%=h time_tag(project.created_on) %>前
+ <%=h time_tag(project.created_on) %>
<% end %>
diff --git a/app/views/projects/watcherlist.html.erb b/app/views/projects/watcherlist.html.erb
index effef316b..65239b53a 100644
--- a/app/views/projects/watcherlist.html.erb
+++ b/app/views/projects/watcherlist.html.erb
@@ -1,28 +1,17 @@
-
-
-
<%= l(:label_user_watcher)%>
-
-
-
-
加入时间
-
-
- <% for user in @project.watcher_users %>
-
-
- <% end%>
-
-
-
-
-
-
- <% html_title(l(:label_followers)) -%>
-
\ No newline at end of file
+
+
成员 本页面展示关注了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户
+
+
diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml
index 1b8dcff89..0f7ba1969 100644
--- a/config/locales/commons/zh.yml
+++ b/config/locales/commons/zh.yml
@@ -226,7 +226,7 @@ zh:
button_download: 下载
button_more: "更多"
button_delete: 删除
- button_unfollow: 取消关注
+ button_unfollow: 已关注
button_follow: 关注
button_watch: 跟踪
button_unwatch: 取消跟踪
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index 75125f258..77e17a8b7 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -52,7 +52,7 @@ zh:
label_agree_join_project: 同意加入
label_apply_project: "加入"
- label_button_following: "添加关注"
+ label_button_following: "关注"
label_project_collect: 收藏
label_project_collect_cancel: 取消收藏
label_exit_project: 退出项目
diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css
index d9e46ab73..33d6d1dbf 100644
--- a/public/stylesheets/css/project.css
+++ b/public/stylesheets/css/project.css
@@ -867,6 +867,7 @@ a.pro_new_project_name{ width: 250px; overflow: hidden;white-space: nowrap;text-
a.pro_new_topbtn{ padding: 3px 7px; font-size: 12px; line-height: 20px; color: #333;vertical-align: middle;background-color: #fff; border: 1px solid #ddd; border-left: 0; border-top-right-radius: 3px; border-bottom-right-radius: 3px; color: #333;}
a.pro_new_topbtn_left { padding: 3px 10px; font-size: 12px;line-height: 20px; background-image: linear-gradient(#fcfcfc, #eee); border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #333; }
a:hover.pro_new_topbtn_left{background-image: linear-gradient(#ededed, #dddddd);}
+a.pro_new_grey_topbtn_left{padding: 3px 10px; font-size: 12px;line-height: 20px; background: #fff; border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #888888; }
.pro_new_topnav ul{border-bottom: 3px solid #fff; height: 30px; line-height: 30px;}
.pro_new_topnav ul li{ float: left;padding:0 15px; height: 30px; line-height: 30px;text-align: center; }
.pro_new_topnav_active{border-bottom: 3px solid #3b94d6; }
@@ -1028,7 +1029,7 @@ textarea.muban_textarea{ width: 98.5%;border:1px solid #ddd; background:#fff; co
.pro_new_users_box{ margin:0 10px;}
.pro_new_users_box li{ width:25%; float: left; margin:10px 0;}
.pro_new_users{ }
-a.pro_new_users { max-width:80px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; word-break:break-all; display: inline-block; font-weight: bold; color: #666;}
+a.pro_new_users { max-width:130px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; word-break:break-all; display: inline-block; font-weight: bold; color: #666;}
a:hover.pro_new_users {color: #3b94d6}
.pro_new_users img{ width:40px;height:40px; border: 3px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
.pro_new_users img:hover{border: 3px solid #e6e6e6;}
From 58790bcb7240643754c58f01117f307348230f31 Mon Sep 17 00:00:00 2001
From: huang
Date: Fri, 25 Nov 2016 10:31:03 +0800
Subject: [PATCH 19/20] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=88=A0?=
=?UTF-8?q?=E9=99=A4=E6=95=B0=E6=8D=AE=E4=B8=80=E8=87=B4=E6=80=A7=20=20?=
=?UTF-8?q?=E8=A7=A3=E5=86=B3Gitlab=E6=9C=AC=E8=BA=ABbug=EF=BC=8C=E5=88=A0?=
=?UTF-8?q?=E9=99=A4=E6=93=8D=E4=BD=9C=E4=BC=9A=E6=8A=A5=E5=BC=82=E5=B8=B8?=
=?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 5 +++--
app/controllers/pull_requests_controller.rb | 2 +-
lib/gitlab-cli/lib/gitlab/request.rb | 2 ++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 5ad31c771..bdf0a11b4 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@@ -808,14 +809,14 @@ class ProjectsController < ApplicationController
if @is_true
begin
g = Gitlab.client
+ g.delete_project(@project.gpid)
@gitlab_repository.destroy
@gitlab_repository = nil
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
@repository = Repository.factory(scm)
@repository.is_default = @project.repository.nil?
- g.delete_project(@project.gpid)
- rescue Exception => e
@project.update_attribute(:gpid, nil)
+ rescue Exception => e
puts e
end
end
diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index 6bfe72c21..a71f9c105 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -109,7 +109,7 @@ class PullRequestsController < ApplicationController
format.js{redirect_to new_project_pull_request_path(:show_tip => tip)}
end
end
- rescue Exception => e
+ rescue Gitlab::Error::Conflict => e
@message = e.message
end
end
diff --git a/lib/gitlab-cli/lib/gitlab/request.rb b/lib/gitlab-cli/lib/gitlab/request.rb
index 64a8f6b4c..683c11776 100644
--- a/lib/gitlab-cli/lib/gitlab/request.rb
+++ b/lib/gitlab-cli/lib/gitlab/request.rb
@@ -19,6 +19,8 @@ module Gitlab
ObjectifiedHash.new body
elsif body.is_a? Array
body.collect! { |e| ObjectifiedHash.new(e) }
+ elsif body == true
+ body
else
raise Error::Parsing.new "Couldn't parse a response body"
end
From e6e4a320ee1191fb8ee7bf3b56a0813f7410f1f9 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Fri, 25 Nov 2016 10:47:48 +0800
Subject: [PATCH 20/20] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=85=B3=E6=B3=A8?=
=?UTF-8?q?=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 10 ++++++++++
app/views/issues/_statistics.html.erb | 2 +-
app/views/projects/watcherlist.html.erb | 13 ++++++++++++-
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 304ab8e02..4e9829d62 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -971,6 +971,14 @@ class ProjectsController < ApplicationController
else
@users -= watched.watcher_users if @watched
end
+ @watchers = @project.watcher_users
+ @limit = 20
+ @is_remote = true
+ @watchers_count = @watchers.count
+ @watcher_pages = Paginator.new @watchers_count, @limit, params['page'] || 1
+ @offset ||= @watcher_pages.offset
+ #@curse_attachments_all = @all_attachments[@offset, @limit]
+ @watchers = paginateHelper @watchers,20
end
end
@@ -987,5 +995,7 @@ class ProjectsController < ApplicationController
end
return projects
end
+
#gcmend
end
+
diff --git a/app/views/issues/_statistics.html.erb b/app/views/issues/_statistics.html.erb
index b144b8e6b..8b1fc6f22 100644
--- a/app/views/issues/_statistics.html.erb
+++ b/app/views/issues/_statistics.html.erb
@@ -12,7 +12,7 @@
<%= link_to "打开#{@issue_open_count} ".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_2" %>
- <%= link_to "锁定#{@issue_close_count} ".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_3" %>
+ <%= link_to "关闭#{@issue_close_count} ".html_safe, "", :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_3" %>
diff --git a/app/views/projects/watcherlist.html.erb b/app/views/projects/watcherlist.html.erb
index 65239b53a..ffa0670de 100644
--- a/app/views/projects/watcherlist.html.erb
+++ b/app/views/projects/watcherlist.html.erb
@@ -1,7 +1,7 @@
成员 本页面展示关注了 <%= link_to @project.owner.try(:show_name), user_path(@project.owner) %>/<%= link_to @project.name, project_path(@project) %> 的用户