Commit ea583955 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' into move-ci-charts

parents d538955a a58c6e9a
...@@ -4,6 +4,16 @@ v 8.1.0 (unreleased) ...@@ -4,6 +4,16 @@ v 8.1.0 (unreleased)
- Show CI status on all pages where commits list is rendered - Show CI status on all pages where commits list is rendered
- Automatically enable CI when push .gitlab-ci.yml file to repository - Automatically enable CI when push .gitlab-ci.yml file to repository
- Move CI charts to project graphs area - Move CI charts to project graphs area
- Fix cases where Markdown did not render links in activity feed (Stan Hu)
- Add first and last to pagination (Zeger-Jan van de Weg)
v 8.0.2 (unreleased)
- Skip check_initd_configured_correctly on omnibus installs
- Prevent double-prefixing of help page paths
- Clarify confirmation text on user deletion
- Make commit graphs responsive to window width changes (Stan Hu)
- Fix top margin for sign-in button on public pages
- Fix LDAP attribute mapping
v 8.0.1 v 8.0.1
- Improve CI migration procedure and documentation - Improve CI migration procedure and documentation
......
...@@ -77,7 +77,7 @@ gem "stamp", '~> 0.5.0' ...@@ -77,7 +77,7 @@ gem "stamp", '~> 0.5.0'
gem 'enumerize', '~> 0.7.0' gem 'enumerize', '~> 0.7.0'
# Pagination # Pagination
gem "kaminari", "~> 0.15.1" gem "kaminari", "~> 0.16.3"
# HAML # HAML
gem "haml-rails", '~> 0.5.3' gem "haml-rails", '~> 0.5.3'
......
...@@ -367,7 +367,7 @@ GEM ...@@ -367,7 +367,7 @@ GEM
railties (>= 3.2.16) railties (>= 3.2.16)
json (1.8.3) json (1.8.3)
jwt (1.5.1) jwt (1.5.1)
kaminari (0.15.1) kaminari (0.16.3)
actionpack (>= 3.0.0) actionpack (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
kgio (2.9.3) kgio (2.9.3)
...@@ -846,7 +846,7 @@ DEPENDENCIES ...@@ -846,7 +846,7 @@ DEPENDENCIES
jquery-scrollto-rails (~> 1.4.3) jquery-scrollto-rails (~> 1.4.3)
jquery-turbolinks (~> 2.0.1) jquery-turbolinks (~> 2.0.1)
jquery-ui-rails (~> 4.2.1) jquery-ui-rails (~> 4.2.1)
kaminari (~> 0.15.1) kaminari (~> 0.16.3)
letter_opener (~> 1.1.2) letter_opener (~> 1.1.2)
mail_room (~> 0.5.1) mail_room (~> 0.5.1)
minitest (~> 5.7.0) minitest (~> 5.7.0)
......
...@@ -93,46 +93,87 @@ ...@@ -93,46 +93,87 @@
} }
h1 { h1 {
margin-top: 45px; font-size: 1.3em;
font-size: 2.5em; font-weight: 600;
margin: 24px 0 12px 0;
padding: 0 0 10px 0;
border-bottom: 1px solid #e7e9ed;
color: #313236;
} }
h2 { h2 {
margin-top: 40px; font-size: 1.2em;
font-size: 2em; font-weight: 600;
margin: 24px 0 12px 0;
color: #313236;
} }
h3 { h3 {
margin-top: 35px; margin: 24px 0 12px 0;
font-size: 1.5em; font-size: 1.25em;
} }
h4 { h4 {
margin-top: 30px; margin: 24px 0 12px 0;
font-size: 1.2em; font-size: 1.1em;
}
h5 {
margin: 24px 0 12px 0;
font-size: 1em;
}
h6 {
margin: 24px 0 12px 0;
font-size: 0.90em;
} }
blockquote { blockquote {
color: #888; padding: 8px 21px;
margin: 12px 0 12px;
border-left: 3px solid #e7e9ed;
}
blockquote p {
color: #7f8fa4 !important;
font-size: 15px; font-size: 15px;
line-height: 1.5; line-height: 1.5;
} }
p {
color:#5c5d5e;
margin:6px 0 0 0;
}
table { table {
@extend .table; @extend .table;
@extend .table-bordered; @extend .table-bordered;
margin: 12px 0 12px 0;
color: #5c5d5e;
th { th {
background: #EEE; background: #f8fafc;
} }
}
pre {
margin: 12px 0 12px 0 !important;
background-color: #f8fafc !important;
font-size: 13px !important;
color: #5b6169 !important;
line-height: 1.6em !important;
} }
p > code { p > code {
font-size: inherit;
font-weight: inherit; font-weight: inherit;
} }
ul {
color: #5c5d5e;
}
li { li {
line-height: 1.5; line-height: 1.6em;
} }
a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] { a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] {
...@@ -152,6 +193,7 @@ ...@@ -152,6 +193,7 @@
} }
} }
@mixin str-truncated($max_width: 82%) { @mixin str-truncated($max_width: 82%) {
display: inline-block; display: inline-block;
overflow: hidden; overflow: hidden;
...@@ -183,7 +225,7 @@ ...@@ -183,7 +225,7 @@
&.active { &.active {
background: #f9f9f9; background: #f9f9f9;
a { a {
font-weight: bold; font-weight: 600;
} }
} }
......
...@@ -302,7 +302,7 @@ table { ...@@ -302,7 +302,7 @@ table {
} }
.btn-sign-in { .btn-sign-in {
margin-top: 15px; margin-top: 8px;
text-shadow: none; text-shadow: none;
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
margin: 0; margin: 0;
display: block; display: block;
li.first,
li.last,
li.next, li.next,
li.prev { li.prev {
> a { > a {
......
...@@ -55,6 +55,7 @@ a > code { ...@@ -55,6 +55,7 @@ a > code {
@include md-typography; @include md-typography;
word-wrap: break-word; word-wrap: break-word;
padding: 7px;
/* Link to current header. */ /* Link to current header. */
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
...@@ -83,9 +84,12 @@ a > code { ...@@ -83,9 +84,12 @@ a > code {
} }
} }
ul { ul,ol {
padding: 0; padding: 0;
margin: 0 0 9px 25px !important; margin: 6px 0 6px 18px !important;
}
ol {
color: #5c5d5e;
} }
} }
......
...@@ -4,6 +4,11 @@ class HelpController < ApplicationController ...@@ -4,6 +4,11 @@ class HelpController < ApplicationController
layout 'help' layout 'help'
def index def index
@help_index = File.read(Rails.root.join('doc', 'README.md'))
# Prefix Markdown links with `help/` unless they already have been
# See http://rubular.com/r/nwwhzH6Z8X
@help_index.gsub!(/(\]\()(?!help\/)([^\)\(]+)(\))/, '\1help/\2\3')
end end
def show def show
......
...@@ -165,7 +165,7 @@ module GitlabMarkdownHelper ...@@ -165,7 +165,7 @@ module GitlabMarkdownHelper
# and return true. Otherwise return false. # and return true. Otherwise return false.
def truncate_if_block(node, truncated) def truncate_if_block(node, truncated)
if node.element? && node.description.block? && !truncated if node.element? && node.description.block? && !truncated
node.content = "#{node.content}..." if node.next_sibling node.inner_html = "#{node.inner_html}..." if node.next_sibling
true true
else else
truncated truncated
......
...@@ -747,15 +747,6 @@ class Project < ActiveRecord::Base ...@@ -747,15 +747,6 @@ class Project < ActiveRecord::Base
service.save service.save
# Create Ci::Project # Create Ci::Project
params = OpenStruct.new({ Ci::CreateProjectService.new.execute(user, self)
id: self.id,
name_with_namespace: self.name_with_namespace,
path_with_namespace: self.path_with_namespace,
web_url: self.web_url,
default_branch: self.default_branch,
ssh_url_to_repo: self.ssh_url_to_repo
})
Ci::CreateProjectService.new.execute(user, params)
end end
end end
...@@ -27,11 +27,7 @@ ...@@ -27,11 +27,7 @@
.col-md-8 .col-md-8
.documentation-index .documentation-index
= preserve do = preserve do
- readme_text = File.read(Rails.root.join("doc", "README.md")) = markdown(@help_index)
- text = readme_text.dup
- readme_text.scan(/\]\(([^(]+)\)/) { |match| text.gsub!(match.first, "help/#{match.first}") }
= markdown text
.col-md-4 .col-md-4
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
......
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
-# num_pages: total number of pages -# num_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span.first %li.first
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
-# num_pages: total number of pages -# num_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%span.last %li.last
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote} = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
...@@ -8,10 +8,15 @@ ...@@ -8,10 +8,15 @@
= paginator.render do = paginator.render do
%div.gl-pagination %div.gl-pagination
%ul.pagination.clearfix %ul.pagination.clearfix
= prev_page_tag unless current_page.first? - unless current_page.first?
= first_page_tag unless num_pages < 5 # As kaminari will always show the first 5 pages
= prev_page_tag
- each_page do |page| - each_page do |page|
- if page.left_outer? || page.right_outer? || page.inside_window? - if page.left_outer? || page.right_outer? || page.inside_window?
= page_tag page = page_tag page
- elsif !page.was_truncated? - elsif !page.was_truncated?
= gap_tag = gap_tag
= next_page_tag unless current_page.last? - unless current_page.last?
= next_page_tag
= last_page_tag unless num_pages < 5
...@@ -32,61 +32,55 @@ ...@@ -32,61 +32,55 @@
%div %div
%p.slead %p.slead
Commits per day of month Commits per day of month
%canvas#month-chart{width: 800, height: 400} %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{width: 800, height: 400} %canvas#hour-chart
.col-md-6 .col-md-6
%div %div
%p.slead %p.slead
Commits per weekday Commits per weekday
%canvas#weekday-chart{width: 800, height: 400} %canvas#weekday-chart
:coffeescript :coffeescript
data = { responsiveChart = (selector, data) ->
labels : #{@commits_per_time.keys.to_json}, options = { "scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2, maintainAspectRatio: false }
datasets : [{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
barStrokeWidth: 1,
barValueSpacing: 1,
barDatasetSpacing: 1,
data : #{@commits_per_time.values.to_json}
}]
}
ctx = $("#hour-chart").get(0).getContext("2d"); # get selector by context
new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) ctx = selector.get(0).getContext("2d")
# pointing parent container to make chart.js inherit its width
container = $(selector).parent()
data = { generateChart = ->
labels : #{@commits_per_week_days.keys.to_json}, selector.attr('width', $(container).width())
datasets : [{ new Chart(ctx).Bar(data, options)
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)", # enabling auto-resizing
barStrokeWidth: 1, $(window).resize( generateChart )
barValueSpacing: 1,
barDatasetSpacing: 1,
data : #{@commits_per_week_days.values.to_json}
}]
}
ctx = $("#weekday-chart").get(0).getContext("2d"); generateChart()
new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2})
data = { chartData = (keys, values) ->
labels : #{@commits_per_month.keys.to_json}, data = {
datasets : [{ labels : keys,
fillColor : "rgba(220,220,220,0.5)", datasets : [{
strokeColor : "rgba(220,220,220,1)", fillColor : "rgba(220,220,220,0.5)",
barStrokeWidth: 1, strokeColor : "rgba(220,220,220,1)",
barValueSpacing: 1, barStrokeWidth: 1,
barDatasetSpacing: 1, barValueSpacing: 1,
data : #{@commits_per_month.values.to_json} barDatasetSpacing: 1,
}] data : values
}]
} }
ctx = $("#month-chart").get(0).getContext("2d"); hourData = chartData(#{@commits_per_time.keys.to_json}, #{@commits_per_time.values.to_json})
new Chart(ctx).Bar(data, {"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) responsiveChart($('#hour-chart'), hourData)
dayData = chartData(#{@commits_per_week_days.keys.to_json}, #{@commits_per_week_days.values.to_json})
responsiveChart($('#weekday-chart'), dayData)
monthData = chartData(#{@commits_per_month.keys.to_json}, #{@commits_per_month.values.to_json})
responsiveChart($('#month-chart'), monthData)
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
### Administrator documentation ### Administrator documentation
+ [User permissions](permissions/README.md) + [User permissions](permissions/permissions.md)
+ [API](api/README.md) + [API](api/README.md)
## Contributor documentation ## Contributor documentation
......
...@@ -33,7 +33,6 @@ For GitLab we developed something we call "GitLab Flavored Markdown" (GFM). It e ...@@ -33,7 +33,6 @@ For GitLab we developed something we call "GitLab Flavored Markdown" (GFM). It e
You can use GFM in You can use GFM in
- commit messages
- comments - comments
- issues - issues
- merge requests - merge requests
......
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
private private
def get_info(key) def get_info(key)
attributes = ldap_config.attributes[key] attributes = ldap_config.attributes[key.to_s]
return super unless attributes return super unless attributes
attributes = Array(attributes) attributes = Array(attributes)
...@@ -14,6 +14,7 @@ module Gitlab ...@@ -14,6 +14,7 @@ module Gitlab
value = nil value = nil
attributes.each do |attribute| attributes.each do |attribute|
value = get_raw(attribute) value = get_raw(attribute)
value = value.first if value
break if value.present? break if value.present?
end end
......
...@@ -146,4 +146,24 @@ describe GitlabMarkdownHelper do ...@@ -146,4 +146,24 @@ describe GitlabMarkdownHelper do
expect(random_markdown_tip).to eq 'Random tip' expect(random_markdown_tip).to eq 'Random tip'
end end
end end
describe '#first_line_in_markdown' do
let(:text) { "@#{user.username}, can you look at this?\nHello world\n"}
it 'truncates Markdown properly' do
actual = first_line_in_markdown(text, 100, project: project)
doc = Nokogiri::HTML.parse(actual)
# Make sure we didn't create invalid markup
expect(doc.errors).to be_empty
# Leading user link
expect(doc.css('a').length).to eq(1)
expect(doc.css('a')[0].attr('href')).to eq user_path(user)
expect(doc.css('a')[0].text).to eq "@#{user.username}"
expect(doc.content).to eq "@#{user.username}, can you look at this?..."
end
end
end end
...@@ -24,10 +24,10 @@ describe Gitlab::LDAP::AuthHash do ...@@ -24,10 +24,10 @@ describe Gitlab::LDAP::AuthHash do
let(:raw_info) do let(:raw_info) do
{ {
uid: '123456', uid: ['123456'],
email: 'johnsmith@example.com', email: ['johnsmith@example.com'],
cn: 'Smith, J.', cn: ['Smith, J.'],
fullName: 'John Smith' fullName: ['John Smith']
} }
end end
...@@ -45,8 +45,8 @@ describe Gitlab::LDAP::AuthHash do ...@@ -45,8 +45,8 @@ describe Gitlab::LDAP::AuthHash do
context "with overridden attributes" do context "with overridden attributes" do
let(:attributes) do let(:attributes) do
{ {
username: ['mail', 'email'], 'username' => ['mail', 'email'],
name: 'fullName' 'name' => 'fullName'
} }
end end
......
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