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
Tatuya Kamada
gitlab-ce
Commits
405f91d2
Commit
405f91d2
authored
Mar 29, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor star/fork buttons
parent
6b9f1e1a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
24 deletions
+47
-24
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+22
-8
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+7
-3
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+7
-7
app/views/projects/repositories/_download_archive.html.haml
app/views/projects/repositories/_download_archive.html.haml
+2
-2
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+9
-4
No files found.
app/assets/stylesheets/pages/projects.scss
View file @
405f91d2
...
...
@@ -48,24 +48,21 @@
.project-home-row
{
@extend
.clearfix
;
margin-bottom
:
15px
;
&
.project-home-row-top
{
margin-bottom
:
1
1
px
;
margin-bottom
:
1
5
px
;
}
.project-home-desc
{
font-size
:
16px
;
line-height
:
1
.3
;
margin-right
:
215px
;
}
.project-home-desc
{
float
:
left
;
color
:
#666
;
}
.btn-action-count
{
margin-left
:
5px
;
}
}
.visibility-level-label
{
...
...
@@ -75,9 +72,26 @@
color
:
inherit
;
}
}
.project-repo-buttons
{
margin-top
:
-5px
;
margin-top
:
-3px
;
position
:
absolute
;
right
:
0
;
width
:
260px
;
text-align
:
right
;
.btn
{
font-weight
:
bold
;
font-size
:
14px
;
line-height
:
16px
;
.count
{
padding-left
:
10px
;
border-left
:
1px
solid
#ccc
;
display
:
inline-block
;
margin-left
:
10px
;
}
}
}
}
...
...
app/helpers/projects_helper.rb
View file @
405f91d2
...
...
@@ -118,11 +118,15 @@ module ProjectsHelper
end
def
link_to_toggle_fork
out
=
icon
(
'code-fork'
)
out
<<
' Fork'
out
<<
content_tag
(
:span
,
class:
'count btn-action-count'
)
do
html
=
content_tag
(
'span'
)
do
icon
(
'code-fork'
)
+
' Fork'
end
count_html
=
content_tag
(
:span
,
class:
'count'
)
do
@project
.
forks_count
.
to_s
end
html
+
count_html
end
private
...
...
app/views/projects/_home_panel.html.haml
View file @
405f91d2
...
...
@@ -14,20 +14,20 @@
–
=
link_to
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
tree_join
(
@repository
.
root_ref
,
readme
.
name
))
do
=
readme
.
name
.pull-right.prepend-left-10.project-repo-buttons
.project-repo-buttons
.inline.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
)
-
unless
@project
.
empty_repo?
.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
.inline.fork-buttons.prepend-left-10
-
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'
,
class:
'btn btn-sm btn-default'
do
=
link_to_toggle_fork
-
else
=
link_to
new_namespace_project_fork_path
(
@project
.
namespace
,
@project
),
title:
"Fork project"
,
class:
'btn btn-sm btn-default'
do
=
link_to_toggle_fork
.star.pull-right.prepend-left-10.project-repo-buttons.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
)
.project-home-row.hidden-xs
-
if
current_user
&&
!
empty_repo
...
...
app/views/projects/repositories/_download_archive.html.haml
View file @
405f91d2
...
...
@@ -3,10 +3,10 @@
-
split_button
=
split_button
||
false
-
if
split_button
==
true
%span
.btn-group
{
class:
btn_class
}
=
link_to
archive_namespace_project_repository_path
(
@project
.
namespace
,
@project
,
ref:
ref
,
format:
'zip'
),
class:
'btn'
,
rel:
'nofollow'
do
=
link_to
archive_namespace_project_repository_path
(
@project
.
namespace
,
@project
,
ref:
ref
,
format:
'zip'
),
class:
'btn
btn-sm
'
,
rel:
'nofollow'
do
%i
.fa.fa-download
%span
Download zip
%a
.btn.dropdown-toggle
{
'data-toggle'
=>
'dropdown'
}
%a
.btn
-sm.btn
.dropdown-toggle
{
'data-toggle'
=>
'dropdown'
}
%span
.caret
%span
.sr-only
Select Archive Format
...
...
app/views/projects/show.html.haml
View file @
405f91d2
...
...
@@ -68,7 +68,7 @@
=
link_to
license_url
(
@project
),
class:
'btn btn-block'
do
View license
.prepend-top-10
.prepend-top-10
.append-bottom-10
%p
%span
.light
Created on
#{
@project
.
created_at
.
stamp
(
'Aug 22, 2013'
)
}
...
...
@@ -79,17 +79,22 @@
-
else
#{
link_to
@project
.
owner_name
,
@project
.
owner
}
-
unless
@project
.
empty_repo?
-
if
can?
current_user
,
:download_code
,
@project
%hr
.prepend-top-10.append-bottom-10
=
render
'projects/repositories/download_archive'
,
split_button:
true
.prepend-top-10
-
@project
.
ci_services
.
each
do
|
ci_service
|
-
if
ci_service
.
active?
&&
ci_service
.
respond_to?
(
:builds_path
)
%hr
-
if
ci_service
.
respond_to?
(
:status_img_path
)
=
link_to
ci_service
.
builds_path
,
:'data-no-turbolink'
=>
'data-no-turbolink'
do
=
image_tag
ci_service
.
status_img_path
,
alt:
"build status"
-
else
%span
.light
CI provided by
=
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
.tab-pane
#tab-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