diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-05 16:45:53 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-05 16:45:53 +0300 |
commit | 040ee6f897c59d81b6221bc427b8b57f992f14e6 (patch) | |
tree | e1b0d43ae1515370a9f3f454da6b4609575851f5 | |
parent | 7da7a790fa467aa1e3ad4ffc6c823c768590dcbd (diff) |
Reorganize elements in project sidebar
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/assets/stylesheets/pages/projects.scss | 17 | ||||
-rw-r--r-- | app/views/layouts/_head_panel.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/_aside.html.haml | 74 | ||||
-rw-r--r-- | app/views/projects/_dropdown.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/_home_panel.html.haml | 5 |
5 files changed, 56 insertions, 47 deletions
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index e98570d88c2..336b511f41d 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -45,11 +45,6 @@ } } - .project-home-dropdown { - margin-left: 10px; - float: right; - } - .project-home-row { @extend .clearfix; margin-bottom: 15px; @@ -81,7 +76,7 @@ margin-top: -3px; position: absolute; right: 0; - width: 260px; + width: 265px; text-align: right; .btn { @@ -317,3 +312,13 @@ table.table.protected-branches-list tr.no-border { float: left; margin-right: 10px; } + +.project-home-dropdown { + margin-top: 8px; + + a { + padding: 4px 10px; + color: #888; + border-color: #ddd; + } +} diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 3329a712430..9400ac223c9 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -12,6 +12,11 @@ .navbar-collapse.collapse %ul.nav.navbar-nav + + - if @project && @repository + %li + .project-home-dropdown + = render "projects/dropdown" %li.hidden-sm.hidden-xs = render 'layouts/search' %li.visible-sm.visible-xs diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index d3ddfa2f33b..e2b00a78953 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -1,4 +1,24 @@ .clearfix + .append-bottom-20 + = render "shared/clone_panel" + + - unless @project.empty_repo? + .well + %h4 Repository + %ul.nav.nav-pills + %li= link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) + %li= link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), namespace_project_branches_path(@project.namespace, @project) + %li= link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), namespace_project_tags_path(@project.namespace, @project) + + %hr + = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-sm' do + %i.fa.fa-exchange + Compare code + + - if can?(current_user, :download_code, @project) + + = render 'projects/repositories/download_archive', split_button: true, btn_class: 'btn-group-sm' + - unless @project.empty_repo? .well %h4 Contribute @@ -20,22 +40,7 @@ %i.fa.fa-fw.fa-exclamation-circle New issue - .well - %h4 Repository - %ul.nav.nav-pills - %li= link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) - %li= link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), namespace_project_branches_path(@project.namespace, @project) - %li= link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), namespace_project_tags_path(@project.namespace, @project) - %hr - = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-sm' do - %i.fa.fa-exchange - Compare code - - if can?(current_user, :download_code, @project) - - = render 'projects/repositories/download_archive', split_button: true, btn_class: 'btn-group-sm' - .append-bottom-20 - = render "shared/clone_panel" - if @project.archived? .alert.alert-warning @@ -51,24 +56,23 @@ %br = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project) - -#- unless @project.empty_repo? - -#- if version = @repository.version - - detail_url = changelog_url(@project) || version_url(@project) - = link_to detail_url, class: 'btn btn-block' do - %i.fa.fa-file-text-o - Version: - %span.count - = @repository.blob_by_oid(version.id).data - - -.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' +- if version = @repository.version + .well + %h4 + Version + .pull-right + = link_to version_url(@project) do + = @repository.blob_by_oid(version.id).data +.well + %h4 + CI + .pull-right + - @project.ci_services.each do |ci_service| + - if ci_service.active? && ci_service.respond_to?(:builds_path) + - 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' diff --git a/app/views/projects/_dropdown.html.haml b/app/views/projects/_dropdown.html.haml index 3036f11bb2d..d623a3716ed 100644 --- a/app/views/projects/_dropdown.html.haml +++ b/app/views/projects/_dropdown.html.haml @@ -1,6 +1,6 @@ - if current_user .dropdown.pull-right - %a.dropdown-toggle.btn.btn-new{href: '#', "data-toggle" => "dropdown"} + %a.dropdown-toggle.btn.btn-sm{href: '#', "data-toggle" => "dropdown"} %i.fa.fa-bars %ul.dropdown-menu - if @project.issues_enabled && can?(current_user, :write_issue, @project) diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 32b1fab61e9..89582d2e3ba 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -35,9 +35,4 @@ - 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 - %hr - -#.project-home-row.hidden-xs - - if current_user && !empty_repo - .project-home-dropdown - = render "dropdown" |