diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2017-03-02 17:57:01 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-03-02 17:57:01 +0000 |
commit | 52352be6be357d30be9760d5b442e97806eb0e10 (patch) | |
tree | d82f3f157d50ca3a59edbd1834ea65aa54d6bc38 /app/views/projects | |
parent | f14ee823d703119aed8500f3cd868f12bcd103bc (diff) | |
download | gitlab-ce-52352be6be357d30be9760d5b442e97806eb0e10.tar.gz |
Cleaning up navigational order - Project
Diffstat (limited to 'app/views/projects')
18 files changed, 137 insertions, 122 deletions
diff --git a/app/views/projects/_activity.html.haml b/app/views/projects/_activity.html.haml index aa0cb3e1a50..fb990dd9592 100644 --- a/app/views/projects/_activity.html.haml +++ b/app/views/projects/_activity.html.haml @@ -1,4 +1,5 @@ - @no_container = true += render "projects/head" %div{ class: container_class } .nav-block.activity-filter-block diff --git a/app/views/projects/_head.html.haml b/app/views/projects/_head.html.haml new file mode 100644 index 00000000000..db08b77c8e0 --- /dev/null +++ b/app/views/projects/_head.html.haml @@ -0,0 +1,20 @@ += content_for :sub_nav do + .scrolling-tabs-container.sub-nav-scroll + = render 'shared/nav_scroll' + .nav-links.sub-nav.scrolling-tabs + %ul{ class: container_class } + = nav_link(path: 'projects#show') do + = link_to project_path(@project), title: 'Project home', class: 'shortcuts-project' do + %span + Home + + = nav_link(path: 'projects#activity') do + = link_to activity_project_path(@project), title: 'Activity', class: 'shortcuts-project-activity' do + %span + Activity + + - if can?(current_user, :read_cycle_analytics, @project) + = nav_link(path: 'cycle_analytics#show') do + = link_to project_cycle_analytics_path(@project), title: 'Cycle Analytics', class: 'shortcuts-project-cycle-analytics' do + %span + Cycle Analytics diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index 80763ce67ca..dd6797f10c0 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -11,14 +11,6 @@ = link_to namespace_project_commits_path(@project.namespace, @project, current_ref) do Commits - = nav_link(controller: %w(network)) do - = link_to namespace_project_network_path(@project.namespace, @project, current_ref) do - Network - - = nav_link(controller: :compare) do - = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: current_ref) do - Compare - = nav_link(html_options: {class: branches_tab_class}) do = link_to namespace_project_branches_path(@project.namespace, @project) do Branches @@ -26,3 +18,19 @@ = nav_link(controller: [:tags, :releases]) do = link_to namespace_project_tags_path(@project.namespace, @project) do Tags + + = nav_link(path: 'graphs#show') do + = link_to namespace_project_graph_path(@project.namespace, @project, current_ref) do + Contributors + + = nav_link(controller: %w(network)) do + = link_to namespace_project_network_path(@project.namespace, @project, current_ref) do + Graph + + = nav_link(controller: :compare) do + = link_to namespace_project_compare_index_path(@project.namespace, @project, from: @repository.root_ref, to: current_ref) do + Compare + + = nav_link(path: 'graphs#charts') do + = link_to charts_namespace_project_graph_path(@project.namespace, @project, current_ref) do + Charts diff --git a/app/views/projects/cycle_analytics/show.html.haml b/app/views/projects/cycle_analytics/show.html.haml index 5405ff16bea..be17f2c764e 100644 --- a/app/views/projects/cycle_analytics/show.html.haml +++ b/app/views/projects/cycle_analytics/show.html.haml @@ -3,7 +3,7 @@ - content_for :page_specific_javascripts do = page_specific_javascript_bundle_tag('cycle_analytics') -= render "projects/pipelines/head" += render "projects/head" #cycle-analytics{ class: container_class, "v-cloak" => "true", data: { request_path: project_cycle_analytics_path(@project) } } - if @cycle_analytics_no_data diff --git a/app/views/projects/graphs/_head.html.haml b/app/views/projects/graphs/_head.html.haml deleted file mode 100644 index 67018aaa2ac..00000000000 --- a/app/views/projects/graphs/_head.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -= content_for :sub_nav do - .scrolling-tabs-container.sub-nav-scroll - = render 'shared/nav_scroll' - .nav-links.sub-nav.scrolling-tabs - %ul{ class: (container_class) } - - - content_for :page_specific_javascripts do - = page_specific_javascript_bundle_tag('lib_chart') - = page_specific_javascript_bundle_tag('graphs') - = nav_link(action: :show) do - = link_to 'Contributors', namespace_project_graph_path - = nav_link(action: :commits) do - = link_to 'Commits', commits_namespace_project_graph_path - = nav_link(action: :languages) do - = link_to 'Languages', languages_namespace_project_graph_path - - if @project.feature_available?(:builds, current_user) - = nav_link(action: :ci) do - = link_to ci_namespace_project_graph_path do - Continuous Integration diff --git a/app/views/projects/graphs/commits.html.haml b/app/views/projects/graphs/charts.html.haml index c8a82f7bca3..d3bce45e974 100644 --- a/app/views/projects/graphs/commits.html.haml +++ b/app/views/projects/graphs/charts.html.haml @@ -1,38 +1,58 @@ - @no_container = true -- page_title "Commits", "Graphs" -= render 'head' +- page_title "Charts" +- content_for :page_specific_javascripts do + = page_specific_javascript_bundle_tag('lib_chart') + = page_specific_javascript_bundle_tag('graphs') += render "projects/commits/head" -%div{ class: container_class } - .sub-header-block - .tree-ref-holder - = render 'shared/ref_switcher', destination: 'graphs_commits' - %ul.breadcrumb.repo-breadcrumb - = commits_breadcrumbs +.repo-charts{ class: container_class } + %h4.sub-header + Programming languages used in this repository - %p.lead - Commit statistics for - %strong= @ref - #{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')} + .row + .col-md-4 + %ul.bordered-list + - @languages.each do |language| + %li + %span{ style: "color: #{language[:color]}" } + = icon('circle') + + = language[:label] + .pull-right + = language[:value] + \% + .col-md-8 + %canvas#languages-chart{ height: 400 } + +.repo-charts{ class: container_class } + .sub-header-block.border-top + + .row.tree-ref-header + .col-md-6 + %h4 + Commit statistics for + %strong= @ref + #{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')} + + .col-md-6 + .tree-ref-container + .tree-ref-holder + = render 'shared/ref_switcher', destination: 'graphs_commits' + %ul.breadcrumb.repo-breadcrumb + = commits_breadcrumbs .row .col-md-6 - %ul + %ul.commit-stats %li - %p.lead - %strong= @commits_graph.commits.size - commits during - %strong= @commits_graph.duration - days + Total: + %strong #{@commits_graph.commits.size} commits %li - %p.lead - Average - %strong= @commits_graph.commit_per_day - commits per day + Average per day: + %strong #{@commits_graph.commit_per_day} commits %li - %p.lead - Contributed by - %strong= @commits_graph.authors - authors + Authors: + %strong= @commits_graph.authors .col-md-6 %div %p.slead @@ -40,15 +60,18 @@ %canvas#month-chart .row .col-md-6 - %div - %p.slead - Commits per day hour (UTC) - %canvas#hour-chart .col-md-6 %div %p.slead Commits per weekday %canvas#weekday-chart + .row + .col-md-6 + .col-md-6 + %div + %p.slead + Commits per day hour (UTC) + %canvas#hour-chart :javascript var responsiveChart = function (selector, data) { @@ -93,3 +116,12 @@ var monthData = chartData(#{@commits_per_month.keys.to_json}, #{@commits_per_month.values.to_json}); responsiveChart($('#month-chart'), monthData); + + var data = #{@languages.to_json}; + var ctx = $("#languages-chart").get(0).getContext("2d"); + var options = { + scaleOverlay: true, + responsive: true, + maintainAspectRatio: false + } + var myPieChart = new Chart(ctx).Pie(data, options); diff --git a/app/views/projects/graphs/ci.html.haml b/app/views/projects/graphs/ci.html.haml deleted file mode 100644 index 6be4273b6ab..00000000000 --- a/app/views/projects/graphs/ci.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -- @no_container = true -- page_title "Continuous Integration", "Graphs" -= render 'head' - -%div{ class: container_class } - .sub-header-block - .oneline - A collection of graphs for Continuous Integration - - #charts.ci-charts - .row - .col-md-6 - = render 'projects/graphs/ci/overall' - .col-md-6 - = render 'projects/graphs/ci/build_times' - - %hr - = render 'projects/graphs/ci/builds' diff --git a/app/views/projects/graphs/languages.html.haml b/app/views/projects/graphs/languages.html.haml deleted file mode 100644 index fcfcae0be20..00000000000 --- a/app/views/projects/graphs/languages.html.haml +++ /dev/null @@ -1,33 +0,0 @@ -- @no_container = true -- page_title "Languages", "Graphs" -= render 'head' - -%div{ class: container_class } - .sub-header-block - .oneline - Programming languages used in this repository - - .row - .col-md-8 - %canvas#languages-chart{ height: 400 } - .col-md-4 - %ul.bordered-list - - @languages.each do |language| - %li - %span{ style: "color: #{language[:color]}" } - = icon('circle') - - = language[:label] - .pull-right - = language[:value] - \% - -:javascript - var data = #{@languages.to_json}; - var ctx = $("#languages-chart").get(0).getContext("2d"); - var options = { - scaleOverlay: true, - responsive: true, - maintainAspectRatio: false - } - var myPieChart = new Chart(ctx).Pie(data, options); diff --git a/app/views/projects/graphs/show.html.haml b/app/views/projects/graphs/show.html.haml index 5ebb939a109..d89dfe31e47 100644 --- a/app/views/projects/graphs/show.html.haml +++ b/app/views/projects/graphs/show.html.haml @@ -1,6 +1,9 @@ - @no_container = true -- page_title "Contributors", "Graphs" -= render 'head' +- page_title "Contributors" +- content_for :page_specific_javascripts do + = page_specific_javascript_bundle_tag('lib_chart') + = page_specific_javascript_bundle_tag('graphs') += render 'projects/commits/head' %div{ class: container_class } .sub-header-block diff --git a/app/views/projects/issues/_head.html.haml b/app/views/projects/issues/_head.html.haml index 4825820c4d9..7a188cb6445 100644 --- a/app/views/projects/issues/_head.html.haml +++ b/app/views/projects/issues/_head.html.haml @@ -7,7 +7,7 @@ = nav_link(controller: :issues) do = link_to namespace_project_issues_path(@project.namespace, @project), title: 'Issues' do %span - Issues + List = nav_link(controller: :boards) do = link_to namespace_project_boards_path(@project.namespace, @project), title: 'Board' do diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index 83e6c026ba7..8a96c8dacf6 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -2,7 +2,6 @@ - @bulk_edit = can?(current_user, :admin_merge_request, @project) - page_title "Merge Requests" -= render "projects/issues/head" = render 'projects/last_push' - content_for :page_specific_javascripts do diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index b88eef65cef..a4a24a217d3 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -1,4 +1,4 @@ -- page_title "Network", @ref +- page_title "Graph", @ref - content_for :page_specific_javascripts do = page_specific_javascript_tag('lib/raphael.js') = page_specific_javascript_bundle_tag('network') diff --git a/app/views/projects/pipelines/_head.html.haml b/app/views/projects/pipelines/_head.html.haml index 721a9b6beb5..a5acb7ac4a5 100644 --- a/app/views/projects/pipelines/_head.html.haml +++ b/app/views/projects/pipelines/_head.html.haml @@ -4,25 +4,25 @@ .nav-links.sub-nav.scrolling-tabs{ class: ('build' if local_assigns.fetch(:build_subnav, false)) } %ul{ class: (container_class) } - if project_nav_tab? :pipelines - = nav_link(controller: :pipelines) do + = nav_link(path: 'pipelines#index', controller: :pipelines) do = link_to project_pipelines_path(@project), title: 'Pipelines', class: 'shortcuts-pipelines' do %span Pipelines - if project_nav_tab? :builds - = nav_link(controller: %w(builds)) do + = nav_link(path: 'builds#index', controller: :builds) do = link_to project_builds_path(@project), title: 'Jobs', class: 'shortcuts-builds' do %span Jobs - if project_nav_tab? :environments - = nav_link(controller: %w(environments)) do + = nav_link(path: 'environments#index', controller: :environments) do = link_to project_environments_path(@project), title: 'Environments', class: 'shortcuts-environments' do %span Environments - - if can?(current_user, :read_cycle_analytics, @project) - = nav_link(controller: %w(cycle_analytics)) do - = link_to project_cycle_analytics_path(@project), title: 'Cycle Analytics' do + - if @project.feature_available?(:builds, current_user) && !@project.empty_repo? + = nav_link(path: 'pipelines#charts') do + = link_to charts_namespace_project_pipelines_path(@project.namespace, @project), title: 'Charts', class: 'shortcuts-pipelines-charts' do %span - Cycle Analytics + Charts diff --git a/app/views/projects/pipelines/charts.html.haml b/app/views/projects/pipelines/charts.html.haml new file mode 100644 index 00000000000..8ffdfa1a2cf --- /dev/null +++ b/app/views/projects/pipelines/charts.html.haml @@ -0,0 +1,21 @@ +- @no_container = true +- page_title "Charts", "Pipelines" +- content_for :page_specific_javascripts do + = page_specific_javascript_bundle_tag('lib_chart') + = page_specific_javascript_bundle_tag('graphs') += render 'head' + +%div{ class: container_class } + .sub-header-block + .oneline + A collection of graphs for Continuous Integration + + #charts.ci-charts + .row + .col-md-6 + = render 'projects/pipelines/charts/overall' + .col-md-6 + = render 'projects/pipelines/charts/build_times' + + %hr + = render 'projects/pipelines/charts/builds' diff --git a/app/views/projects/graphs/ci/_build_times.haml b/app/views/projects/pipelines/charts/_build_times.haml index bb0975a9535..bb0975a9535 100644 --- a/app/views/projects/graphs/ci/_build_times.haml +++ b/app/views/projects/pipelines/charts/_build_times.haml diff --git a/app/views/projects/graphs/ci/_builds.haml b/app/views/projects/pipelines/charts/_builds.haml index b6f453b9736..b6f453b9736 100644 --- a/app/views/projects/graphs/ci/_builds.haml +++ b/app/views/projects/pipelines/charts/_builds.haml diff --git a/app/views/projects/graphs/ci/_overall.haml b/app/views/projects/pipelines/charts/_overall.haml index edc4f7b079f..edc4f7b079f 100644 --- a/app/views/projects/graphs/ci/_overall.haml +++ b/app/views/projects/pipelines/charts/_overall.haml diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index e3d8daf5066..30d185e6556 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -8,7 +8,8 @@ = render 'shared/no_ssh' = render 'shared/no_password' -= render 'projects/last_push' += render "projects/head" += render "projects/last_push" = render "home_panel" - if current_user && can?(current_user, :download_code, @project) |