Commit 1cc3d14a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch '18533-graphs-wiki-subnav' into 'master'

Resolve "Graphs and Wiki subnav"

## What does this MR do?
Styles sub nav in `Wiki` and `Graphs`

## What are the relevant issue numbers?
Closes #18533 

## Screenshots (if relevant)
![Screen_Shot_2016-06-15_at_9.32.43_AM](/uploads/111dae6e1b9c7d8038ac88b9be6f76a2/Screen_Shot_2016-06-15_at_9.32.43_AM.png)

cc @dzaporozhets 

See merge request !4678
parents 15516150 ff84cc0b
...@@ -149,6 +149,7 @@ v 8.9.0 (unreleased) ...@@ -149,6 +149,7 @@ v 8.9.0 (unreleased)
- Ensure Todos counters doesn't count Todos for projects pending delete - Ensure Todos counters doesn't count Todos for projects pending delete
- Add left/right arrows horizontal navigation - Add left/right arrows horizontal navigation
- Add tooltip to pin/unpin navbar - Add tooltip to pin/unpin navbar
- Add new sub nav style to Wiki and Graphs sub navigation
v 8.8.5 v 8.8.5
- Import GitHub repositories respecting the API rate limit !4166 - Import GitHub repositories respecting the API rate limit !4166
......
...@@ -111,10 +111,6 @@ ...@@ -111,10 +111,6 @@
width: 50%; width: 50%;
line-height: 28px; line-height: 28px;
&.wiki-page {
padding: 16px 10px 11px;
}
/* Small devices (phones, tablets, 768px and lower) */ /* Small devices (phones, tablets, 768px and lower) */
@media (max-width: $screen-sm-min) { @media (max-width: $screen-sm-min) {
width: 100%; width: 100%;
......
...@@ -14,19 +14,27 @@ ...@@ -14,19 +14,27 @@
font-size: 10px; font-size: 10px;
} }
#contributors-master {
@include make-md-column(12);
svg {
width: 100%;
}
}
#contributors { #contributors {
.contributors-list { .contributors-list {
margin: 0 0 10px; margin: 0 0 10px;
list-style: none; list-style: none;
padding: 0; padding: 0;
}
.person { svg {
&:nth-child(even) { width: 100%;
float: right;
} }
}
float: left; .person {
@include make-md-column(6);
margin-top: 10px; margin-top: 10px;
@media (max-width: $screen-sm-min) { @media (max-width: $screen-sm-min) {
......
- page_specific_javascripts asset_path("graphs/application.js") .nav-links.sub-nav
%ul.nav-links %ul{ class: (container_class) }
= nav_link(action: :show) do
= link_to 'Contributors', namespace_project_graph_path - page_specific_javascripts asset_path("graphs/application.js")
= nav_link(action: :commits) do = nav_link(action: :show) do
= link_to 'Commits', commits_namespace_project_graph_path = link_to 'Contributors', namespace_project_graph_path
= nav_link(action: :languages) do = nav_link(action: :commits) do
= link_to 'Languages', languages_namespace_project_graph_path = link_to 'Commits', commits_namespace_project_graph_path
- if @project.builds_enabled? = nav_link(action: :languages) do
= nav_link(action: :ci) do = link_to 'Languages', languages_namespace_project_graph_path
= link_to ci_namespace_project_graph_path do - if @project.builds_enabled?
Continuous Integration = nav_link(action: :ci) do
= link_to ci_namespace_project_graph_path do
Continuous Integration
- @no_container = true
- page_title "Continuous Integration", "Graphs" - page_title "Continuous Integration", "Graphs"
= render 'head' = render 'head'
.row-content-block.append-bottom-default
.oneline
A collection of graphs for Continuous Integration
#charts.ci-charts %div{ class: (container_class) }
.row .sub-header-block
.col-md-6 .oneline
= render 'projects/graphs/ci/overall' A collection of graphs for Continuous Integration
.col-md-6
= render 'projects/graphs/ci/build_times'
%hr #charts.ci-charts
= render 'projects/graphs/ci/builds' .row
.col-md-6
= render 'projects/graphs/ci/overall'
.col-md-6
= render 'projects/graphs/ci/build_times'
%hr
= render 'projects/graphs/ci/builds'
- @no_container = true
- page_title "Commits", "Graphs" - page_title "Commits", "Graphs"
= render 'head' = render 'head'
.row-content-block.append-bottom-default %div{ class: (container_class) }
.tree-ref-holder .sub-header-block
= render 'shared/ref_switcher', destination: 'graphs_commits' .tree-ref-holder
%ul.breadcrumb.repo-breadcrumb = render 'shared/ref_switcher', destination: 'graphs_commits'
= commits_breadcrumbs %ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
%p.lead %p.lead
Commit statistics for Commit statistics for
%strong #{@ref} %strong #{@ref}
#{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')} #{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')}
.row .row
.col-md-6 .col-md-6
%ul %ul
%li %li
%p.lead %p.lead
%strong #{@commits_graph.commits.size} %strong #{@commits_graph.commits.size}
commits during commits during
%strong #{@commits_graph.duration} %strong #{@commits_graph.duration}
days days
%li %li
%p.lead %p.lead
Average Average
%strong #{@commits_graph.commit_per_day} %strong #{@commits_graph.commit_per_day}
commits per day commits per day
%li %li
%p.lead %p.lead
Contributed by Contributed by
%strong #{@commits_graph.authors} %strong #{@commits_graph.authors}
authors authors
.col-md-6 .col-md-6
%div %div
%p.slead %p.slead
Commits per day of month Commits per day of month
%canvas#month-chart %canvas#month-chart
.row .row
.col-md-6 .col-md-6
%div %div
%p.slead %p.slead
Commits per day hour (UTC) Commits per day hour (UTC)
%canvas#hour-chart %canvas#hour-chart
.col-md-6 .col-md-6
%div %div
%p.slead %p.slead
Commits per weekday Commits per weekday
%canvas#weekday-chart %canvas#weekday-chart
:javascript :javascript
var responsiveChart = function (selector, data) { var responsiveChart = function (selector, data) {
......
- @no_container = true
- page_title "Languages", "Graphs" - page_title "Languages", "Graphs"
= render 'head' = render 'head'
.row-content-block.append-bottom-default %div{ class: (container_class) }
.oneline .sub-header-block
Programming languages used in this repository .oneline
Programming languages used in this repository
.row .row
.col-md-8 .col-md-8
%canvas#languages-chart{ height: 400 } %canvas#languages-chart{ height: 400 }
.col-md-4 .col-md-4
%ul.bordered-list %ul.bordered-list
- @languages.each do |language| - @languages.each do |language|
%li %li
%span{ style: "color: #{language[:color]}" } %span{ style: "color: #{language[:color]}" }
= icon('circle') = icon('circle')
   
= language[:label] = language[:label]
.pull-right .pull-right
= language[:value] = language[:value]
\% \%
:javascript :javascript
var data = #{@languages.to_json}; var data = #{@languages.to_json};
......
- @no_container = true
- page_title "Contributors", "Graphs" - page_title "Contributors", "Graphs"
= render 'head' = render 'head'
.row-content-block.append-bottom-default %div{ class: (container_class) }
.tree-ref-holder .sub-header-block
= render 'shared/ref_switcher', destination: 'graphs' .tree-ref-holder
%ul.breadcrumb.repo-breadcrumb = render 'shared/ref_switcher', destination: 'graphs'
= commits_breadcrumbs %ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
.loading-graph
.center .loading-graph
%h3.page-title .center
%i.fa.fa-spinner.fa-spin %h3.page-title
Building repository graph. %i.fa.fa-spinner.fa-spin
%p.slead Please wait a moment, this page will automatically refresh when ready. Building repository graph.
%p.slead Please wait a moment, this page will automatically refresh when ready.
.stat-graph.hide
.header.clearfix .stat-graph.hide
%h3#date_header.page-title .header.clearfix
%p.light %h3#date_header.page-title
Commits to #{@ref}, excluding merge commits. Limited to 6,000 commits. %p.light
%input#brush_change{:type => "hidden"} Commits to #{@ref}, excluding merge commits. Limited to 6,000 commits.
.graphs %input#brush_change{:type => "hidden"}
#contributors-master .graphs.row
#contributors.clearfix #contributors-master
%ol.contributors-list.clearfix #contributors.clearfix
%ol.contributors-list.clearfix
......
- if (@page && @page.persisted?) - if (@page && @page.persisted?)
- if can?(current_user, :create_wiki, @project)
= link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
New Page
= link_to namespace_project_wiki_history_path(@project.namespace, @project, @page), class: "btn" do = link_to namespace_project_wiki_history_path(@project.namespace, @project, @page), class: "btn" do
Page History Page History
- if can?(current_user, :create_wiki, @project) - if can?(current_user, :create_wiki, @project)
......
.top-area .nav-links.sub-nav
%ul.nav-links %ul{ class: (container_class) }
= nav_link(html_options: {class: params[:id] == 'home' ? 'active' : '' }) do = nav_link(html_options: {class: params[:id] == 'home' ? 'active' : '' }) do
= link_to 'Home', namespace_project_wiki_path(@project.namespace, @project, :home) = link_to 'Home', namespace_project_wiki_path(@project.namespace, @project, :home)
...@@ -10,9 +10,4 @@ ...@@ -10,9 +10,4 @@
= link_to namespace_project_wikis_git_access_path(@project.namespace, @project) do = link_to namespace_project_wikis_git_access_path(@project.namespace, @project) do
Git Access Git Access
.nav-controls = render 'projects/wikis/new'
- if can?(current_user, :create_wiki, @project)
= link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
New Page
= render 'projects/wikis/new'
%div#modal-new-wiki.modal - @no_container = true
.modal-dialog
.modal-content %div{ class: (container_class) }
.modal-header %div#modal-new-wiki.modal
%a.close{href: "#", "data-dismiss" => "modal"} × .modal-dialog
%h3.page-title New Wiki Page .modal-content
.modal-body .modal-header
%form.new-wiki-page %a.close{href: "#", "data-dismiss" => "modal"} ×
.form-group %h3.page-title New Wiki Page
= label_tag :new_wiki_path do .modal-body
%span Page slug %form.new-wiki-page
= text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'form-control', required: true, :'data-wikis-path' => namespace_project_wikis_path(@project.namespace, @project), autofocus: true .form-group
.form-actions = label_tag :new_wiki_path do
= button_tag 'Create Page', class: 'build-new-wiki btn btn-create' %span Page slug
= text_field_tag :new_wiki_path, nil, placeholder: 'how-to-setup', class: 'form-control', required: true, :'data-wikis-path' => namespace_project_wikis_path(@project.namespace, @project), autofocus: true
.form-actions
= button_tag 'Create Page', class: 'build-new-wiki btn btn-create'
- @no_container = true
- page_title "Edit", @page.title.capitalize, "Wiki" - page_title "Edit", @page.title.capitalize, "Wiki"
= render 'nav' = render 'nav'
.top-area %div{ class: (container_class) }
.nav-text.wiki-page .top-area
%strong .nav-text
- if @page.persisted? %strong
= link_to @page.title.capitalize, namespace_project_wiki_path(@project.namespace, @project, @page) - if @page.persisted?
- else = link_to @page.title.capitalize, namespace_project_wiki_path(@project.namespace, @project, @page)
= @page.title.capitalize - else
%span.light = @page.title.capitalize
· %span.light
Edit Page ·
Edit Page
.nav-controls .nav-controls
= render 'main_links' - if can?(current_user, :create_wiki, @project)
= link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
New Page
= render 'main_links'
= render 'form' = render 'form'
- @no_container = true
- page_title "Git Access", "Wiki" - page_title "Git Access", "Wiki"
= render 'nav' = render 'nav'
.row-content-block %div{ class: (container_class) }
%span.oneline .sub-header-block
Git access for %span.oneline
%strong= @project_wiki.path_with_namespace Git access for
%strong= @project_wiki.path_with_namespace
.pull-right .pull-right
= render "shared/clone_panel", project: @project_wiki = render "shared/clone_panel", project: @project_wiki
.git-empty.prepend-top-default .prepend-top-default
%fieldset %fieldset
%legend Install Gollum: %legend Install Gollum:
%pre.dark %pre.dark
:preserve :preserve
gem install gollum gem install gollum
%legend Clone Your Wiki: %legend Clone Your Wiki:
%pre.dark %pre.dark
:preserve :preserve
git clone #{ content_tag(:span, default_url_to_repo(@project_wiki), class: 'clone')} git clone #{ content_tag(:span, default_url_to_repo(@project_wiki), class: 'clone')}
cd #{h @project_wiki.path} cd #{h @project_wiki.path}
%legend Start Gollum And Edit Locally: %legend Start Gollum And Edit Locally:
%pre.dark %pre.dark
:preserve :preserve
gollum gollum
== Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin == Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin
>> Thin web server (v1.5.0 codename Knife) >> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024 >> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop >> Listening on 0.0.0.0:4567, CTRL+C to stop
- page_title "History", @page.title.capitalize, "Wiki" - page_title "History", @page.title.capitalize, "Wiki"
= render 'nav' = render 'nav'
%div{ class: (container_class) }
.top-area
.nav-text
%strong
= link_to @page.title.capitalize, namespace_project_wiki_path(@project.namespace, @project, @page)
%span.light
·
History
.top-area .table-holder
.nav-text %table.table
%strong %thead
= link_to @page.title.capitalize, namespace_project_wiki_path(@project.namespace, @project, @page)
%span.light
·
History
.table-holder
%table.table
%thead
%tr
%th Page version
%th Author
%th Commit Message
%th Last updated
%th Format
%tbody
- @page.versions.each_with_index do |version, index|
- commit = version
%tr %tr
%td %th Page version
= link_to project_wiki_path_with_version(@project, @page, %th Author
commit.id, index == 0) do %th Commit Message
= truncate_sha(commit.id) %th Last updated
%td %th Format
= commit.author.name %tbody
%td - @page.versions.each_with_index do |version, index|
= commit.message - commit = version
%td %tr
#{time_ago_with_tooltip(version.authored_date)} %td
%td = link_to project_wiki_path_with_version(@project, @page,
%strong commit.id, index == 0) do
= @page.page.wiki.page(@page.page.name, commit.id).try(:format) = truncate_sha(commit.id)
%td
= commit.author.name
%td
= commit.message
%td
#{time_ago_with_tooltip(version.authored_date)}
%td
%strong
= @page.page.wiki.page(@page.page.name, commit.id).try(:format)
- @no_container = true
- page_title "Pages", "Wiki" - page_title "Pages", "Wiki"
= render 'nav' = render 'nav'
%ul.content-list %div{ class: (container_class) }
- @wiki_pages.each do |wiki_page| %ul.content-list
%li - @wiki_pages.each do |wiki_page|
= link_to wiki_page.title, namespace_project_wiki_path(@project.namespace, @project, wiki_page) %li
%small (#{wiki_page.format}) = link_to wiki_page.title, namespace_project_wiki_path(@project.namespace, @project, wiki_page)
.pull-right %small (#{wiki_page.format})
%small Last edited #{time_ago_with_tooltip(wiki_page.commit.authored_date)} .pull-right
= paginate @wiki_pages, theme: 'gitlab' %small Last edited #{time_ago_with_tooltip(wiki_page.commit.authored_date)}
= paginate @wiki_pages, theme: 'gitlab'
- @no_container = true
- page_title @page.title.capitalize, "Wiki" - page_title @page.title.capitalize, "Wiki"
= render 'nav' = render 'nav'
.top-area %div{ class: (container_class) }
.nav-text .top-area
%strong= @page.title.capitalize .nav-text
%strong= @page.title.capitalize
%span.wiki-last-edit-by %span.wiki-last-edit-by
· ·
last edited by #{@page.commit.author.name} #{time_ago_with_tooltip(@page.commit.authored_date)} last edited by #{@page.commit.author.name} #{time_ago_with_tooltip(@page.commit.authored_date)}
.nav-controls .nav-controls
= render 'main_links' = render 'main_links'
- if @page.historical? - if @page.historical?
.warning_message .warning_message
This is an old version of this page. This is an old version of this page.
You can view the #{link_to "most recent version", namespace_project_wiki_path(@project.namespace, @project, @page)} or browse the #{link_to "history", namespace_project_wiki_history_path(@project.namespace, @project, @page)}. You can view the #{link_to "most recent version", namespace_project_wiki_path(@project.namespace, @project, @page)} or browse the #{link_to "history", namespace_project_wiki_history_path(@project.namespace, @project, @page)}.
.wiki-holder.prepend-top-default.append-bottom-default .wiki-holder.prepend-top-default.append-bottom-default
.wiki .wiki
= preserve do = preserve do
= render_wiki_content(@page) = render_wiki_content(@page)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment