From 1234bc0aefba2d5ea138dfe74051f8fcb8779979 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 22 Feb 2016 15:34:50 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AF=BC=E8=AF=AD?= =?UTF-8?q?=E4=BB=8E=E5=B8=96=E5=AD=90=E4=B8=AD=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course_activity.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index c9c6cec4b..9c1431d5d 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -67,8 +67,9 @@ class CourseActivity < ActiveRecord::Base # 导语 def add_course_lead if self.course_act_type == "Course" - name = Redmine::Configuration['course_message_lead_subject'] - content = Redmine::Configuration['course_message_lead_content'] + lead_message = Message.find(12440) + name = lead_message.subject + content = lead_message.content # message的status状态为0为正常,为1表示创建课程时发送的message message = Message.create(:subject => name, :content => content, :board_id => self.course.boards.first.id, :author_id => self.course.tea_id , :sticky => true, :status => true ) # 更新的目的是为了排序,因为该条动态的时间可能与课程创建的动态创建时间一直 From 78c70dce81ff65935ee4262334eba09ba5cec5de Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 22 Feb 2016 15:52:16 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E9=95=BF=E5=BA=A6=E5=BC=95=E8=B5=B7=E7=9A=84?= =?UTF-8?q?=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/show.html.erb | 4 ++-- public/stylesheets/project.css | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index afe4740eb..76d5745df 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -36,12 +36,12 @@ <% if @changesets && !@changesets.empty? %> <% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %> <%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> -
<%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %>
+
提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
<%= @changesets_latest_coimmit.message %>
<% else %> -
<%=@changesets_latest_coimmit.author_email %>
+
提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
<%= @changesets_latest_coimmit.message %>
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 29c099d3d..11c01aa09 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -1168,3 +1168,4 @@ div.disable_link {background-color: #c1c1c1 !important;} /*问题跟踪局部修改属性*/ .proInfoBox2{ border:1px solid #dddddd; height:45px; padding:10px 0; background-color:#f1f1f1;} .proInfoBox2 ul li{ height:24px; position:relative;} +.maxwidth150{max-width: 150px;} From 2156b6db76fd977fcf48540fe015867158bbbe49 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 22 Feb 2016 16:56:37 +0800 Subject: [PATCH 3/6] =?UTF-8?q?issue=E5=9B=9E=E5=A4=8D=20Forge=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=9B=B4=E6=96=B0=E6=8E=92=E5=BA=8F=E9=9D=A0=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journal.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/models/journal.rb b/app/models/journal.rb index 2da815a44..b184c82e6 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -52,6 +52,7 @@ class Journal < ActiveRecord::Base # fq after_save :act_as_activity,:be_user_score, :act_as_forge_message, :act_as_at_message + after_create :update_issue_time # end #after_destroy :down_user_score #before_save :be_user_score @@ -230,4 +231,12 @@ class Journal < ActiveRecord::Base project.project_score.update_attribute(:issue_journal_num, project.project_score.issue_journal_num + 1) end end + + # 回复issue的时候,更新issue的时候 + def update_issue_time + if self.journalized_type == "Issue" + forge_activity = ForgeActivity.where("forge_act_id =? and forge_act_type =?", self.issue, "Issue").first + forge_activity.update_attribute(:created_at, self.created_on) unless forge_activity.nil? + end + end end From e62386ad656c4708644e2cc1e8ccba372f516538 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 23 Feb 2016 09:12:50 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=B1=80=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/trustie/gitlab/helper.rb | 24 ++++++++++++++++++++++++ lib/trustie/gitlab/sync.rb | 8 +++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/trustie/gitlab/helper.rb b/lib/trustie/gitlab/helper.rb index 61c1fbd17..a306bb855 100644 --- a/lib/trustie/gitlab/helper.rb +++ b/lib/trustie/gitlab/helper.rb @@ -3,6 +3,15 @@ module Trustie module Gitlab module Helper + GUEST = 10 + REPORTER = 20 + DEVELOPER = 30 + MASTER = 40 + OWNER = 50 + # 项目公开和私有 + PUBLIC = 20 + PRIVATE = 0 + def change_password(uid, en_pwd, salt) return unless uid options = {:encrypted_password=>en_pwd, :password_salt=>salt} @@ -44,6 +53,21 @@ module Trustie self.g.delete_user(user.gid) end + def get_gitlab_role m + case m.roles.first.position + when 1,2 + GUEST + when 5 + REPORTER + when 4 + DEVELOPER + when 3 + MASTER + else + GUEST + end + end + end end end \ No newline at end of file diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb index d41b813e7..2f4f77c53 100644 --- a/lib/trustie/gitlab/sync.rb +++ b/lib/trustie/gitlab/sync.rb @@ -61,7 +61,7 @@ module Trustie unless gid gid = sync_user(m.user).id end - self.g.add_team_member(gproject.id, gid, UserLevel::DEVELOPER) + self.g.add_team_member(gproject.id, gid, get_gitlab_role(m)) rescue => e puts e end @@ -111,7 +111,7 @@ module Trustie unless gid gid = sync_user(m.user).id end - self.g.add_team_member(gproject.id, gid, UserLevel::DEVELOPER) + self.g.add_team_member(gproject.id, gid, get_gitlab_role(m)) rescue => e puts e end @@ -125,7 +125,7 @@ module Trustie unless gid gid = sync_user(m.user).id end - self.g.add_team_member(project.gpid, gid, UserLevel::DEVELOPER) + self.g.add_team_member(project.gpid, gid, get_gitlab_role(m)) rescue => e puts e end @@ -134,6 +134,8 @@ module Trustie def remove_project end + + end end From ed7183b1a966ee41124d16fc60ca449aa6b9240c Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 23 Feb 2016 11:31:34 +0800 Subject: [PATCH 5/6] 0 --- lib/trustie/gitlab/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/trustie/gitlab/helper.rb b/lib/trustie/gitlab/helper.rb index a306bb855..9fb1f5735 100644 --- a/lib/trustie/gitlab/helper.rb +++ b/lib/trustie/gitlab/helper.rb @@ -11,7 +11,7 @@ module Trustie # 项目公开和私有 PUBLIC = 20 PRIVATE = 0 - + def change_password(uid, en_pwd, salt) return unless uid options = {:encrypted_password=>en_pwd, :password_salt=>salt} From 69ae7e384595ea941a6e8330ba9346cf226a7e1f Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 23 Feb 2016 15:45:19 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160223073859_add_publish_to_attachment_histories.rb | 6 ++++++ db/schema.rb | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160223073859_add_publish_to_attachment_histories.rb diff --git a/db/migrate/20160223073859_add_publish_to_attachment_histories.rb b/db/migrate/20160223073859_add_publish_to_attachment_histories.rb new file mode 100644 index 000000000..81533004f --- /dev/null +++ b/db/migrate/20160223073859_add_publish_to_attachment_histories.rb @@ -0,0 +1,6 @@ +class AddPublishToAttachmentHistories < ActiveRecord::Migration + def change + add_column :attachment_histories, :is_publish, :integer, :default => 1 + add_column :attachment_histories, :publish_time, :date + end +end diff --git a/db/schema.rb b/db/schema.rb index c22b79790..db33479a5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160220100507) do +ActiveRecord::Schema.define(:version => 20160223073859) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -99,6 +99,8 @@ ActiveRecord::Schema.define(:version => 20160220100507) do t.integer "quotes" t.integer "version" t.integer "attachment_id" + t.integer "is_publish", :default => 1 + t.date "publish_time" end create_table "attachments", :force => true do |t| @@ -118,6 +120,8 @@ ActiveRecord::Schema.define(:version => 20160220100507) do t.integer "is_public", :default => 1 t.integer "copy_from" t.integer "quotes" + t.integer "is_publish", :default => 1 + t.date "publish_time" end add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id" @@ -1373,7 +1377,6 @@ ActiveRecord::Schema.define(:version => 20160220100507) do t.integer "changeset_num", :default => 0 t.integer "board_message_num", :default => 0 t.integer "board_num", :default => 0 - t.integer "act_num", :default => 0 t.integer "attach_num", :default => 0 t.datetime "commit_time" end