From 6d6fb561a79716e7b12b7b63ba103724a3f60d29 Mon Sep 17 00:00:00 2001 From: Dimitrie Hoekstra Date: Tue, 1 Nov 2016 01:41:28 +0100 Subject: added various changes to commit title area --- app/assets/stylesheets/pages/commit.scss | 36 ++++++++++ app/views/projects/commit/_commit_box.html.haml | 93 +++++++++++++------------ 2 files changed, 83 insertions(+), 46 deletions(-) diff --git a/app/assets/stylesheets/pages/commit.scss b/app/assets/stylesheets/pages/commit.scss index 8ecf7fcb96d..d4890f03a71 100644 --- a/app/assets/stylesheets/pages/commit.scss +++ b/app/assets/stylesheets/pages/commit.scss @@ -36,6 +36,42 @@ padding: 10px 0; margin-bottom: 0; + .commitable-meta { + display: inline-block; + line-height: 18px; + } + + .commit-hash-full { + @media (max-width: $screen-md-min) { + width: 80px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + vertical-align: bottom; + } + } + + .commitable-actions { + @media (min-width: $screen-sm) { + float: right; + padding-top: 0; + } + + .dropdown{ + @media (max-width: $screen-sm) { + width: 100%; + margin-top: 10px; + } + } + + .dropdown-toggle { + @media (max-width: $screen-sm) { + width: 100%; + } + } + } + .commit-options-dropdown-caret { @media (max-width: $screen-sm) { margin-left: 0; diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index d8c95376b94..cca3a962816 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -1,52 +1,53 @@ .commit-info-row.commit-info-row-header - %span.hidden-xs.hidden-sm Commit - = link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit), class: "monospace js-details-short" - = link_to("#", class: "js-details-expand hidden-xs hidden-sm") do - %span.text-expander - \... - %span.js-details-content.hide - = link_to @commit.id, namespace_project_commit_path(@project.namespace, @project, @commit), class: "monospace hidden-xs hidden-sm" - = clipboard_button(clipboard_text: @commit.id) - %span.hidden-xs authored - #{time_ago_with_tooltip(@commit.authored_date)} - %span by - = author_avatar(@commit, size: 24) - %strong - = commit_author_link(@commit, avatar: true, size: 24) - - if @commit.different_committer? - %span.light Committed by + .commitable-meta + %strong Commit + %strong.monospace.js-details-short= @commit.short_id + = link_to("#", class: "js-details-expand hidden-xs hidden-sm") do + %span.text-expander + \... + %span.js-details-content.hide + %strong.monospace.commit-hash-full= @commit.id + = clipboard_button(clipboard_text: @commit.id) + %span.hidden-xs authored + #{time_ago_with_tooltip(@commit.authored_date)} + %span by + = author_avatar(@commit, size: 24) %strong - = commit_committer_link(@commit, avatar: true, size: 24) - #{time_ago_with_tooltip(@commit.committed_date)} - - .pull-right.commit-action-buttons - - if defined?(@notes_count) && @notes_count > 0 - %span.btn.disabled.btn-grouped.hidden-xs.append-right-10 - = icon('comment') - = @notes_count - = link_to namespace_project_tree_path(@project.namespace, @project, @commit), class: "btn btn-default append-right-10 hidden-xs hidden-sm" do - Browse Files - .dropdown.inline - %a.btn.btn-default.dropdown-toggle{ data: { toggle: "dropdown" } } - %span.hidden-xs Options - = icon('caret-down', class: ".commit-options-dropdown-caret") - %ul.dropdown-menu.dropdown-menu-align-right - %li.visible-xs-block.visible-sm-block - = link_to namespace_project_tree_path(@project.namespace, @project, @commit) do - Browse Files - - unless @commit.has_been_reverted?(current_user) + = commit_author_link(@commit, avatar: true, size: 24) + - if @commit.different_committer? + %span.light Committed by + %strong + = commit_committer_link(@commit, avatar: true, size: 24) + #{time_ago_with_tooltip(@commit.committed_date)} + .commitable-actions + .commit-action-buttons + - if defined?(@notes_count) && @notes_count > 0 + %span.btn.disabled.btn-grouped.hidden-xs.append-right-10 + = icon('comment') + = @notes_count + = link_to namespace_project_tree_path(@project.namespace, @project, @commit), class: "btn btn-default append-right-10 hidden-xs hidden-sm" do + Browse Files + .dropdown.inline + %a.btn.btn-default.dropdown-toggle{ data: { toggle: "dropdown" } } + %span Options + = icon('caret-down', class: ".commit-options-dropdown-caret") + %ul.dropdown-menu.dropdown-menu-align-right + %li.visible-xs-block.visible-sm-block + = link_to namespace_project_tree_path(@project.namespace, @project, @commit) do + Browse Files + - unless @commit.has_been_reverted?(current_user) + %li.clearfix + = revert_commit_link(@commit, namespace_project_commit_path(@project.namespace, @project, @commit.id), has_tooltip: false) + %li.clearfix + = cherry_pick_commit_link(@commit, namespace_project_commit_path(@project.namespace, @project, @commit.id), has_tooltip: false) %li.clearfix - = revert_commit_link(@commit, namespace_project_commit_path(@project.namespace, @project, @commit.id), has_tooltip: false) - %li.clearfix - = cherry_pick_commit_link(@commit, namespace_project_commit_path(@project.namespace, @project, @commit.id), has_tooltip: false) - %li.clearfix - = link_to "Tag", new_namespace_project_tag_path(@project.namespace, @project, ref: @commit) - %li.divider - %li.dropdown-header - Download - - unless @commit.parents.length > 1 - %li= link_to "Email Patches", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch) - %li= link_to "Plain Diff", namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff) + = link_to "Tag", new_namespace_project_tag_path(@project.namespace, @project, ref: @commit) + %li.divider + %li.dropdown-header + Download + - unless @commit.parents.length > 1 + %li= link_to "Email Patches", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch) + %li= link_to "Plain Diff", namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff) .commit-box %h3.commit-title -- cgit v1.2.1 From 30d4cce00c8e98395f177df590b4e2cdc15e0572 Mon Sep 17 00:00:00 2001 From: Dimitrie Hoekstra Date: Tue, 1 Nov 2016 10:35:34 +0000 Subject: Update commit.scss to have correct linting --- app/assets/stylesheets/pages/commit.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pages/commit.scss b/app/assets/stylesheets/pages/commit.scss index d4890f03a71..04d2d2ba622 100644 --- a/app/assets/stylesheets/pages/commit.scss +++ b/app/assets/stylesheets/pages/commit.scss @@ -58,7 +58,7 @@ padding-top: 0; } - .dropdown{ + .dropdown { @media (max-width: $screen-sm) { width: 100%; margin-top: 10px; -- cgit v1.2.1 From ff3379641a075748fc6b79e0701e533a763caa85 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Tue, 1 Nov 2016 16:47:15 -0500 Subject: Update commit page styles --- app/assets/stylesheets/pages/commit.scss | 46 +++++++------------- app/views/projects/commit/_commit_box.html.haml | 57 ++++++++++++------------- 2 files changed, 44 insertions(+), 59 deletions(-) diff --git a/app/assets/stylesheets/pages/commit.scss b/app/assets/stylesheets/pages/commit.scss index 04d2d2ba622..47d3e72679b 100644 --- a/app/assets/stylesheets/pages/commit.scss +++ b/app/assets/stylesheets/pages/commit.scss @@ -36,13 +36,17 @@ padding: 10px 0; margin-bottom: 0; - .commitable-meta { - display: inline-block; - line-height: 18px; + @media (min-width: $screen-sm-min) { + display: flex; + align-items: center; + + .commit-meta { + flex: 1; + } } .commit-hash-full { - @media (max-width: $screen-md-min) { + @media (max-width: $screen-sm-max) { width: 80px; white-space: nowrap; overflow: hidden; @@ -52,31 +56,24 @@ } } - .commitable-actions { - @media (min-width: $screen-sm) { - float: right; - padding-top: 0; + .commit-action-buttons { + i { + color: $gl-icon-color; + font-size: 13px; + margin-right: 3px; } - .dropdown { - @media (max-width: $screen-sm) { + @media (max-width: $screen-xs-max) { + .dropdown { width: 100%; margin-top: 10px; } - } - .dropdown-toggle { - @media (max-width: $screen-sm) { + .dropdown-toggle { width: 100%; } } } - - .commit-options-dropdown-caret { - @media (max-width: $screen-sm) { - margin-left: 0; - } - } } .avatar { @@ -224,17 +221,6 @@ } } -.commit-action-buttons { - position: relative; - top: -1px; - - i { - color: $gl-icon-color; - font-size: 13px; - margin-right: 3px; - } -} - /* * Commit message textarea for web editor and * custom merge request message diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index cca3a962816..0ebc38d16cf 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -1,5 +1,5 @@ .commit-info-row.commit-info-row-header - .commitable-meta + .commit-meta %strong Commit %strong.monospace.js-details-short= @commit.short_id = link_to("#", class: "js-details-expand hidden-xs hidden-sm") do @@ -19,35 +19,34 @@ %strong = commit_committer_link(@commit, avatar: true, size: 24) #{time_ago_with_tooltip(@commit.committed_date)} - .commitable-actions - .commit-action-buttons - - if defined?(@notes_count) && @notes_count > 0 - %span.btn.disabled.btn-grouped.hidden-xs.append-right-10 - = icon('comment') - = @notes_count - = link_to namespace_project_tree_path(@project.namespace, @project, @commit), class: "btn btn-default append-right-10 hidden-xs hidden-sm" do - Browse Files - .dropdown.inline - %a.btn.btn-default.dropdown-toggle{ data: { toggle: "dropdown" } } - %span Options - = icon('caret-down', class: ".commit-options-dropdown-caret") - %ul.dropdown-menu.dropdown-menu-align-right - %li.visible-xs-block.visible-sm-block - = link_to namespace_project_tree_path(@project.namespace, @project, @commit) do - Browse Files - - unless @commit.has_been_reverted?(current_user) - %li.clearfix - = revert_commit_link(@commit, namespace_project_commit_path(@project.namespace, @project, @commit.id), has_tooltip: false) + .commit-action-buttons + - if defined?(@notes_count) && @notes_count > 0 + %span.btn.disabled.btn-grouped.hidden-xs.append-right-10 + = icon('comment') + = @notes_count + = link_to namespace_project_tree_path(@project.namespace, @project, @commit), class: "btn btn-default append-right-10 hidden-xs hidden-sm" do + Browse Files + .dropdown.inline + %a.btn.btn-default.dropdown-toggle{ data: { toggle: "dropdown" } } + %span Options + = icon('caret-down') + %ul.dropdown-menu.dropdown-menu-align-right + %li.visible-xs-block.visible-sm-block + = link_to namespace_project_tree_path(@project.namespace, @project, @commit) do + Browse Files + - unless @commit.has_been_reverted?(current_user) %li.clearfix - = cherry_pick_commit_link(@commit, namespace_project_commit_path(@project.namespace, @project, @commit.id), has_tooltip: false) - %li.clearfix - = link_to "Tag", new_namespace_project_tag_path(@project.namespace, @project, ref: @commit) - %li.divider - %li.dropdown-header - Download - - unless @commit.parents.length > 1 - %li= link_to "Email Patches", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch) - %li= link_to "Plain Diff", namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff) + = revert_commit_link(@commit, namespace_project_commit_path(@project.namespace, @project, @commit.id), has_tooltip: false) + %li.clearfix + = cherry_pick_commit_link(@commit, namespace_project_commit_path(@project.namespace, @project, @commit.id), has_tooltip: false) + %li.clearfix + = link_to "Tag", new_namespace_project_tag_path(@project.namespace, @project, ref: @commit) + %li.divider + %li.dropdown-header + Download + - unless @commit.parents.length > 1 + %li= link_to "Email Patches", namespace_project_commit_path(@project.namespace, @project, @commit, format: :patch) + %li= link_to "Plain Diff", namespace_project_commit_path(@project.namespace, @project, @commit, format: :diff) .commit-box %h3.commit-title -- cgit v1.2.1 From 5d0f68f26b0b6597c99d1e21d6f6978d963ea0d3 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Fri, 4 Nov 2016 11:23:58 -0500 Subject: Fix diff_comments failure --- features/steps/shared/diff_note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 4df4e89f5b9..35b71599708 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -210,7 +210,7 @@ module SharedDiffNote end step 'I click side-by-side diff button' do - find('#parallel-diff-btn').click + find('#parallel-diff-btn').trigger('click') end step 'I see side-by-side diff button' do -- cgit v1.2.1