From cb2287df0ad9396d1f075bde1c4f6de481d908e6 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Fri, 9 Jun 2017 01:50:11 +0300 Subject: Notes bundle for the issue discussions refactor. --- app/views/projects/issues/_discussion.html.haml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 8b095f4ca10..f1711bf074e 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -3,5 +3,10 @@ = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' +#js-notes + - content_for :page_specific_javascripts do + = webpack_bundle_tag 'common_vue' + = webpack_bundle_tag 'notes' + #notes = render 'shared/notes/notes_with_form', :autocomplete => true -- cgit v1.2.1 From 76c3d2d434d3c550c3de912abc0a5b1dc1455368 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 9 Jun 2017 16:24:54 -0500 Subject: Add full JSON endpoints for issue notes and discussions --- app/views/discussions/_headline.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/discussions/_headline.html.haml b/app/views/discussions/_headline.html.haml index c1dabeed387..25e90924413 100644 --- a/app/views/discussions/_headline.html.haml +++ b/app/views/discussions/_headline.html.haml @@ -5,7 +5,7 @@ by = link_to_member(@project, discussion.resolved_by, avatar: false) = time_ago_with_tooltip(discussion.resolved_at, placement: "bottom") -- elsif discussion.last_updated_at != discussion.created_at +- elsif discussion.updated? .discussion-headline-light.js-discussion-headline Last updated - if discussion.last_updated_by -- cgit v1.2.1 From 4b87ecd37d3ef0d0e2d0bbe59d6a4d0a409e19f9 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 9 Jun 2017 16:41:59 -0500 Subject: Add data-discussions-path to issues notes div --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index f1711bf074e..6d09a171b53 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -8,5 +8,5 @@ = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' -#notes +#notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json) } } = render 'shared/notes/notes_with_form', :autocomplete => true -- cgit v1.2.1 From 0273b1188b939b157d439247a97e6c2d24a9f0b4 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Sat, 10 Jun 2017 01:50:31 +0300 Subject: Initial version of main component, Vuex store and service of issue discussions refactor. --- app/views/projects/issues/_discussion.html.haml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 6d09a171b53..d5ec7fdcb3e 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -3,10 +3,11 @@ = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' -#js-notes +%section{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json) } } + #js-notes - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' -#notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json) } } +#notes = render 'shared/notes/notes_with_form', :autocomplete => true -- cgit v1.2.1 From 16a5808e6061cce75f84de8cfb332ec2f5c81ef6 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Tue, 13 Jun 2017 20:01:59 +0300 Subject: =?UTF-8?q?Implement=20initial=20version=20of=20Vue=20notes=20for?= =?UTF-8?q?=20issues.=20=F0=9F=8E=89=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shared/notes/_notes_with_form.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/shared/notes/_notes_with_form.html.haml b/app/views/shared/notes/_notes_with_form.html.haml index f0fcc414756..51049acf042 100644 --- a/app/views/shared/notes/_notes_with_form.html.haml +++ b/app/views/shared/notes/_notes_with_form.html.haml @@ -15,11 +15,11 @@ .timeline-content.timeline-content-form = render "shared/notes/form", view: diff_view, supports_autocomplete: autocomplete - elsif !current_user - .disabled-comment.text-center.prepend-top-default + .disabled-comment.text-center.prepend-top-default.js-disabled-comment Please - = link_to "register", new_session_path(:user, redirect_to_referer: 'yes') + = link_to "register", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-register-link' or - = link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes') + = link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-sign-in-link' to comment :javascript -- cgit v1.2.1 From 0df662feeee6c15ebb81963b0d739db5a1261720 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Wed, 14 Jun 2017 05:13:38 +0300 Subject: Implement note awards as a vue component. --- app/views/projects/issues/_discussion.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index d5ec7fdcb3e..6ce7014095b 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -9,5 +9,6 @@ = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' -#notes + +#notes{style: "margin-top: 150px"} = render 'shared/notes/notes_with_form', :autocomplete => true -- cgit v1.2.1 From e57093ff627a8fdf97fc5398808f1427e26463ad Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Fri, 23 Jun 2017 18:42:08 +0300 Subject: IssueNotesRefactor: Implement main note form. --- app/views/projects/issues/_discussion.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 6ce7014095b..960366a4827 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -10,5 +10,5 @@ = webpack_bundle_tag 'notes' -#notes{style: "margin-top: 150px"} - = render 'shared/notes/notes_with_form', :autocomplete => true +/ #notes{style: "margin-top: 150px"} +/ = render 'shared/notes/notes_with_form', :autocomplete => true -- cgit v1.2.1 From ebf915511359c336b99c1127c5b902f8757ba5e0 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 23 Jun 2017 17:10:05 -0500 Subject: Add data required for note form --- app/views/projects/issues/_discussion.html.haml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 960366a4827..04e3211fb87 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -12,3 +12,9 @@ / #notes{style: "margin-top: 150px"} / = render 'shared/notes/notes_with_form', :autocomplete => true + +:javascript + window.gl.issueData = #{serialize_issuable(@issue)}; + window.gl.currentUserData = #{UserSerializer.new.represent(current_user).to_json}; + +%section#note-form{ data: { new_session_path: new_session_path(:user, redirect_to_referer: 'yes') } } -- cgit v1.2.1 From 44ccf2b1148e53a3b9148ea90a2f45cc8c8a000e Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Wed, 28 Jun 2017 16:21:10 +0300 Subject: IssueNotesRefactor: Change data attr path. --- app/views/projects/issues/_discussion.html.haml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 04e3211fb87..8e4b9f8910a 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -3,7 +3,7 @@ = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' -%section{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json) } } +%section{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), new_session_path: new_session_path(:user, redirect_to_referer: 'yes') } } #js-notes - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' @@ -16,5 +16,3 @@ :javascript window.gl.issueData = #{serialize_issuable(@issue)}; window.gl.currentUserData = #{UserSerializer.new.represent(current_user).to_json}; - -%section#note-form{ data: { new_session_path: new_session_path(:user, redirect_to_referer: 'yes') } } -- cgit v1.2.1 From 17d67a989bb1a87df17583e96b387aa3fa3a9f56 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Thu, 29 Jun 2017 14:47:59 +0300 Subject: IssueNotesRefactor: Implement close/reopen issue actions. --- app/views/projects/issues/show.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index a57844f974e..8509e97fbc6 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -34,8 +34,8 @@ - unless current_user == @issue.author %li= link_to 'Report abuse', new_abuse_report_path(user_id: @issue.author.id, ref_url: issue_url(@issue)) - if can_update_issue - %li= link_to 'Close issue', issue_path(@issue, issue: { state_event: :close }, format: 'json'), class: "btn-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' - %li= link_to 'Reopen issue', issue_path(@issue, issue: { state_event: :reopen }, format: 'json'), class: "btn-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' + %li= link_to 'Close issue', issue_path(@issue, issue: { state_event: :close }, format: 'json'), class: "btn-close js-btn-issue-action #{issue_button_visibility(@issue, true)}", title: 'Close issue' + %li= link_to 'Reopen issue', issue_path(@issue, issue: { state_event: :reopen }, format: 'json'), class: "btn-reopen js-btn-issue-action #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' - if can_report_spam %li= link_to 'Submit as spam', mark_as_spam_project_issue_path(@project, @issue), method: :post, class: 'btn-spam', title: 'Submit as spam' - if can_update_issue || can_report_spam -- cgit v1.2.1 From 15f3362d343ab7ea51402b81c339bc1bd25fa9eb Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Thu, 29 Jun 2017 18:59:22 +0300 Subject: IssueDiscussionsRefactor: Implement polling mechanism. --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 8e4b9f8910a..ab0534f1fb0 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -3,7 +3,7 @@ = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' -%section{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), new_session_path: new_session_path(:user, redirect_to_referer: 'yes') } } +%section{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), notes_path: notes_url, last_fetched_at: Time.now.to_i } } #js-notes - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' -- cgit v1.2.1 From 0f098eb60a706fb69f1a822ee409826f663ee82f Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Wed, 5 Jul 2017 00:56:25 +0300 Subject: IssueNotesRefactor: Create signed out widget. --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index ab0534f1fb0..de92e55a5bc 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -3,7 +3,7 @@ = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' -%section{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), notes_path: notes_url, last_fetched_at: Time.now.to_i } } +%section.js-notes-wrapper{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), notes_path: notes_url, last_fetched_at: Time.now.to_i } } #js-notes - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' -- cgit v1.2.1 From 3d4d9c5ab9464954d80a7bad3cff70d49af9b74f Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Sun, 9 Jul 2017 16:44:01 +0300 Subject: IssueNotesRefactor: Fix adding main note awards. --- app/views/projects/issues/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 8509e97fbc6..f4e4b6cb8fa 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -72,7 +72,7 @@ .content-block.emoji-block .row - .col-sm-8 + .col-sm-8.js-issue-note-awards = render 'award_emoji/awards_block', awardable: @issue, inline: true .col-sm-4.new-branch-col = render 'new_branch' unless @issue.confidential? -- cgit v1.2.1 From 717c30221cbaa348ce0f448e57bd3e2620c9cbcf Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Tue, 11 Jul 2017 00:53:52 +0300 Subject: IssueNotesRefactor: Implement up arrow to edit last note. --- app/views/shared/issuable/_close_reopen_button.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/shared/issuable/_close_reopen_button.html.haml b/app/views/shared/issuable/_close_reopen_button.html.haml index 8a1268a1c6d..f16bc8dd430 100644 --- a/app/views/shared/issuable/_close_reopen_button.html.haml +++ b/app/views/shared/issuable/_close_reopen_button.html.haml @@ -4,9 +4,9 @@ - if can_update && is_current_user = link_to "Close #{display_issuable_type}", close_issuable_url(issuable), method: button_method, - class: "hidden-xs hidden-sm btn btn-grouped btn-close #{issuable_button_visibility(issuable, true)}", title: "Close #{display_issuable_type}" + class: "hidden-xs hidden-sm btn btn-grouped btn-close js-btn-issue-action #{issuable_button_visibility(issuable, true)}", title: "Close #{display_issuable_type}" = link_to "Reopen #{display_issuable_type}", reopen_issuable_url(issuable), method: button_method, - class: "hidden-xs hidden-sm btn btn-grouped btn-reopen #{issuable_button_visibility(issuable, false)}", title: "Reopen #{display_issuable_type}" + class: "hidden-xs hidden-sm btn btn-grouped btn-reopen js-btn-issue-action #{issuable_button_visibility(issuable, false)}", title: "Reopen #{display_issuable_type}" - elsif can_update && !is_current_user = render 'shared/issuable/close_reopen_report_toggle', issuable: issuable - else -- cgit v1.2.1 From ddb193d09d280495ba60dab2ee0c097a57ce4752 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Tue, 11 Jul 2017 18:35:28 +0300 Subject: IssueNotesRefactor: Add GfmAutoComplete references to page. --- app/views/projects/issues/_discussion.html.haml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index de92e55a5bc..90b97d36d2c 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -13,6 +13,8 @@ / #notes{style: "margin-top: 150px"} / = render 'shared/notes/notes_with_form', :autocomplete => true += render "layouts/init_auto_complete" + :javascript window.gl.issueData = #{serialize_issuable(@issue)}; window.gl.currentUserData = #{UserSerializer.new.represent(current_user).to_json}; -- cgit v1.2.1 From 3c2d98f4c2bad4cccc981ff2e4bc2b5212eba9d6 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Fri, 14 Jul 2017 20:16:56 +0300 Subject: IssueNotesRefactor: Address MR comments. --- app/views/projects/issues/show.html.haml | 2 +- app/views/projects/merge_requests/_mr_title.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index f4e4b6cb8fa..043f862f552 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -22,7 +22,7 @@ = confidential_icon(@issue) = issuable_meta(@issue, @project, "Issue") - .issuable-actions + .issuable-actions.js-issuable-actions .clearfix.issue-btn-group.dropdown %button.btn.btn-default.pull-left.hidden-md.hidden-lg{ type: "button", data: { toggle: "dropdown" } } Options diff --git a/app/views/projects/merge_requests/_mr_title.html.haml b/app/views/projects/merge_requests/_mr_title.html.haml index a2e819fb3a7..f3c44c94a5c 100644 --- a/app/views/projects/merge_requests/_mr_title.html.haml +++ b/app/views/projects/merge_requests/_mr_title.html.haml @@ -17,7 +17,7 @@ .issuable-meta = issuable_meta(@merge_request, @project, "Merge request") - .issuable-actions + .issuable-actions.js-issuable-actions .clearfix.issue-btn-group.dropdown %button.btn.btn-default.pull-left.hidden-md.hidden-lg{ type: "button", data: { toggle: "dropdown" } } Options -- cgit v1.2.1 From 3c946b932b60ffa58245a091b58108396e5b6546 Mon Sep 17 00:00:00 2001 From: Fatih Acet Date: Mon, 17 Jul 2017 20:12:55 +0300 Subject: IssueNotesRefactor: Fix Rspec tests. --- app/views/shared/issuable/_close_reopen_report_toggle.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml index 6756a7f17fd..a38cd319e3c 100644 --- a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml +++ b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml @@ -2,7 +2,7 @@ - button_action = issuable.closed? ? 'reopen' : 'close' - display_button_action = button_action.capitalize - button_responsive_class = 'hidden-xs hidden-sm' -- button_class = "#{button_responsive_class} btn btn-grouped js-issuable-close-button issuable-close-button" +- button_class = "#{button_responsive_class} btn btn-grouped js-issuable-close-button js-btn-issue-action issuable-close-button" - toggle_class = "#{button_responsive_class} btn btn-nr dropdown-toggle js-issuable-close-toggle" - button_method = issuable_close_reopen_button_method(issuable) -- cgit v1.2.1 From d34c620fae23597e0130474fe20883f0718ded58 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Thu, 27 Jul 2017 21:24:05 +0100 Subject: [ci skip] Add issue data and notes data provided through haml to the store to stop querying the DOM everywhere --- app/views/projects/issues/_discussion.html.haml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 90b97d36d2c..2b4fb6be327 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -3,16 +3,16 @@ = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' -%section.js-notes-wrapper{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), notes_path: notes_url, last_fetched_at: Time.now.to_i } } - #js-notes +%section + #js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), + new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), + notes_path: '#{notes_url}?full_data=1', last_fetched_at: Time.now.to_i, + issue_data: serialize_issuable(@issue), + current_user_data: UserSerializer.new.represent(current_user).to_json }} - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' - -/ #notes{style: "margin-top: 150px"} -/ = render 'shared/notes/notes_with_form', :autocomplete => true - = render "layouts/init_auto_complete" :javascript -- cgit v1.2.1 From 3343bf30f737b25fe5337c1e6c21180649f8dc3d Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 28 Jul 2017 10:46:46 +0100 Subject: [ci skip] Remove DOM querying for paths, save them in the store --- app/views/projects/issues/_discussion.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 2b4fb6be327..76150264e31 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -5,8 +5,10 @@ %section #js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), + register_path: "#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane", new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), - notes_path: '#{notes_url}?full_data=1', last_fetched_at: Time.now.to_i, + notes_path: '#{notes_url}?full_data=1', + last_fetched_at: Time.now.to_i, issue_data: serialize_issuable(@issue), current_user_data: UserSerializer.new.represent(current_user).to_json }} - content_for :page_specific_javascripts do -- cgit v1.2.1 From 7a251207e1b6f2b4c709d319d870694ace620e0c Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 28 Jul 2017 12:53:51 +0100 Subject: [ci skip] Emit events up to prevent accessing refs of refs --- app/views/projects/issues/_discussion.html.haml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 76150264e31..987cde6c38b 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -7,6 +7,8 @@ #js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), register_path: "#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane", new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), + markdown_docs: help_page_path('user/markdown'), + quick_actions_docs: help_page_path('user/project/quick_actions'), notes_path: '#{notes_url}?full_data=1', last_fetched_at: Time.now.to_i, issue_data: serialize_issuable(@issue), -- cgit v1.2.1 From f5a21c596b79c5f86c6b8034e1d0bf1d7078c593 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 28 Jul 2017 19:59:31 +0100 Subject: [ci skip] Fix shortcuts for preview --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 987cde6c38b..d31ec19b97d 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -9,7 +9,7 @@ new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), markdown_docs: help_page_path('user/markdown'), quick_actions_docs: help_page_path('user/project/quick_actions'), - notes_path: '#{notes_url}?full_data=1', + notes_path: "#{notes_url}?full_data=1", last_fetched_at: Time.now.to_i, issue_data: serialize_issuable(@issue), current_user_data: UserSerializer.new.represent(current_user).to_json }} -- cgit v1.2.1 From 7a98970bd84b8f42bc117040cc284a73cbf03a8a Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 1 Aug 2017 18:23:42 +0100 Subject: [ci skip] Removes Vue from awards handler code --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index d31ec19b97d..12ac93addd7 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -3,7 +3,7 @@ = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' -%section +%section.js-vue-notes-event #js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), register_path: "#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane", new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), -- cgit v1.2.1 From b55ad844e8d9b92961c712fa0e1d93d1eecabeae Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Wed, 2 Aug 2017 17:37:22 +0100 Subject: [ci skip] Remove all global data --- app/views/projects/issues/_discussion.html.haml | 4 ---- 1 file changed, 4 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 12ac93addd7..8e17895c1c7 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -18,7 +18,3 @@ = webpack_bundle_tag 'notes' = render "layouts/init_auto_complete" - -:javascript - window.gl.issueData = #{serialize_issuable(@issue)}; - window.gl.currentUserData = #{UserSerializer.new.represent(current_user).to_json}; -- cgit v1.2.1 From 6f5f7e404997c1b82d30cd3e551245756c21a73f Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Mon, 7 Aug 2017 12:59:34 +0100 Subject: Convert ?full_data=1 -> ?view=full_data --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 8e17895c1c7..538bb50d3c9 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -9,7 +9,7 @@ new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), markdown_docs: help_page_path('user/markdown'), quick_actions_docs: help_page_path('user/project/quick_actions'), - notes_path: "#{notes_url}?full_data=1", + notes_path: notes_url(view: 'full_data'), last_fetched_at: Time.now.to_i, issue_data: serialize_issuable(@issue), current_user_data: UserSerializer.new.represent(current_user).to_json }} -- cgit v1.2.1 From b219dcd028ceea5345c17160b6849d540fd77924 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 11 Aug 2017 11:45:05 +0100 Subject: Adds confidential issue information --- app/views/projects/_md_preview.html.haml | 7 ------- app/views/projects/issues/_discussion.html.haml | 2 -- 2 files changed, 9 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/_md_preview.html.haml b/app/views/projects/_md_preview.html.haml index 6e13bf47ff6..71424593f2e 100644 --- a/app/views/projects/_md_preview.html.haml +++ b/app/views/projects/_md_preview.html.haml @@ -1,12 +1,5 @@ - referenced_users = local_assigns.fetch(:referenced_users, nil) -- if defined?(@issue) && @issue.confidential? - %li.confidential-issue-warning - = confidential_icon(@issue) - %span This is a confidential issue. Your comment will not be visible to the public. -- else - %li.confidential-issue-warning.not-confidential - .md-area .md-header %ul.nav-links.clearfix diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 538bb50d3c9..683efef22ea 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -16,5 +16,3 @@ - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' - -= render "layouts/init_auto_complete" -- cgit v1.2.1 From b38e690344a3d37e3be0305c88ea96adbc82aca6 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 11 Aug 2017 12:51:41 +0100 Subject: Fix open discussions --- app/views/projects/issues/_discussion.html.haml | 2 ++ app/views/shared/notes/_notes_with_form.html.haml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 683efef22ea..8f4da97850f 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -16,3 +16,5 @@ - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' + += render "layouts/init_auto_complete" \ No newline at end of file diff --git a/app/views/shared/notes/_notes_with_form.html.haml b/app/views/shared/notes/_notes_with_form.html.haml index 04866064905..1264f07eac9 100644 --- a/app/views/shared/notes/_notes_with_form.html.haml +++ b/app/views/shared/notes/_notes_with_form.html.haml @@ -15,7 +15,7 @@ .timeline-content.timeline-content-form = render "shared/notes/form", view: diff_view, supports_autocomplete: autocomplete - elsif !current_user - .disabled-comment.text-center.prepend-top-default.js-disabled-comment + .disabled-comment.text-center.prepend-top-default Please = link_to "register", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-register-link' or -- cgit v1.2.1 From b96a3d4d60747102bc437c99b4d040c5c0329689 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Fri, 11 Aug 2017 15:28:46 +0100 Subject: Fix open discussions Put back deleted tests --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 8f4da97850f..538bb50d3c9 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -17,4 +17,4 @@ = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' -= render "layouts/init_auto_complete" \ No newline at end of file += render "layouts/init_auto_complete" -- cgit v1.2.1 From 1e41440b0beb5803dd0e2bc901922ea362092119 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Sat, 12 Aug 2017 00:35:44 +0100 Subject: Fix broken tests --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 538bb50d3c9..57391c3f148 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -12,7 +12,7 @@ notes_path: notes_url(view: 'full_data'), last_fetched_at: Time.now.to_i, issue_data: serialize_issuable(@issue), - current_user_data: UserSerializer.new.represent(current_user).to_json }} + current_user_data: UserSerializer.new.represent(current_user).to_json } } - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' -- cgit v1.2.1 From 6bf781e486fd9e86c37b365b0ea210a32b26ed4a Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 14 Aug 2017 11:35:58 +0100 Subject: Fix autocomplete broken tests --- app/views/projects/issues/_discussion.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 57391c3f148..f2992a7c687 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -1,3 +1,4 @@ +- @gfm_form = true - content_for :note_actions do - if can?(current_user, :update_issue, @issue) = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' @@ -16,5 +17,3 @@ - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'notes' - -= render "layouts/init_auto_complete" -- cgit v1.2.1 From 99ba5d0d5097e3170747d17261bb3b9f60aa49fb Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 17 Aug 2017 18:55:04 +0200 Subject: Remove view=full_data from NotesController --- app/views/projects/issues/_discussion.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index f2992a7c687..50aae5388e9 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -10,7 +10,7 @@ new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), markdown_docs: help_page_path('user/markdown'), quick_actions_docs: help_page_path('user/project/quick_actions'), - notes_path: notes_url(view: 'full_data'), + notes_path: notes_url, last_fetched_at: Time.now.to_i, issue_data: serialize_issuable(@issue), current_user_data: UserSerializer.new.represent(current_user).to_json } } -- cgit v1.2.1 From 9c22974cd14f41ed156ced0a6742dbae7412b0db Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 17 Aug 2017 19:25:56 +0200 Subject: Rename a few attribute suffixes from `_url` to `_path` --- app/views/projects/issues/_discussion.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 50aae5388e9..3e63758a5e5 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -8,8 +8,8 @@ #js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), register_path: "#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane", new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), - markdown_docs: help_page_path('user/markdown'), - quick_actions_docs: help_page_path('user/project/quick_actions'), + markdown_docs_path: help_page_path('user/markdown'), + quick_actions_docs_path: help_page_path('user/project/quick_actions'), notes_path: notes_url, last_fetched_at: Time.now.to_i, issue_data: serialize_issuable(@issue), -- cgit v1.2.1 From 7c491d4fefbd0a079a497e5cae07056bfe467622 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Thu, 17 Aug 2017 19:27:11 +0200 Subject: Misc tweaks --- app/views/projects/issues/_discussion.html.haml | 8 +++----- app/views/projects/issues/show.html.haml | 5 +++++ app/views/shared/notes/_notes_with_form.html.haml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index 3e63758a5e5..483f28c74f2 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -1,12 +1,13 @@ - @gfm_form = true + - content_for :note_actions do - if can?(current_user, :update_issue, @issue) = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' %section.js-vue-notes-event - #js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), - register_path: "#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane", + #js-vue-notes{ data: { discussions_path: discussions_project_issue_path(@project, @issue, format: :json), + register_path: new_session_path(:user, redirect_to_referer: 'yes', anchor: 'register-pane'), new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), markdown_docs_path: help_page_path('user/markdown'), quick_actions_docs_path: help_page_path('user/project/quick_actions'), @@ -14,6 +15,3 @@ last_fetched_at: Time.now.to_i, issue_data: serialize_issuable(@issue), current_user_data: UserSerializer.new.represent(current_user).to_json } } - - content_for :page_specific_javascripts do - = webpack_bundle_tag 'common_vue' - = webpack_bundle_tag 'notes' diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index f2141b84e6d..04b4ed95a2d 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -2,6 +2,11 @@ - page_title "#{@issue.title} (#{@issue.to_reference})", "Issues" - page_description @issue.description - page_card_attributes @issue.card_attributes + +- content_for :page_specific_javascripts do + = webpack_bundle_tag 'common_vue' + = webpack_bundle_tag 'notes' + - can_update_issue = can?(current_user, :update_issue, @issue) - can_report_spam = @issue.submittable_as_spam_by?(current_user) diff --git a/app/views/shared/notes/_notes_with_form.html.haml b/app/views/shared/notes/_notes_with_form.html.haml index 1264f07eac9..e3e86709b8f 100644 --- a/app/views/shared/notes/_notes_with_form.html.haml +++ b/app/views/shared/notes/_notes_with_form.html.haml @@ -17,7 +17,7 @@ - elsif !current_user .disabled-comment.text-center.prepend-top-default Please - = link_to "register", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-register-link' + = link_to "register", new_session_path(:user, redirect_to_referer: 'yes', anchor: 'register-pane'), class: 'js-register-link' or = link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-sign-in-link' to comment -- cgit v1.2.1 From 852f50977111fc11511682217e81cdce908c318f Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Thu, 24 Aug 2017 17:24:29 -0500 Subject: rename skip_level? to disallowed_visibitility_level? --- app/views/shared/_visibility_radios.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/shared/_visibility_radios.html.haml b/app/views/shared/_visibility_radios.html.haml index 182c4eebd50..7b9453943d1 100644 --- a/app/views/shared/_visibility_radios.html.haml +++ b/app/views/shared/_visibility_radios.html.haml @@ -1,5 +1,5 @@ - Gitlab::VisibilityLevel.values.each do |level| - - next if skip_level?(form_model, level) + - next if disallowed_visibility_level?(form_model, level) .radio - restricted = restricted_visibility_levels.include?(level) = form.label "#{model_method}_#{level}" do -- cgit v1.2.1 From 69f679ed3476a887e67a591114c50ebcd1efa1a6 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 25 Aug 2017 13:00:01 -0500 Subject: rename .project-visibility-level-holder to .visibility-level-setting and move from projects.scss to settings.scss --- app/views/admin/application_settings/_form.html.haml | 6 +++--- app/views/projects/new.html.haml | 2 +- app/views/shared/_visibility_level.html.haml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app/views') diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 959af5c0d13..734a08c61fa 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -7,15 +7,15 @@ = f.label :default_branch_protection, class: 'control-label col-sm-2' .col-sm-10 = f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control' - .form-group.project-visibility-level-holder + .form-group.visibility-level-setting = f.label :default_project_visibility, class: 'control-label col-sm-2' .col-sm-10 = render('shared/visibility_radios', model_method: :default_project_visibility, form: f, selected_level: @application_setting.default_project_visibility, form_model: Project.new) - .form-group.project-visibility-level-holder + .form-group.visibility-level-setting = f.label :default_snippet_visibility, class: 'control-label col-sm-2' .col-sm-10 = render('shared/visibility_radios', model_method: :default_snippet_visibility, form: f, selected_level: @application_setting.default_snippet_visibility, form_model: ProjectSnippet.new) - .form-group.project-visibility-level-holder + .form-group.visibility-level-setting = f.label :default_group_visibility, class: 'control-label col-sm-2' .col-sm-10 = render('shared/visibility_radios', model_method: :default_group_visibility, form: f, selected_level: @application_setting.default_group_visibility, form_model: Group.new) diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 647e0a772b1..e2ea96b855d 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -111,7 +111,7 @@ %span.light (optional) = f.text_area :description, placeholder: 'Description format', class: "form-control", rows: 3, maxlength: 250 - .form-group.project-visibility-level-holder + .form-group.visibility-level-setting = f.label :visibility_level, class: 'label-light' do Visibility Level = link_to icon('question-circle'), help_page_path("public_access/public_access"), aria: { label: 'Documentation for Visibility Level' } diff --git a/app/views/shared/_visibility_level.html.haml b/app/views/shared/_visibility_level.html.haml index 73efec88bb1..192d2502aaf 100644 --- a/app/views/shared/_visibility_level.html.haml +++ b/app/views/shared/_visibility_level.html.haml @@ -1,6 +1,6 @@ - with_label = local_assigns.fetch(:with_label, true) -.form-group.project-visibility-level-holder +.form-group.visibility-level-setting - if with_label = f.label :visibility_level, class: 'control-label' do Visibility Level -- cgit v1.2.1 From 10a7478ed0b9cbc4b3d4a316f4e124796dbac495 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 25 Aug 2017 13:46:49 -0500 Subject: fix disabled state style for visibility level options --- app/views/shared/_visibility_radios.html.haml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/shared/_visibility_radios.html.haml b/app/views/shared/_visibility_radios.html.haml index 7b9453943d1..d8d1093d4e3 100644 --- a/app/views/shared/_visibility_radios.html.haml +++ b/app/views/shared/_visibility_radios.html.haml @@ -1,9 +1,10 @@ - Gitlab::VisibilityLevel.values.each do |level| - - next if disallowed_visibility_level?(form_model, level) - .radio - - restricted = restricted_visibility_levels.include?(level) + - disallowed = disallowed_visibility_level?(form_model, level) + - restricted = restricted_visibility_levels.include?(level) + - disabled = disallowed || restricted + .radio{ class: [('disabled' if disabled), ('restricted' if restricted)] } = form.label "#{model_method}_#{level}" do - = form.radio_button model_method, level, checked: (selected_level == level), disabled: restricted + = form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled = visibility_level_icon(level) .option-title = visibility_level_label(level) -- cgit v1.2.1 From 04e3e609daa54a62b0caf5a5ed5ade1cdb8c5eae Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 25 Aug 2017 13:48:15 -0500 Subject: show alternate description text for disabled visibility settings --- app/views/shared/_visibility_radios.html.haml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'app/views') diff --git a/app/views/shared/_visibility_radios.html.haml b/app/views/shared/_visibility_radios.html.haml index d8d1093d4e3..8a80ccd4030 100644 --- a/app/views/shared/_visibility_radios.html.haml +++ b/app/views/shared/_visibility_radios.html.haml @@ -8,9 +8,10 @@ = visibility_level_icon(level) .option-title = visibility_level_label(level) - .option-descr + .option-description = visibility_level_description(level, form_model) -- unless restricted_visibility_levels.empty? - %div - %span.info - Some visibility level settings have been restricted by the administrator. + .option-disabled-reason + - if restricted + This visibility level has been restricted by the administrator. + - elsif disallowed + This option is not available the visibility of parent or child items prevents it. -- cgit v1.2.1 From 8cf504a71c326033a5a0885fa950a7d2c37ca93c Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 25 Aug 2017 14:07:44 -0500 Subject: don't check disabled radio inputs --- app/views/shared/_visibility_radios.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/shared/_visibility_radios.html.haml b/app/views/shared/_visibility_radios.html.haml index 8a80ccd4030..13eeaeefa9f 100644 --- a/app/views/shared/_visibility_radios.html.haml +++ b/app/views/shared/_visibility_radios.html.haml @@ -4,7 +4,7 @@ - disabled = disallowed || restricted .radio{ class: [('disabled' if disabled), ('restricted' if restricted)] } = form.label "#{model_method}_#{level}" do - = form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled + = form.radio_button model_method, level, checked: (selected_level == level && !disabled), disabled: disabled = visibility_level_icon(level) .option-title = visibility_level_label(level) -- cgit v1.2.1 From fc95395c5dc8b297e831a51bcec04c0644eb06d2 Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Fri, 25 Aug 2017 15:01:56 -0500 Subject: display specific reasons when visibility options are disabled --- app/views/shared/_visibility_radios.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/shared/_visibility_radios.html.haml b/app/views/shared/_visibility_radios.html.haml index 13eeaeefa9f..4a656ccfeac 100644 --- a/app/views/shared/_visibility_radios.html.haml +++ b/app/views/shared/_visibility_radios.html.haml @@ -12,6 +12,6 @@ = visibility_level_description(level, form_model) .option-disabled-reason - if restricted - This visibility level has been restricted by the administrator. + = restricted_visibility_level_description(level) - elsif disallowed - This option is not available the visibility of parent or child items prevents it. + = disallowed_visibility_level_description(level, form_model) -- cgit v1.2.1 From 0c8736a8a741770672fbb91fab9203d323781b86 Mon Sep 17 00:00:00 2001 From: winh Date: Fri, 11 Aug 2017 18:42:35 +0200 Subject: Change pipeline dropdowns to new style --- app/views/ci/status/_dropdown_graph_badge.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/ci/status/_dropdown_graph_badge.html.haml b/app/views/ci/status/_dropdown_graph_badge.html.haml index 8ed23ac4919..dcfb7f0c32d 100644 --- a/app/views/ci/status/_dropdown_graph_badge.html.haml +++ b/app/views/ci/status/_dropdown_graph_badge.html.haml @@ -6,14 +6,14 @@ - tooltip = "#{subject.name} - #{status.label}" - if status.has_details? - = link_to status.details_path, class: 'mini-pipeline-graph-dropdown-item', data: { toggle: 'tooltip', title: tooltip } do + = link_to status.details_path, class: 'mini-pipeline-graph-dropdown-item', data: { toggle: 'tooltip', title: tooltip, container: 'body' } do %span{ class: klass }= custom_icon(status.icon) %span.ci-build-text= subject.name - else - .mini-pipeline-graph-dropdown-item{ data: { toggle: 'tooltip', title: tooltip } } + .menu-item.mini-pipeline-graph-dropdown-item{ data: { toggle: 'tooltip', title: tooltip, container: 'body' } } %span{ class: klass }= custom_icon(status.icon) %span.ci-build-text= subject.name - if status.has_action? - = link_to status.action_path, class: 'ci-action-icon-wrapper js-ci-action-icon', method: status.action_method, data: { toggle: 'tooltip', title: status.action_title } do + = link_to status.action_path, class: 'ci-action-icon-wrapper js-ci-action-icon', method: status.action_method, data: { toggle: 'tooltip', title: status.action_title, container: 'body' } do = custom_icon(status.action_icon) -- cgit v1.2.1 From fde951b8dcb61625df5fc0d3144154fd93d3ea76 Mon Sep 17 00:00:00 2001 From: winh Date: Thu, 10 Aug 2017 21:59:26 +0200 Subject: Make label actions dropdown style consistent --- app/views/shared/_label.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index 8ded7440de3..23a418ad640 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -14,10 +14,10 @@ %ul %li = link_to_label(label, subject: subject, type: :merge_request) do - view merge requests + View merge requests %li = link_to_label(label, subject: subject) do - view open issues + View open issues - if current_user %li.label-subscription - if can_subscribe_to_label_in_different_levels?(label) -- cgit v1.2.1 From 757c622c8005e52162e808faf9e066ce5399e59b Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Tue, 8 Aug 2017 17:24:49 +0100 Subject: Enable the new navigation by default --- app/views/layouts/header/_default.html.haml | 2 -- app/views/layouts/header/_new.html.haml | 2 -- app/views/profiles/preferences/show.html.haml | 20 -------------------- 3 files changed, 24 deletions(-) (limited to 'app/views') diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index b32cfe158bb..1d875f81041 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -74,8 +74,6 @@ = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li = link_to "Settings", profile_path - %li - = link_to "Turn on new navigation", profile_preferences_path(anchor: "new-navigation") %li.divider %li = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" diff --git a/app/views/layouts/header/_new.html.haml b/app/views/layouts/header/_new.html.haml index 2c1c23d6ea9..c6779d2de31 100644 --- a/app/views/layouts/header/_new.html.haml +++ b/app/views/layouts/header/_new.html.haml @@ -68,8 +68,6 @@ = link_to "Profile", current_user, class: 'profile-link', data: { user: current_user.username } %li = link_to "Settings", profile_path - %li - = link_to "Turn off new navigation", profile_preferences_path(anchor: "new-navigation") %li.divider %li = link_to "Sign out", destroy_user_session_path, method: :delete, class: "sign-out-link" diff --git a/app/views/profiles/preferences/show.html.haml b/app/views/profiles/preferences/show.html.haml index f08dcc0c242..9e7fe556d88 100644 --- a/app/views/profiles/preferences/show.html.haml +++ b/app/views/profiles/preferences/show.html.haml @@ -18,26 +18,6 @@ = scheme.name .col-sm-12 %hr - .col-lg-4.profile-settings-sidebar#new-navigation - %h4.prepend-top-0 - New Navigation - %p - This setting allows you to turn on or off the new upcoming navigation concept. - .col-lg-8.syntax-theme - .nav-wip - %p - The new navigation is currently a work-in-progress concept and is currently only usable on wide-screens. There are a number of improvements that we are working on in order to further refine our navigation. - %p - %a{ href: 'https://gitlab.com/gitlab-org/gitlab-ce/issues/32794', target: 'blank' } Learn more - about the improvements that are coming soon! - = label_tag do - .preview= image_tag "old_nav.png" - %input.js-experiment-feature-toggle{ type: "radio", value: "false", name: "new_nav", checked: !show_new_nav? } - Old - = label_tag do - .preview= image_tag "new_nav.png" - %input.js-experiment-feature-toggle{ type: "radio", value: "true", name: "new_nav", checked: show_new_nav? } - New .col-sm-12 %hr .col-lg-4.profile-settings-sidebar -- cgit v1.2.1 From 331722c03c8cf38b37e3b0df143c13e1d40d030c Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 11 Aug 2017 16:50:25 +0100 Subject: added logo ID to top bar fixed flexbox not working in phantomjs --- app/views/layouts/header/_new.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/layouts/header/_new.html.haml b/app/views/layouts/header/_new.html.haml index c6779d2de31..4538920ef3d 100644 --- a/app/views/layouts/header/_new.html.haml +++ b/app/views/layouts/header/_new.html.haml @@ -4,7 +4,7 @@ .header-content .title-container %h1.title - = link_to root_path, title: 'Dashboard' do + = link_to root_path, title: 'Dashboard', id: 'logo' do = brand_header_logo %span.logo-text.hidden-xs = render 'shared/logo_type.svg' -- cgit v1.2.1 From 669fb299c71806fc8bee8b13a4600982e3fff623 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 14 Aug 2017 15:11:31 +0100 Subject: fixed up a bunch of specs some caused by webkit prefixes --- app/views/layouts/header/_new.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/layouts/header/_new.html.haml b/app/views/layouts/header/_new.html.haml index 4538920ef3d..c84d7053cd6 100644 --- a/app/views/layouts/header/_new.html.haml +++ b/app/views/layouts/header/_new.html.haml @@ -37,13 +37,13 @@ data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = icon('tachometer fw') %li - = link_to assigned_issues_dashboard_path, title: 'Issues', aria: { label: "Issues" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do + = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'dashboard-shortcuts-issues', aria: { label: "Issues" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = custom_icon('issues') - issues_count = assigned_issuables_count(:issues) %span.badge.issues-count{ class: ('hidden' if issues_count.zero?) } = number_with_delimiter(issues_count) %li - = link_to assigned_mrs_dashboard_path, title: 'Merge requests', aria: { label: "Merge requests" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do + = link_to assigned_mrs_dashboard_path, title: 'Merge requests', class: 'dashboard-shortcuts-merge_requests', aria: { label: "Merge requests" }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = custom_icon('mr_bold') - merge_requests_count = assigned_issuables_count(:merge_requests) %span.badge.merge-requests-count{ class: ('hidden' if merge_requests_count.zero?) } -- cgit v1.2.1 From d92bff4eaef9ef519ab34161426f1f9afb6fecb2 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Fri, 18 Aug 2017 12:07:10 +0100 Subject: more spec fixes --- app/views/groups/issues.html.haml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/views') diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 12bc092d216..837ef385dd5 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -12,6 +12,8 @@ - content_for :breadcrumbs_extra do = link_to params.merge(rss_url_options), class: 'btn btn-default append-right-10' do = icon('rss') + %span.icon-label + Subscribe = render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", type: :issues - if group_issues_exists -- cgit v1.2.1 From b0f982fbdf69c292ab4530c0aaaf1ab42f4e7a01 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 21 Aug 2017 11:30:03 +0100 Subject: Add settings for minimum key strength and allowed key type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an amalgamation of: * Cory Hinshaw: Initial implementation !5552 * Rémy Coutable: Updates !9350 * Nick Thomas: Resolve conflicts and add ED25519 support !13712 --- .../admin/application_settings/_form.html.haml | 49 +++++++++++++++++++--- 1 file changed, 44 insertions(+), 5 deletions(-) (limited to 'app/views') diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 959af5c0d13..1cda98ffea8 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -42,18 +42,57 @@ = link_to "(?)", help_page_path("integration/bitbucket") and GitLab.com = link_to "(?)", help_page_path("integration/gitlab") + + .form-group + .col-sm-offset-2.col-sm-10 + .checkbox + = f.label :project_export_enabled do + = f.check_box :project_export_enabled + Project export enabled + .form-group %label.control-label.col-sm-2 Enabled Git access protocols .col-sm-10 = select(:application_setting, :enabled_git_access_protocol, [['Both SSH and HTTP(S)', nil], ['Only SSH', 'ssh'], ['Only HTTP(S)', 'http']], {}, class: 'form-control') %span.help-block#clone-protocol-help Allow only the selected protocols to be used for Git access. + .form-group - .col-sm-offset-2.col-sm-10 - .checkbox - = f.label :project_export_enabled do - = f.check_box :project_export_enabled - Project export enabled + = f.label :allowed_key_types, 'Allowed SSH keys', class: 'control-label col-sm-2' + .col-sm-10 + = hidden_field_tag 'application_setting[allowed_key_types][]', nil, id: 'allowed_key_types-none' + - allowed_key_types_checkboxes('allowed-key-types-help').each do |key_type_checkbox| + .checkbox= key_type_checkbox + %span.help-block#allowed-key-types-help + Only SSH keys with allowed algorithms can be uploaded. + + .form-group + = f.label :minimum_rsa_bits, 'Minimum RSA key length', class: 'control-label col-sm-2' + .col-sm-10 + = f.select :minimum_rsa_bits, Gitlab::SSHPublicKey.allowed_sizes('rsa'), {}, class: 'form-control' + .help-block + The minimum length for user RSA SSH keys (in bits) + + .form-group + = f.label :minimum_dsa_bits, 'Minimum DSA key length', class: 'control-label col-sm-2' + .col-sm-10 + = f.select :minimum_dsa_bits, Gitlab::SSHPublicKey.allowed_sizes('dsa'), {}, class: 'form-control' + .help-block + The minimum length for user DSA SSH keys (in bits) + + .form-group + = f.label :minimum_ecdsa_bits, 'Minimum ECDSA key length', class: 'control-label col-sm-2' + .col-sm-10 + = f.select :minimum_ecdsa_bits, Gitlab::SSHPublicKey.allowed_sizes('ecdsa'), {}, class: 'form-control' + .help-block + The minimum elliptic curve size for user ECDSA SSH keys (in bits) + + .form-group + = f.label :minimum_ed25519_bits, 'Minimum ED25519 key length', class: 'control-label col-sm-2' + .col-sm-10 + = f.select :minimum_ed25519_bits, Gitlab::SSHPublicKey.allowed_sizes('ed25519'), {}, class: 'form-control' + .help-block + The minimum length for user ED25519 SSH keys (in bits) %fieldset %legend Account and Limit Settings -- cgit v1.2.1 From b49b7bc147955df6589b13942d0437a3b4518c7b Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 21 Aug 2017 15:01:05 +0100 Subject: Warn users when their keys are invalid --- app/views/profiles/keys/_key.html.haml | 8 +++++++- app/views/profiles/keys/_key_details.html.haml | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml index d2a60ac2867..99b9a05fff6 100644 --- a/app/views/profiles/keys/_key.html.haml +++ b/app/views/profiles/keys/_key.html.haml @@ -1,6 +1,12 @@ %li.key-list-item .pull-left.append-right-10 - = icon 'key', class: "settings-list-icon hidden-xs" + - if key.valid? + = icon 'key', class: 'settings-list-icon hidden-xs' + - else + = icon 'exclamation-triangle', class: 'settings-list-icon hidden-xs', + title: 'The key is disabled because it is invalid' + + .key-list-item-info = link_to path_to_key(key, is_admin), class: "title" do = key.title diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml index d44603c638c..cf70320e7a8 100644 --- a/app/views/profiles/keys/_key_details.html.haml +++ b/app/views/profiles/keys/_key_details.html.haml @@ -16,6 +16,7 @@ %strong= @key.last_used_at.try(:to_s, :medium) || 'N/A' .col-md-8 + = form_errors(@key, 'The key has the following') unless @key.valid? %p %span.light Fingerprint: %code.key-fingerprint= @key.fingerprint -- cgit v1.2.1 From 6847060266792471c9c14518a5106e0f622cd6c5 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Fri, 25 Aug 2017 14:08:48 +0100 Subject: Rework the permissions model for SSH key restrictions `allowed_key_types` is removed and the `minimum__bits` fields are renamed to `_key_restriction`. A special sentinel value (`-1`) signifies that the key type is disabled. This also feeds through to the UI - checkboxes per key type are out, inline selection of "forbidden" and "allowed" (i.e., no restrictions) are in. As with the previous model, unknown key types are disallowed, even if the underlying ssh daemon happens to support them. The defaults have also been changed from the lowest known bit size to "no restriction". So if someone does happen to have a 768-bit RSA key, it will continue to work on upgrade, at least until the administrator restricts them. --- .../admin/application_settings/_form.html.haml | 42 ++++------------------ 1 file changed, 6 insertions(+), 36 deletions(-) (limited to 'app/views') diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 1cda98ffea8..fd083c03633 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -57,42 +57,12 @@ %span.help-block#clone-protocol-help Allow only the selected protocols to be used for Git access. - .form-group - = f.label :allowed_key_types, 'Allowed SSH keys', class: 'control-label col-sm-2' - .col-sm-10 - = hidden_field_tag 'application_setting[allowed_key_types][]', nil, id: 'allowed_key_types-none' - - allowed_key_types_checkboxes('allowed-key-types-help').each do |key_type_checkbox| - .checkbox= key_type_checkbox - %span.help-block#allowed-key-types-help - Only SSH keys with allowed algorithms can be uploaded. - - .form-group - = f.label :minimum_rsa_bits, 'Minimum RSA key length', class: 'control-label col-sm-2' - .col-sm-10 - = f.select :minimum_rsa_bits, Gitlab::SSHPublicKey.allowed_sizes('rsa'), {}, class: 'form-control' - .help-block - The minimum length for user RSA SSH keys (in bits) - - .form-group - = f.label :minimum_dsa_bits, 'Minimum DSA key length', class: 'control-label col-sm-2' - .col-sm-10 - = f.select :minimum_dsa_bits, Gitlab::SSHPublicKey.allowed_sizes('dsa'), {}, class: 'form-control' - .help-block - The minimum length for user DSA SSH keys (in bits) - - .form-group - = f.label :minimum_ecdsa_bits, 'Minimum ECDSA key length', class: 'control-label col-sm-2' - .col-sm-10 - = f.select :minimum_ecdsa_bits, Gitlab::SSHPublicKey.allowed_sizes('ecdsa'), {}, class: 'form-control' - .help-block - The minimum elliptic curve size for user ECDSA SSH keys (in bits) - - .form-group - = f.label :minimum_ed25519_bits, 'Minimum ED25519 key length', class: 'control-label col-sm-2' - .col-sm-10 - = f.select :minimum_ed25519_bits, Gitlab::SSHPublicKey.allowed_sizes('ed25519'), {}, class: 'form-control' - .help-block - The minimum length for user ED25519 SSH keys (in bits) + - ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type| + - field_name = :"#{type}_key_restriction" + .form-group + = f.label field_name, "#{type.upcase} SSH keys", class: 'control-label col-sm-2' + .col-sm-10 + = f.select field_name, key_restriction_options_for_select(type), {}, class: 'form-control' %fieldset %legend Account and Limit Settings -- cgit v1.2.1 From b84ca08e351fc9238bef4e6b4bf74158d25d4f1d Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 28 Aug 2017 21:33:35 +0100 Subject: Address review comments --- app/views/profiles/keys/_key_details.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/profiles/keys/_key_details.html.haml b/app/views/profiles/keys/_key_details.html.haml index cf70320e7a8..77521417f47 100644 --- a/app/views/profiles/keys/_key_details.html.haml +++ b/app/views/profiles/keys/_key_details.html.haml @@ -16,7 +16,7 @@ %strong= @key.last_used_at.try(:to_s, :medium) || 'N/A' .col-md-8 - = form_errors(@key, 'The key has the following') unless @key.valid? + = form_errors(@key, type: 'key') unless @key.valid? %p %span.light Fingerprint: %code.key-fingerprint= @key.fingerprint -- cgit v1.2.1 From 29b40db58944a32db6cf1ae9906653a2e5f4be9d Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Wed, 30 Aug 2017 21:20:00 +0100 Subject: More review comments --- app/views/profiles/keys/_key.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/profiles/keys/_key.html.haml b/app/views/profiles/keys/_key.html.haml index 99b9a05fff6..103446243e5 100644 --- a/app/views/profiles/keys/_key.html.haml +++ b/app/views/profiles/keys/_key.html.haml @@ -3,8 +3,8 @@ - if key.valid? = icon 'key', class: 'settings-list-icon hidden-xs' - else - = icon 'exclamation-triangle', class: 'settings-list-icon hidden-xs', - title: 'The key is disabled because it is invalid' + = icon 'exclamation-triangle', class: 'settings-list-icon hidden-xs has-tooltip', + title: key.errors.full_messages.join(', ') .key-list-item-info -- cgit v1.2.1 From 8ffbab216b90c7743ee15a652bb72eaf460bc3ba Mon Sep 17 00:00:00 2001 From: Mike Greiling Date: Wed, 30 Aug 2017 16:27:20 -0500 Subject: ensure disabled radio options still show up as checked when necessary --- app/views/shared/_visibility_radios.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/shared/_visibility_radios.html.haml b/app/views/shared/_visibility_radios.html.haml index 4a656ccfeac..0ec7677a566 100644 --- a/app/views/shared/_visibility_radios.html.haml +++ b/app/views/shared/_visibility_radios.html.haml @@ -4,7 +4,7 @@ - disabled = disallowed || restricted .radio{ class: [('disabled' if disabled), ('restricted' if restricted)] } = form.label "#{model_method}_#{level}" do - = form.radio_button model_method, level, checked: (selected_level == level && !disabled), disabled: disabled + = form.radio_button model_method, level, checked: (selected_level == level), disabled: disabled = visibility_level_icon(level) .option-title = visibility_level_label(level) -- cgit v1.2.1 From 04cd47dd5a08ca5cc84c44346b2893111da9594c Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Tue, 29 Aug 2017 12:15:19 +0200 Subject: Don't show references to Pages when not available In this instance its subgroups, and given we can't deploy it, we shouldn't allow it to be shown. Fixes gitlab-org/gitlab-ce#34864 --- app/views/layouts/nav/_new_project_sidebar.html.haml | 2 +- app/views/projects/settings/_head.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/layouts/nav/_new_project_sidebar.html.haml b/app/views/layouts/nav/_new_project_sidebar.html.haml index 341943cf833..6ae816d0bbb 100644 --- a/app/views/layouts/nav/_new_project_sidebar.html.haml +++ b/app/views/layouts/nav/_new_project_sidebar.html.haml @@ -208,7 +208,7 @@ = link_to project_settings_ci_cd_path(@project), title: 'CI / CD' do %span CI / CD - - if Gitlab.config.pages.enabled + - if @project.pages_available? = nav_link(controller: :pages) do = link_to project_pages_path(@project), title: 'Pages' do %span diff --git a/app/views/projects/settings/_head.html.haml b/app/views/projects/settings/_head.html.haml index 15ba09b10ba..7d24c6a9122 100644 --- a/app/views/projects/settings/_head.html.haml +++ b/app/views/projects/settings/_head.html.haml @@ -23,7 +23,7 @@ = link_to project_settings_ci_cd_path(@project), title: 'Pipelines' do %span Pipelines - - if Gitlab.config.pages.enabled + - if @project.pages_available? = nav_link(controller: :pages) do = link_to project_pages_path(@project), title: 'Pages' do %span -- cgit v1.2.1 From 37383d9a9d9706008a7fa1d90079cb019681094b Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Thu, 31 Aug 2017 11:21:40 +0100 Subject: Rollsback changes made to signing_enabled. --- app/views/admin/application_settings/_form.html.haml | 2 +- app/views/layouts/nav/_profile.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 959af5c0d13..8c2a0975a49 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -153,7 +153,7 @@ .checkbox = f.label :password_authentication_enabled do = f.check_box :password_authentication_enabled - Password authentication enabled + Sign-in enabled - if omniauth_enabled? && button_based_providers.any? .form-group = f.label :enabled_oauth_sign_in_sources, 'Enabled OAuth sign-in sources', class: 'control-label col-sm-2' diff --git a/app/views/layouts/nav/_profile.html.haml b/app/views/layouts/nav/_profile.html.haml index 26d9640e98a..448f6abedf2 100644 --- a/app/views/layouts/nav/_profile.html.haml +++ b/app/views/layouts/nav/_profile.html.haml @@ -29,7 +29,7 @@ = link_to profile_emails_path, title: 'Emails' do %span Emails - - if current_user.allow_password_authentication? + - unless current_user.ldap_user? = nav_link(controller: :passwords) do = link_to edit_profile_password_path, title: 'Password' do %span -- cgit v1.2.1 From 9897bfd14a95d73bc1168d4ad37cb892926bd9b7 Mon Sep 17 00:00:00 2001 From: Mike Bartlett Date: Fri, 1 Sep 2017 15:25:15 +0200 Subject: Hide Koding setting in admin panel if not enabled --- .../admin/application_settings/_form.html.haml | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'app/views') diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index 734a08c61fa..02102508faf 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -530,24 +530,27 @@ .help-block If you got a lot of false alarms from repository checks you can choose to clear all repository check information from the database. - %fieldset - %legend Koding - .form-group - .col-sm-offset-2.col-sm-10 - .checkbox - = f.label :koding_enabled do - = f.check_box :koding_enabled - Enable Koding - .form-group - = f.label :koding_url, 'Koding URL', class: 'control-label col-sm-2' - .col-sm-10 - = f.text_field :koding_url, class: 'form-control', placeholder: 'http://gitlab.your-koding-instance.com:8090' - .help-block - Koding has integration enabled out of the box for the - %strong gitlab - team, and you need to provide that team's URL here. Learn more in the - = succeed "." do - = link_to "Koding administration documentation", help_page_path("administration/integration/koding") + - if koding_enabled? + %fieldset + %legend Koding + .form-group + .col-sm-offset-2.col-sm-10 + .checkbox + = f.label :koding_enabled do + = f.check_box :koding_enabled + Enable Koding + .help-block + Koding integration has been deprecated since GitLab 10.0. If you disable your Koding integration, you will not be able to enable it again. + .form-group + = f.label :koding_url, 'Koding URL', class: 'control-label col-sm-2' + .col-sm-10 + = f.text_field :koding_url, class: 'form-control', placeholder: 'http://gitlab.your-koding-instance.com:8090' + .help-block + Koding has integration enabled out of the box for the + %strong gitlab + team, and you need to provide that team's URL here. Learn more in the + = succeed "." do + = link_to "Koding administration documentation", help_page_path("administration/integration/koding") %fieldset %legend PlantUML -- cgit v1.2.1 From 641b552aa68fe9ad1c07d46b2407e2d020a9c69c Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Fri, 1 Sep 2017 14:17:52 -0500 Subject: Use new MR icon for milestone sidebar --- app/views/shared/milestones/_sidebar.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index 40379f48393..28cf17f6677 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -88,7 +88,7 @@ .block.merge-requests .sidebar-collapsed-icon %strong - = icon('exclamation', 'aria-hidden': 'true') + = custom_icon('mr_bold') %span= milestone.merge_requests.count .title.hide-collapsed Merge requests -- cgit v1.2.1 From e9924687147b1222fa2df3765a1e3c37662028a2 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Mon, 31 Jul 2017 21:59:04 +0900 Subject: ini --- app/views/projects/runners/_form.html.haml | 6 ++++++ app/views/projects/runners/show.html.haml | 3 +++ 2 files changed, 9 insertions(+) (limited to 'app/views') diff --git a/app/views/projects/runners/_form.html.haml b/app/views/projects/runners/_form.html.haml index 2ef1f98ba48..7dae8ecbb94 100644 --- a/app/views/projects/runners/_form.html.haml +++ b/app/views/projects/runners/_form.html.haml @@ -6,6 +6,12 @@ .checkbox = f.check_box :active %span.light Paused Runners don't accept new jobs + .form-group + = label :protected, "Protected", class: 'control-label' + .col-sm-10 + .checkbox + = f.check_box :protected + %span.light This runner will only run on pipelines trigged on protected branches .form-group = label :run_untagged, 'Run untagged jobs', class: 'control-label' .col-sm-10 diff --git a/app/views/projects/runners/show.html.haml b/app/views/projects/runners/show.html.haml index 49415ba557b..e51bb299938 100644 --- a/app/views/projects/runners/show.html.haml +++ b/app/views/projects/runners/show.html.haml @@ -19,6 +19,9 @@ %tr %td Active %td= @runner.active? ? 'Yes' : 'No' + %tr + %td Protected + %td= @runner.protected? ? 'Yes' : 'No' %tr %td Can run untagged jobs %td= @runner.run_untagged? ? 'Yes' : 'No' -- cgit v1.2.1 From e1ef436d1fd6419ce8a08c4ac33bf664786c80b0 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Thu, 17 Aug 2017 01:54:05 +0900 Subject: Update application code by the db schema change --- app/views/projects/runners/_form.html.haml | 2 +- app/views/projects/runners/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/runners/_form.html.haml b/app/views/projects/runners/_form.html.haml index 7dae8ecbb94..2942ce541ed 100644 --- a/app/views/projects/runners/_form.html.haml +++ b/app/views/projects/runners/_form.html.haml @@ -10,7 +10,7 @@ = label :protected, "Protected", class: 'control-label' .col-sm-10 .checkbox - = f.check_box :protected + = f.check_box :access_level, 1, 0 %span.light This runner will only run on pipelines trigged on protected branches .form-group = label :run_untagged, 'Run untagged jobs', class: 'control-label' diff --git a/app/views/projects/runners/show.html.haml b/app/views/projects/runners/show.html.haml index e51bb299938..9d427d18272 100644 --- a/app/views/projects/runners/show.html.haml +++ b/app/views/projects/runners/show.html.haml @@ -21,7 +21,7 @@ %td= @runner.active? ? 'Yes' : 'No' %tr %td Protected - %td= @runner.protected? ? 'Yes' : 'No' + %td= @runner.protected_? ? 'Yes' : 'No' %tr %td Can run untagged jobs %td= @runner.run_untagged? ? 'Yes' : 'No' -- cgit v1.2.1 From eda34b1a1846a5d5b55cc127a32b0c7628580f25 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Mon, 21 Aug 2017 17:24:44 +0900 Subject: Add spec. Fix runner setting page. It worked. --- app/views/projects/runners/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/runners/_form.html.haml b/app/views/projects/runners/_form.html.haml index 2942ce541ed..d66383bd8f1 100644 --- a/app/views/projects/runners/_form.html.haml +++ b/app/views/projects/runners/_form.html.haml @@ -10,7 +10,7 @@ = label :protected, "Protected", class: 'control-label' .col-sm-10 .checkbox - = f.check_box :access_level, 1, 0 + = f.check_box :access_level, {}, Ci::Runner.access_levels['protected_'], Ci::Runner.access_levels['unprotected'] %span.light This runner will only run on pipelines trigged on protected branches .form-group = label :run_untagged, 'Run untagged jobs', class: 'control-label' -- cgit v1.2.1 From 641491777032482632e63e0d968a0bad32856794 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Thu, 24 Aug 2017 01:59:01 +0900 Subject: Remove conversion string to interger for access_level --- app/views/projects/runners/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/projects/runners/_form.html.haml b/app/views/projects/runners/_form.html.haml index d66383bd8f1..8c98075eeb5 100644 --- a/app/views/projects/runners/_form.html.haml +++ b/app/views/projects/runners/_form.html.haml @@ -10,7 +10,7 @@ = label :protected, "Protected", class: 'control-label' .col-sm-10 .checkbox - = f.check_box :access_level, {}, Ci::Runner.access_levels['protected_'], Ci::Runner.access_levels['unprotected'] + = f.check_box :access_level, {}, 'protected_', 'unprotected' %span.light This runner will only run on pipelines trigged on protected branches .form-group = label :run_untagged, 'Run untagged jobs', class: 'control-label' -- cgit v1.2.1 From 1024718e9fddbb0d61d3f64f44303964641fcdd8 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Tue, 29 Aug 2017 15:56:03 +0900 Subject: Refactor access_level to not_protected and ref_protected --- app/views/projects/runners/_form.html.haml | 2 +- app/views/projects/runners/show.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/projects/runners/_form.html.haml b/app/views/projects/runners/_form.html.haml index 8c98075eeb5..ac8e15a48b2 100644 --- a/app/views/projects/runners/_form.html.haml +++ b/app/views/projects/runners/_form.html.haml @@ -10,7 +10,7 @@ = label :protected, "Protected", class: 'control-label' .col-sm-10 .checkbox - = f.check_box :access_level, {}, 'protected_', 'unprotected' + = f.check_box :access_level, {}, 'ref_protected', 'not_protected' %span.light This runner will only run on pipelines trigged on protected branches .form-group = label :run_untagged, 'Run untagged jobs', class: 'control-label' diff --git a/app/views/projects/runners/show.html.haml b/app/views/projects/runners/show.html.haml index 9d427d18272..dfab04aa1fb 100644 --- a/app/views/projects/runners/show.html.haml +++ b/app/views/projects/runners/show.html.haml @@ -21,7 +21,7 @@ %td= @runner.active? ? 'Yes' : 'No' %tr %td Protected - %td= @runner.protected_? ? 'Yes' : 'No' + %td= @runner.ref_protected? ? 'Yes' : 'No' %tr %td Can run untagged jobs %td= @runner.run_untagged? ? 'Yes' : 'No' -- cgit v1.2.1 From 90c60138db4e1f86026aac5760febe4ba066ca30 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 14 Aug 2017 02:26:19 -0500 Subject: Move "Move to different project" to sidebar Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/34261 --- .../boards/components/sidebar/_due_date.html.haml | 2 +- .../boards/components/sidebar/_labels.html.haml | 2 +- .../boards/components/sidebar/_milestone.html.haml | 2 +- app/views/shared/icons/_icon_arrow_right.svg.erb | 1 + app/views/shared/issuable/_form.html.haml | 12 ----------- app/views/shared/issuable/_sidebar.html.haml | 23 +++++++++++++++++++--- .../shared/issuable/_sidebar_assignees.html.haml | 2 +- .../shared/issuable/form/_issue_assignee.html.haml | 2 +- .../form/_merge_request_assignee.html.haml | 2 +- app/views/shared/milestones/_sidebar.html.haml | 4 ++-- 10 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 app/views/shared/icons/_icon_arrow_right.svg.erb (limited to 'app/views') diff --git a/app/views/projects/boards/components/sidebar/_due_date.html.haml b/app/views/projects/boards/components/sidebar/_due_date.html.haml index f44a9d49a54..e8394eab213 100644 --- a/app/views/projects/boards/components/sidebar/_due_date.html.haml +++ b/app/views/projects/boards/components/sidebar/_due_date.html.haml @@ -3,7 +3,7 @@ Due date - if can?(current_user, :admin_issue, @project) = icon("spinner spin", class: "block-loading") - = link_to "Edit", "#", class: "edit-link pull-right" + = link_to "Edit", "#", class: "js-sidebar-dropdown-toggle edit-link pull-right" .value .value-content %span.no-value{ "v-if" => "!issue.dueDate" } diff --git a/app/views/projects/boards/components/sidebar/_labels.html.haml b/app/views/projects/boards/components/sidebar/_labels.html.haml index 7d0c35fe183..6b389736e8b 100644 --- a/app/views/projects/boards/components/sidebar/_labels.html.haml +++ b/app/views/projects/boards/components/sidebar/_labels.html.haml @@ -3,7 +3,7 @@ Labels - if can?(current_user, :admin_issue, @project) = icon("spinner spin", class: "block-loading") - = link_to "Edit", "#", class: "edit-link pull-right" + = link_to "Edit", "#", class: "js-sidebar-dropdown-toggle edit-link pull-right" .value.issuable-show-labels %span.no-value{ "v-if" => "issue.labels && issue.labels.length === 0" } None diff --git a/app/views/projects/boards/components/sidebar/_milestone.html.haml b/app/views/projects/boards/components/sidebar/_milestone.html.haml index 002e9994ee0..a1ddb261ea3 100644 --- a/app/views/projects/boards/components/sidebar/_milestone.html.haml +++ b/app/views/projects/boards/components/sidebar/_milestone.html.haml @@ -3,7 +3,7 @@ Milestone - if can?(current_user, :admin_issue, @project) = icon("spinner spin", class: "block-loading") - = link_to "Edit", "#", class: "edit-link pull-right" + = link_to "Edit", "#", class: "js-sidebar-dropdown-toggle edit-link pull-right" .value %span.no-value{ "v-if" => "!issue.milestone" } None diff --git a/app/views/shared/icons/_icon_arrow_right.svg.erb b/app/views/shared/icons/_icon_arrow_right.svg.erb new file mode 100644 index 00000000000..24d64eb73bd --- /dev/null +++ b/app/views/shared/icons/_icon_arrow_right.svg.erb @@ -0,0 +1 @@ + diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index c016aa2abcd..bb02dfa0d3a 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -29,18 +29,6 @@ = render 'shared/issuable/form/metadata', issuable: issuable, form: form -- if issuable.can_move?(current_user) - %hr - .form-group - = label_tag :move_to_project_id, 'Move', class: 'control-label' - .col-sm-10 - .issuable-form-select-holder - = hidden_field_tag :move_to_project_id, nil, class: 'js-move-dropdown', data: { placeholder: 'Select project', projects_url: autocomplete_projects_path(project_id: @project.id), page_size: MoveToProjectFinder::PAGE_SIZE } -   - %span{ data: { toggle: 'tooltip', placement: 'auto top' }, style: 'cursor: default', - title: 'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.' } - = icon('question-circle') - = render 'shared/issuable/form/branch_chooser', issuable: issuable, form: form = render 'shared/issuable/form/merge_params', issuable: issuable diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index c3f25c9d255..b07bc45512f 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -34,7 +34,7 @@ Milestone = icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') - if can_edit_issuable - = link_to 'Edit', '#', class: 'edit-link pull-right' + = link_to 'Edit', '#', class: 'js-sidebar-dropdown-toggle edit-link pull-right' .value.hide-collapsed - if issuable.milestone = link_to issuable.milestone.title, milestone_path(issuable.milestone), class: "bold has-tooltip", title: milestone_remaining_days(issuable.milestone), data: { container: "body", html: 1 } @@ -60,7 +60,7 @@ Due date = icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project) - = link_to 'Edit', '#', class: 'edit-link pull-right' + = link_to 'Edit', '#', class: 'js-sidebar-dropdown-toggle edit-link pull-right' .value.hide-collapsed %span.value-content - if issuable.due_date @@ -95,7 +95,7 @@ Labels = icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') - if can_edit_issuable - = link_to 'Edit', '#', class: 'edit-link pull-right' + = link_to 'Edit', '#', class: 'js-sidebar-dropdown-toggle edit-link pull-right' .value.issuable-show-labels.hide-collapsed{ class: ("has-labels" if selected_labels.any?) } - if selected_labels.any? - selected_labels.each do |label| @@ -141,5 +141,22 @@ %cite{ title: project_ref } = project_ref = clipboard_button(text: project_ref, title: "Copy reference to clipboard", placement: "left") + - if current_user && issuable.can_move?(current_user) + .block.js-sidebar-move-issue-block + .sidebar-collapsed-icon{ data: { toggle: 'tooltip', placement: 'left', container: 'body' }, title: 'Move issue' } + = custom_icon('icon_arrow_right') + .dropdown.sidebar-move-issue-dropdown.hide-collapsed + %button.btn.btn-default.btn-block.js-sidebar-dropdown-toggle.js-move-issue{ type: 'button', + data: { toggle: 'dropdown' } } + Move issue + .dropdown-menu.dropdown-menu-selectable + = dropdown_title('Move issue') + = dropdown_filter('Search project', search_id: 'sidebar-move-issue-dropdown-search') + = dropdown_content + = dropdown_loading + = dropdown_footer add_content_class: true do + %button.btn.btn-new.sidebar-move-issue-confirmation-button.js-move-issue-confirmation-button{ disabled: true } + Move + = icon('spinner spin', class: 'sidebar-move-issue-confirmation-loading-icon') %script.js-sidebar-options{ type: "application/json" }= issuable_sidebar_options(issuable, can_edit_issuable).to_json.html_safe diff --git a/app/views/shared/issuable/_sidebar_assignees.html.haml b/app/views/shared/issuable/_sidebar_assignees.html.haml index 57392cd7fbb..58782fa5f58 100644 --- a/app/views/shared/issuable/_sidebar_assignees.html.haml +++ b/app/views/shared/issuable/_sidebar_assignees.html.haml @@ -13,7 +13,7 @@ Assignee = icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') - if can_edit_issuable - = link_to 'Edit', '#', class: 'edit-link pull-right' + = link_to 'Edit', '#', class: 'js-sidebar-dropdown-toggle edit-link pull-right' - if !signed_in %a.gutter-toggle.pull-right.js-sidebar-toggle{ role: "button", href: "#", "aria-label" => "Toggle sidebar" } = sidebar_gutter_toggle_icon diff --git a/app/views/shared/issuable/form/_issue_assignee.html.haml b/app/views/shared/issuable/form/_issue_assignee.html.haml index 66091d95a91..9b2b6e572e7 100644 --- a/app/views/shared/issuable/form/_issue_assignee.html.haml +++ b/app/views/shared/issuable/form/_issue_assignee.html.haml @@ -11,7 +11,7 @@ Assignee = icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') - if can_edit_issuable - = link_to 'Edit', '#', class: 'edit-link pull-right' + = link_to 'Edit', '#', class: 'js-sidebar-dropdown-toggle edit-link pull-right' .value.hide-collapsed - if assignees.any? - assignees.each do |assignee| diff --git a/app/views/shared/issuable/form/_merge_request_assignee.html.haml b/app/views/shared/issuable/form/_merge_request_assignee.html.haml index 18011d528a0..bf8613b0f0d 100644 --- a/app/views/shared/issuable/form/_merge_request_assignee.html.haml +++ b/app/views/shared/issuable/form/_merge_request_assignee.html.haml @@ -9,7 +9,7 @@ Assignee = icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true') - if can_edit_issuable - = link_to 'Edit', '#', class: 'edit-link pull-right' + = link_to 'Edit', '#', class: 'js-sidebar-dropdown-toggle edit-link pull-right' .value.hide-collapsed - if merge_request.assignee = link_to_member(@project, merge_request.assignee, size: 32, extra_class: 'bold') do diff --git a/app/views/shared/milestones/_sidebar.html.haml b/app/views/shared/milestones/_sidebar.html.haml index 40379f48393..2ae0145727c 100644 --- a/app/views/shared/milestones/_sidebar.html.haml +++ b/app/views/shared/milestones/_sidebar.html.haml @@ -21,7 +21,7 @@ .title Start date - if @project && can?(current_user, :admin_milestone, @project) - = link_to 'Edit', edit_project_milestone_path(@project, @milestone), class: 'edit-link pull-right' + = link_to 'Edit', edit_project_milestone_path(@project, @milestone), class: 'js-sidebar-dropdown-toggle edit-link pull-right' .value %span.value-content - if milestone.start_date @@ -51,7 +51,7 @@ .title.hide-collapsed Due date - if @project && can?(current_user, :admin_milestone, @project) - = link_to 'Edit', edit_project_milestone_path(@project, @milestone), class: 'edit-link pull-right' + = link_to 'Edit', edit_project_milestone_path(@project, @milestone), class: 'js-sidebar-dropdown-toggle edit-link pull-right' .value.hide-collapsed %span.value-content - if milestone.due_date -- cgit v1.2.1