Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gpt
large_projects
gitlabhq1
Commits
3cd00d19
Commit
3cd00d19
authored
8 years ago
by
Douwe Maan
Browse files
Options
Download
Email Patches
Plain Diff
Consistently use monospace font for branch and tag names
parent
f737a079
Changes
40
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
110 additions
and
121 deletions
+110
-121
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js
...s/vue_merge_request_widget/components/mr_widget_header.js
+28
-26
app/assets/stylesheets/framework/typography.scss
app/assets/stylesheets/framework/typography.scss
+5
-0
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+28
-28
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+2
-9
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+4
-13
app/models/issue.rb
app/models/issue.rb
+1
-1
app/models/project_services/chat_message/pipeline_message.rb
app/models/project_services/chat_message/pipeline_message.rb
+3
-3
app/models/project_services/chat_message/push_message.rb
app/models/project_services/chat_message/push_message.rb
+2
-2
app/serializers/pipeline_entity.rb
app/serializers/pipeline_entity.rb
+1
-1
app/views/projects/_last_push.html.haml
app/views/projects/_last_push.html.haml
+1
-1
app/views/projects/branches/_branch.html.haml
app/views/projects/branches/_branch.html.haml
+2
-1
app/views/projects/branches/new.html.haml
app/views/projects/branches/new.html.haml
+1
-1
app/views/projects/builds/_header.html.haml
app/views/projects/builds/_header.html.haml
+7
-9
app/views/projects/commit/branches.html.haml
app/views/projects/commit/branches.html.haml
+14
-14
app/views/projects/compare/_form.html.haml
app/views/projects/compare/_form.html.haml
+2
-2
app/views/projects/compare/index.html.haml
app/views/projects/compare/index.html.haml
+3
-3
app/views/projects/compare/show.html.haml
app/views/projects/compare/show.html.haml
+2
-2
app/views/projects/issues/_related_branches.html.haml
app/views/projects/issues/_related_branches.html.haml
+1
-2
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+1
-1
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+2
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js
View file @
3cd00d19
...
...
@@ -61,32 +61,34 @@ export default {
</span>
</div>
<div class="normal">
<b>Request to merge</b>
<span
class="label-branch"
:class="{'label-truncated has-tooltip': isBranchTitleLong(mr.sourceBranch)}"
:title="isBranchTitleLong(mr.sourceBranch) ? mr.sourceBranch : ''"
data-placement="bottom"
v-html="mr.sourceBranchLink"></span>
<button
class="btn btn-transparent btn-clipboard has-tooltip"
data-title="Copy branch name to clipboard"
:data-clipboard-text="mr.sourceBranch">
<i
aria-hidden="true"
class="fa fa-clipboard"></i>
</button>
<b>into</b>
<span
class="label-branch"
:class="{'label-truncated has-tooltip': isBranchTitleLong(mr.targetBranch)}"
:title="isBranchTitleLong(mr.targetBranch) ? mr.targetBranch : ''"
data-placement="bottom">
<a
:href="mr.targetBranchCommitsPath">
{{mr.targetBranch}}
</a>
</span>
<strong>
Request to merge
<span
class="label-branch"
:class="{'label-truncated has-tooltip': isBranchTitleLong(mr.sourceBranch)}"
:title="isBranchTitleLong(mr.sourceBranch) ? mr.sourceBranch : ''"
data-placement="bottom"
v-html="mr.sourceBranchLink"></span>
<button
class="btn btn-transparent btn-clipboard has-tooltip"
data-title="Copy branch name to clipboard"
:data-clipboard-text="mr.sourceBranch">
<i
aria-hidden="true"
class="fa fa-clipboard"></i>
</button>
into
<span
class="label-branch"
:class="{'label-truncated has-tooltip': isBranchTitleLong(mr.targetBranch)}"
:title="isBranchTitleLong(mr.targetBranch) ? mr.targetBranch : ''"
data-placement="bottom">
<a
:href="mr.targetBranchCommitsPath">
{{mr.targetBranch}}
</a>
</span>
</strong>
<span
v-if="shouldShowCommitsBehindText"
class="diverged-commits-count">
...
...
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/framework/typography.scss
View file @
3cd00d19
...
...
@@ -305,6 +305,11 @@ a > code {
color
:
$link-color
;
}
.git-revision-dropdown-toggle
,
.git-revision-dropdown
.dropdown-content
ul
li
a
{
font-family
:
$monospace_font
;
}
/**
* Apply Markdown typography
*
...
...
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/pages/merge_requests.scss
View file @
3cd00d19
...
...
@@ -160,6 +160,34 @@
text-transform
:
capitalize
;
}
.label-branch
{
@extend
.monospace
;
color
:
$gl-text-color
;
font-weight
:
bold
;
overflow
:
hidden
;
margin
:
0
3px
;
word-break
:
break-all
;
&
.label-truncated
{
position
:
relative
;
display
:
inline-block
;
width
:
250px
;
margin-bottom
:
-3px
;
white-space
:
nowrap
;
text-overflow
:
clip
;
line-height
:
14px
;
&
::after
{
position
:
absolute
;
content
:
'...'
;
right
:
0
;
font-family
:
$regular_font
;
background-color
:
$gray-light
;
}
}
}
.js-deployment-link
{
display
:
inline-block
;
}
...
...
@@ -359,34 +387,6 @@
}
}
.label-branch
{
color
:
$gl-text-color
;
font-family
:
$monospace_font
;
font-weight
:
bold
;
overflow
:
hidden
;
font-size
:
90%
;
margin
:
0
3px
;
word-break
:
break-all
;
&
.label-truncated
{
position
:
relative
;
display
:
inline-block
;
width
:
250px
;
margin-bottom
:
-3px
;
white-space
:
nowrap
;
text-overflow
:
clip
;
line-height
:
14px
;
&
::after
{
position
:
absolute
;
content
:
'...'
;
right
:
0
;
font-family
:
$regular_font
;
background-color
:
$gray-light
;
}
}
}
.commits-empty
{
text-align
:
center
;
...
...
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/pages/projects.scss
View file @
3cd00d19
...
...
@@ -825,7 +825,8 @@ pre.light-well {
}
.compare-form-group
{
.dropdown-menu
{
.dropdown-menu
,
.inline-input-group
{
width
:
100%
;
@media
(
min-width
:
$screen-sm-min
)
{
...
...
@@ -844,14 +845,6 @@ pre.light-well {
width
:
auto
;
}
}
.inline-input-group
{
width
:
100%
;
@media
(
min-width
:
$screen-sm-min
)
{
width
:
250px
;
}
}
}
.clearable-input
{
...
...
This diff is collapsed.
Click to expand it.
app/helpers/commits_helper.rb
View file @
3cd00d19
...
...
@@ -74,12 +74,8 @@ module CommitsHelper
# Returns the sorted alphabetically links to branches, separated by a comma
def
commit_branches_links
(
project
,
branches
)
branches
.
sort
.
map
do
|
branch
|
link_to
(
namespace_project_tree_path
(
project
.
namespace
,
project
,
branch
)
)
do
content_tag
:span
,
class:
'label label-gray'
do
icon
(
'code-fork'
)
+
' '
+
branch
end
link_to
(
namespace_project_commits_path
(
project
.
namespace
,
project
,
branch
),
class:
"label label-gray monospace"
)
do
icon
(
'code-fork'
)
+
"
#{
branch
}
"
end
end
.
join
(
" "
).
html_safe
end
...
...
@@ -88,13 +84,8 @@ module CommitsHelper
def
commit_tags_links
(
project
,
tags
)
sorted
=
VersionSorter
.
rsort
(
tags
)
sorted
.
map
do
|
tag
|
link_to
(
namespace_project_commits_path
(
project
.
namespace
,
project
,
project
.
repository
.
find_tag
(
tag
).
name
)
)
do
content_tag
:span
,
class:
'label label-gray'
do
icon
(
'tag'
)
+
' '
+
tag
end
link_to
(
namespace_project_commits_path
(
project
.
namespace
,
project
,
tag
),
class:
"label label-gray monospace"
)
do
icon
(
'tag'
)
+
"
#{
tag
}
"
end
end
.
join
(
" "
).
html_safe
end
...
...
This diff is collapsed.
Click to expand it.
app/models/issue.rb
View file @
3cd00d19
...
...
@@ -174,7 +174,7 @@ class Issue < ActiveRecord::Base
# Returns boolean if a related branch exists for the current issue
# ignores merge requests branchs
def
has_related_branch?
def
has_related_branch?
project
.
repository
.
branch_names
.
any?
do
|
branch
|
/\A
#{
iid
}
-(?!\d+-stable)/i
=~
branch
end
...
...
This diff is collapsed.
Click to expand it.
app/models/project_services/chat_message/pipeline_message.rb
View file @
3cd00d19
...
...
@@ -35,7 +35,7 @@ module ChatMessage
def
activity
{
title:
"Pipeline
#{
pipeline_link
}
of
#{
branch_link
}
#{
ref_type
}
by
#{
user_name
}
#{
humanized_status
}
"
,
title:
"Pipeline
#{
pipeline_link
}
of
#{
ref_type
}
#{
branch_link
}
by
#{
user_name
}
#{
humanized_status
}
"
,
subtitle:
"in
#{
project_link
}
"
,
text:
"in
#{
pretty_duration
(
duration
)
}
"
,
image:
user_avatar
||
''
...
...
@@ -45,7 +45,7 @@ module ChatMessage
private
def
message
"
#{
project_link
}
: Pipeline
#{
pipeline_link
}
of
#{
branch_link
}
#{
ref_type
}
by
#{
user_name
}
#{
humanized_status
}
in
#{
pretty_duration
(
duration
)
}
"
"
#{
project_link
}
: Pipeline
#{
pipeline_link
}
of
#{
ref_type
}
#{
branch_link
}
by
#{
user_name
}
#{
humanized_status
}
in
#{
pretty_duration
(
duration
)
}
"
end
def
humanized_status
...
...
@@ -70,7 +70,7 @@ module ChatMessage
end
def
branch_link
"[
#{
ref
}
](
#{
branch_url
}
)"
"
`
[
#{
ref
}
](
#{
branch_url
}
)
`
"
end
def
project_link
...
...
This diff is collapsed.
Click to expand it.
app/models/project_services/chat_message/push_message.rb
View file @
3cd00d19
...
...
@@ -61,7 +61,7 @@ module ChatMessage
end
def
removed_branch_message
"
#{
user_name
}
removed
#{
ref_type
}
#{
ref
}
from
#{
project_link
}
"
"
#{
user_name
}
removed
#{
ref_type
}
`
#{
ref
}
`
from
#{
project_link
}
"
end
def
push_message
...
...
@@ -102,7 +102,7 @@ module ChatMessage
end
def
branch_link
"[
#{
ref
}
](
#{
branch_url
}
)"
"
`
[
#{
ref
}
](
#{
branch_url
}
)
`
"
end
def
project_link
...
...
This diff is collapsed.
Click to expand it.
app/serializers/pipeline_entity.rb
View file @
3cd00d19
...
...
@@ -38,7 +38,7 @@ class PipelineEntity < Grape::Entity
expose
:path
do
|
pipeline
|
if
pipeline
.
ref
namespace_project_
tree
_path
(
namespace_project_
commits
_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
id:
pipeline
.
ref
)
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/_last_push.html.haml
View file @
3cd00d19
...
...
@@ -5,7 +5,7 @@
.event-last-push
.event-last-push-text
%span
You pushed to
=
link_to
namespace_project_commits_path
(
event
.
project
.
namespace
,
event
.
project
,
event
.
ref_name
)
do
=
link_to
namespace_project_commits_path
(
event
.
project
.
namespace
,
event
.
project
,
event
.
ref_name
,
class:
'monospace'
)
do
%strong
=
event
.
ref_name
-
if
@project
&&
event
.
project
!=
@project
%span
at
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/branches/_branch.html.haml
View file @
3cd00d19
...
...
@@ -6,7 +6,8 @@
-
merge_project
=
can?
(
current_user
,
:create_merge_request
,
@project
)
?
@project
:
(
current_user
&&
current_user
.
fork_of
(
@project
))
%li
{
class:
"js-branch-#{branch.name}"
}
%div
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
branch
.
name
),
class:
'item-title str-truncated'
do
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
branch
.
name
),
class:
'item-title str-truncated monospace'
do
=
icon
(
'code-fork'
)
=
branch
.
name
-
if
branch
.
name
==
@repository
.
root_ref
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/branches/new.html.haml
View file @
3cd00d19
...
...
@@ -19,7 +19,7 @@
=
label_tag
:ref
,
'Create from'
,
class:
'control-label'
.col-sm-10.dropdown.create-from
=
hidden_field_tag
:ref
,
default_ref
=
button_tag
type:
'button'
,
title:
default_ref
,
class:
'dropdown-toggle form-control js-branch-select'
,
required:
true
,
data:
{
toggle:
'dropdown'
,
selected:
default_ref
,
field_name:
'ref'
}
do
=
button_tag
type:
'button'
,
title:
default_ref
,
class:
'dropdown-toggle form-control js-branch-select
git-revision-dropdown-toggle
'
,
required:
true
,
data:
{
toggle:
'dropdown'
,
selected:
default_ref
,
field_name:
'ref'
}
do
.text-left.dropdown-toggle-text
=
default_ref
=
render
'shared/ref_dropdown'
,
dropdown_class:
'wide'
.help-block
Existing branch name, tag, or commit SHA
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/builds/_header.html.haml
View file @
3cd00d19
...
...
@@ -6,18 +6,16 @@
=
render
'ci/status/badge'
,
status:
@build
.
detailed_status
(
current_user
),
link:
false
,
title:
@build
.
status_title
%strong
Job
=
link_to
namespace_project_build_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'js-build-id'
do
\##{@build.id}
=
link_to
"#
#{
@build
.
id
}
"
,
namespace_project_build_path
(
@project
.
namespace
,
@project
,
@build
),
class:
'js-build-id'
in pipeline
=
link_to
pipeline_path
(
pipeline
)
do
%strong
##{pipeline.id}
%strong
=
link_to
"
#
#{
pipeline
.
id
}
"
,
pipeline_path
(
pipeline
)
for commit
=
link_to
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
pipeline
.
sha
)
do
%strong
=
pipeline
.
short_sha
%strong
=
link_to
pipeline
.
short_sha
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
pipeline
.
sha
)
from
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@build
.
ref
)
do
%code
=
@build
.
ref
%strong
=
link_to
@build
.
ref
,
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@build
.
ref
),
class:
'monospace'
=
render
"projects/builds/user"
if
@build
.
user
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/commit/branches.html.haml
View file @
3cd00d19
-
if
@branches
.
any?
%span
-
branch
=
commit_default_branch
(
@project
,
@branches
)
=
link_to
(
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
branch
))
do
%span
.label.label-gray
=
branch
-
if
@branches
.
any?
||
@tags
.
any?
=
link_to
(
"#"
,
class:
"js-details-expand"
)
do
%span
.label.label-gray
\...
-
if
@branches
.
any?
||
@tags
.
any?
-
branch
=
commit_default_branch
(
@project
,
@branches
)
=
link_to
(
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
branch
),
class:
"label label-gray monospace"
)
do
=
icon
(
'code-fork'
)
=
branch
-# `commit_default_branch` deletes the default branch from `@branches`,
-# so only render this if we have more branches left
-
if
@branches
.
any?
||
@tags
.
any?
%span
=
link_to
"…"
,
"#"
,
class:
"js-details-expand label label-gray"
%span
.js-details-content.hide
-
if
@branches
.
any?
=
commit_branches_links
(
@project
,
@branches
)
-
if
@tags
.
any?
=
commit_tags_links
(
@project
,
@tags
)
=
commit_branches_links
(
@project
,
@branches
)
if
@branches
.
any?
=
commit_tags_links
(
@project
,
@tags
)
if
@tags
.
any?
This diff is collapsed.
Click to expand it.
app/views/projects/compare/_form.html.haml
View file @
3cd00d19
...
...
@@ -7,7 +7,7 @@
.input-group.inline-input-group
%span
.input-group-addon
from
=
hidden_field_tag
:from
,
params
[
:from
]
=
button_tag
type:
'button'
,
title:
params
[
:from
],
class:
"form-control compare-dropdown-toggle js-compare-dropdown has-tooltip"
,
required:
true
,
data:
{
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
toggle:
"dropdown"
,
target:
".js-compare-from-dropdown"
,
selected:
params
[
:from
],
field_name: :from
}
do
=
button_tag
type:
'button'
,
title:
params
[
:from
],
class:
"form-control compare-dropdown-toggle js-compare-dropdown has-tooltip
git-revision-dropdown-toggle
"
,
required:
true
,
data:
{
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
toggle:
"dropdown"
,
target:
".js-compare-from-dropdown"
,
selected:
params
[
:from
],
field_name: :from
}
do
.dropdown-toggle-text.str-truncated
=
params
[
:from
]
||
'Select branch/tag'
=
render
'shared/ref_dropdown'
.compare-ellipsis.inline
...
...
...
@@ -15,7 +15,7 @@
.input-group.inline-input-group
%span
.input-group-addon
to
=
hidden_field_tag
:to
,
params
[
:to
]
=
button_tag
type:
'button'
,
title:
params
[
:to
],
class:
"form-control compare-dropdown-toggle js-compare-dropdown has-tooltip"
,
required:
true
,
data:
{
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
toggle:
"dropdown"
,
target:
".js-compare-to-dropdown"
,
selected:
params
[
:to
],
field_name: :to
}
do
=
button_tag
type:
'button'
,
title:
params
[
:to
],
class:
"form-control compare-dropdown-toggle js-compare-dropdown has-tooltip
git-revision-dropdown-toggle
"
,
required:
true
,
data:
{
refs_url:
refs_namespace_project_path
(
@project
.
namespace
,
@project
),
toggle:
"dropdown"
,
target:
".js-compare-to-dropdown"
,
selected:
params
[
:to
],
field_name: :to
}
do
.dropdown-toggle-text.str-truncated
=
params
[
:to
]
||
'Select branch/tag'
=
render
'shared/ref_dropdown'
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/compare/index.html.haml
View file @
3cd00d19
...
...
@@ -6,10 +6,10 @@
.sub-header-block
Compare Git revisions.
%br
Fill input field with commit
id
like
%code
.
label-branch
4eedf23
Fill input field with commit
SHA
like
%code
.
monospace
4eedf23
or branch/tag name like
%code
.
label-branch
master
%code
.
monospace
master
and press compare button for the commits list and a code diff.
%br
Changes are shown
<b>
from
</b>
the version in the first field
<b>
to
</b>
the version in the second field.
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/compare/show.html.haml
View file @
3cd00d19
...
...
@@ -16,9 +16,9 @@
There isn't anything to compare.
%p
.slead
-
if
params
[
:to
]
==
params
[
:from
]
%span
.
label-branch
=
params
[
:from
]
%span
.
monospace
=
params
[
:from
]
and
%span
.
label-branch
=
params
[
:to
]
%span
.
monospace
=
params
[
:to
]
are the same.
-
else
You'll need to use different branch names to get a valid comparison.
This diff is collapsed.
Click to expand it.
app/views/projects/issues/_related_branches.html.haml
View file @
3cd00d19
...
...
@@ -11,5 +11,4 @@
=
render_pipeline_status
(
pipeline
)
%span
.related-branch-info
%strong
=
link_to
namespace_project_compare_path
(
@project
.
namespace
,
@project
,
from:
@project
.
default_branch
,
to:
branch
),
class:
"label-branch"
do
=
branch
=
link_to
branch
,
namespace_project_compare_path
(
@project
.
namespace
,
@project
,
from:
@project
.
default_branch
,
to:
branch
),
class:
"monospace"
This diff is collapsed.
Click to expand it.
app/views/projects/merge_requests/_merge_request.html.haml
View file @
3cd00d19
...
...
@@ -37,7 +37,7 @@
by
#{
link_to_member
(
@project
,
merge_request
.
author
,
avatar:
false
)
}
-
if
merge_request
.
target_project
.
default_branch
!=
merge_request
.
target_branch
=
link_to
namespace_project_commits_path
(
merge_request
.
project
.
namespace
,
merge_request
.
project
,
merge_request
.
target_branch
)
do
=
link_to
namespace_project_commits_path
(
merge_request
.
project
.
namespace
,
merge_request
.
project
,
merge_request
.
target_branch
)
,
class:
'monospace'
do
=
icon
(
'code-fork'
)
=
merge_request
.
target_branch
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/merge_requests/_new_submit.html.haml
View file @
3cd00d19
...
...
@@ -3,9 +3,9 @@
%p
.slead
-
source_title
,
target_title
=
format_mr_branch_names
(
@merge_request
)
From
%strong
.
label-branch
=
source_title
%strong
.
monospace
=
source_title
%span
into
%strong
.
label-branch
=
target_title
%strong
.
monospace
=
target_title
%span
.pull-right
=
link_to
'Change branches'
,
mr_change_branches_path
(
@merge_request
)
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment