Commit 91b10819 authored by Phil Hughes's avatar Phil Hughes

Fork/Star button re-design

parent 090f2344
...@@ -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;
} }
......
...@@ -49,8 +49,7 @@ ...@@ -49,8 +49,7 @@
@extend .clearfix; @extend .clearfix;
margin-bottom: 15px; margin-bottom: 15px;
.project-home-desc, .project-home-desc {
.star-fork-buttons {
font-size: 16px; font-size: 16px;
line-height: 1.3; line-height: 1.3;
} }
...@@ -60,25 +59,10 @@ ...@@ -60,25 +59,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;
......
...@@ -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-primary'
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
......
...@@ -14,29 +14,25 @@ ...@@ -14,29 +14,25 @@
&ndash; &ndash;
= 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
.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? - 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-primary' 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-primary' do
= link_to_toggle_fork = 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? - unless @project.empty_repo?
- if can? current_user, :download_code, @project - if can? current_user, :download_code, @project
.pull-right.prepend-left-10 .pull-right.prepend-left-10
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment