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)
- Ensure Todos counters doesn't count Todos for projects pending delete
- Add left/right arrows horizontal navigation
- Add tooltip to pin/unpin navbar
- Add new sub nav style to Wiki and Graphs sub navigation
v 8.8.5
- Import GitHub repositories respecting the API rate limit !4166
......
......@@ -111,10 +111,6 @@
width: 50%;
line-height: 28px;
&.wiki-page {
padding: 16px 10px 11px;
}
/* Small devices (phones, tablets, 768px and lower) */
@media (max-width: $screen-sm-min) {
width: 100%;
......
......@@ -14,19 +14,27 @@
font-size: 10px;
}
#contributors-master {
@include make-md-column(12);
svg {
width: 100%;
}
}
#contributors {
.contributors-list {
margin: 0 0 10px;
list-style: none;
padding: 0;
}
.person {
&:nth-child(even) {
float: right;
svg {
width: 100%;
}
}
float: left;
.person {
@include make-md-column(6);
margin-top: 10px;
@media (max-width: $screen-sm-min) {
......
- page_specific_javascripts asset_path("graphs/application.js")
%ul.nav-links
= 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.builds_enabled?
= nav_link(action: :ci) do
= link_to ci_namespace_project_graph_path do
Continuous Integration
.nav-links.sub-nav
%ul{ class: (container_class) }
- page_specific_javascripts asset_path("graphs/application.js")
= 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.builds_enabled?
= nav_link(action: :ci) do
= link_to ci_namespace_project_graph_path do
Continuous Integration
- @no_container = true
- page_title "Continuous Integration", "Graphs"
= render 'head'
.row-content-block.append-bottom-default
.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'
%div{ class: (container_class) }
.sub-header-block
.oneline
A collection of graphs for Continuous Integration
%hr
= render 'projects/graphs/ci/builds'
#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'
- @no_container = true
- page_title "Commits", "Graphs"
= render 'head'
.row-content-block.append-bottom-default
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs_commits'
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
%div{ class: (container_class) }
.sub-header-block
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs_commits'
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
%p.lead
Commit statistics for
%strong #{@ref}
#{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')}
%p.lead
Commit statistics for
%strong #{@ref}
#{@commits_graph.start_date.strftime('%b %d')} - #{@commits_graph.end_date.strftime('%b %d')}
.row
.col-md-6
%ul
%li
%p.lead
%strong #{@commits_graph.commits.size}
commits during
%strong #{@commits_graph.duration}
days
%li
%p.lead
Average
%strong #{@commits_graph.commit_per_day}
commits per day
%li
%p.lead
Contributed by
%strong #{@commits_graph.authors}
authors
.col-md-6
%div
%p.slead
Commits per day of month
%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
%ul
%li
%p.lead
%strong #{@commits_graph.commits.size}
commits during
%strong #{@commits_graph.duration}
days
%li
%p.lead
Average
%strong #{@commits_graph.commit_per_day}
commits per day
%li
%p.lead
Contributed by
%strong #{@commits_graph.authors}
authors
.col-md-6
%div
%p.slead
Commits per day of month
%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
:javascript
var responsiveChart = function (selector, data) {
......
- @no_container = true
- page_title "Languages", "Graphs"
= render 'head'
.row-content-block.append-bottom-default
.oneline
Programming languages used in this repository
%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]
\%
.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};
......
- @no_container = true
- page_title "Contributors", "Graphs"
= render 'head'
.row-content-block.append-bottom-default
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs'
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
.loading-graph
.center
%h3.page-title
%i.fa.fa-spinner.fa-spin
Building repository graph.
%p.slead Please wait a moment, this page will automatically refresh when ready.
.stat-graph.hide
.header.clearfix
%h3#date_header.page-title
%p.light
Commits to #{@ref}, excluding merge commits. Limited to 6,000 commits.
%input#brush_change{:type => "hidden"}
.graphs
#contributors-master
#contributors.clearfix
%ol.contributors-list.clearfix
%div{ class: (container_class) }
.sub-header-block
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs'
%ul.breadcrumb.repo-breadcrumb
= commits_breadcrumbs
.loading-graph
.center
%h3.page-title
%i.fa.fa-spinner.fa-spin
Building repository graph.
%p.slead Please wait a moment, this page will automatically refresh when ready.
.stat-graph.hide
.header.clearfix
%h3#date_header.page-title
%p.light
Commits to #{@ref}, excluding merge commits. Limited to 6,000 commits.
%input#brush_change{:type => "hidden"}
.graphs.row
#contributors-master
#contributors.clearfix
%ol.contributors-list.clearfix
......
- 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
Page History
- if can?(current_user, :create_wiki, @project)
......
.top-area
%ul.nav-links
.nav-links.sub-nav
%ul{ class: (container_class) }
= nav_link(html_options: {class: params[:id] == 'home' ? 'active' : '' }) do
= link_to 'Home', namespace_project_wiki_path(@project.namespace, @project, :home)
......@@ -10,9 +10,4 @@
= link_to namespace_project_wikis_git_access_path(@project.namespace, @project) do
Git Access
.nav-controls
- 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'
= render 'projects/wikis/new'
%div#modal-new-wiki.modal
.modal-dialog
.modal-content
.modal-header
%a.close{href: "#", "data-dismiss" => "modal"} ×
%h3.page-title New Wiki Page
.modal-body
%form.new-wiki-page
.form-group
= label_tag :new_wiki_path do
%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
%div{ class: (container_class) }
%div#modal-new-wiki.modal
.modal-dialog
.modal-content
.modal-header
%a.close{href: "#", "data-dismiss" => "modal"} ×
%h3.page-title New Wiki Page
.modal-body
%form.new-wiki-page
.form-group
= label_tag :new_wiki_path do
%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"
= render 'nav'
.top-area
.nav-text.wiki-page
%strong
- if @page.persisted?
= link_to @page.title.capitalize, namespace_project_wiki_path(@project.namespace, @project, @page)
- else
= @page.title.capitalize
%span.light
·
Edit Page
%div{ class: (container_class) }
.top-area
.nav-text
%strong
- if @page.persisted?
= link_to @page.title.capitalize, namespace_project_wiki_path(@project.namespace, @project, @page)
- else
= @page.title.capitalize
%span.light
·
Edit Page
.nav-controls
= render 'main_links'
.nav-controls
- 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"
= render 'nav'
.row-content-block
%span.oneline
Git access for
%strong= @project_wiki.path_with_namespace
%div{ class: (container_class) }
.sub-header-block
%span.oneline
Git access for
%strong= @project_wiki.path_with_namespace
.pull-right
= render "shared/clone_panel", project: @project_wiki
.pull-right
= render "shared/clone_panel", project: @project_wiki
.git-empty.prepend-top-default
%fieldset
%legend Install Gollum:
%pre.dark
:preserve
gem install gollum
.prepend-top-default
%fieldset
%legend Install Gollum:
%pre.dark
:preserve
gem install gollum
%legend Clone Your Wiki:
%pre.dark
:preserve
git clone #{ content_tag(:span, default_url_to_repo(@project_wiki), class: 'clone')}
cd #{h @project_wiki.path}
%legend Clone Your Wiki:
%pre.dark
:preserve
git clone #{ content_tag(:span, default_url_to_repo(@project_wiki), class: 'clone')}
cd #{h @project_wiki.path}
%legend Start Gollum And Edit Locally:
%pre.dark
:preserve
gollum
== Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop
%legend Start Gollum And Edit Locally:
%pre.dark
:preserve
gollum
== Sinatra/1.3.5 has taken the stage on 4567 for development with backup from Thin
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop
- page_title "History", @page.title.capitalize, "Wiki"
= 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
.nav-text
%strong
= 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
.table-holder
%table.table
%thead
%tr
%td
= link_to project_wiki_path_with_version(@project, @page,
commit.id, index == 0) do
= 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)
%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
%td
= link_to project_wiki_path_with_version(@project, @page,
commit.id, index == 0) do
= 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"
= render 'nav'
%ul.content-list
- @wiki_pages.each do |wiki_page|
%li
= link_to wiki_page.title, namespace_project_wiki_path(@project.namespace, @project, wiki_page)
%small (#{wiki_page.format})
.pull-right
%small Last edited #{time_ago_with_tooltip(wiki_page.commit.authored_date)}
= paginate @wiki_pages, theme: 'gitlab'
%div{ class: (container_class) }
%ul.content-list
- @wiki_pages.each do |wiki_page|
%li
= link_to wiki_page.title, namespace_project_wiki_path(@project.namespace, @project, wiki_page)
%small (#{wiki_page.format})
.pull-right
%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"
= render 'nav'
.top-area
.nav-text
%strong= @page.title.capitalize
%div{ class: (container_class) }
.top-area
.nav-text
%strong= @page.title.capitalize
%span.wiki-last-edit-by
·
last edited by #{@page.commit.author.name} #{time_ago_with_tooltip(@page.commit.authored_date)}
%span.wiki-last-edit-by
·
last edited by #{@page.commit.author.name} #{time_ago_with_tooltip(@page.commit.authored_date)}
.nav-controls
= render 'main_links'
.nav-controls
= render 'main_links'
- if @page.historical?
.warning_message
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)}.
- if @page.historical?
.warning_message
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)}.
.wiki-holder.prepend-top-default.append-bottom-default
.wiki
= preserve do
= render_wiki_content(@page)
.wiki-holder.prepend-top-default.append-bottom-default
.wiki
= preserve do
= 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