Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
09b8d9d6
Commit
09b8d9d6
authored
Jan 29, 2021
by
Yogi
Committed by
Mike Greiling
Jan 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply new GitLab UI for buttons in blob header
parent
44f55ba6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
8 deletions
+13
-8
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+6
-6
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+1
-1
changelogs/unreleased/gl-button-file.yml
changelogs/unreleased/gl-button-file.yml
+5
-0
ee/app/views/projects/blob/_header_file_locks_link.html.haml
ee/app/views/projects/blob/_header_file_locks_link.html.haml
+1
-1
No files found.
app/helpers/blob_helper.rb
View file @
09b8d9d6
...
@@ -64,7 +64,7 @@ module BlobHelper
...
@@ -64,7 +64,7 @@ module BlobHelper
def
edit_blob_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
options
=
{})
def
edit_blob_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
options
=
{})
return
unless
blob
=
readable_blob
(
options
,
path
,
project
,
ref
)
return
unless
blob
=
readable_blob
(
options
,
path
,
project
,
ref
)
common_classes
=
"btn
btn-primary
js-edit-blob gl-mr-3
#{
options
[
:extra_class
]
}
"
common_classes
=
"btn
gl-button btn-confirm
js-edit-blob gl-mr-3
#{
options
[
:extra_class
]
}
"
data
=
{
track_event:
'click_edit'
,
track_label:
'Edit'
}
data
=
{
track_event:
'click_edit'
,
track_label:
'Edit'
}
if
Feature
.
enabled?
(
:web_ide_primary_edit
,
project
.
group
)
if
Feature
.
enabled?
(
:web_ide_primary_edit
,
project
.
group
)
...
@@ -84,7 +84,7 @@ module BlobHelper
...
@@ -84,7 +84,7 @@ module BlobHelper
def
ide_edit_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
blob
:)
def
ide_edit_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
blob
:)
return
unless
blob
return
unless
blob
common_classes
=
'btn
btn-primary
ide-edit-button gl-mr-3'
common_classes
=
'btn
gl-button btn-confirm
ide-edit-button gl-mr-3'
data
=
{
track_event:
'click_edit_ide'
,
track_label:
'Web IDE'
}
data
=
{
track_event:
'click_edit_ide'
,
track_label:
'Web IDE'
}
unless
Feature
.
enabled?
(
:web_ide_primary_edit
,
project
.
group
)
unless
Feature
.
enabled?
(
:web_ide_primary_edit
,
project
.
group
)
...
@@ -105,7 +105,7 @@ module BlobHelper
...
@@ -105,7 +105,7 @@ module BlobHelper
return
unless
current_user
return
unless
current_user
return
unless
blob
return
unless
blob
common_classes
=
"btn btn-
#{
btn_class
}
"
common_classes
=
"btn
gl-button btn-default
btn-
#{
btn_class
}
"
base_button
=
button_tag
(
label
,
class:
"
#{
common_classes
}
disabled"
,
disabled:
true
)
base_button
=
button_tag
(
label
,
class:
"
#{
common_classes
}
disabled"
,
disabled:
true
)
if
!
on_top_of_branch?
(
project
,
ref
)
if
!
on_top_of_branch?
(
project
,
ref
)
...
@@ -247,7 +247,7 @@ module BlobHelper
...
@@ -247,7 +247,7 @@ module BlobHelper
def
copy_blob_source_button
(
blob
)
def
copy_blob_source_button
(
blob
)
return
unless
blob
.
rendered_as_text?
(
ignore_errors:
false
)
return
unless
blob
.
rendered_as_text?
(
ignore_errors:
false
)
clipboard_button
(
target:
".blob-content[data-blob-id='
#{
blob
.
id
}
'] > pre"
,
class:
"btn btn-sm js-copy-blob-source-btn"
,
title:
_
(
"Copy file contents"
))
clipboard_button
(
target:
".blob-content[data-blob-id='
#{
blob
.
id
}
'] > pre"
,
class:
"btn
gl-button btn-default
btn-sm js-copy-blob-source-btn"
,
title:
_
(
"Copy file contents"
))
end
end
def
open_raw_blob_button
(
blob
)
def
open_raw_blob_button
(
blob
)
...
@@ -257,7 +257,7 @@ module BlobHelper
...
@@ -257,7 +257,7 @@ module BlobHelper
title
=
_
(
'Open raw'
)
title
=
_
(
'Open raw'
)
link_to
sprite_icon
(
'doc-code'
),
link_to
sprite_icon
(
'doc-code'
),
external_storage_url_or_path
(
blob_raw_path
),
external_storage_url_or_path
(
blob_raw_path
),
class:
'btn btn-sm has-tooltip'
,
class:
'btn
gl-button btn-default
btn-sm has-tooltip'
,
target:
'_blank'
,
target:
'_blank'
,
rel:
'noopener noreferrer'
,
rel:
'noopener noreferrer'
,
aria:
{
label:
title
},
aria:
{
label:
title
},
...
@@ -272,7 +272,7 @@ module BlobHelper
...
@@ -272,7 +272,7 @@ module BlobHelper
link_to
sprite_icon
(
'download'
),
link_to
sprite_icon
(
'download'
),
external_storage_url_or_path
(
blob_raw_path
(
inline:
false
)),
external_storage_url_or_path
(
blob_raw_path
(
inline:
false
)),
download:
@path
,
download:
@path
,
class:
'btn btn-sm has-tooltip'
,
class:
'btn
gl-button btn-default
btn-sm has-tooltip'
,
target:
'_blank'
,
target:
'_blank'
,
rel:
'noopener noreferrer'
,
rel:
'noopener noreferrer'
,
aria:
{
label:
title
},
aria:
{
label:
title
},
...
...
app/helpers/commits_helper.rb
View file @
09b8d9d6
...
@@ -177,7 +177,7 @@ module CommitsHelper
...
@@ -177,7 +177,7 @@ module CommitsHelper
external_url
=
environment
.
external_url_for
(
diff_new_path
,
commit_sha
)
external_url
=
environment
.
external_url_for
(
diff_new_path
,
commit_sha
)
return
unless
external_url
return
unless
external_url
link_to
(
external_url
,
class:
'btn btn-file-option has-tooltip'
,
target:
'_blank'
,
rel:
'noopener noreferrer'
,
title:
"View on
#{
environment
.
formatted_external_url
}
"
,
data:
{
container:
'body'
})
do
link_to
(
external_url
,
class:
'btn
gl-button btn-default
btn-file-option has-tooltip'
,
target:
'_blank'
,
rel:
'noopener noreferrer'
,
title:
"View on
#{
environment
.
formatted_external_url
}
"
,
data:
{
container:
'body'
})
do
sprite_icon
(
'external-link'
)
sprite_icon
(
'external-link'
)
end
end
end
end
...
...
changelogs/unreleased/gl-button-file.yml
0 → 100644
View file @
09b8d9d6
---
title
:
Apply new GitLab UI for buttons in blob header
merge_request
:
52429
author
:
Yogi (@yo)
type
:
other
ee/app/views/projects/blob/_header_file_locks_link.html.haml
View file @
09b8d9d6
=
lock_file_link
(
html_options:
{
class:
'btn btn-sm path-lock'
})
=
lock_file_link
(
html_options:
{
class:
'btn
gl-button btn-default
btn-sm path-lock'
})
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