From 0f41417a8c88f11aedaeb2c59b524e47db7f40e0 Mon Sep 17 00:00:00 2001 From: Ben Hadley-Evans Date: Fri, 18 Sep 2015 09:21:09 +0100 Subject: Correct markdown.md docs RE use in commit messages. Remove the line from the markdown documentation which states GFM can be used in commit messages as this is currently not true. See issue gitlab-org/gitlab-ce#1582. [ci skip] --- doc/markdown/markdown.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/markdown/markdown.md b/doc/markdown/markdown.md index 6fdb2fe1491..d83838127c9 100644 --- a/doc/markdown/markdown.md +++ b/doc/markdown/markdown.md @@ -33,7 +33,6 @@ For GitLab we developed something we call "GitLab Flavored Markdown" (GFM). It e You can use GFM in -- commit messages - comments - issues - merge requests -- cgit v1.2.1 From ef2679d0b9c0b145085725cf75203d7851fcc143 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 22 Sep 2015 11:17:36 -0700 Subject: Make commit graphs responsive to window width changes Closes #2653 --- CHANGELOG | 1 + app/views/projects/graphs/commits.html.haml | 76 +++++++++++++---------------- 2 files changed, 36 insertions(+), 41 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1cb338f16da..dcedaa96d79 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.0.1 - Improve CI migration procedure and documentation + - Make commit graphs responsive to window width changes (Stan Hu) v 8.0.0 - Fix Markdown links not showing up in dashboard activity feed (Stan Hu) diff --git a/app/views/projects/graphs/commits.html.haml b/app/views/projects/graphs/commits.html.haml index bf0cac539b8..112be875b6b 100644 --- a/app/views/projects/graphs/commits.html.haml +++ b/app/views/projects/graphs/commits.html.haml @@ -32,61 +32,55 @@ %div %p.slead Commits per day of month - %canvas#month-chart{width: 800, height: 400} + %canvas#month-chart .row .col-md-6 %div %p.slead Commits per day hour (UTC) - %canvas#hour-chart{width: 800, height: 400} + %canvas#hour-chart .col-md-6 %div %p.slead Commits per weekday - %canvas#weekday-chart{width: 800, height: 400} + %canvas#weekday-chart :coffeescript - data = { - labels : #{@commits_per_time.keys.to_json}, - 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} - }] - } + responsiveChart = (selector, data) -> + options = { "scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2, maintainAspectRatio: false } - ctx = $("#hour-chart").get(0).getContext("2d"); - new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) + # get selector by context + ctx = selector.get(0).getContext("2d") + # pointing parent container to make chart.js inherit its width + container = $(selector).parent() - data = { - labels : #{@commits_per_week_days.keys.to_json}, - datasets : [{ - fillColor : "rgba(220,220,220,0.5)", - strokeColor : "rgba(220,220,220,1)", - barStrokeWidth: 1, - barValueSpacing: 1, - barDatasetSpacing: 1, - data : #{@commits_per_week_days.values.to_json} - }] - } + generateChart = -> + selector.attr('width', $(container).width()) + new Chart(ctx).Bar(data, options) + + # enabling auto-resizing + $(window).resize( generateChart ) - ctx = $("#weekday-chart").get(0).getContext("2d"); - new Chart(ctx).Bar(data,{"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) + generateChart() - data = { - labels : #{@commits_per_month.keys.to_json}, - datasets : [{ - fillColor : "rgba(220,220,220,0.5)", - strokeColor : "rgba(220,220,220,1)", - barStrokeWidth: 1, - barValueSpacing: 1, - barDatasetSpacing: 1, - data : #{@commits_per_month.values.to_json} - }] + chartData = (keys, values) -> + data = { + labels : keys, + datasets : [{ + fillColor : "rgba(220,220,220,0.5)", + strokeColor : "rgba(220,220,220,1)", + barStrokeWidth: 1, + barValueSpacing: 1, + barDatasetSpacing: 1, + data : values + }] } - ctx = $("#month-chart").get(0).getContext("2d"); - new Chart(ctx).Bar(data, {"scaleOverlay": true, responsive: true, pointHitDetectionRadius: 2}) + hourData = chartData(#{@commits_per_time.keys.to_json}, #{@commits_per_time.values.to_json}) + 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) -- cgit v1.2.1 From c551c81e28418c67fb398d6efb2183588c09f862 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 22 Sep 2015 18:26:41 -0400 Subject: Fix "User permissions" help page path --- doc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/README.md b/doc/README.md index 5f38086b8e3..a0ff856ebb6 100644 --- a/doc/README.md +++ b/doc/README.md @@ -51,7 +51,7 @@ ### Administrator documentation -+ [User permissions](permissions/README.md) ++ [User permissions](permissions/permissions.md) + [API](api/README.md) ## Contributor documentation -- cgit v1.2.1 From 64e0dfa5306aebdedeb65f2a6db95f4d2314f143 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 22 Sep 2015 18:26:51 -0400 Subject: Prevent double-prefixing of help page paths Prior, because the link "api/README.md" was matched twice, the first link became "help/help/api/README.md". Now we do a negative lookahead to make sure the link doesn't start with `help/`. This fix is still not ideal, see TODO note. --- app/controllers/help_controller.rb | 18 ++++++++++++++++++ app/views/help/index.html.haml | 6 +----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index ad00948da51..7283c4f4a4c 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -4,6 +4,8 @@ class HelpController < ApplicationController layout 'help' def index + @help_index = File.read(Rails.root.join('doc', 'README.md')) + prefix_help_links!(@help_index) end def show @@ -57,6 +59,22 @@ class HelpController < ApplicationController params end + # Prefix links in a Markdown document with `help/` unless they already have + # been + # + # TODO (rspeicher): This should be a pipeline filter that only gets included + # for help pages, and it should operate on the Nokogiri doc to be more robust. + # + # text - Markdown String + # + # Modifies `text` in-place + def prefix_help_links!(text) + # Match text inside a Markdown link unless it already starts with `help/` + # + # See http://rubular.com/r/nwwhzH6Z8X + text.gsub!(%r{(\]\()(?!help\/)([^\)\(]+)(\))}x, '\1help/\2\3') + end + PATH_SEPS = Regexp.union(*[::File::SEPARATOR, ::File::ALT_SEPARATOR].compact) # Taken from ActionDispatch::FileHandler diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index f492aaf4c0a..ab7ed1b5d95 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -27,11 +27,7 @@ .col-md-8 .documentation-index = preserve do - - readme_text = File.read(Rails.root.join("doc", "README.md")) - - text = readme_text.dup - - readme_text.scan(/\]\(([^(]+)\)/) { |match| text.gsub!(match.first, "help/#{match.first}") } - = markdown text - + = markdown(@help_index) .col-md-4 .panel.panel-default .panel-heading -- cgit v1.2.1 From 95f73a68fa3ff235c35217b1c72666c5bad6ce03 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 23 Sep 2015 00:24:17 -0400 Subject: Simplify help path prefixing --- app/controllers/help_controller.rb | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb index 7283c4f4a4c..55050615473 100644 --- a/app/controllers/help_controller.rb +++ b/app/controllers/help_controller.rb @@ -5,7 +5,10 @@ class HelpController < ApplicationController def index @help_index = File.read(Rails.root.join('doc', 'README.md')) - prefix_help_links!(@help_index) + + # Prefix Markdown links with `help/` unless they already have been + # See http://rubular.com/r/nwwhzH6Z8X + @help_index.gsub!(/(\]\()(?!help\/)([^\)\(]+)(\))/, '\1help/\2\3') end def show @@ -59,22 +62,6 @@ class HelpController < ApplicationController params end - # Prefix links in a Markdown document with `help/` unless they already have - # been - # - # TODO (rspeicher): This should be a pipeline filter that only gets included - # for help pages, and it should operate on the Nokogiri doc to be more robust. - # - # text - Markdown String - # - # Modifies `text` in-place - def prefix_help_links!(text) - # Match text inside a Markdown link unless it already starts with `help/` - # - # See http://rubular.com/r/nwwhzH6Z8X - text.gsub!(%r{(\]\()(?!help\/)([^\)\(]+)(\))}x, '\1help/\2\3') - end - PATH_SEPS = Regexp.union(*[::File::SEPARATOR, ::File::ALT_SEPARATOR].compact) # Taken from ActionDispatch::FileHandler -- cgit v1.2.1 From a7b0ee3fd17d4e2afd427606b002d3a9f7c6673d Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 22 Sep 2015 21:56:27 -0700 Subject: Fix cases where Markdown did not render links in activity feed HTML would be stripped in `truncate_if_block` when a comment had multiple lines and the first wasn't long enough to be truncated. The use of `node.content` would strip all HTML tags. Using `node.inner_html` retains these tags and puts the "..." in between paragraph tags. Closes #2586 --- CHANGELOG | 1 + app/helpers/gitlab_markdown_helper.rb | 2 +- spec/helpers/gitlab_markdown_helper_spec.rb | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 1cb338f16da..fff641fcb48 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.0.1 + - Fix cases where Markdown did not render links in activity feed (Stan Hu) - Improve CI migration procedure and documentation v 8.0.0 diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index 78bf25f55e7..153a44870f6 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -165,7 +165,7 @@ module GitlabMarkdownHelper # and return true. Otherwise return false. def truncate_if_block(node, 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 else truncated diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index b8101ae77ec..be0e0c747b7 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -146,4 +146,24 @@ describe GitlabMarkdownHelper do expect(random_markdown_tip).to eq 'Random tip' 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 -- cgit v1.2.1 From 9103602620ec4eb527ac45954a78b3f3466e97a2 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 22 Sep 2015 15:14:26 +0200 Subject: Improve UI for rendered markdown --- app/assets/stylesheets/base/mixins.scss | 72 ++++++++++++++++++++------ app/assets/stylesheets/generic/typography.scss | 8 ++- 2 files changed, 63 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/base/mixins.scss b/app/assets/stylesheets/base/mixins.scss index a2f6c3e21f4..421588f64d8 100644 --- a/app/assets/stylesheets/base/mixins.scss +++ b/app/assets/stylesheets/base/mixins.scss @@ -93,46 +93,87 @@ } h1 { - margin-top: 45px; - font-size: 2.5em; + font-size: 1.3em; + font-weight: 600; + margin: 24px 0 12px 0; + padding: 0 0 10px 0; + border-bottom: 1px solid #e7e9ed; + color: #313236; } h2 { - margin-top: 40px; - font-size: 2em; + font-size: 1.2em; + font-weight: 600; + margin: 24px 0 12px 0; + color: #313236; } h3 { - margin-top: 35px; - font-size: 1.5em; + margin: 24px 0 12px 0; + font-size: 1.25em; } h4 { - margin-top: 30px; - font-size: 1.2em; + margin: 24px 0 12px 0; + font-size: 1.1em; + } + + h5 { + margin: 24px 0 12px 0; + font-size: 1em; + } + + h6 { + margin: 24px 0 12px 0; + font-size: 0.90em; } blockquote { - color: #888; + padding: 8px 21px; + margin: 12px 0 12px; + border-left: 3px solid #e7e9ed; + } + + blockquote p { + color: #7f8fa4 !important; font-size: 15px; line-height: 1.5; } - + + p { + color:#5c5d5e; + margin:6px 0 0 0; + } + table { @extend .table; @extend .table-bordered; + margin: 12px 0 12px 0; + color: #5c5d5e; 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 { - font-size: inherit; font-weight: inherit; } + + ul { + color: #5c5d5e; + } + li { - line-height: 1.5; + line-height: 1.6em; } a[href*="/uploads/"], a[href*="storage.googleapis.com/google-code-attachments/"] { @@ -152,6 +193,7 @@ } } + @mixin str-truncated($max_width: 82%) { display: inline-block; overflow: hidden; @@ -183,7 +225,7 @@ &.active { background: #f9f9f9; a { - font-weight: bold; + font-weight: 600; } } diff --git a/app/assets/stylesheets/generic/typography.scss b/app/assets/stylesheets/generic/typography.scss index d5f0d86a307..7a8a17ced99 100644 --- a/app/assets/stylesheets/generic/typography.scss +++ b/app/assets/stylesheets/generic/typography.scss @@ -55,6 +55,7 @@ a > code { @include md-typography; word-wrap: break-word; + padding: 7px; /* Link to current header. */ h1, h2, h3, h4, h5, h6 { @@ -83,9 +84,12 @@ a > code { } } - ul { + ul,ol { padding: 0; - margin: 0 0 9px 25px !important; + margin: 6px 0 6px 18px !important; + } + ol { + color: #5c5d5e; } } -- cgit v1.2.1 From 73a3df4de351528dfe954c0f44af1f0e45b221d0 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 23 Sep 2015 16:37:59 +0200 Subject: Fix LDAP attribute mapping --- lib/gitlab/ldap/auth_hash.rb | 3 ++- spec/lib/gitlab/ldap/auth_hash_spec.rb | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/gitlab/ldap/auth_hash.rb b/lib/gitlab/ldap/auth_hash.rb index 55deeeacd90..bf4dd9542d5 100644 --- a/lib/gitlab/ldap/auth_hash.rb +++ b/lib/gitlab/ldap/auth_hash.rb @@ -6,7 +6,7 @@ module Gitlab private def get_info(key) - attributes = ldap_config.attributes[key] + attributes = ldap_config.attributes[key.to_s] return super unless attributes attributes = Array(attributes) @@ -14,6 +14,7 @@ module Gitlab value = nil attributes.each do |attribute| value = get_raw(attribute) + value = value.first if value break if value.present? end diff --git a/spec/lib/gitlab/ldap/auth_hash_spec.rb b/spec/lib/gitlab/ldap/auth_hash_spec.rb index 18c7924fea1..7d8268536a4 100644 --- a/spec/lib/gitlab/ldap/auth_hash_spec.rb +++ b/spec/lib/gitlab/ldap/auth_hash_spec.rb @@ -24,10 +24,10 @@ describe Gitlab::LDAP::AuthHash do let(:raw_info) do { - uid: '123456', - email: 'johnsmith@example.com', - cn: 'Smith, J.', - fullName: 'John Smith' + uid: ['123456'], + email: ['johnsmith@example.com'], + cn: ['Smith, J.'], + fullName: ['John Smith'] } end @@ -45,8 +45,8 @@ describe Gitlab::LDAP::AuthHash do context "with overridden attributes" do let(:attributes) do { - username: ['mail', 'email'], - name: 'fullName' + 'username' => ['mail', 'email'], + 'name' => 'fullName' } end -- cgit v1.2.1 From 0a57c3f610433d0093ecc1f638fce339c4128abc Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 23 Sep 2015 16:52:26 +0200 Subject: Refactor Project#enable_ci method Signed-off-by: Dmitriy Zaporozhets --- app/models/project.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index c5c94cbfba2..a7ea1236b86 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -747,15 +747,6 @@ class Project < ActiveRecord::Base service.save # Create Ci::Project - params = OpenStruct.new({ - 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) + Ci::CreateProjectService.new.execute(user, self) end end -- cgit v1.2.1 From 15bf2e44572b409e97f5cad5fed0ffbf4fd83314 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 23 Sep 2015 12:58:00 -0400 Subject: Fix top margin for sign-in button on public pages Closes #2615 --- app/assets/stylesheets/generic/common.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 48fad7701ef..b659717b4e1 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -302,7 +302,7 @@ table { } .btn-sign-in { - margin-top: 15px; + margin-top: 8px; text-shadow: none; } -- cgit v1.2.1 From be696b72eb796d7376bdfd0c72a1a089a5acee4f Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 23 Sep 2015 13:24:37 -0400 Subject: Update CHANGELOG to add unreleased 8.0.2 entry [ci skip] --- CHANGELOG | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1a3b102f4e1..8f7d118eca6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,11 +3,18 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.1.0 (unreleased) - Show CI status on all pages where commits list is rendered - Automatically enable CI when push .gitlab-ci.yml file to repository + - Fix cases where Markdown did not render links in activity feed (Stan Hu) + +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 - - Fix cases where Markdown did not render links in activity feed (Stan Hu) - Improve CI migration procedure and documentation - - Make commit graphs responsive to window width changes (Stan Hu) v 8.0.0 - Fix Markdown links not showing up in dashboard activity feed (Stan Hu) -- cgit v1.2.1 From 3d177a818f1c623704df94d6ab6649cf9f70dbbc Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 17 Sep 2015 20:24:47 +0200 Subject: Add links to first and/or last page with kaminari Also update Kaminari gem to the latest version --- CHANGELOG | 2 ++ Gemfile | 2 +- Gemfile.lock | 4 ++-- app/views/kaminari/gitlab/_first_page.html.haml | 2 +- app/views/kaminari/gitlab/_last_page.html.haml | 2 +- app/views/kaminari/gitlab/_paginator.html.haml | 9 +++++++-- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8f7d118eca6..aa3ae7b768e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,8 @@ v 8.0.1 v 8.0.0 - Fix Markdown links not showing up in dashboard activity feed (Stan Hu) - Remove milestones from merge requests when milestones are deleted (Stan Hu) +v 8.0.0 (unreleased) + - Add first and last to pagination (Zeger-Jan van de Weg) - Fix HTML link that was improperly escaped in new user e-mail (Stan Hu) - Fix broken sort in merge request API (Stan Hu) - Bump rouge to 1.10.1 to remove warning noise and fix other syntax highlighting bugs (Stan Hu) diff --git a/Gemfile b/Gemfile index 924ee382f4d..b29846f738a 100644 --- a/Gemfile +++ b/Gemfile @@ -77,7 +77,7 @@ gem "stamp", '~> 0.5.0' gem 'enumerize', '~> 0.7.0' # Pagination -gem "kaminari", "~> 0.15.1" +gem "kaminari", "~> 0.16.3" # HAML gem "haml-rails", '~> 0.5.3' diff --git a/Gemfile.lock b/Gemfile.lock index 320f7629fb6..6070beb9d07 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -367,7 +367,7 @@ GEM railties (>= 3.2.16) json (1.8.3) jwt (1.5.1) - kaminari (0.15.1) + kaminari (0.16.3) actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.9.3) @@ -846,7 +846,7 @@ DEPENDENCIES jquery-scrollto-rails (~> 1.4.3) jquery-turbolinks (~> 2.0.1) jquery-ui-rails (~> 4.2.1) - kaminari (~> 0.15.1) + kaminari (~> 0.16.3) letter_opener (~> 1.1.2) mail_room (~> 0.5.1) minitest (~> 5.7.0) diff --git a/app/views/kaminari/gitlab/_first_page.html.haml b/app/views/kaminari/gitlab/_first_page.html.haml index 41c9c0b3af6..ada7306d98d 100644 --- a/app/views/kaminari/gitlab/_first_page.html.haml +++ b/app/views/kaminari/gitlab/_first_page.html.haml @@ -5,5 +5,5 @@ -# num_pages: total number of pages -# per_page: number of items to fetch per page -# remote: data-remote -%span.first +%li.first = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote diff --git a/app/views/kaminari/gitlab/_last_page.html.haml b/app/views/kaminari/gitlab/_last_page.html.haml index b03a206224c..3431d029bcc 100644 --- a/app/views/kaminari/gitlab/_last_page.html.haml +++ b/app/views/kaminari/gitlab/_last_page.html.haml @@ -5,5 +5,5 @@ -# num_pages: total number of pages -# per_page: number of items to fetch per page -# remote: data-remote -%span.last +%li.last = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote} diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml index b8d419b5894..2f645186921 100644 --- a/app/views/kaminari/gitlab/_paginator.html.haml +++ b/app/views/kaminari/gitlab/_paginator.html.haml @@ -8,10 +8,15 @@ = paginator.render do %div.gl-pagination %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| - if page.left_outer? || page.right_outer? || page.inside_window? = page_tag page - elsif !page.was_truncated? = gap_tag - = next_page_tag unless current_page.last? + - unless current_page.last? + = next_page_tag + = last_page_tag unless num_pages < 5 + -- cgit v1.2.1 From fe6ea911073a723e9472632e90363fafb9a50553 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Wed, 23 Sep 2015 13:39:58 +0200 Subject: Fix styling conform the new style Add my name to the right page of the changelog --- CHANGELOG | 3 +-- app/assets/stylesheets/generic/pagination.scss | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index aa3ae7b768e..3f16a370a94 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ v 8.1.0 (unreleased) - Show CI status on all pages where commits list is rendered - Automatically enable CI when push .gitlab-ci.yml file to repository - 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 @@ -19,8 +20,6 @@ v 8.0.1 v 8.0.0 - Fix Markdown links not showing up in dashboard activity feed (Stan Hu) - Remove milestones from merge requests when milestones are deleted (Stan Hu) -v 8.0.0 (unreleased) - - Add first and last to pagination (Zeger-Jan van de Weg) - Fix HTML link that was improperly escaped in new user e-mail (Stan Hu) - Fix broken sort in merge request API (Stan Hu) - Bump rouge to 1.10.1 to remove warning noise and fix other syntax highlighting bugs (Stan Hu) diff --git a/app/assets/stylesheets/generic/pagination.scss b/app/assets/stylesheets/generic/pagination.scss index a937677ebdc..6677f94dafd 100644 --- a/app/assets/stylesheets/generic/pagination.scss +++ b/app/assets/stylesheets/generic/pagination.scss @@ -9,6 +9,8 @@ margin: 0; display: block; + li.first, + li.last, li.next, li.prev { > a { -- cgit v1.2.1