From 71a1689fec04093b1ee3455a11527efe93b207a6 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 9 May 2015 23:16:33 +0200 Subject: [PATCH 1/5] Add icons to more tabs. --- app/views/projects/_section.html.haml | 2 ++ app/views/projects/commits/_head.html.haml | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/projects/_section.html.haml b/app/views/projects/_section.html.haml index 0b7f4cb780a..f4f876f3809 100644 --- a/app/views/projects/_section.html.haml +++ b/app/views/projects/_section.html.haml @@ -1,10 +1,12 @@ %ul.nav.nav-tabs %li.active = link_to '#tab-activity', 'data-toggle' => 'tab' do + = icon("tachometer") Activity - if @repository.readme %li = link_to '#tab-readme', 'data-toggle' => 'tab' do + = icon("file-text-o") Readme .tab-content .tab-pane.active#tab-activity diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index 66101f3f0da..66261c7336d 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -1,17 +1,22 @@ %ul.nav.nav-tabs = nav_link(controller: [:commit, :commits]) do = link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) do + = icon("history") Commits %span.badge= number_with_precision(@repository.commit_count, precision: 0, delimiter: ',') = nav_link(controller: :compare) do - = link_to 'Compare', namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref) + = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref) do + = icon("exchange") + Compare = nav_link(html_options: {class: branches_tab_class}) do = link_to namespace_project_branches_path(@project.namespace, @project) do + = icon("code-fork") Branches %span.badge.js-totalbranch-count= @repository.branches.size = nav_link(controller: :tags) do = link_to namespace_project_tags_path(@project.namespace, @project) do + = icon("tags") Tags %span.badge.js-totaltags-count= @repository.tags.length From e9dff9f4103506d22a7044d2b721b74c4d0b510a Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 9 May 2015 23:17:05 +0200 Subject: [PATCH 2/5] Fix alignment of ref picker, breadcrumb and buttons. --- app/assets/stylesheets/pages/commits.scss | 4 ---- app/assets/stylesheets/pages/projects.scss | 3 ++- app/assets/stylesheets/pages/tree.scss | 8 -------- app/views/projects/tree/show.html.haml | 2 +- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/pages/commits.scss b/app/assets/stylesheets/pages/commits.scss index 84361e15481..359f4073e87 100644 --- a/app/assets/stylesheets/pages/commits.scss +++ b/app/assets/stylesheets/pages/commits.scss @@ -29,10 +29,6 @@ .commits-feed-holder { float: right; - - .btn { - padding: 4px 12px; - } } li.commit { diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 5a8d4665294..224aea2db59 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -249,7 +249,8 @@ ul.nav.nav-projects-tabs { } .breadcrumb.repo-breadcrumb { - padding: 2px 0; + padding: 0; + line-height: 34px; background: white; border: none; font-size: 16px; diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss index 57f63b52aa1..34ee4d7b31e 100644 --- a/app/assets/stylesheets/pages/tree.scss +++ b/app/assets/stylesheets/pages/tree.scss @@ -106,17 +106,9 @@ } } -.tree-download-holder .btn { - padding: 4px 12px; -} - .tree-ref-holder { float: left; margin-right: 15px; - - .select2-container .select2-choice, .select2-container.select2-drop-above .select2-choice { - padding: 4px 12px; - } } .readme-holder { diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml index 72916cad182..04590f65b27 100644 --- a/app/views/projects/tree/show.html.haml +++ b/app/views/projects/tree/show.html.haml @@ -8,7 +8,7 @@ - if can? current_user, :download_code, @project .tree-download-holder - = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group-sm pull-right hidden-xs hidden-sm', split_button: true + = render 'projects/repositories/download_archive', ref: @ref, btn_class: 'btn-group pull-right hidden-xs hidden-sm', split_button: true #tree-holder.tree-holder.clearfix = render "tree", tree: @tree From bfe23847977376e3b89d98f17e0b3fd0fa2ddd77 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 9 May 2015 23:43:15 +0200 Subject: [PATCH 3/5] Restructure project sidebar. --- app/helpers/icons_helper.rb | 6 +- app/views/projects/_aside.html.haml | 148 +++++++++++++++------------- 2 files changed, 85 insertions(+), 69 deletions(-) diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb index a9030729b48..a730684f8f3 100644 --- a/app/helpers/icons_helper.rb +++ b/app/helpers/icons_helper.rb @@ -26,15 +26,15 @@ module IconsHelper end def public_icon - icon('globe') + icon('globe fw') end def internal_icon - icon('shield') + icon('shield fw') end def private_icon - icon('lock') + icon('lock fw') end def file_type_icon_class(type, mode, name) diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index 1241b51f9ac..8044906dbf4 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -1,85 +1,101 @@ .clearfix - .append-bottom-20 - = render "shared/clone_panel" - - unless @project.empty_repo? .well %h4.visibility-level-label = visibility_level_icon(@project.visibility_level) = "#{visibility_level_label(@project.visibility_level).capitalize} project" - %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) + + - if @repository.changelog || @repository.license || @repository.contribution_guide + %ul.nav.nav-pills + - if @repository.changelog + %li.hidden-xs + = link_to changelog_url(@project) do + = icon("list-alt fw") + Changelog + - if @repository.license + %li + = link_to license_url(@project) do + = icon("check-circle-o fw") + License + - if @repository.contribution_guide + %li + = link_to contribution_guide_url(@project) do + = icon("info-circle fw") + Contribution guide .actions - = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-sm' do + - if can? current_user, :write_issue, @project + = link_to url_for_new_issue(@project, only_path: true), title: "New Issue", class: 'btn btn-sm append-right-10' do + = icon("exclamation-circle fw") + New Issue + - if can? current_user, :write_merge_request, @project + = link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-sm", title: "New Merge Request" do + = icon("plus fw") + New Merge Request + + - if version = @repository.version + .well + %h4 + = icon("clock-o fw") + Version + .pull-right + = link_to version_url(@project) do + = @repository.blob_by_oid(version.id).data + + - if forked_from_project = @project.forked_from_project + .well + %h4 + = icon("code-fork fw") + Forked from + .pull-right + = link_to forked_from_project.namespace.try(:name), project_path(forked_from_project) + + - @project.ci_services.each do |ci_service| + - if ci_service.active? && ci_service.respond_to?(:builds_path) + .well + %h4 + = icon("check fw") + = ci_service.title + .pull-right + - 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 + = link_to 'view builds', ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' + + - unless @project.empty_repo? + .well + %h4 + = icon("archive fw") + Repository + + %ul.nav.nav-pills + %li + = link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) do + = icon("history fw") + = pluralize(number_with_delimiter(@repository.commit_count), 'commit') + %li + = link_to namespace_project_branches_path(@project.namespace, @project) do + = icon("code-fork fw") + = pluralize(number_with_delimiter(@repository.branch_names.count), 'branch') + %li + = link_to namespace_project_tags_path(@project.namespace, @project) do + = icon("tags fw") + = pluralize(number_with_delimiter(@repository.tag_names.count), 'tag') + + = render "shared/clone_panel" + + .actions.prepend-top-10 + = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-sm append-right-10' 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 - %ul.nav.nav-pills - - if @repository.changelog - %li.hidden-xs - = link_to changelog_url(@project) do - Changelog - - if @repository.contribution_guide - %li.hidden-xs - = link_to contribution_guide_url(@project) do - Contribution guide - - if @repository.license - %li - = link_to license_url(@project) do - License - .actions - = link_to url_for_new_issue(@project, only_path: true), title: "New Issue", class: 'btn btn-sm' do - %i.fa.fa-fw.fa-exclamation-circle - New issue - - if can? current_user, :write_merge_request, @project -   - = link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-sm", title: "New Merge Request" do - %i.fa.fa-plus - New Merge Request - - - - if @project.archived? .alert.alert-warning %h4 - %i.fa.fa-exclamation-triangle + = icon("exclamation-triangle fw") Archived project! %p Repository is read-only - - - if @project.forked_from_project - .well - %h4 - Forked from - .pull-right - = link_to @project.forked_from_project.namespace.try(:name), project_path(@project.forked_from_project) - - -- if version = @repository.version - .well - %h4 - Version - .pull-right - = link_to version_url(@project) do - = @repository.blob_by_oid(version.id).data - -- @project.ci_services.each do |ci_service| - - if ci_service.active? && ci_service.respond_to?(:builds_path) - .well - %h4 - = ci_service.title - .pull-right - - 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 - = link_to 'view builds', ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' From a5ce66d83637734f79bc61c7d1bf7c71e3d26afc Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 12 May 2015 10:28:56 +0200 Subject: [PATCH 4/5] Move clone panel to bottom of project sidebar. --- app/views/projects/_aside.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index 8044906dbf4..5edec7fe65c 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -83,9 +83,7 @@ = icon("tags fw") = pluralize(number_with_delimiter(@repository.tag_names.count), 'tag') - = render "shared/clone_panel" - - .actions.prepend-top-10 + .actions = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-sm append-right-10' do %i.fa.fa-exchange Compare code @@ -93,6 +91,8 @@ - if can?(current_user, :download_code, @project) = render 'projects/repositories/download_archive', split_button: true, btn_class: 'btn-group-sm' + = render "shared/clone_panel" + - if @project.archived? .alert.alert-warning %h4 From 4346c39ba9578169e218ccae47501612051e6f04 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 12 May 2015 10:29:59 +0200 Subject: [PATCH 5/5] Move "Forked from" above "Version". --- app/views/projects/_aside.html.haml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index 5edec7fe65c..c2f56996ba8 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -28,11 +28,20 @@ = link_to url_for_new_issue(@project, only_path: true), title: "New Issue", class: 'btn btn-sm append-right-10' do = icon("exclamation-circle fw") New Issue + - if can? current_user, :write_merge_request, @project = link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-sm", title: "New Merge Request" do = icon("plus fw") New Merge Request + - if forked_from_project = @project.forked_from_project + .well + %h4 + = icon("code-fork fw") + Forked from + .pull-right + = link_to forked_from_project.namespace.try(:name), project_path(forked_from_project) + - if version = @repository.version .well %h4 @@ -42,14 +51,6 @@ = link_to version_url(@project) do = @repository.blob_by_oid(version.id).data - - if forked_from_project = @project.forked_from_project - .well - %h4 - = icon("code-fork fw") - Forked from - .pull-right - = link_to forked_from_project.namespace.try(:name), project_path(forked_from_project) - - @project.ci_services.each do |ci_service| - if ci_service.active? && ci_service.respond_to?(:builds_path) .well