From 6f1a59b8ed6bbe8d2c0b25bdbb82102e7b29cafd Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 13 Jan 2016 13:27:05 +0000 Subject: Removes white line when hiding diff comments in MR Fixes #6071 --- app/assets/stylesheets/pages/diff.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss index afd6fb73675..e5366427f76 100644 --- a/app/assets/stylesheets/pages/diff.scss +++ b/app/assets/stylesheets/pages/diff.scss @@ -76,6 +76,7 @@ width: 100%; font-family: $monospace_font; border: none; + border-collapse: separate; margin: 0px; padding: 0px; .line_holder td { -- cgit v1.2.1 From 46b56fc7ecf7251195dcdba961c3b103664fdd73 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Wed, 13 Jan 2016 16:46:40 -0500 Subject: initial fix --- app/assets/javascripts/issuable_context.js.coffee | 11 ++++++++++- app/assets/javascripts/issue.js.coffee | 1 - app/assets/javascripts/merge_request.js.coffee | 5 ++--- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/issuable_context.js.coffee b/app/assets/javascripts/issuable_context.js.coffee index 02232698bc2..bcc3e52bf9b 100644 --- a/app/assets/javascripts/issuable_context.js.coffee +++ b/app/assets/javascripts/issuable_context.js.coffee @@ -15,7 +15,16 @@ class @IssuableContext $(@).width($(@).outerWidth()) .on 'affixed-top.bs.affix affixed-bottom.bs.affix', -> $(@).width('') - + $discussion = $('.issuable-discussion') + $sidebar = $('.issuable-sidebar') + discussionHeight = $discussion.height() + sidebarHeight = $sidebar.height() + console.log(sidebarHeight,discussionHeight) + if sidebarHeight > discussionHeight + $discussion.height(sidebarHeight + 50) + console.log('fixing issues') + return + # No affix if discussion is smaller than sidebar $('.issuable-affix').affix offset: top: -> @top = ($('.issuable-affix').offset().top - 70) diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee index 0d26c58a81d..2297061a605 100644 --- a/app/assets/javascripts/issue.js.coffee +++ b/app/assets/javascripts/issue.js.coffee @@ -6,7 +6,6 @@ class @Issue constructor: -> # Prevent duplicate event bindings @disableTaskList() - if $('a.btn-close').length @initTaskList() @initIssueBtnEventListeners() diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee index ed0bf2b3f48..d4fd4ed6003 100644 --- a/app/assets/javascripts/merge_request.js.coffee +++ b/app/assets/javascripts/merge_request.js.coffee @@ -50,11 +50,10 @@ class @MergeRequest $this = $(this) if $this.data('submitted') return - e.preventDefault() - e.stopImmediatePropagation() shouldSubmit = $this.hasClass('btn-comment') - console.log("shouldSubmit") if shouldSubmit + e.preventDefault() + e.stopImmediatePropagation() _this.submitNoteForm($this.closest('form'),$this) submitNoteForm: (form, $button) => -- cgit v1.2.1 From df8776f480eeb81245f338f85998b93d11f833a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20D=C3=A1vila?= Date: Wed, 13 Jan 2016 17:03:24 -0500 Subject: Consider that URL can end with '/' before redirecting. #7975 --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 81cb1367e2c..bf99b2e777d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -115,7 +115,7 @@ class ApplicationController < ActionController::Base # localhost/group/project # if id =~ /\.git\Z/ - redirect_to request.original_url.gsub(/\.git\Z/, '') and return + redirect_to request.original_url.gsub(/\.git\/?\Z/, '') and return end project_path = "#{namespace}/#{id}" -- cgit v1.2.1 From 7b143a81f38364a90a7e3b86ad461549898245f1 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Wed, 13 Jan 2016 18:54:11 -0500 Subject: fixes scrollbar jump by making discussion the same size as the sidebar when sidebar is bigger, and not allowing affix to do fixed position on the sidebar --- app/assets/javascripts/issuable_context.js.coffee | 11 +---------- app/assets/javascripts/issue.js.coffee | 15 +++++++++++++++ app/assets/javascripts/merge_request.js.coffee | 21 +++++++++++++++++++-- app/assets/stylesheets/pages/issuable.scss | 5 +++++ 4 files changed, 40 insertions(+), 12 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/issuable_context.js.coffee b/app/assets/javascripts/issuable_context.js.coffee index bcc3e52bf9b..02232698bc2 100644 --- a/app/assets/javascripts/issuable_context.js.coffee +++ b/app/assets/javascripts/issuable_context.js.coffee @@ -15,16 +15,7 @@ class @IssuableContext $(@).width($(@).outerWidth()) .on 'affixed-top.bs.affix affixed-bottom.bs.affix', -> $(@).width('') - $discussion = $('.issuable-discussion') - $sidebar = $('.issuable-sidebar') - discussionHeight = $discussion.height() - sidebarHeight = $sidebar.height() - console.log(sidebarHeight,discussionHeight) - if sidebarHeight > discussionHeight - $discussion.height(sidebarHeight + 50) - console.log('fixing issues') - return - # No affix if discussion is smaller than sidebar + $('.issuable-affix').affix offset: top: -> @top = ($('.issuable-affix').offset().top - 70) diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee index 2297061a605..cbc70cd846c 100644 --- a/app/assets/javascripts/issue.js.coffee +++ b/app/assets/javascripts/issue.js.coffee @@ -6,10 +6,25 @@ class @Issue constructor: -> # Prevent duplicate event bindings @disableTaskList() + @fixAffixScroll() if $('a.btn-close').length @initTaskList() @initIssueBtnEventListeners() + fixAffixScroll: -> + fixAffix = -> + $discussion = $('.issuable-discussion') + $sidebar = $('.issuable-sidebar') + if $sidebar.hasClass('no-affix') + $sidebar.removeClass(['affix-top','affix']) + discussionHeight = $discussion.height() + sidebarHeight = $sidebar.height() + if sidebarHeight > discussionHeight + $discussion.height(sidebarHeight + 50) + $sidebar.addClass('no-affix') + $(window).on('resize', fixAffix) + fixAffix() + initTaskList: -> $('.detail-page-description .js-task-list-container').taskList('enable') $(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList diff --git a/app/assets/javascripts/merge_request.js.coffee b/app/assets/javascripts/merge_request.js.coffee index d4fd4ed6003..239f3d6afae 100644 --- a/app/assets/javascripts/merge_request.js.coffee +++ b/app/assets/javascripts/merge_request.js.coffee @@ -15,6 +15,8 @@ class @MergeRequest this.$('.show-all-commits').on 'click', => this.showAllCommits() + @fixAffixScroll(); + @initTabs() # Prevent duplicate event bindings @@ -28,6 +30,20 @@ class @MergeRequest $: (selector) -> this.$el.find(selector) + fixAffixScroll: -> + fixAffix = -> + $discussion = $('.issuable-discussion') + $sidebar = $('.issuable-sidebar') + if $sidebar.hasClass('no-affix') + $sidebar.removeClass(['affix-top','affix']) + discussionHeight = $discussion.height() + sidebarHeight = $sidebar.height() + if sidebarHeight > discussionHeight + $discussion.height(sidebarHeight + 50) + $sidebar.addClass('no-affix') + $(window).on('resize', fixAffix) + fixAffix() + initTabs: -> if @opts.action != 'new' # `MergeRequests#new` has no tab-persisting or lazy-loading behavior @@ -50,10 +66,11 @@ class @MergeRequest $this = $(this) if $this.data('submitted') return + e.preventDefault() + e.stopImmediatePropagation() shouldSubmit = $this.hasClass('btn-comment') + console.log("shouldSubmit") if shouldSubmit - e.preventDefault() - e.stopImmediatePropagation() _this.submitNoteForm($this.closest('form'),$this) submitNoteForm: (form, $button) => diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index d4b44004f4f..c3c33f0b76a 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -20,6 +20,11 @@ position: fixed; top: 70px; margin-right: 35px; + + &.no-affix { + position: relative; + top: 0; + } } } } -- cgit v1.2.1 From d00725a17594bd4908d31397c6012b397ff1148d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 14 Jan 2016 16:05:47 +0100 Subject: Fix alignment issues after a fix on titles weight --- app/assets/stylesheets/pages/commit.scss | 2 +- app/assets/stylesheets/pages/tags.scss | 2 +- app/views/projects/commits/_commit.html.haml | 2 +- app/views/projects/tags/_tag.html.haml | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/pages/commit.scss b/app/assets/stylesheets/pages/commit.scss index 6ec88bdd804..3d6162d4ed4 100644 --- a/app/assets/stylesheets/pages/commit.scss +++ b/app/assets/stylesheets/pages/commit.scss @@ -2,7 +2,7 @@ display: block; } -.commit-row-title .commit-title { +.commit-row-title .title { font-weight: 600; } diff --git a/app/assets/stylesheets/pages/tags.scss b/app/assets/stylesheets/pages/tags.scss index e9cd6dc6c5e..0ef6754bf35 100644 --- a/app/assets/stylesheets/pages/tags.scss +++ b/app/assets/stylesheets/pages/tags.scss @@ -1,3 +1,3 @@ -.tag-name{ +.tag-name { font-weight: 600; } diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 4d4b410ee29..e4b54dedda8 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -11,7 +11,7 @@ = cache(cache_key) do %li.commit.js-toggle-container{ id: "commit-#{commit.short_id}" } .commit-row-title - .commit-title.str-truncated + .title.str-truncated = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" - if commit.description? %a.text-expander.js-toggle-button ... diff --git a/app/views/projects/tags/_tag.html.haml b/app/views/projects/tags/_tag.html.haml index 56a7ced1236..94c75de2fdb 100644 --- a/app/views/projects/tags/_tag.html.haml +++ b/app/views/projects/tags/_tag.html.haml @@ -2,10 +2,9 @@ - release = @releases.find { |release| release.tag == tag.name } %li %div - = link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do - .tag-name - = icon('tag') - = tag.name + = link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'tag-name' do + = icon('tag') + = tag.name - if tag.message.present?   = strip_gpg_signature(tag.message) -- cgit v1.2.1 From ac652d82f17d378e485dcef15a8fabdcf9bad76b Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Thu, 14 Jan 2016 19:45:43 +0100 Subject: Let the CI runner know about builds that this build depends on This allows us to implement artifacts passing: runner will download artifacts from all prior builds --- app/models/ci/build.rb | 8 ++++++++ app/uploaders/artifact_uploader.rb | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 6cc26abce66..16a5b03f591 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -128,6 +128,14 @@ module Ci !self.commit.latest_builds_for_ref(self.ref).include?(self) end + def depends_on_builds + # Get builds of the same type + latest_builds = self.commit.builds.similar(self).latest + + # Return builds from previous stages + latest_builds.where('stage_idx < ?', stage_idx) + end + def trace_html html = Ci::Ansi2html::convert(trace) if trace.present? html || '' diff --git a/app/uploaders/artifact_uploader.rb b/app/uploaders/artifact_uploader.rb index 1b0ae6c0056..1cd93263c9f 100644 --- a/app/uploaders/artifact_uploader.rb +++ b/app/uploaders/artifact_uploader.rb @@ -32,6 +32,10 @@ class ArtifactUploader < CarrierWave::Uploader::Base self.class.storage == CarrierWave::Storage::File end + def filename + file.try(:filename) + end + def exists? file.try(:exists?) end -- cgit v1.2.1 From e80113593c120b71af428ea1b00f11fcdeae58b8 Mon Sep 17 00:00:00 2001 From: Kirilll Zaycev Date: Tue, 1 Dec 2015 23:47:23 +0300 Subject: Raise hook url limit --- app/models/hooks/project_hook.rb | 4 ++-- app/models/hooks/service_hook.rb | 4 ++-- app/models/hooks/system_hook.rb | 4 ++-- app/models/hooks/web_hook.rb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/models/hooks/project_hook.rb b/app/models/hooks/project_hook.rb index fa18ba5dbbe..fe923fafbe0 100644 --- a/app/models/hooks/project_hook.rb +++ b/app/models/hooks/project_hook.rb @@ -3,11 +3,11 @@ # Table name: web_hooks # # id :integer not null, primary key -# url :string(255) +# url :string(2000) # project_id :integer # created_at :datetime # updated_at :datetime -# type :string(255) default("ProjectHook") +# type :string default("ProjectHook") # service_id :integer # push_events :boolean default(TRUE), not null # issues_events :boolean default(FALSE), not null diff --git a/app/models/hooks/service_hook.rb b/app/models/hooks/service_hook.rb index b333a337347..80962264ba2 100644 --- a/app/models/hooks/service_hook.rb +++ b/app/models/hooks/service_hook.rb @@ -3,11 +3,11 @@ # Table name: web_hooks # # id :integer not null, primary key -# url :string(255) +# url :string(2000) # project_id :integer # created_at :datetime # updated_at :datetime -# type :string(255) default("ProjectHook") +# type :string default("ProjectHook") # service_id :integer # push_events :boolean default(TRUE), not null # issues_events :boolean default(FALSE), not null diff --git a/app/models/hooks/system_hook.rb b/app/models/hooks/system_hook.rb index d81512fae5d..c147d8762a9 100644 --- a/app/models/hooks/system_hook.rb +++ b/app/models/hooks/system_hook.rb @@ -3,11 +3,11 @@ # Table name: web_hooks # # id :integer not null, primary key -# url :string(255) +# url :string(2000) # project_id :integer # created_at :datetime # updated_at :datetime -# type :string(255) default("ProjectHook") +# type :string default("ProjectHook") # service_id :integer # push_events :boolean default(TRUE), not null # issues_events :boolean default(FALSE), not null diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb index 3bb50c63cac..7a13c3f0a39 100644 --- a/app/models/hooks/web_hook.rb +++ b/app/models/hooks/web_hook.rb @@ -3,11 +3,11 @@ # Table name: web_hooks # # id :integer not null, primary key -# url :string(255) +# url :string(2000) # project_id :integer # created_at :datetime # updated_at :datetime -# type :string(255) default("ProjectHook") +# type :string default("ProjectHook") # service_id :integer # push_events :boolean default(TRUE), not null # issues_events :boolean default(FALSE), not null -- cgit v1.2.1 From 0f6ff0dfc3077094c1434a0ab861d206dfdda05a Mon Sep 17 00:00:00 2001 From: Andriy Dyadyura Date: Thu, 14 Jan 2016 22:44:34 +0100 Subject: update --- app/assets/stylesheets/pages/projects.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 13b0ed769fc..8fa072e911f 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -92,12 +92,12 @@ } .project-repo-buttons { - margin-top: 12px; + margin-top: 20px; margin-bottom: 0px; .count-buttons { display: block; - margin-bottom: 12px; + margin-bottom: 20px; } .clone-row { -- cgit v1.2.1 From 519c293e52adc9c8f6d9b728f635836a62adca68 Mon Sep 17 00:00:00 2001 From: Andriy Dyadyura Date: Thu, 14 Jan 2016 23:00:25 +0100 Subject: update --- app/assets/stylesheets/pages/projects.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 8fa072e911f..3a87b71078d 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -163,7 +163,7 @@ line-height: 13px; padding: $gl-vert-padding $gl-padding; letter-spacing: .4px; - padding: 10px; + padding: 10px 14px; text-align: center; vertical-align: middle; touch-action: manipulation; -- cgit v1.2.1 From 6fd92ad4a972352c3308da14c08af3f1b0458adc Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 14 Jan 2016 17:33:21 -0500 Subject: Prefer custom WOFF2 fonts if the browser supports them [ci skip] --- app/assets/fonts/SourceSansPro-Black.ttf.woff2 | Bin 0 -> 82052 bytes app/assets/fonts/SourceSansPro-BlackIt.ttf.woff2 | Bin 0 -> 34812 bytes app/assets/fonts/SourceSansPro-Bold.ttf.woff2 | Bin 0 -> 85604 bytes app/assets/fonts/SourceSansPro-BoldIt.ttf.woff2 | Bin 0 -> 35864 bytes .../fonts/SourceSansPro-ExtraLight.ttf.woff2 | Bin 0 -> 82808 bytes .../fonts/SourceSansPro-ExtraLightIt.ttf.woff2 | Bin 0 -> 34560 bytes app/assets/fonts/SourceSansPro-It.ttf.woff2 | Bin 0 -> 36016 bytes app/assets/fonts/SourceSansPro-Light.ttf.woff2 | Bin 0 -> 86336 bytes app/assets/fonts/SourceSansPro-LightIt.ttf.woff2 | Bin 0 -> 35952 bytes app/assets/fonts/SourceSansPro-Regular.ttf.woff2 | Bin 0 -> 86844 bytes app/assets/fonts/SourceSansPro-Semibold.ttf.woff2 | Bin 0 -> 86196 bytes .../fonts/SourceSansPro-SemiboldIt.ttf.woff2 | Bin 0 -> 35984 bytes app/assets/stylesheets/framework/fonts.scss | 24 +++++++++++++++++---- 13 files changed, 20 insertions(+), 4 deletions(-) create mode 100755 app/assets/fonts/SourceSansPro-Black.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-BlackIt.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-Bold.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-BoldIt.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-ExtraLight.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-ExtraLightIt.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-It.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-Light.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-LightIt.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-Regular.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-Semibold.ttf.woff2 create mode 100755 app/assets/fonts/SourceSansPro-SemiboldIt.ttf.woff2 (limited to 'app') diff --git a/app/assets/fonts/SourceSansPro-Black.ttf.woff2 b/app/assets/fonts/SourceSansPro-Black.ttf.woff2 new file mode 100755 index 00000000000..c90d078406c Binary files /dev/null and b/app/assets/fonts/SourceSansPro-Black.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-BlackIt.ttf.woff2 b/app/assets/fonts/SourceSansPro-BlackIt.ttf.woff2 new file mode 100755 index 00000000000..b87e22c41b5 Binary files /dev/null and b/app/assets/fonts/SourceSansPro-BlackIt.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-Bold.ttf.woff2 b/app/assets/fonts/SourceSansPro-Bold.ttf.woff2 new file mode 100755 index 00000000000..0f46f3e833a Binary files /dev/null and b/app/assets/fonts/SourceSansPro-Bold.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-BoldIt.ttf.woff2 b/app/assets/fonts/SourceSansPro-BoldIt.ttf.woff2 new file mode 100755 index 00000000000..8007df6df32 Binary files /dev/null and b/app/assets/fonts/SourceSansPro-BoldIt.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-ExtraLight.ttf.woff2 b/app/assets/fonts/SourceSansPro-ExtraLight.ttf.woff2 new file mode 100755 index 00000000000..b715f274082 Binary files /dev/null and b/app/assets/fonts/SourceSansPro-ExtraLight.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-ExtraLightIt.ttf.woff2 b/app/assets/fonts/SourceSansPro-ExtraLightIt.ttf.woff2 new file mode 100755 index 00000000000..d8f9d29d4aa Binary files /dev/null and b/app/assets/fonts/SourceSansPro-ExtraLightIt.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-It.ttf.woff2 b/app/assets/fonts/SourceSansPro-It.ttf.woff2 new file mode 100755 index 00000000000..a00852641f8 Binary files /dev/null and b/app/assets/fonts/SourceSansPro-It.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-Light.ttf.woff2 b/app/assets/fonts/SourceSansPro-Light.ttf.woff2 new file mode 100755 index 00000000000..d8b610ad76e Binary files /dev/null and b/app/assets/fonts/SourceSansPro-Light.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-LightIt.ttf.woff2 b/app/assets/fonts/SourceSansPro-LightIt.ttf.woff2 new file mode 100755 index 00000000000..e0eebac8273 Binary files /dev/null and b/app/assets/fonts/SourceSansPro-LightIt.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-Regular.ttf.woff2 b/app/assets/fonts/SourceSansPro-Regular.ttf.woff2 new file mode 100755 index 00000000000..0dd3464c74b Binary files /dev/null and b/app/assets/fonts/SourceSansPro-Regular.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-Semibold.ttf.woff2 b/app/assets/fonts/SourceSansPro-Semibold.ttf.woff2 new file mode 100755 index 00000000000..2526d2e1b60 Binary files /dev/null and b/app/assets/fonts/SourceSansPro-Semibold.ttf.woff2 differ diff --git a/app/assets/fonts/SourceSansPro-SemiboldIt.ttf.woff2 b/app/assets/fonts/SourceSansPro-SemiboldIt.ttf.woff2 new file mode 100755 index 00000000000..606935af089 Binary files /dev/null and b/app/assets/fonts/SourceSansPro-SemiboldIt.ttf.woff2 differ diff --git a/app/assets/stylesheets/framework/fonts.scss b/app/assets/stylesheets/framework/fonts.scss index 20988f7b430..7a946109e3a 100644 --- a/app/assets/stylesheets/framework/fonts.scss +++ b/app/assets/stylesheets/framework/fonts.scss @@ -3,23 +3,39 @@ font-family: 'Source Sans Pro'; font-style: normal; font-weight: 300; - src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), font-url('SourceSansPro-Light.ttf.woff'); + src: + local('Source Sans Pro Light'), + local('SourceSansPro-Light'), + font-url('SourceSansPro-Light.ttf.woff2') format('woff2'), + font-url('SourceSansPro-Light.ttf.woff') format('woff'); } @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 400; - src: local('Source Sans Pro'), local('SourceSansPro-Regular'), font-url('SourceSansPro-Regular.ttf.woff'); + src: + local('Source Sans Pro'), + local('SourceSansPro-Regular'), + font-url('SourceSansPro-Regular.ttf.woff2') format('woff2'), + font-url('SourceSansPro-Regular.ttf.woff') format('woff'); } @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 600; - src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), font-url('SourceSansPro-Semibold.ttf.woff'); + src: + local('Source Sans Pro Semibold'), + local('SourceSansPro-Semibold'), + font-url('SourceSansPro-Semibold.ttf.woff2') format('woff2'), + font-url('SourceSansPro-Semibold.ttf.woff') format('woff'); } @font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 700; - src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), font-url('SourceSansPro-Bold.ttf.woff'); + src: + local('Source Sans Pro Bold'), + local('SourceSansPro-Bold'), + font-url('SourceSansPro-Bold.ttf.woff2') format('woff2'), + font-url('SourceSansPro-Bold.ttf.woff') format('woff'); } -- cgit v1.2.1 From daf60957d9823ea09283f0306be69c4e50750397 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Thu, 14 Jan 2016 17:21:05 -0500 Subject: Fix javascript error with deleting messages in issue or merge request Elements searched for by jQuery no longer existed in the DOM. Javascript was also unnecessarily complex, for using jQuery Fixes #8109 --- app/assets/javascripts/notes.js.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 356fb6aa08c..8866d81c925 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -355,7 +355,7 @@ class @Notes $('.note[id="' + note_id + '"]').each -> note = $(this) notes = note.closest(".notes") - count = notes.closest(".notes_holder").find(".discussion-notes-count") + count = notes.closest(".issuable-details").find(".notes-tab .badge") # check if this is the last note for this line if notes.find(".note").length is 1 @@ -365,9 +365,10 @@ class @Notes # for diff lines notes.closest("tr").remove() - else - # update notes count - count.get(0).lastChild.nodeValue = " #{notes.children().length - 1}" + + # update notes count + oldNum = parseInt(count.text()) + count.text(oldNum - 1) note.remove() -- cgit v1.2.1 From a69271374df0018b2bfa7cd96e183dedc903f36b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 15 Jan 2016 11:10:55 +0100 Subject: Streamline item titles to use a single class, and add back strong tags --- app/assets/stylesheets/framework/common.scss | 2 ++ app/assets/stylesheets/pages/branches.scss | 3 --- app/assets/stylesheets/pages/groups.scss | 5 ----- app/assets/stylesheets/pages/tags.scss | 3 --- app/views/projects/branches/_branch.html.haml | 4 ++-- app/views/projects/commits/_commit.html.haml | 2 +- app/views/projects/tags/_tag.html.haml | 7 ++++--- app/views/projects/tags/show.html.haml | 2 +- app/views/shared/groups/_group.html.haml | 4 ++-- 9 files changed, 12 insertions(+), 20 deletions(-) delete mode 100644 app/assets/stylesheets/pages/branches.scss delete mode 100644 app/assets/stylesheets/pages/tags.scss (limited to 'app') diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss index 05645116268..585a9d83913 100644 --- a/app/assets/stylesheets/framework/common.scss +++ b/app/assets/stylesheets/framework/common.scss @@ -75,6 +75,8 @@ hr { @include str-truncated; } +.item-title { font-weight: 600; } + /** FLASH message **/ .author_link { color: $gl-link-color; diff --git a/app/assets/stylesheets/pages/branches.scss b/app/assets/stylesheets/pages/branches.scss deleted file mode 100644 index abae5c3d0a5..00000000000 --- a/app/assets/stylesheets/pages/branches.scss +++ /dev/null @@ -1,3 +0,0 @@ -.branch-name{ - font-weight: 600; -} diff --git a/app/assets/stylesheets/pages/groups.scss b/app/assets/stylesheets/pages/groups.scss index 3404c2631e1..263993f59a5 100644 --- a/app/assets/stylesheets/pages/groups.scss +++ b/app/assets/stylesheets/pages/groups.scss @@ -11,8 +11,3 @@ height: 42px; } } - -.content-list .group-name { - font-weight: 600; - color: #4c4e54; -} diff --git a/app/assets/stylesheets/pages/tags.scss b/app/assets/stylesheets/pages/tags.scss deleted file mode 100644 index 0ef6754bf35..00000000000 --- a/app/assets/stylesheets/pages/tags.scss +++ /dev/null @@ -1,3 +0,0 @@ -.tag-name { - font-weight: 600; -} diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index d276e5932d1..d78c2dc0071 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -1,12 +1,12 @@ - commit = @repository.commit(branch.target) - bar_graph_width_factor = @max_commits > 0 ? 100.0/@max_commits : 0 -- diverging_commit_counts = @repository.diverging_commit_counts(branch) +- diverging_commit_counts = @repository.diverging_commit_counts(branch) - number_commits_behind = diverging_commit_counts[:behind] - number_commits_ahead = diverging_commit_counts[:ahead] %li(class="js-branch-#{branch.name}") %div = link_to namespace_project_tree_path(@project.namespace, @project, branch.name) do - .branch-name.str-truncated= branch.name + %strong.item-title.str-truncated= branch.name   - if branch.name == @repository.root_ref %span.label.label-primary default diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index e4b54dedda8..7e1d4d10ff1 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -11,7 +11,7 @@ = cache(cache_key) do %li.commit.js-toggle-container{ id: "commit-#{commit.short_id}" } .commit-row-title - .title.str-truncated + %strong.item-title.str-truncated = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" - if commit.description? %a.text-expander.js-toggle-button ... diff --git a/app/views/projects/tags/_tag.html.haml b/app/views/projects/tags/_tag.html.haml index 94c75de2fdb..0010bda83fc 100644 --- a/app/views/projects/tags/_tag.html.haml +++ b/app/views/projects/tags/_tag.html.haml @@ -2,9 +2,10 @@ - release = @releases.find { |release| release.tag == tag.name } %li %div - = link_to namespace_project_tag_path(@project.namespace, @project, tag.name), class: 'tag-name' do - = icon('tag') - = tag.name + = link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do + %strong.item-title + = icon('tag') + = tag.name - if tag.message.present?   = strip_gpg_signature(tag.message) diff --git a/app/views/projects/tags/show.html.haml b/app/views/projects/tags/show.html.haml index dbb20347860..370a214b2d9 100644 --- a/app/views/projects/tags/show.html.haml +++ b/app/views/projects/tags/show.html.haml @@ -17,7 +17,7 @@ .pull-right = link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row grouped has_tooltip', title: "Delete tag", method: :delete, data: { confirm: "Deleting the '#{@tag.name}' tag cannot be undone. Are you sure?" } do %i.fa.fa-trash-o - .tag-name.title + %strong.item-title = @tag.name - if @tag.message.present? %span.light diff --git a/app/views/shared/groups/_group.html.haml b/app/views/shared/groups/_group.html.haml index f4cfa29ae56..f2882dacf47 100644 --- a/app/views/shared/groups/_group.html.haml +++ b/app/views/shared/groups/_group.html.haml @@ -10,7 +10,8 @@ %i.fa.fa-sign-out = image_tag group_icon(group), class: "avatar s46 hidden-xs" - = link_to group.name, group, class: 'group-name' + = link_to group, class: 'group-name' do + %strong.item-title= group.name - if group_member as @@ -18,4 +19,3 @@ %div.light #{pluralize(group.projects.count, "project")}, #{pluralize(group.users.count, "user")} - -- cgit v1.2.1 From 9e053decfcaa9722fce20f57114c494ee7285718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 15 Jan 2016 11:14:33 +0100 Subject: Remove unnecessary class --- app/assets/stylesheets/pages/commit.scss | 4 ---- 1 file changed, 4 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/pages/commit.scss b/app/assets/stylesheets/pages/commit.scss index 3d6162d4ed4..e53d6fc6bdc 100644 --- a/app/assets/stylesheets/pages/commit.scss +++ b/app/assets/stylesheets/pages/commit.scss @@ -2,10 +2,6 @@ display: block; } -.commit-row-title .title { - font-weight: 600; -} - .commit-author, .commit-committer{ display: block; color: #999; -- cgit v1.2.1 From f7240e03a6045ff64ca8595d9e11e3a1dab86624 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 15 Jan 2016 11:29:53 +0100 Subject: Fix autocomplete for new issues/MRs/snippets --- app/controllers/projects/issues_controller.rb | 2 +- app/controllers/projects/merge_requests_controller.rb | 1 + app/controllers/projects/snippets_controller.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index f476afb2d92..68244883803 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -49,7 +49,7 @@ class Projects::IssuesController < Projects::ApplicationController assignee_id: "" ) - @issue = @project.issues.new(issue_params) + @issue = @noteable = @project.issues.new(issue_params) respond_with(@issue) end diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index de948d271c8..a6284a24223 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -90,6 +90,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController def new params[:merge_request] ||= ActionController::Parameters.new(source_project: @project) @merge_request = MergeRequests::BuildService.new(project, current_user, merge_request_params).execute + @noteable = @merge_request @target_branches = if @merge_request.target_project @merge_request.target_project.repository.branch_names diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb index 2104c7a7a71..92b0caa2efb 100644 --- a/app/controllers/projects/snippets_controller.rb +++ b/app/controllers/projects/snippets_controller.rb @@ -25,7 +25,7 @@ class Projects::SnippetsController < Projects::ApplicationController end def new - @snippet = @project.snippets.build + @snippet = @noteable = @project.snippets.build end def create -- cgit v1.2.1 From f66f9e95bf1e67ad13de9958d16103b858b58e72 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 15 Jan 2016 02:29:34 -0800 Subject: Give reporters the ability to download artifacts. Also fix a few places where page_404 should be render_404. --- app/controllers/projects/builds_controller.rb | 4 ++-- app/controllers/projects/commit_controller.rb | 2 +- app/models/ability.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb index 0e965966ffa..92d9699fe84 100644 --- a/app/controllers/projects/builds_controller.rb +++ b/app/controllers/projects/builds_controller.rb @@ -42,7 +42,7 @@ class Projects::BuildsController < Projects::ApplicationController def retry unless @build.retryable? - return page_404 + return render_404 end build = Ci::Build.retry(@build) @@ -72,7 +72,7 @@ class Projects::BuildsController < Projects::ApplicationController def authorize_manage_builds! unless can?(current_user, :manage_builds, project) - return page_404 + return render_404 end end end diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 0aaba3792bf..870f6795219 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -79,7 +79,7 @@ class Projects::CommitController < Projects::ApplicationController def authorize_manage_builds! unless can?(current_user, :manage_builds, project) - return page_404 + return render_404 end end end diff --git a/app/models/ability.rb b/app/models/ability.rb index 5375148a654..ab59a3506a2 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -160,6 +160,7 @@ class Ability @project_report_rules ||= project_guest_rules + [ :create_commit_status, :read_commit_statuses, + :read_build_artifacts, :download_code, :fork_project, :create_project_snippet, @@ -175,7 +176,6 @@ class Ability :create_merge_request, :create_wiki, :manage_builds, - :read_build_artifacts, :push_code ] end -- cgit v1.2.1 From 6b2f38f39a473e6791b39e61645d76638d4bd673 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 15 Jan 2016 13:48:29 +0100 Subject: Fix nonexistent method in artifacts controller --- app/controllers/projects/artifacts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb index dff0732bdfe..f159a6d6dc6 100644 --- a/app/controllers/projects/artifacts_controller.rb +++ b/app/controllers/projects/artifacts_controller.rb @@ -8,7 +8,7 @@ class Projects::ArtifactsController < Projects::ApplicationController end unless artifacts_file.exists? - return not_found! + return render_404 end send_file artifacts_file.path, disposition: 'attachment' -- cgit v1.2.1 From 51266f41b3150b3a198bf8316d093a86d4d38cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 15 Jan 2016 15:28:16 +0100 Subject: Consider re-assign as a mention from a notification point of view This will ensure new assignee gets an email even if his notif level is "on mention". --- app/services/notification_service.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index e4edc55bf69..60b86914a38 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -379,7 +379,7 @@ class NotificationService previous_assignee_id = previous_record(target, "assignee_id") previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id - recipients = build_recipients(target, project, current_user, [previous_assignee]) + recipients = build_recipients(target, project, current_user, action: :reassign, extra_recipients: [previous_assignee]) recipients.each do |recipient| mailer.send( @@ -400,22 +400,28 @@ class NotificationService end end - def build_recipients(target, project, current_user, extra_recipients = nil) + def build_recipients(target, project, current_user, action: nil, extra_recipients: nil) recipients = target.participants(current_user) recipients = recipients.concat(extra_recipients).compact.uniq if extra_recipients recipients = add_project_watchers(recipients, project) recipients = reject_mention_users(recipients, project) - recipients = reject_muted_users(recipients, project) + # Re-assign is considered as a mention of the new assignee so we add the + # new assignee to the list of recipients after we rejected users with + # the "on mention" notification level + if action == :reassign + recipients << target.assignee + end + + recipients = reject_muted_users(recipients, project) recipients = add_subscribed_users(recipients, target) recipients = reject_unsubscribed_users(recipients, target) recipients.delete(current_user) - recipients = recipients.uniq - recipients + recipients.uniq end def mailer -- cgit v1.2.1 From ef3d5a2712871ab490facfc0764d24edec84a8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 15 Jan 2016 15:46:01 +0100 Subject: Replace strong by span for .item-title elements --- app/views/projects/branches/_branch.html.haml | 2 +- app/views/projects/commits/_commit.html.haml | 2 +- app/views/projects/tags/_tag.html.haml | 2 +- app/views/projects/tags/show.html.haml | 4 ++-- app/views/shared/groups/_group.html.haml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index d78c2dc0071..76a823d3828 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -6,7 +6,7 @@ %li(class="js-branch-#{branch.name}") %div = link_to namespace_project_tree_path(@project.namespace, @project, branch.name) do - %strong.item-title.str-truncated= branch.name + %span.item-title.str-truncated= branch.name   - if branch.name == @repository.root_ref %span.label.label-primary default diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index 7e1d4d10ff1..7f2903589a9 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -11,7 +11,7 @@ = cache(cache_key) do %li.commit.js-toggle-container{ id: "commit-#{commit.short_id}" } .commit-row-title - %strong.item-title.str-truncated + %span.item-title.str-truncated = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" - if commit.description? %a.text-expander.js-toggle-button ... diff --git a/app/views/projects/tags/_tag.html.haml b/app/views/projects/tags/_tag.html.haml index 0010bda83fc..399782273d3 100644 --- a/app/views/projects/tags/_tag.html.haml +++ b/app/views/projects/tags/_tag.html.haml @@ -3,7 +3,7 @@ %li %div = link_to namespace_project_tag_path(@project.namespace, @project, tag.name) do - %strong.item-title + %span.item-title = icon('tag') = tag.name - if tag.message.present? diff --git a/app/views/projects/tags/show.html.haml b/app/views/projects/tags/show.html.haml index 370a214b2d9..8c7f93f93b6 100644 --- a/app/views/projects/tags/show.html.haml +++ b/app/views/projects/tags/show.html.haml @@ -17,8 +17,8 @@ .pull-right = link_to namespace_project_tag_path(@project.namespace, @project, @tag.name), class: 'btn btn-remove remove-row grouped has_tooltip', title: "Delete tag", method: :delete, data: { confirm: "Deleting the '#{@tag.name}' tag cannot be undone. Are you sure?" } do %i.fa.fa-trash-o - %strong.item-title - = @tag.name + .title + %span.item-title= @tag.name - if @tag.message.present? %span.light   diff --git a/app/views/shared/groups/_group.html.haml b/app/views/shared/groups/_group.html.haml index f2882dacf47..778b20fb4f2 100644 --- a/app/views/shared/groups/_group.html.haml +++ b/app/views/shared/groups/_group.html.haml @@ -11,7 +11,7 @@ = image_tag group_icon(group), class: "avatar s46 hidden-xs" = link_to group, class: 'group-name' do - %strong.item-title= group.name + %span.item-title= group.name - if group_member as -- cgit v1.2.1 From 30a4f4c9e0cc44b67ea6041b8aef01196649b8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 15 Jan 2016 17:57:45 +0100 Subject: This will ensure previous assignee gets an email even if his notif level is "on mention" --- app/services/notification_service.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 60b86914a38..ca8a41d93b8 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -376,10 +376,10 @@ class NotificationService end def reassign_resource_email(target, project, current_user, method) - previous_assignee_id = previous_record(target, "assignee_id") + previous_assignee_id = previous_record(target, 'assignee_id') previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id - recipients = build_recipients(target, project, current_user, action: :reassign, extra_recipients: [previous_assignee]) + recipients = build_recipients(target, project, current_user, action: :reassign, previous_assignee: previous_assignee) recipients.each do |recipient| mailer.send( @@ -400,11 +400,9 @@ class NotificationService end end - def build_recipients(target, project, current_user, action: nil, extra_recipients: nil) + def build_recipients(target, project, current_user, action: nil, previous_assignee: nil) recipients = target.participants(current_user) - recipients = recipients.concat(extra_recipients).compact.uniq if extra_recipients - recipients = add_project_watchers(recipients, project) recipients = reject_mention_users(recipients, project) @@ -412,6 +410,7 @@ class NotificationService # new assignee to the list of recipients after we rejected users with # the "on mention" notification level if action == :reassign + recipients << previous_assignee if previous_assignee recipients << target.assignee end -- cgit v1.2.1 From 604a811f80a16b7713a2a3fba0e7309d99ab2285 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Fri, 15 Jan 2016 14:04:07 -0500 Subject: Fixes issue where firefox does not delete message after comment submit Issue was **not** in the way comment was being submitted. `app/assets/javascripts/awards_handler.coffee` was throwing an error. This error was preventing any js from running after it. Fixes #1473 --- app/assets/javascripts/awards_handler.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee index 619abb1fb07..4670c95344d 100644 --- a/app/assets/javascripts/awards_handler.coffee +++ b/app/assets/javascripts/awards_handler.coffee @@ -5,7 +5,7 @@ class @AwardsHandler event.preventDefault() $(".emoji-menu").show() - $("html").click -> + $("html").on 'click', (event) -> if !$(event.target).closest(".emoji-menu").length if $(".emoji-menu").is(":visible") $(".emoji-menu").hide() -- cgit v1.2.1 From c12bd5474e7c6caa9a2af4287cf25e84b47a6b74 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Sat, 16 Jan 2016 10:14:13 -0500 Subject: Search title was getting clipped horizontally. Fixed by adding height to search title css. --- app/assets/stylesheets/pages/search.scss | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/assets/stylesheets/pages/search.scss b/app/assets/stylesheets/pages/search.scss index 3aaa96da609..bdcf1897522 100644 --- a/app/assets/stylesheets/pages/search.scss +++ b/app/assets/stylesheets/pages/search.scss @@ -3,6 +3,10 @@ border-bottom: 1px solid #DDD; padding-bottom: 15px; margin-bottom: 15px; + + .term { + height: 22px; + } } } -- cgit v1.2.1 From c70ed7f2cdc0fbecea739a08332529b71325938c Mon Sep 17 00:00:00 2001 From: Josh Frye Date: Tue, 12 Jan 2016 12:36:28 -0500 Subject: Autofill abuse message text with user url. Closes #2838 --- app/controllers/abuse_reports_controller.rb | 1 + app/views/abuse_reports/new.html.haml | 2 +- app/views/users/show.html.haml | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/abuse_reports_controller.rb b/app/controllers/abuse_reports_controller.rb index 38814459f66..2eac0cabf7a 100644 --- a/app/controllers/abuse_reports_controller.rb +++ b/app/controllers/abuse_reports_controller.rb @@ -2,6 +2,7 @@ class AbuseReportsController < ApplicationController def new @abuse_report = AbuseReport.new @abuse_report.user_id = params[:user_id] + @ref_url = params.fetch(:ref_url, '') end def create diff --git a/app/views/abuse_reports/new.html.haml b/app/views/abuse_reports/new.html.haml index 3e5cdd2ce4a..8d31182a3e6 100644 --- a/app/views/abuse_reports/new.html.haml +++ b/app/views/abuse_reports/new.html.haml @@ -16,7 +16,7 @@ .form-group = f.label :message, class: 'control-label' .col-sm-10 - = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true + = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true, value: @ref_url .help-block Explain the problem with this user. If appropriate, provide a link to the relevant issue or comment. diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 849304ee2b6..7125b01c3ff 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -93,7 +93,30 @@ %h4.center.light %i.fa.fa-spinner.fa-spin .user-calendar-activities + .cover-controls + - if @user == current_user + = link_to profile_path, class: 'btn btn-gray' do + = icon('pencil') + - elsif current_user + %span.report-abuse + - if @user.abuse_report + %button.btn.btn-danger{ title: 'Already reported for abuse', + data: { toggle: 'tooltip', placement: 'left', container: 'body' }} + = icon('exclamation-circle') + - else + = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: 'btn btn-gray', + title: 'Report abuse', data: {toggle: 'tooltip', placement: 'left', container: 'body'} do + = icon('exclamation-circle') + - if current_user +   + = link_to user_path(@user, :atom, { private_token: current_user.private_token }), class: 'btn btn-gray' do + = icon('rss') +.gray-content-block.second-block + .user-calendar + %h4.center.light + %i.fa.fa-spinner.fa-spin + .user-calendar-activities .content_list = spinner -- cgit v1.2.1 From 2d3655cd1403d354717ee4cb704c35a061e4b561 Mon Sep 17 00:00:00 2001 From: Josh Frye Date: Tue, 12 Jan 2016 14:15:59 -0500 Subject: sanitize user supplied input. --- app/views/abuse_reports/new.html.haml | 2 +- app/views/users/show.html.haml | 25 +------------------------ 2 files changed, 2 insertions(+), 25 deletions(-) (limited to 'app') diff --git a/app/views/abuse_reports/new.html.haml b/app/views/abuse_reports/new.html.haml index 8d31182a3e6..f125ecf7be5 100644 --- a/app/views/abuse_reports/new.html.haml +++ b/app/views/abuse_reports/new.html.haml @@ -16,7 +16,7 @@ .form-group = f.label :message, class: 'control-label' .col-sm-10 - = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true, value: @ref_url + = f.text_area :message, class: "form-control js-quick-submit", rows: 2, required: true, value: sanitize(@ref_url) .help-block Explain the problem with this user. If appropriate, provide a link to the relevant issue or comment. diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 7125b01c3ff..3bfd781e51d 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -20,7 +20,7 @@ data: { toggle: 'tooltip', placement: 'left', container: 'body' }} = icon('exclamation-circle') - else - = link_to new_abuse_report_path(user_id: @user.id), class: 'btn btn-gray', + = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: 'btn btn-gray', title: 'Report abuse', data: {toggle: 'tooltip', placement: 'left', container: 'body'} do = icon('exclamation-circle') - if current_user @@ -93,30 +93,7 @@ %h4.center.light %i.fa.fa-spinner.fa-spin .user-calendar-activities - .cover-controls - - if @user == current_user - = link_to profile_path, class: 'btn btn-gray' do - = icon('pencil') - - elsif current_user - %span.report-abuse - - if @user.abuse_report - %button.btn.btn-danger{ title: 'Already reported for abuse', - data: { toggle: 'tooltip', placement: 'left', container: 'body' }} - = icon('exclamation-circle') - - else - = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: 'btn btn-gray', - title: 'Report abuse', data: {toggle: 'tooltip', placement: 'left', container: 'body'} do - = icon('exclamation-circle') - - if current_user -   - = link_to user_path(@user, :atom, { private_token: current_user.private_token }), class: 'btn btn-gray' do - = icon('rss') -.gray-content-block.second-block - .user-calendar - %h4.center.light - %i.fa.fa-spinner.fa-spin - .user-calendar-activities .content_list = spinner -- cgit v1.2.1 From d633755350f1549d4643ac527980c9b28aa1287c Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 16 Jan 2016 16:25:35 -0500 Subject: Use a more sensible message for the AbuseReport uniqueness validation Previously it was "user has already been taken", when really we were saying the user has already been reported. --- app/models/abuse_report.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/abuse_report.rb b/app/models/abuse_report.rb index 2bc15c60d57..cc59aa4e911 100644 --- a/app/models/abuse_report.rb +++ b/app/models/abuse_report.rb @@ -17,7 +17,7 @@ class AbuseReport < ActiveRecord::Base validates :reporter, presence: true validates :user, presence: true validates :message, presence: true - validates :user_id, uniqueness: true + validates :user_id, uniqueness: { message: 'has already been reported' } def remove_user user.block -- cgit v1.2.1 From 6754caed3c28e47269d4605f325040339fab1cab Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 16 Jan 2016 22:17:57 -0500 Subject: Autosize the textarea in showEditForm [ci skip] --- app/assets/javascripts/notes.js.coffee | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 8866d81c925..2bfc5cb2d9c 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -320,6 +320,7 @@ class @Notes form.show() textarea = form.find("textarea") textarea.focus() + autosize(textarea) # HACK (rspeicher/DouweM): Work around a Chrome 43 bug(?). # The textarea has the correct value, Chrome just won't show it unless we -- cgit v1.2.1 From adcab296fd48074daf9cac903d90270391f3e9d1 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 15 Jan 2016 10:33:42 +0100 Subject: Expose link to CI Lint Tool on builds page --- app/views/projects/builds/index.html.haml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml index 5d18c0d803a..36b308b7b8f 100644 --- a/app/views/projects/builds/index.html.haml +++ b/app/views/projects/builds/index.html.haml @@ -6,7 +6,19 @@ - if can?(current_user, :manage_builds, @project) .pull-left.hidden-xs - if @all_builds.running_or_pending.any? - = link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post + = link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), + data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post + + .pull-left.hidden-xs.hidden-sm{ style: 'margin-left: 7px;' } + .dropdown + %button.btn.btn-default.dropdown-toggle{ type: 'button', id: 'tools-dropdown', 'data-toggle' => 'dropdown' } + Tools + %span.caret + %ul.dropdown-menu.dropdown-menu-right + %li + = link_to ci_lint_path do + = icon('wrench') + %span CI Lint Tool %ul.nav-links %li{class: ('active' if @scope.nil?)} -- cgit v1.2.1 From 59ffe978fd5e89b55c737a030314a0bc3fdb85bd Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Sun, 17 Jan 2016 16:33:53 +0100 Subject: Reuse existing CSS classes when exposing CI Lint tool --- app/views/projects/builds/index.html.haml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml index 36b308b7b8f..747d94cc9e6 100644 --- a/app/views/projects/builds/index.html.haml +++ b/app/views/projects/builds/index.html.haml @@ -9,16 +9,15 @@ = link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post - .pull-left.hidden-xs.hidden-sm{ style: 'margin-left: 7px;' } - .dropdown - %button.btn.btn-default.dropdown-toggle{ type: 'button', id: 'tools-dropdown', 'data-toggle' => 'dropdown' } - Tools - %span.caret - %ul.dropdown-menu.dropdown-menu-right - %li - = link_to ci_lint_path do - = icon('wrench') - %span CI Lint Tool + .dropdown.inline + %button.btn.btn-default.dropdown-toggle{ type: 'button', id: 'tools-dropdown', 'data-toggle' => 'dropdown' } + Tools + %span.caret + %ul.dropdown-menu.dropdown-menu-right + %li + = link_to ci_lint_path do + = icon('wrench') + %span CI Lint Tool %ul.nav-links %li{class: ('active' if @scope.nil?)} -- cgit v1.2.1 From 182cc843b02a6773b8650b4e0f2e42a099bef0bd Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Fri, 15 Jan 2016 16:04:48 +0100 Subject: Remove leading comma when user is the only one to award that emoji Fixes #9073 --- app/assets/javascripts/awards_handler.coffee | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee index 619abb1fb07..8b7e0723f6f 100644 --- a/app/assets/javascripts/awards_handler.coffee +++ b/app/assets/javascripts/awards_handler.coffee @@ -19,7 +19,7 @@ class @AwardsHandler @addAwardToEmojiBar(emoji) $(".emoji-menu").hide() - + addAwardToEmojiBar: (emoji) -> @addEmojiToFrequentlyUsedList(emoji) @@ -66,9 +66,14 @@ class @AwardsHandler addMeToAuthorList: (emoji) -> award_block = @findEmojiIcon(emoji).parent() - authors = award_block.attr("data-original-title").split(", ") + authors = _.compact(award_block.attr("data-original-title").split(", ")) authors.push("me") - award_block.attr("title", authors.join(", ")) + + if authors.length == 1 + award_block.attr("title", "me") + else + award_block.attr("title", authors.join(", ")) + @resetTooltip(award_block) resetTooltip: (award) -> @@ -78,7 +83,7 @@ class @AwardsHandler setTimeout (-> award.tooltip() ), 200 - + createEmoji: (emoji) -> emojiCssClass = @resolveNameToCssClass(emoji) -- cgit v1.2.1 From 6fe33804dc080522242d9ea3639548c2b246a56b Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 18 Jan 2016 08:12:31 +0100 Subject: Remove dropdown containing CI Lint button on builds page Link to CI Lint on builds page will be a separate button from now on. --- app/views/projects/builds/index.html.haml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/views/projects/builds/index.html.haml b/app/views/projects/builds/index.html.haml index 747d94cc9e6..bbb6944a65a 100644 --- a/app/views/projects/builds/index.html.haml +++ b/app/views/projects/builds/index.html.haml @@ -9,15 +9,9 @@ = link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post - .dropdown.inline - %button.btn.btn-default.dropdown-toggle{ type: 'button', id: 'tools-dropdown', 'data-toggle' => 'dropdown' } - Tools - %span.caret - %ul.dropdown-menu.dropdown-menu-right - %li - = link_to ci_lint_path do - = icon('wrench') - %span CI Lint Tool + = link_to ci_lint_path, class: 'btn btn-default' do + = icon('wrench') + %span CI Lint %ul.nav-links %li{class: ('active' if @scope.nil?)} -- cgit v1.2.1 From 021d4ebdb8833915ee0de3c191bc7716a265b90a Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 18 Jan 2016 12:03:17 +0100 Subject: Replaced "td" with "th" in the Sherlock SQL list --- app/views/sherlock/transactions/_queries.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/sherlock/transactions/_queries.html.haml b/app/views/sherlock/transactions/_queries.html.haml index b7e0162e80d..b8d93e9ff45 100644 --- a/app/views/sherlock/transactions/_queries.html.haml +++ b/app/views/sherlock/transactions/_queries.html.haml @@ -8,7 +8,7 @@ %tr %th= t('sherlock.time') %th= t('sherlock.query') - %td + %th %tbody - @transaction.sorted_queries.each do |query| %tr -- cgit v1.2.1 From d6a8021ea11c97a8b65f8693a7afe1cb7216295b Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 18 Jan 2016 12:16:55 +0100 Subject: Scope issue projects to a Group when possible When using IssuableFinder with a Group we can greatly reduce the amount of projects operated on (due to not including all public/internal projects) by simply passing it down to the ProjectsFinder class. This reduces the timings of the involved queries from roughly 300 ms to roughly 20 ms. Fixes gitlab-org/gitlab-ce#4071, gitlab-org/gitlab-ce#3707 --- app/finders/issuable_finder.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 4d56b48e3f8..0a4192e6bac 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -81,7 +81,8 @@ class IssuableFinder elsif current_user && params[:authorized_only].presence && !current_user_related? @projects = current_user.authorized_projects.reorder(nil) else - @projects = ProjectsFinder.new.execute(current_user).reorder(nil) + @projects = ProjectsFinder.new.execute(current_user, group: group). + reorder(nil) end end -- cgit v1.2.1 From 13f0ea12e3b99a59c3387aa2646a8b84220ba4a4 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 18 Jan 2016 10:18:16 +0100 Subject: Improve ux in builds artifacts browser --- .../projects/artifacts/_tree_directory.html.haml | 6 +++-- app/views/projects/artifacts/_tree_file.html.haml | 10 ++++----- app/views/projects/artifacts/browse.html.haml | 26 +++++++++++++--------- 3 files changed, 24 insertions(+), 18 deletions(-) (limited to 'app') diff --git a/app/views/projects/artifacts/_tree_directory.html.haml b/app/views/projects/artifacts/_tree_directory.html.haml index 5b87d55efd5..e4b7979949c 100644 --- a/app/views/projects/artifacts/_tree_directory.html.haml +++ b/app/views/projects/artifacts/_tree_directory.html.haml @@ -1,7 +1,9 @@ -%tr{ class: 'tree-item' } +- path_to_directory = browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: directory.path) + +%tr.tree-item{ 'data-link' => path_to_directory} %td.tree-item-file-name = tree_icon('folder', '755', directory.name) %span.str-truncated - = link_to directory.name, browse_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: directory.path) + = link_to directory.name, path_to_directory %td %td diff --git a/app/views/projects/artifacts/_tree_file.html.haml b/app/views/projects/artifacts/_tree_file.html.haml index 92c1648f726..3dfc09cc495 100644 --- a/app/views/projects/artifacts/_tree_file.html.haml +++ b/app/views/projects/artifacts/_tree_file.html.haml @@ -1,11 +1,11 @@ -%tr{ class: 'tree-item' } +- path_to_file = file_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: file.path) + +%tr.tree-item{ 'data-link' => path_to_file } %td.tree-item-file-name = tree_icon('file', '664', file.name) %span.str-truncated - = file.name + = link_to file.name, path_to_file %td = number_to_human_size(file.metadata[:size], precision: 2) %td - = link_to file_namespace_project_build_artifacts_path(@project.namespace, @project, @build, path: file.path), - class: 'btn btn-xs btn-default artifact-download' do - = icon('download') + = number_to_human_size(file.metadata[:zipped], precision: 2) diff --git a/app/views/projects/artifacts/browse.html.haml b/app/views/projects/artifacts/browse.html.haml index 1add7ef6bfb..9dc7b2c2e1f 100644 --- a/app/views/projects/artifacts/browse.html.haml +++ b/app/views/projects/artifacts/browse.html.haml @@ -1,24 +1,28 @@ - page_title 'Artifacts', "#{@build.name} (##{@build.id})", 'Builds' = render 'projects/builds/header_title' -#tree-holder.tree-holder - .gray-content-block.top-block.clearfix - .pull-right - = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), - class: 'btn btn-default' do - = icon('download') - Download artifacts archive +.top-block.gray-content-block.clearfix + .pull-right + = link_to download_namespace_project_build_artifacts_path(@project.namespace, @project, @build), + class: 'btn btn-default' do + = icon('download') + Download artifacts archive -%div.tree-content-holder - .table-holder - %table.table.tree-table.table-striped +.tree-holder + %div.tree-content-holder + %table.table.tree-table %thead %tr %th Name %th Size - %th Download + %th Compressed to = render partial: 'tree_directory', collection: @entry.directories(parent: true), as: :directory = render partial: 'tree_file', collection: @entry.files, as: :file - if @entry.empty? .center Empty + +:javascript + $(document).on('click', 'tr[data-link]', function(e) { + window.location = this.dataset.link; + }); -- cgit v1.2.1 From ea44742b47bcb9dec75ba73793b1235863f04728 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Mon, 18 Jan 2016 15:58:15 -0500 Subject: Fix positioning issues with browse files button Issue is that in Firefox clipboard is blocking the browse files from moving all the way to the right. Move clipboard up 1px into -1px to unblock browse files --- app/assets/stylesheets/pages/commits.scss | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss index 800df95cff3..818fd03e2ae 100644 --- a/app/assets/stylesheets/pages/commits.scss +++ b/app/assets/stylesheets/pages/commits.scss @@ -36,6 +36,10 @@ li.commit { line-height: 20px; margin-bottom: 2px; + .btn-clipboard { + margin-top: -1px; + } + .notes_count { float: right; margin-right: 10px; -- cgit v1.2.1 From 1133251f0883f137ddd2154507fe5f83c5894117 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Mon, 18 Jan 2016 19:51:48 -0500 Subject: Reduce margin to fit dropdowns Fixes #10747 --- app/assets/stylesheets/framework/filters.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/filters.scss b/app/assets/stylesheets/framework/filters.scss index 8e6922c9231..b7638c86bfa 100644 --- a/app/assets/stylesheets/framework/filters.scss +++ b/app/assets/stylesheets/framework/filters.scss @@ -1,5 +1,5 @@ .filter-item { - margin-right: 15px; + margin-right: 6px; } @media (min-width: 800px) { -- cgit v1.2.1 From 3c078cef41305d2c4126501f5de571143c19e147 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Wed, 13 Jan 2016 08:59:56 -0500 Subject: adds exclamation point when assigned user cannot merge --- app/assets/stylesheets/pages/projects.scss | 5 +++++ app/views/shared/issuable/_sidebar.html.haml | 3 +++ 2 files changed, 8 insertions(+) (limited to 'app') diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 3a87b71078d..b14033720b5 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -558,3 +558,8 @@ pre.light-well { width: 101%; } } + +.cannot-be-merged, .cannot-be-merged:hover { + color: #E62958; + margin-top: 2px; +} diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 9f4a7098ea2..1eb14b51533 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -10,6 +10,9 @@ .value - if issuable.assignee %strong= link_to_member(@project, issuable.assignee, size: 24) + - if issuable.instance_of?(MergeRequest) && !@merge_request.can_be_merged_by?(issuable.assignee) + %a.pull-right.cannot-be-merged{href:'#', data:{toggle:'tooltip'}, title:'Not allowed to merge'} + = icon('exclamation-triangle') - else .light None -- cgit v1.2.1 From 8b3d6793454b2a955c88d9dcd65a130133996646 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Wed, 13 Jan 2016 23:31:30 -0500 Subject: color variable for error for exclamation point --- app/assets/stylesheets/framework/variables.scss | 2 ++ app/assets/stylesheets/pages/projects.scss | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 85ecdddda79..70239a74c85 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -26,6 +26,8 @@ $gl-vert-padding: 6px; $gl-padding-top:10px; $gl-avatar-size: 46px; $secondary-text: #7f8fa4; +$error-exclamation-point: #E62958; + /* * Color schema diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index b14033720b5..b715819e30a 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -560,6 +560,6 @@ pre.light-well { } .cannot-be-merged, .cannot-be-merged:hover { - color: #E62958; + color: $error-exclamation-point; margin-top: 2px; -} +} \ No newline at end of file -- cgit v1.2.1 From fbb27a4244994103ed94c4921fc47902a767b860 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Mon, 18 Jan 2016 20:17:29 -0500 Subject: Fix spacing issues, fix naming inconsistencies. Fix conflicts. Used `issuable` instead --- app/assets/stylesheets/pages/projects.scss | 4 ++-- app/views/shared/issuable/_sidebar.html.haml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index b715819e30a..b14033720b5 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -560,6 +560,6 @@ pre.light-well { } .cannot-be-merged, .cannot-be-merged:hover { - color: $error-exclamation-point; + color: #E62958; margin-top: 2px; -} \ No newline at end of file +} diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 1eb14b51533..3092ff54242 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -10,8 +10,8 @@ .value - if issuable.assignee %strong= link_to_member(@project, issuable.assignee, size: 24) - - if issuable.instance_of?(MergeRequest) && !@merge_request.can_be_merged_by?(issuable.assignee) - %a.pull-right.cannot-be-merged{href:'#', data:{toggle:'tooltip'}, title:'Not allowed to merge'} + - if issuable.instance_of?(MergeRequest) && !issuable.can_be_merged_by?(issuable.assignee) + %a.pull-right.cannot-be-merged{href: '#', data: {toggle: 'tooltip'}, title: 'Not allowed to merge'} = icon('exclamation-triangle') - else .light None -- cgit v1.2.1 From 19608d3ee027efb27ecf83671a85487040287619 Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 19 Jan 2016 12:00:38 +0100 Subject: Fix double request issue in artifacts browser --- app/views/projects/artifacts/browse.html.haml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/projects/artifacts/browse.html.haml b/app/views/projects/artifacts/browse.html.haml index 9dc7b2c2e1f..b70c776a2b2 100644 --- a/app/views/projects/artifacts/browse.html.haml +++ b/app/views/projects/artifacts/browse.html.haml @@ -23,6 +23,10 @@ .center Empty :javascript - $(document).on('click', 'tr[data-link]', function(e) { + $('.tree-holder').on('click', 'tr[data-link] a', function(e) { + e.stopImmediatePropagation(); + }); + + $('.tree-holder').on('click', 'tr[data-link]', function(e) { window.location = this.dataset.link; }); -- cgit v1.2.1 From b4ee6f57b9322401d1439eb21f9160ae2cb91d14 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 19 Jan 2016 13:48:07 +0100 Subject: Greatly improve external_issue_tracker performance This greatly improves the performance of Project#external_issue_tracker by moving most of the fields queried in Ruby to the database and letting the database handle all logic. Prior to this change the process of finding an external issue tracker was along the lines of the following: 1. Load all project services into memory. 2. Reduce the list to only services where "issue_tracker?" returns true 3. Reduce the list from step 2 to service where "default?" returns false 4. Find the first service where "activated?" returns true This has to two big problems: 1. Loading all services into memory only to reduce the list down to a single item later on is a waste of memory (and slow timing wise). 2. Calling Array#select followed by Array#reject followed by Array#find allocates extra objects when this really isn't needed. To work around this the following service fields have been moved to the database (instead of being hardcoded): * category * default This in turn means we can get the external issue tracker using the following query: SELECT * FROM services WHERE active IS TRUE AND default IS FALSE AND category = 'issue_tracker' AND project_id = XXX LIMIT 1 This coupled with memoizing the result (just as before this commit) greatly reduces the time it takes for Project#external_issue_tracker to complete. The exact reduction depends on one's environment, but locally the execution time is reduced from roughly 230 ms to only 2 ms (= a reduction of almost 180x). Fixes gitlab-org/gitlab-ce#10771 --- app/models/project.rb | 7 ++----- app/models/project_services/ci_service.rb | 8 +++----- app/models/project_services/gitlab_issue_tracker_service.rb | 4 +--- app/models/project_services/issue_tracker_service.rb | 6 ++---- app/models/service.rb | 11 ++++++++--- 5 files changed, 16 insertions(+), 20 deletions(-) (limited to 'app') diff --git a/app/models/project.rb b/app/models/project.rb index 7e131151513..cb668e0c2f7 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -468,12 +468,9 @@ class Project < ActiveRecord::Base !external_issue_tracker end - def external_issues_trackers - services.select(&:issue_tracker?).reject(&:default?) - end - def external_issue_tracker - @external_issues_tracker ||= external_issues_trackers.find(&:activated?) + @external_issue_tracker ||= + services.issue_trackers.active.without_defaults.first end def can_have_issues_tracker_id? diff --git a/app/models/project_services/ci_service.rb b/app/models/project_services/ci_service.rb index c3f70d1f972..e10b5529b42 100644 --- a/app/models/project_services/ci_service.rb +++ b/app/models/project_services/ci_service.rb @@ -23,14 +23,12 @@ # List methods you need to implement to get your CI service # working with GitLab Merge Requests class CiService < Service - def category - :ci - end - + default_value_for :category, 'ci' + def valid_token?(token) self.respond_to?(:token) && self.token.present? && self.token == token end - + def supported_events %w(push) end diff --git a/app/models/project_services/gitlab_issue_tracker_service.rb b/app/models/project_services/gitlab_issue_tracker_service.rb index 7aa04309f54..05436cd0f79 100644 --- a/app/models/project_services/gitlab_issue_tracker_service.rb +++ b/app/models/project_services/gitlab_issue_tracker_service.rb @@ -24,9 +24,7 @@ class GitlabIssueTrackerService < IssueTrackerService prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url - def default? - true - end + default_value_for :default, true def to_param 'gitlab' diff --git a/app/models/project_services/issue_tracker_service.rb b/app/models/project_services/issue_tracker_service.rb index ed201979d39..25045224ce5 100644 --- a/app/models/project_services/issue_tracker_service.rb +++ b/app/models/project_services/issue_tracker_service.rb @@ -23,12 +23,10 @@ class IssueTrackerService < Service validates :project_url, :issues_url, :new_issue_url, presence: true, if: :activated? - def category - :issue_tracker - end + default_value_for :category, 'issue_tracker' def default? - false + default end def issue_url(iid) diff --git a/app/models/service.rb b/app/models/service.rb index 24f4bf7646e..721273250ea 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -43,6 +43,9 @@ class Service < ActiveRecord::Base validates :project_id, presence: true, unless: Proc.new { |service| service.template? } scope :visible, -> { where.not(type: ['GitlabIssueTrackerService', 'GitlabCiService']) } + scope :issue_trackers, -> { where(category: 'issue_tracker') } + scope :active, -> { where(active: true) } + scope :without_defaults, -> { where(default: false) } scope :push_hooks, -> { where(push_events: true, active: true) } scope :tag_push_hooks, -> { where(tag_push_events: true, active: true) } @@ -51,6 +54,8 @@ class Service < ActiveRecord::Base scope :note_hooks, -> { where(note_events: true, active: true) } scope :build_hooks, -> { where(build_events: true, active: true) } + default_value_for :category, 'common' + def activated? active end @@ -60,7 +65,7 @@ class Service < ActiveRecord::Base end def category - :common + read_attribute(:category).to_sym end def initialize_properties @@ -153,7 +158,7 @@ class Service < ActiveRecord::Base # Returns a hash of the properties that have been assigned a new value since last save, # indicating their original values (attr => original value). - # ActiveRecord does not provide a mechanism to track changes in serialized keys, + # ActiveRecord does not provide a mechanism to track changes in serialized keys, # so we need a specific implementation for service properties. # This allows to track changes to properties set with the accessor methods, # but not direct manipulation of properties hash. @@ -164,7 +169,7 @@ class Service < ActiveRecord::Base def reset_updated_properties @updated_properties = nil end - + def async_execute(data) return unless supported_events.include?(data[:object_kind]) -- cgit v1.2.1 From f5562355f4580ea049d33991aa0eaf76f46b17f7 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Tue, 19 Jan 2016 08:44:16 -0500 Subject: Move multiple css rules to multiple lines. Removes extra line breaks. --- app/assets/stylesheets/framework/variables.scss | 1 - app/assets/stylesheets/pages/projects.scss | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss index 70239a74c85..3ec48da9a41 100644 --- a/app/assets/stylesheets/framework/variables.scss +++ b/app/assets/stylesheets/framework/variables.scss @@ -28,7 +28,6 @@ $gl-avatar-size: 46px; $secondary-text: #7f8fa4; $error-exclamation-point: #E62958; - /* * Color schema */ diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index b14033720b5..003a4c22f20 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -559,7 +559,8 @@ pre.light-well { } } -.cannot-be-merged, .cannot-be-merged:hover { +.cannot-be-merged, +.cannot-be-merged:hover { color: #E62958; margin-top: 2px; } -- cgit v1.2.1 From 11797df1af483156b8cf11290c49c3f4d6089d99 Mon Sep 17 00:00:00 2001 From: Josh Frye Date: Mon, 18 Jan 2016 12:41:49 -0500 Subject: Change 'public' flag to more robust 'visibility' query. --- app/models/project.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/models/project.rb b/app/models/project.rb index 7e131151513..56db0ce6cf6 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -272,6 +272,10 @@ class Project < ActiveRecord::Base query: "%#{query.try(:downcase)}%") end + def search_by_visibility(level) + where(visibility_level: visibility_levels[level.capitalize]) + end + def search_by_title(query) where('projects.archived = ?', false).where('LOWER(projects.name) LIKE :query', query: "%#{query.downcase}%") end -- cgit v1.2.1 From ae6080c791ee8b6aedd7091e2a321f5fe41f0978 Mon Sep 17 00:00:00 2001 From: Josh Frye Date: Tue, 19 Jan 2016 09:53:40 -0500 Subject: Add specs. Adjust filter. --- app/models/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/project.rb b/app/models/project.rb index 56db0ce6cf6..60729d93187 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -273,7 +273,7 @@ class Project < ActiveRecord::Base end def search_by_visibility(level) - where(visibility_level: visibility_levels[level.capitalize]) + where(visibility_level: Gitlab::VisibilityLevel.const_get(level.upcase)) end def search_by_title(query) -- cgit v1.2.1 From 2ece1b774aac36f4a92801c665355e7fe1c4d48f Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Tue, 19 Jan 2016 13:24:42 -0200 Subject: Fix creator should be added as a master of the project on creation --- app/services/projects/create_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index a6820183bee..c94d7ab710f 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -95,7 +95,7 @@ module Projects system_hook_service.execute_hooks_for(@project, :create) unless @project.group - @project.team << [current_user, :master, current_user] + @project.team << [current_user, :master] end @project.import_start if @project.import? -- cgit v1.2.1 From 98e1a5b63424b6912de98ee5055d3f9e57e63899 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 19 Jan 2016 16:25:38 +0100 Subject: Allow LDAP users to change their email if it was not set by the LDAP server --- app/models/user.rb | 5 ++++- app/views/profiles/show.html.haml | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/models/user.rb b/app/models/user.rb index 592468933ed..4214f01f6a4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -664,7 +664,10 @@ class User < ActiveRecord::Base end def all_emails - [self.email, *self.emails.map(&:email)] + all_emails = [] + all_emails << self.email unless self.temp_oauth_email? + all_emails.concat(self.emails.map(&:email)) + all_emails end def hook_attrs diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 9459d8a6295..add9a00138b 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -21,10 +21,10 @@ .form-group = f.label :email, class: "control-label" .col-sm-10 - - if @user.ldap_user? + - if @user.ldap_user? && @user.ldap_email? = f.text_field :email, class: "form-control", required: true, readonly: true %span.help-block.light - Email is read-only for LDAP user + Your email address was automatically set based on the LDAP server. - else - if @user.temp_oauth_email? = f.text_field :email, class: "form-control", required: true, value: nil -- cgit v1.2.1 From 2821306a740d62153b1a9192cb912b04b42b9279 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 19 Jan 2016 16:48:43 +0000 Subject: when starring a project it correctly increase the star count This is instead of increasing star & fork count Fixed #11396 --- app/assets/javascripts/star.js.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/star.js.coffee b/app/assets/javascripts/star.js.coffee index d849b2e7950..f27780dda93 100644 --- a/app/assets/javascripts/star.js.coffee +++ b/app/assets/javascripts/star.js.coffee @@ -6,7 +6,7 @@ class @Star $starIcon = $this.find('i') toggleStar = (isStarred) -> - $this.parent().find('span.count').text data.star_count + $this.parent().find('.star-count').text data.star_count if isStarred $starSpan.removeClass('starred').text 'Star' $starIcon.removeClass('fa-star').addClass 'fa-star-o' @@ -19,4 +19,4 @@ class @Star return ).on 'ajax:error', (e, xhr, status, error) -> new Flash('Star toggle failed. Try again later.', 'alert') - return \ No newline at end of file + return -- cgit v1.2.1 From 84124380e815e549f50d82051b2b546c12d9a724 Mon Sep 17 00:00:00 2001 From: Anton Baklanov Date: Sat, 19 Dec 2015 21:04:40 +0200 Subject: Added X-GitLab-... headers to emails from CI and Email On Push services Fixes #2098 --- app/mailers/emails/builds.rb | 13 +++++++++++++ app/mailers/emails/projects.rb | 6 +++++- app/mailers/notify.rb | 15 +++++++++------ 3 files changed, 27 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/mailers/emails/builds.rb b/app/mailers/emails/builds.rb index d58609a2de5..64c1ce8cfab 100644 --- a/app/mailers/emails/builds.rb +++ b/app/mailers/emails/builds.rb @@ -3,13 +3,26 @@ module Emails def build_fail_email(build_id, to) @build = Ci::Build.find(build_id) @project = @build.project + add_project_headers + add_build_headers + headers['X-GitLab-Build-Status'] = "failed" mail(to: to, subject: subject("Build failed for #{@project.name}", @build.short_sha)) end def build_success_email(build_id, to) @build = Ci::Build.find(build_id) @project = @build.project + add_project_headers + add_build_headers + headers['X-GitLab-Build-Status'] = "success" mail(to: to, subject: subject("Build success for #{@project.name}", @build.short_sha)) end + + private + def add_build_headers + headers['X-GitLab-Build-Id'] = @build.id + headers['X-GitLab-Build-Ref'] = @build.ref + end + end end diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb index b96418679bd..377c2999d6c 100644 --- a/app/mailers/emails/projects.rb +++ b/app/mailers/emails/projects.rb @@ -43,7 +43,7 @@ module Emails @current_user = @created_by = User.find(created_by_id) @access_level = access_level @invite_email = invite_email - + @target_url = namespace_project_url(@project.namespace, @project) mail(to: @created_by.notification_email, @@ -65,6 +65,10 @@ module Emails # used in notify layout @target_url = @message.target_url + @project = Project.find project_id + + add_project_headers + headers['X-GitLab-Author'] = @message.author_username mail(from: sender(@message.author_id, @message.send_from_committer_email?), reply_to: @message.reply_to, diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index e1cd075a978..8cbc9eefc7b 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -100,12 +100,7 @@ class Notify < BaseMailer end def mail_thread(model, headers = {}) - if @project - headers['X-GitLab-Project'] = @project.name - headers['X-GitLab-Project-Id'] = @project.id - headers['X-GitLab-Project-Path'] = @project.path_with_namespace - end - + add_project_headers headers["X-GitLab-#{model.class.name}-ID"] = model.id headers['X-GitLab-Reply-Key'] = reply_key @@ -152,4 +147,12 @@ class Notify < BaseMailer def reply_key @reply_key ||= SentNotification.reply_key end + + def add_project_headers + return unless @project + + headers['X-GitLab-Project'] = @project.name + headers['X-GitLab-Project-Id'] = @project.id + headers['X-GitLab-Project-Path'] = @project.path_with_namespace + end end -- cgit v1.2.1