BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
57a49b34
Commit
57a49b34
authored
Mar 29, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'repo-buttons' into 'master'
Repo buttons Fixes #796 Moved the star & fork button to inline with the other buttons. See merge request !473
parents
40c36753
6920fd3d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
41 deletions
+20
-41
mobile.scss
app/assets/stylesheets/generic/mobile.scss
+0
-7
projects.scss
app/assets/stylesheets/pages/projects.scss
+10
-18
projects_helper.rb
app/helpers/projects_helper.rb
+2
-2
_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+5
-13
show.html.haml
app/views/projects/show.html.haml
+3
-1
No files found.
app/assets/stylesheets/generic/mobile.scss
View file @
57a49b34
...
@@ -24,13 +24,6 @@
...
@@ -24,13 +24,6 @@
display
:
none
!
important
;
display
:
none
!
important
;
}
}
.project-home-panel
{
.star-fork-buttons
{
padding-top
:
10px
;
padding-right
:
15px
;
}
}
.project-home-links
{
.project-home-links
{
display
:
none
;
display
:
none
;
}
}
...
...
app/assets/stylesheets/pages/projects.scss
View file @
57a49b34
...
@@ -49,8 +49,11 @@
...
@@ -49,8 +49,11 @@
@extend
.clearfix
;
@extend
.clearfix
;
margin-bottom
:
15px
;
margin-bottom
:
15px
;
.project-home-desc
,
&
.project-home-row-top
{
.star-fork-buttons
{
margin-bottom
:
11px
;
}
.project-home-desc
{
font-size
:
16px
;
font-size
:
16px
;
line-height
:
1
.3
;
line-height
:
1
.3
;
}
}
...
@@ -60,25 +63,10 @@
...
@@ -60,25 +63,10 @@
color
:
#666
;
color
:
#666
;
}
}
.star-fork-buttons
{
.btn-action-count
{
float
:
right
;
min-width
:
200px
;
font-weight
:
bold
;
.star-buttons
,
.fork-buttons
{
float
:
right
;
margin-left
:
20px
;
a
:hover
{
text-decoration
:
none
;
}
.count
{
margin-left
:
5px
;
margin-left
:
5px
;
}
}
}
}
}
}
.visibility-level-label
{
.visibility-level-label
{
color
:
#555
;
color
:
#555
;
...
@@ -87,6 +75,10 @@
...
@@ -87,6 +75,10 @@
color
:
inherit
;
color
:
inherit
;
}
}
}
}
.project-repo-buttons
{
margin-top
:
-5px
;
}
}
}
.project-home-links
{
.project-home-links
{
...
...
app/helpers/projects_helper.rb
View file @
57a49b34
...
@@ -81,7 +81,7 @@ module ProjectsHelper
...
@@ -81,7 +81,7 @@ module ProjectsHelper
end
end
def
link_to_toggle_star
(
title
,
starred
,
signed_in
)
def
link_to_toggle_star
(
title
,
starred
,
signed_in
)
cls
=
'star-btn'
cls
=
'star-btn
btn btn-sm btn-default
'
cls
<<
' disabled'
unless
signed_in
cls
<<
' disabled'
unless
signed_in
toggle_html
=
content_tag
(
'span'
,
class:
'toggle'
)
do
toggle_html
=
content_tag
(
'span'
,
class:
'toggle'
)
do
...
@@ -120,7 +120,7 @@ module ProjectsHelper
...
@@ -120,7 +120,7 @@ module ProjectsHelper
def
link_to_toggle_fork
def
link_to_toggle_fork
out
=
icon
(
'code-fork'
)
out
=
icon
(
'code-fork'
)
out
<<
' Fork'
out
<<
' Fork'
out
<<
content_tag
(
:span
,
class:
'count'
)
do
out
<<
content_tag
(
:span
,
class:
'count
btn-action-count
'
)
do
@project
.
forks_count
.
to_s
@project
.
forks_count
.
to_s
end
end
end
end
...
...
app/views/projects/_home_panel.html.haml
View file @
57a49b34
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
.project-home-panel
{
:class
=>
(
"empty-project"
if
empty_repo
)}
.project-home-panel
{
:class
=>
(
"empty-project"
if
empty_repo
)}
.project-identicon-holder
.project-identicon-holder
=
project_icon
(
@project
,
alt:
''
,
class:
'avatar project-avatar'
)
=
project_icon
(
@project
,
alt:
''
,
class:
'avatar project-avatar'
)
.project-home-row
.project-home-row
.project-home-row-top
.project-home-desc
.project-home-desc
-
if
@project
.
description
.
present?
-
if
@project
.
description
.
present?
=
escaped_autolink
(
@project
.
description
)
=
escaped_autolink
(
@project
.
description
)
...
@@ -14,31 +14,23 @@
...
@@ -14,31 +14,23 @@
–
–
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@repository
.
root_ref
,
readme
.
name
))
do
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@repository
.
root_ref
,
readme
.
name
))
do
=
readme
.
name
=
readme
.
name
.
star-fork
-buttons
.
pull-right.prepend-left-10.project-repo
-buttons
-
unless
@project
.
empty_repo?
-
unless
@project
.
empty_repo?
.fork-buttons
.fork-buttons
-
if
current_user
&&
can?
(
current_user
,
:fork_project
,
@project
)
&&
@project
.
namespace
!=
current_user
.
namespace
-
if
current_user
&&
can?
(
current_user
,
:fork_project
,
@project
)
&&
@project
.
namespace
!=
current_user
.
namespace
-
if
current_user
.
already_forked?
(
@project
)
&&
current_user
.
manageable_namespaces
.
size
<
2
-
if
current_user
.
already_forked?
(
@project
)
&&
current_user
.
manageable_namespaces
.
size
<
2
=
link_to
namespace_project_path
(
current_user
,
current_user
.
fork_of
(
@project
)),
title:
'Go to your fork'
do
=
link_to
namespace_project_path
(
current_user
,
current_user
.
fork_of
(
@project
)),
title:
'Go to your fork'
,
class:
'btn btn-sm btn-default'
do
=
link_to_toggle_fork
=
link_to_toggle_fork
-
else
-
else
=
link_to
new_namespace_project_fork_path
(
@project
.
namespace
,
@project
),
title:
"Fork project"
do
=
link_to
new_namespace_project_fork_path
(
@project
.
namespace
,
@project
),
title:
"Fork project"
,
class:
'btn btn-sm btn-default'
do
=
link_to_toggle_fork
=
link_to_toggle_fork
.star.pull-right.prepend-left-10.project-repo-buttons.js-toggler-container
{
class:
@show_star
?
'on'
:
''
}
.star-buttons
%span
.star.js-toggler-container
{
class:
@show_star
?
'on'
:
''
}
-
if
current_user
-
if
current_user
=
link_to_toggle_star
(
'Star this project.'
,
false
,
true
)
=
link_to_toggle_star
(
'Star this project.'
,
false
,
true
)
=
link_to_toggle_star
(
'Unstar this project.'
,
true
,
true
)
=
link_to_toggle_star
(
'Unstar this project.'
,
true
,
true
)
-
else
=
link_to_toggle_star
(
'You must sign in to star a project.'
,
false
,
false
)
.project-home-row.hidden-xs
.project-home-row.hidden-xs
-
if
current_user
&&
!
empty_repo
-
if
current_user
&&
!
empty_repo
.project-home-dropdown
.project-home-dropdown
=
render
"dropdown"
=
render
"dropdown"
-
unless
@project
.
empty_repo?
-
if
can?
current_user
,
:download_code
,
@project
.pull-right.prepend-left-10
=
render
'projects/repositories/download_archive'
,
split_button:
true
=
render
"shared/clone_panel"
=
render
"shared/clone_panel"
app/views/projects/show.html.haml
View file @
57a49b34
...
@@ -87,6 +87,9 @@
...
@@ -87,6 +87,9 @@
-
else
-
else
%span
.light
CI provided by
%span
.light
CI provided by
=
link_to
ci_service
.
title
,
ci_service
.
builds_path
,
:'data-no-turbolink'
=>
'data-no-turbolink'
=
link_to
ci_service
.
title
,
ci_service
.
builds_path
,
:'data-no-turbolink'
=>
'data-no-turbolink'
-
unless
@project
.
empty_repo?
-
if
can?
current_user
,
:download_code
,
@project
=
render
'projects/repositories/download_archive'
,
split_button:
true
-
if
readme
-
if
readme
.tab-pane
#tab-readme
.tab-pane
#tab-readme
...
@@ -97,4 +100,3 @@
...
@@ -97,4 +100,3 @@
=
readme
.
name
=
readme
.
name
.wiki
.wiki
=
render_readme
(
readme
)
=
render_readme
(
readme
)
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