diff options
author | Phil Hughes <theephil@gmail.com> | 2015-03-26 19:38:20 +0000 |
---|---|---|
committer | Phil Hughes <theephil@gmail.com> | 2015-03-26 19:38:20 +0000 |
commit | 91b108192c84178ec100ece41f159b68738f1a32 (patch) | |
tree | 2d9eb5a9733411e44a04884c13b635c3419c440f /app | |
parent | 090f2344ecb6631b20df5853045536f1eb0589d3 (diff) | |
download | gitlab-ce-91b108192c84178ec100ece41f159b68738f1a32.tar.gz |
Fork/Star button re-design
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/generic/mobile.scss | 7 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/projects.scss | 22 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 4 | ||||
-rw-r--r-- | app/views/projects/_home_panel.html.haml | 28 |
4 files changed, 17 insertions, 44 deletions
diff --git a/app/assets/stylesheets/generic/mobile.scss b/app/assets/stylesheets/generic/mobile.scss index 1b0e056216f..71a1fc4493f 100644 --- a/app/assets/stylesheets/generic/mobile.scss +++ b/app/assets/stylesheets/generic/mobile.scss @@ -24,13 +24,6 @@ display: none !important; } - .project-home-panel { - .star-fork-buttons { - padding-top: 10px; - padding-right: 15px; - } - } - .project-home-links { display: none; } diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 6d55a5fa66e..9ad1be41579 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -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,23 +59,8 @@ 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 { - margin-left: 5px; - } - } + .btn-action-count { + margin-left: 5px; } } diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 7bf51b5b8e8..f535b01b2ec 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -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 diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index a295a0d6cdc..3bb70458b16 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -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 |