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
f5351af4
Commit
f5351af4
authored
Jan 21, 2021
by
Yogi
Committed by
David O'Regan
Jan 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add gl-button to nav buttons in the project page
parent
fe289694
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
24 deletions
+12
-24
app/assets/stylesheets/framework/buttons.scss
app/assets/stylesheets/framework/buttons.scss
+0
-13
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+0
-4
app/helpers/stat_anchors_helper.rb
app/helpers/stat_anchors_helper.rb
+2
-2
app/presenters/project_presenter.rb
app/presenters/project_presenter.rb
+2
-2
changelogs/unreleased/yo-gl-button-project-page.yml
changelogs/unreleased/yo-gl-button-project-page.yml
+5
-0
spec/helpers/stat_anchors_helper_spec.rb
spec/helpers/stat_anchors_helper_spec.rb
+2
-2
spec/presenters/project_presenter_spec.rb
spec/presenters/project_presenter_spec.rb
+1
-1
No files found.
app/assets/stylesheets/framework/buttons.scss
View file @
f5351af4
...
...
@@ -437,19 +437,6 @@
}
}
.btn-missing
{
color
:
$gl-text-color-secondary
;
border
:
1px
dashed
$border-gray-normal-dashed
;
border-radius
:
$border-radius-default
;
&
:hover
,
&
:active
,
&
:focus
{
color
:
$gl-text-color-secondary
;
background-color
:
$white-normal
;
}
}
// The .btn-svg class is available for legacy icon buttons to
// preserve a 34px height and have 16x16 icons at the same time.
// Once a button is migrated (to the current 32px height)
...
...
app/assets/stylesheets/pages/projects.scss
View file @
f5351af4
...
...
@@ -571,10 +571,6 @@
top
:
0
;
}
}
.btn-missing
{
@extend
.btn-missing
;
}
}
}
...
...
app/helpers/stat_anchors_helper.rb
View file @
f5351af4
...
...
@@ -11,14 +11,14 @@ module StatAnchorsHelper
private
def
button_attribute
(
anchor
)
"btn-
#{
anchor
.
class_modifier
||
'
missing
'
}
"
"btn-
#{
anchor
.
class_modifier
||
'
dashed
'
}
"
end
def
extra_classes
(
anchor
)
if
anchor
.
is_link
'stat-link'
else
"btn
#{
button_attribute
(
anchor
)
}
"
"
gl-button
btn
#{
button_attribute
(
anchor
)
}
"
end
end
end
app/presenters/project_presenter.rb
View file @
f5351af4
...
...
@@ -17,7 +17,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
MAX_TOPICS_TO_SHOW
=
3
def
statistic_icon
(
icon_name
=
'plus-square-o'
)
sprite_icon
(
icon_name
,
css_class:
'icon gl-mr-2'
)
sprite_icon
(
icon_name
,
css_class:
'icon gl-mr-2
gl-text-gray-500
'
)
end
def
statistics_anchors
(
show_auto_devops_callout
:)
...
...
@@ -239,7 +239,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
AnchorData
.
new
(
false
,
statistic_icon
+
_
(
'New file'
),
new_file_path
,
'
missing
'
)
'
dashed
'
)
end
end
...
...
changelogs/unreleased/yo-gl-button-project-page.yml
0 → 100644
View file @
f5351af4
---
title
:
Add gl-button to nav buttons in the project page
merge_request
:
51427
author
:
Yogi (@yo)
type
:
other
spec/helpers/stat_anchors_helper_spec.rb
View file @
f5351af4
...
...
@@ -21,7 +21,7 @@ RSpec.describe StatAnchorsHelper do
let
(
:anchor
)
{
anchor_klass
.
new
(
false
,
nil
,
nil
,
'default'
)
}
it
'returns the proper attributes'
do
expect
(
subject
[
:class
]).
to
include
(
'btn btn-default'
)
expect
(
subject
[
:class
]).
to
include
(
'
gl-button
btn btn-default'
)
end
end
...
...
@@ -29,7 +29,7 @@ RSpec.describe StatAnchorsHelper do
let
(
:anchor
)
{
anchor_klass
.
new
(
false
)
}
it
'returns the proper attributes'
do
expect
(
subject
[
:class
]).
to
include
(
'
btn btn-missing
'
)
expect
(
subject
[
:class
]).
to
include
(
'
gl-button btn btn-dashed
'
)
end
end
end
...
...
spec/presenters/project_presenter_spec.rb
View file @
f5351af4
...
...
@@ -350,7 +350,7 @@ RSpec.describe ProjectPresenter do
is_link:
false
,
label:
a_string_including
(
"New file"
),
link:
presenter
.
project_new_blob_path
(
project
,
'master'
),
class_modifier:
'
missing
'
class_modifier:
'
dashed
'
)
end
...
...
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