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

Fork/Star button re-design

parent 090f2344
......@@ -24,13 +24,6 @@
display: none !important;
}
.project-home-panel {
.star-fork-buttons {
padding-top: 10px;
padding-right: 15px;
}
}
.project-home-links {
display: none;
}
......
......@@ -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;
......
......@@ -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
......
......@@ -14,29 +14,25 @@
&ndash;
= 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
......
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