From 04e365ebb761d56f2269452caa7206957afacb1a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 11:23:25 +0300 Subject: Move project sidebar to separate partial Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_aside.html.haml | 54 +++++++++++++++++++++++++++++++++++++ app/views/projects/show.html.haml | 54 +------------------------------------ 2 files changed, 55 insertions(+), 53 deletions(-) create mode 100644 app/views/projects/_aside.html.haml diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml new file mode 100644 index 00000000000..c68478c20f1 --- /dev/null +++ b/app/views/projects/_aside.html.haml @@ -0,0 +1,54 @@ +.clearfix + - if @project.archived? + .alert.alert-warning + %h4 + %i.fa.fa-exclamation-triangle + Archived project! + %p Repository is read-only + + - if @project.forked_from_project + .well + %i.fa.fa-code-fork.project-fork-icon + Forked from: + %br + = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project) + + - unless @project.empty_repo? + = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-block' 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-block' + + - 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.append-bottom-10 + %p + %span.light Created on + #{@project.created_at.stamp('Aug 22, 2013')} + %p + %span.light Owned by #{@project.group ? "the" : nil} + - if @project.group + #{link_to @project.group.name, @project.group} group + - else + #{link_to @project.owner_name, @project.owner} + + +.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' + diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index cd18ae0c8da..5cf2b73600c 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -56,59 +56,7 @@ .content_list = spinner %aside.col-md-3.project-side - .clearfix - - if @project.archived? - .alert.alert-warning - %h4 - %i.fa.fa-exclamation-triangle - Archived project! - %p Repository is read-only - - - if @project.forked_from_project - .well - %i.fa.fa-code-fork.project-fork-icon - Forked from: - %br - = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project) - - - unless @project.empty_repo? - = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-block' 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-block' - - - 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.append-bottom-10 - %p - %span.light Created on - #{@project.created_at.stamp('Aug 22, 2013')} - %p - %span.light Owned by #{@project.group ? "the" : nil} - - if @project.group - #{link_to @project.group.name, @project.group} group - - else - #{link_to @project.owner_name, @project.owner} - - - .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' + = render 'aside' - if readme = @repository.readme .tab-pane#tab-readme -- cgit v1.2.1 From 31e5cd214ec6c50be440c4dfc093952b7f13a4b0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 11:26:27 +0300 Subject: Move project section to own partial Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_section.html.haml | 15 +++++++++++++++ app/views/projects/show.html.haml | 15 +-------------- 2 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 app/views/projects/_section.html.haml diff --git a/app/views/projects/_section.html.haml b/app/views/projects/_section.html.haml new file mode 100644 index 00000000000..3e7a5ae3c22 --- /dev/null +++ b/app/views/projects/_section.html.haml @@ -0,0 +1,15 @@ +.hidden-xs + = render "events/event_last_push", event: @last_push + + - if current_user + %ul.nav.nav-pills.event_filter.pull-right + %li + = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'rss-btn' do + %i.fa.fa-rss + Activity Feed + + = render 'shared/event_filter' + %hr +.content_list += spinner + diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 5cf2b73600c..8132ac730c8 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -41,20 +41,7 @@ .row %section.col-md-9 - .hidden-xs - = render "events/event_last_push", event: @last_push - - - if current_user - %ul.nav.nav-pills.event_filter.pull-right - %li - = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'rss-btn' do - %i.fa.fa-rss - Activity Feed - - = render 'shared/event_filter' - %hr - .content_list - = spinner + = render 'section' %aside.col-md-3.project-side = render 'aside' -- cgit v1.2.1 From 3ce0557ab0ecf365423070e3bcf89224981701c3 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 11:29:52 +0300 Subject: Move tabs with activity/readme to section Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_section.html.haml | 43 +++++++++++++++------- app/views/projects/show.html.haml | 68 +++++++++++++---------------------- 2 files changed, 55 insertions(+), 56 deletions(-) diff --git a/app/views/projects/_section.html.haml b/app/views/projects/_section.html.haml index 3e7a5ae3c22..e6b04c5a34d 100644 --- a/app/views/projects/_section.html.haml +++ b/app/views/projects/_section.html.haml @@ -1,15 +1,34 @@ -.hidden-xs - = render "events/event_last_push", event: @last_push +%ul.nav.nav-tabs + %li.active + = link_to '#tab-activity', 'data-toggle' => 'tab' do + Activity + - if @repository.readme + %li + = link_to '#tab-readme', 'data-toggle' => 'tab' do + Readme +.tab-content + .tab-pane.active#tab-activity + .hidden-xs + = render "events/event_last_push", event: @last_push - - if current_user - %ul.nav.nav-pills.event_filter.pull-right - %li - = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'rss-btn' do - %i.fa.fa-rss - Activity Feed + - if current_user + %ul.nav.nav-pills.event_filter.pull-right + %li + = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'rss-btn' do + %i.fa.fa-rss + Activity Feed - = render 'shared/event_filter' - %hr -.content_list -= spinner + = render 'shared/event_filter' + %hr + .content_list + = spinner + - if readme = @repository.readme + .tab-pane#tab-readme + %article.readme-holder#README + = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do + %h4.readme-file-title + %i.fa.fa-file + = readme.name + .wiki + = render_readme(readme) diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 8132ac730c8..f54e5486e96 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -7,50 +7,30 @@ = render 'shared/no_password' = render "home_panel" -%ul.nav.nav-tabs - %li.active - = link_to '#tab-activity', 'data-toggle' => 'tab' do - Activity - - if @repository.readme - %li - = link_to '#tab-readme', 'data-toggle' => 'tab' do - Readme - - 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 +- 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 - .project-home-links - - unless @project.empty_repo? - = link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) - = link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), namespace_project_branches_path(@project.namespace, @project) - = link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), namespace_project_tags_path(@project.namespace, @project) - %span.light.prepend-left-20= repository_size +.project-home-links + - unless @project.empty_repo? + = link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) + = link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), namespace_project_branches_path(@project.namespace, @project) + = link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), namespace_project_tags_path(@project.namespace, @project) + %span.light.prepend-left-20= repository_size -.tab-content - .tab-pane.active#tab-activity - = render 'shared/show_aside' += render 'shared/show_aside' - .row - %section.col-md-9 - = render 'section' - %aside.col-md-3.project-side - = render 'aside' - - - if readme = @repository.readme - .tab-pane#tab-readme - %article.readme-holder#README - = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do - %h4.readme-file-title - %i.fa.fa-file - = readme.name - .wiki - = render_readme(readme) +.row + %section.col-md-8 + = render 'section' + %aside.col-md-4.project-side + = render 'aside' -- cgit v1.2.1 From 478a4b19dab663f65cabf0c02d3f72688cdf1ad2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 11:47:01 +0300 Subject: Turn sidebar in sections with contribute and repository Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/pages/projects.scss | 9 ------ app/views/projects/_aside.html.haml | 48 ++++++++++++++++++++++++------ app/views/projects/show.html.haml | 19 ------------ 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index c005470355e..36a8a230578 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -99,15 +99,6 @@ } } -.project-home-links { - padding: 10px 0px; - float: right; - a { - margin-left: 10px; - font-weight: 500; - } -} - .git-clone-holder { .project-home-dropdown + & { margin-right: 45px; diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index c68478c20f1..a5a570c0edb 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -1,4 +1,41 @@ .clearfix + - 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 + %hr + = 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 + + .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' + + -#%li + %span.light.prepend-left-20= repository_size - if @project.archived? .alert.alert-warning %h4 @@ -13,15 +50,8 @@ %br = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project) - - unless @project.empty_repo? - = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: @ref || @repository.root_ref), class: 'btn btn-block' 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-block' - - - if version = @repository.version + -#- 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 diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index f54e5486e96..d944b325952 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -7,25 +7,6 @@ = render 'shared/no_password' = render "home_panel" -- 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 - -.project-home-links - - unless @project.empty_repo? - = link_to pluralize(number_with_delimiter(@repository.commit_count), 'commit'), namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref) - = link_to pluralize(number_with_delimiter(@repository.branch_names.count), 'branch'), namespace_project_branches_path(@project.namespace, @project) - = link_to pluralize(number_with_delimiter(@repository.tag_names.count), 'tag'), namespace_project_tags_path(@project.namespace, @project) - %span.light.prepend-left-20= repository_size = render 'shared/show_aside' -- cgit v1.2.1 From 4adac0b4bee1447d87babea86e94a224e6a8b015 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 11:49:49 +0300 Subject: Remove unnecessary info from project home page Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_aside.html.haml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index a5a570c0edb..aeee5126431 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -59,17 +59,6 @@ %span.count = @repository.blob_by_oid(version.id).data -.prepend-top-10.append-bottom-10 - %p - %span.light Created on - #{@project.created_at.stamp('Aug 22, 2013')} - %p - %span.light Owned by #{@project.group ? "the" : nil} - - if @project.group - #{link_to @project.group.name, @project.group} group - - else - #{link_to @project.owner_name, @project.owner} - .prepend-top-10 - @project.ci_services.each do |ci_service| -- cgit v1.2.1 From 7da7a790fa467aa1e3ad4ffc6c823c768590dcbd Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 13:09:50 +0300 Subject: Move clone panel to sidebar Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/pages/projects.scss | 10 +++++----- app/views/projects/_aside.html.haml | 5 +++-- app/views/projects/_home_panel.html.haml | 4 ++-- app/views/projects/empty.html.haml | 2 ++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 36a8a230578..e98570d88c2 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -28,19 +28,19 @@ .project-identicon-holder { position: absolute; left: 0; + top: -20px; .avatar { - width: 70px; - height: 70px; + width: 60px; + height: 60px; } .identicon { - font-size: 45px; - line-height: 1.6; + font-size: 28px; + line-height: 60px; } .avatar, .identicon { - @include border-radius(4px); box-shadow: 0 1px 2px #ddd; } } diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index aeee5126431..d3ddfa2f33b 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -34,8 +34,9 @@   = render 'projects/repositories/download_archive', split_button: true, btn_class: 'btn-group-sm' - -#%li - %span.light.prepend-left-20= repository_size + .append-bottom-20 + = render "shared/clone_panel" + - if @project.archived? .alert.alert-warning %h4 diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 5689bdee1c6..32b1fab61e9 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -36,8 +36,8 @@ = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project", class: 'btn btn-sm btn-default' do = link_to_toggle_fork - .project-home-row.hidden-xs +%hr + -#.project-home-row.hidden-xs - if current_user && !empty_repo .project-home-dropdown = render "dropdown" - = render "shared/clone_panel" diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 4f8104e0792..8080a904978 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -13,6 +13,8 @@ add a file  or do a push via the command line. +.well + = render "shared/clone_panel" %h4 %strong Command line instructions %div.git-empty -- cgit v1.2.1 From 040ee6f897c59d81b6221bc427b8b57f992f14e6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 16:45:53 +0300 Subject: Reorganize elements in project sidebar Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/pages/projects.scss | 17 ++++--- app/views/layouts/_head_panel.html.haml | 5 ++ app/views/projects/_aside.html.haml | 74 ++++++++++++++++-------------- app/views/projects/_dropdown.html.haml | 2 +- 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" -- cgit v1.2.1 From 30c6dbe36d298ce0ee362502d7b4196f910f424e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 17:30:50 +0300 Subject: Show CI link on project home page only if CI enabled Signed-off-by: Dmitriy Zaporozhets --- app/views/projects/_aside.html.haml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index e2b00a78953..a5f127afc20 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -64,15 +64,15 @@ .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) + +- @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 - %span.light CI provided by - = link_to ci_service.title, ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' + = link_to 'view builds', ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' -- cgit v1.2.1 From ebcc810b9d8b6a88b22539fb1df05b131fa1b7cc Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 18:29:23 +0300 Subject: Remove project dropdown and fix db sche,a Signed-off-by: Dmitriy Zaporozhets --- app/views/layouts/_head_panel.html.haml | 5 ----- db/schema.rb | 28 ++-------------------------- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 9400ac223c9..3329a712430 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -12,11 +12,6 @@ .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/db/schema.rb b/db/schema.rb index f0cccb8b749..04abf9bb9a6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -350,10 +350,10 @@ ActiveRecord::Schema.define(version: 20150502064022) do t.string "import_url" t.integer "visibility_level", default: 0, null: false t.boolean "archived", default: false, null: false + t.string "avatar" t.string "import_status" t.float "repository_size", default: 0.0 t.integer "star_count", default: 0, null: false - t.string "avatar" t.string "import_type" t.string "import_source" end @@ -476,6 +476,7 @@ ActiveRecord::Schema.define(version: 20150502064022) do t.integer "notification_level", default: 1, null: false t.datetime "password_expires_at" t.integer "created_by_id" + t.datetime "last_credential_check_at" t.string "avatar" t.string "confirmation_token" t.datetime "confirmed_at" @@ -483,7 +484,6 @@ ActiveRecord::Schema.define(version: 20150502064022) do t.string "unconfirmed_email" t.boolean "hide_no_ssh_key", default: false t.string "website_url", default: "", null: false - t.datetime "last_credential_check_at" t.string "github_access_token" t.string "gitlab_access_token" t.string "notification_email" @@ -505,30 +505,6 @@ ActiveRecord::Schema.define(version: 20150502064022) do add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree add_index "users", ["username"], name: "index_users_on_username", using: :btree - create_table "users_groups", force: true do |t| - t.integer "group_access", null: false - t.integer "group_id", null: false - t.integer "user_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "notification_level", default: 3, null: false - end - - add_index "users_groups", ["user_id"], name: "index_users_groups_on_user_id", using: :btree - - create_table "users_projects", force: true do |t| - t.integer "user_id", null: false - t.integer "project_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "project_access", default: 0, null: false - t.integer "notification_level", default: 3, null: false - end - - add_index "users_projects", ["project_access"], name: "index_users_projects_on_project_access", using: :btree - add_index "users_projects", ["project_id"], name: "index_users_projects_on_project_id", using: :btree - add_index "users_projects", ["user_id"], name: "index_users_projects_on_user_id", using: :btree - create_table "users_star_projects", force: true do |t| t.integer "project_id", null: false t.integer "user_id", null: false -- cgit v1.2.1 From ac7b12c0e832d14faa0df82a4b0dc0b2e42f3b8b Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 18:34:05 +0300 Subject: Fix right margin for project description Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/pages/projects.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 336b511f41d..e523dc959c3 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -56,7 +56,7 @@ .project-home-desc { font-size: 16px; line-height: 1.3; - margin-right: 215px; + margin-right: 250px; } .project-home-desc { -- cgit v1.2.1 From 2a1be883c88f41eaa8ef494be91c234e17c08eff Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 18:34:49 +0300 Subject: Add changelog item Signed-off-by: Dmitriy Zaporozhets --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 671b41b26e2..ee63c00f366 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,7 +14,7 @@ v 7.11.0 (unreleased) - Redirect to sign in page after signing out. - Fix "Hello @username." references not working by no longer allowing usernames to end in period. - Fix "Revspec not found" errors when viewing diffs in a forked project with submodules (Stan Hu) - - + - Improve project page UI - Fix broken file browsing with relative submodule in personal projects (Stan Hu) - Fix DB error when trying to tag a repository (Stan Hu) - Add "Reply quoting selected text" shortcut key (`r`) -- cgit v1.2.1 From 3b0cf49f33aa972428113393ffc30279fb6857cb Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 19:25:18 +0300 Subject: Fix project description and avatar alignment Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/pages/projects.scss | 84 +++++++----------------------- app/views/layouts/_head_panel.html.haml | 3 +- app/views/projects/_home_panel.html.haml | 7 ++- app/views/projects/show.html.haml | 1 - 4 files changed, 25 insertions(+), 70 deletions(-) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index e523dc959c3..0ab096112cf 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -17,31 +17,25 @@ .project-home-panel { margin-bottom: 20px; position: relative; - padding-left: 85px; - - &.empty-project { - border-bottom: 0px; - padding-bottom: 15px; - margin-bottom: 0px; - } + padding-left: 65px; + border-bottom: 1px solid #DDD; + padding-bottom: 10px; + padding-top: 5px; + min-height: 50px; .project-identicon-holder { position: absolute; left: 0; - top: -20px; + top: -10px; .avatar { - width: 60px; - height: 60px; + width: 50px; + height: 50px; } .identicon { - font-size: 28px; - line-height: 60px; - } - - .avatar, .identicon { - box-shadow: 0 1px 2px #ddd; + font-size: 26px; + line-height: 50px; } } @@ -199,50 +193,22 @@ ul.nav.nav-projects-tabs { } .project-side { - .btn-block { - background-image: none; - - .btn, &.btn { - white-space: normal; - text-align: left; - padding: 10px 15px; - - &.dropdown-toggle { - text-align: center; - } - - &:hover { - background-color: #eee; - border-color: #DDD; - } - } - - .count { - float: right; - font-weight: 500; - text-shadow: 0 1px #FFF; - } - - &.btn-group-justified { - .btn { - width: 100%; - } - .dropdown-toggle { - width: 30px; - padding: 10px; - } - ul { - width: 100%; - } - } - } - .project-fork-icon { float: left; font-size: 26px; margin-right: 10px; line-height: 1.5; } + + .well { + h4 { + font-weight: normal; + } + + .nav-pills a { + padding: 10px; + } + } } .transfer-project .select2-container { @@ -312,13 +278,3 @@ 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..ef685a0434e 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -4,7 +4,8 @@ = link_to root_path, class: 'home', title: 'Dashboard', id: 'js-shortcuts-home', data: {toggle: 'tooltip', placement: 'bottom'} do = brand_header_logo %h3 GitLab - %h1.title= title + %h1.title + = title %button.navbar-toggle{type: 'button', data: {target: '.navbar-collapse', toggle: 'collapse'}} %span.sr-only Toggle navigation diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 89582d2e3ba..f9cdda4a3ba 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -1,5 +1,5 @@ - empty_repo = @project.empty_repo? -.project-home-panel{:class => ("empty-project" if empty_repo)} +.project-home-panel.clearfix{:class => ("empty-project" if empty_repo)} .project-identicon-holder = project_icon(@project, alt: '', class: 'avatar project-avatar') .project-home-row.project-home-row-top @@ -9,7 +9,7 @@ - if can?(current_user, :admin_project, @project) – = link_to 'Edit', edit_namespace_project_path - - elsif !@project.empty_repo? && @repository.readme + - elsif !empty_repo && @repository.readme - readme = @repository.readme – = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do @@ -26,7 +26,7 @@ Star %span.count = @project.star_count - - unless @project.empty_repo? + - unless empty_repo - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace .inline.fork-buttons.prepend-left-10 - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 @@ -35,4 +35,3 @@ - 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 diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index d944b325952..2259dea0865 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -7,7 +7,6 @@ = render 'shared/no_password' = render "home_panel" - = render 'shared/show_aside' .row -- cgit v1.2.1 From cecfbd55deaca45a61d970e2bea4e44eab2b3dc3 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 19:38:53 +0300 Subject: Restlye project sidebar a bit to make it more clear Signed-off-by: Dmitriy Zaporozhets --- app/assets/stylesheets/pages/projects.scss | 5 +++++ app/views/projects/_aside.html.haml | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index 0ab096112cf..afa8aa24ee4 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -203,11 +203,16 @@ ul.nav.nav-projects-tabs { .well { h4 { font-weight: normal; + margin: 0; } .nav-pills a { padding: 10px; } + + .nav { + margin: 10px 0; + } } } diff --git a/app/views/projects/_aside.html.haml b/app/views/projects/_aside.html.haml index a5f127afc20..1a7ab74c93a 100644 --- a/app/views/projects/_aside.html.haml +++ b/app/views/projects/_aside.html.haml @@ -10,14 +10,14 @@ %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 + .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 + %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' + - 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 @@ -35,10 +35,10 @@ %li = link_to license_url(@project) do License - %hr - = 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 + .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 -- cgit v1.2.1 From 16db90e5fc58e481dd67670525a35dc5a1870198 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 5 May 2015 21:43:33 +0300 Subject: Fix project test Signed-off-by: Dmitriy Zaporozhets --- features/steps/project/project.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index f14396bcfff..00706ab30e9 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -68,7 +68,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps step 'I should see project "Shop" version' do within '.project-side' do - page.should have_content 'Version: 6.7.0.pre' + page.should have_content '6.7.0.pre' end end -- cgit v1.2.1