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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
91b10819
Commit
91b10819
authored
Mar 26, 2015
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fork/Star button re-design
parent
090f2344
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
44 deletions
+17
-44
app/assets/stylesheets/generic/mobile.scss
app/assets/stylesheets/generic/mobile.scss
+0
-7
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+3
-19
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+2
-2
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+12
-16
No files found.
app/assets/stylesheets/generic/mobile.scss
View file @
91b10819
...
...
@@ -24,13 +24,6 @@
display
:
none
!
important
;
}
.project-home-panel
{
.star-fork-buttons
{
padding-top
:
10px
;
padding-right
:
15px
;
}
}
.project-home-links
{
display
:
none
;
}
...
...
app/assets/stylesheets/pages/projects.scss
View file @
91b10819
...
...
@@ -49,8 +49,7 @@
@extend
.clearfix
;
margin-bottom
:
15px
;
.project-home-desc
,
.star-fork-buttons
{
.project-home-desc
{
font-size
:
16px
;
line-height
:
1
.3
;
}
...
...
@@ -60,25 +59,10 @@
color
:
#666
;
}
.star-fork-buttons
{
float
:
right
;
min-width
:
200px
;
font-weight
:
bold
;
.star-buttons
,
.fork-buttons
{
float
:
right
;
margin-left
:
20px
;
a
:hover
{
text-decoration
:
none
;
}
.count
{
.btn-action-count
{
margin-left
:
5px
;
}
}
}
}
.visibility-level-label
{
color
:
#555
;
...
...
app/helpers/projects_helper.rb
View file @
91b10819
...
...
@@ -81,7 +81,7 @@ module ProjectsHelper
end
def
link_to_toggle_star
(
title
,
starred
,
signed_in
)
cls
=
'star-btn'
cls
=
'star-btn
btn btn-primary
'
cls
<<
' disabled'
unless
signed_in
toggle_html
=
content_tag
(
'span'
,
class:
'toggle'
)
do
...
...
@@ -120,7 +120,7 @@ module ProjectsHelper
def
link_to_toggle_fork
out
=
icon
(
'code-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
end
end
...
...
app/views/projects/_home_panel.html.haml
View file @
91b10819
...
...
@@ -14,29 +14,25 @@
–
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@repository
.
root_ref
,
readme
.
name
))
do
=
readme
.
name
.star-fork-buttons
.project-home-row.hidden-xs
-
if
current_user
&&
!
empty_repo
.project-home-dropdown
=
render
"dropdown"
%span
.star.pull-right.prepend-left-10.js-toggler-container
{
class:
@show_star
?
'on'
:
''
}
-
if
current_user
=
link_to_toggle_star
(
'Star this project.'
,
false
,
true
)
=
link_to_toggle_star
(
'Unstar this project.'
,
true
,
true
)
.pull-right.prepend-left-10
-
unless
@project
.
empty_repo?
.fork-buttons
-
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
=
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-primary'
do
=
link_to_toggle_fork
-
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-primary'
do
=
link_to_toggle_fork
.star-buttons
%span
.star.js-toggler-container
{
class:
@show_star
?
'on'
:
''
}
-
if
current_user
=
link_to_toggle_star
(
'Star this project.'
,
false
,
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
-
if
current_user
&&
!
empty_repo
.project-home-dropdown
=
render
"dropdown"
-
unless
@project
.
empty_repo?
-
if
can?
current_user
,
:download_code
,
@project
.pull-right.prepend-left-10
...
...
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