summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-18 18:24:08 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-18 18:24:08 +0200
commit2122d7b919821f41e90a13622dee31bce60b2a40 (patch)
tree8dbf54b5ef6f6c0b1453784d32c181cd5f512c35
parente86668984f4f7465ed39ffcf9ce09aabfa8f79da (diff)
parent1eb3dde45b55afb723954e577b7bd12946aeb3ca (diff)
downloadgitlab-ce-2122d7b919821f41e90a13622dee31bce60b2a40.tar.gz
Merge branch 'master' into ci-build-list
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--CHANGELOG1
-rw-r--r--Gemfile.lock3
-rw-r--r--app/controllers/admin/application_settings_controller.rb1
-rw-r--r--app/controllers/ci/application_controller.rb4
-rw-r--r--app/controllers/ci/projects_controller.rb24
-rw-r--r--app/finders/trending_projects_finder.rb17
-rw-r--r--app/helpers/groups_helper.rb10
-rw-r--r--app/helpers/projects_helper.rb35
-rw-r--r--app/views/admin/application_settings/_form.html.haml5
-rw-r--r--app/views/ci/projects/_form.html.haml1
-rw-r--r--app/views/ci/projects/_gl_projects.html.haml15
-rw-r--r--app/views/ci/projects/_project.html.haml60
-rw-r--r--app/views/ci/projects/_search.html.haml8
-rw-r--r--app/views/ci/projects/gitlab.html.haml27
-rw-r--r--app/views/ci/projects/index.html.haml33
-rw-r--r--app/views/groups/milestones/_header_title.html.haml1
-rw-r--r--app/views/groups/milestones/show.html.haml2
-rw-r--r--app/views/help/index.html.haml3
-rw-r--r--app/views/layouts/ci/_nav_admin.html.haml4
-rw-r--r--app/views/layouts/dashboard.html.haml3
-rw-r--r--app/views/layouts/group.html.haml5
-rw-r--r--app/views/layouts/group_settings.html.haml1
-rw-r--r--app/views/layouts/nav/_dashboard.html.haml2
-rw-r--r--app/views/layouts/profile.html.haml3
-rw-r--r--app/views/layouts/project.html.haml4
-rw-r--r--app/views/layouts/project_settings.html.haml1
-rw-r--r--app/views/projects/activity.html.haml2
-rw-r--r--app/views/projects/blame/show.html.haml2
-rw-r--r--app/views/projects/blob/_header_title.html.haml1
-rw-r--r--app/views/projects/blob/edit.html.haml2
-rw-r--r--app/views/projects/blob/new.html.haml3
-rw-r--r--app/views/projects/blob/show.html.haml1
-rw-r--r--app/views/projects/branches/index.html.haml1
-rw-r--r--app/views/projects/branches/new.html.haml2
-rw-r--r--app/views/projects/commit/show.html.haml1
-rw-r--r--app/views/projects/commits/_header_title.html.haml1
-rw-r--r--app/views/projects/commits/show.html.haml1
-rw-r--r--app/views/projects/compare/index.html.haml1
-rw-r--r--app/views/projects/compare/show.html.haml1
-rw-r--r--app/views/projects/graphs/_header_title.html.haml1
-rw-r--r--app/views/projects/graphs/commits.html.haml3
-rw-r--r--app/views/projects/graphs/show.html.haml3
-rw-r--r--app/views/projects/issues/_header_title.html.haml1
-rw-r--r--app/views/projects/issues/index.html.haml2
-rw-r--r--app/views/projects/issues/new.html.haml2
-rw-r--r--app/views/projects/issues/show.html.haml2
-rw-r--r--app/views/projects/labels/_header_title.html.haml1
-rw-r--r--app/views/projects/labels/edit.html.haml2
-rw-r--r--app/views/projects/labels/index.html.haml1
-rw-r--r--app/views/projects/labels/new.html.haml2
-rw-r--r--app/views/projects/merge_requests/_header_title.html.haml1
-rw-r--r--app/views/projects/merge_requests/_show.html.haml2
-rw-r--r--app/views/projects/merge_requests/edit.html.haml2
-rw-r--r--app/views/projects/merge_requests/index.html.haml2
-rw-r--r--app/views/projects/merge_requests/invalid.html.haml2
-rw-r--r--app/views/projects/merge_requests/new.html.haml2
-rw-r--r--app/views/projects/milestones/_header_title.html.haml1
-rw-r--r--app/views/projects/milestones/edit.html.haml1
-rw-r--r--app/views/projects/milestones/index.html.haml1
-rw-r--r--app/views/projects/milestones/new.html.haml1
-rw-r--r--app/views/projects/milestones/show.html.haml2
-rw-r--r--app/views/projects/network/show.html.haml1
-rw-r--r--app/views/projects/project_members/_header_title.html.haml1
-rw-r--r--app/views/projects/project_members/import.html.haml2
-rw-r--r--app/views/projects/project_members/index.html.haml1
-rw-r--r--app/views/projects/snippets/_header_title.html.haml1
-rw-r--r--app/views/projects/snippets/edit.html.haml2
-rw-r--r--app/views/projects/snippets/index.html.haml2
-rw-r--r--app/views/projects/snippets/new.html.haml2
-rw-r--r--app/views/projects/snippets/show.html.haml2
-rw-r--r--app/views/projects/tags/index.html.haml1
-rw-r--r--app/views/projects/tags/new.html.haml2
-rw-r--r--app/views/projects/tree/show.html.haml1
-rw-r--r--app/views/projects/wikis/_header_title.html.haml1
-rw-r--r--app/views/projects/wikis/edit.html.haml2
-rw-r--r--app/views/projects/wikis/empty.html.haml2
-rw-r--r--app/views/projects/wikis/git_access.html.haml2
-rw-r--r--app/views/projects/wikis/history.html.haml4
-rw-r--r--app/views/projects/wikis/pages.html.haml2
-rw-r--r--app/views/projects/wikis/show.html.haml4
-rw-r--r--app/views/shared/projects/_list.html.haml2
-rw-r--r--db/migrate/20150916114643_add_help_page_text_to_application_settings.rb5
-rw-r--r--db/schema.rb1
-rw-r--r--doc/ssh/README.md2
-rw-r--r--features/steps/admin/settings.rb1
-rw-r--r--lib/ci/project_list_builder.rb21
-rw-r--r--spec/controllers/ci/projects_controller_spec.rb2
87 files changed, 227 insertions, 171 deletions
diff --git a/CHANGELOG b/CHANGELOG
index aab2416a09b..811089bbc61 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -53,6 +53,7 @@ v 8.0.0 (unreleased)
- Add FogBugz project import (Jared Szechy)
- Sort users autocomplete lists by user (Allister Antosik)
- Webhook for issue now contains repository field (Jungkook Park)
+ - Add ability to add custom text to the help page (Jeroen van Baarsen)
v 7.14.3
- No changes
diff --git a/Gemfile.lock b/Gemfile.lock
index eeaddc95a8e..f43e885ce48 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -928,6 +928,3 @@ DEPENDENCIES
webmock (~> 1.21.0)
whenever (~> 0.8.4)
wikicloth (= 0.8.1)
-
-BUNDLED WITH
- 1.10.6
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index f38e07af84b..7c134d2ec9b 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -46,6 +46,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:gravatar_enabled,
:twitter_sharing_enabled,
:sign_in_text,
+ :help_page_text,
:home_page_url,
:after_sign_out_path,
:max_attachment_size,
diff --git a/app/controllers/ci/application_controller.rb b/app/controllers/ci/application_controller.rb
index a5868da377f..d45c4e9caf1 100644
--- a/app/controllers/ci/application_controller.rb
+++ b/app/controllers/ci/application_controller.rb
@@ -10,9 +10,7 @@ module Ci
def authenticate_public_page!
unless project.public
- unless current_user
- redirect_to(new_user_sessions_path) and return
- end
+ authenticate_user!
return access_denied! unless can?(current_user, :read_project, gl_project)
end
diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb
index 6483a84ee91..653384b7178 100644
--- a/app/controllers/ci/projects_controller.rb
+++ b/app/controllers/ci/projects_controller.rb
@@ -5,38 +5,32 @@ module Ci
before_action :authenticate_user!, except: [:build, :badge, :index, :show]
before_action :authenticate_public_page!, only: :show
before_action :project, only: [:build, :integration, :show, :badge, :edit, :update, :destroy, :toggle_shared_runners, :dumped_yaml]
- before_action :authorize_access_project!, except: [:build, :gitlab, :badge, :index, :show, :new, :create]
+ before_action :authorize_access_project!, except: [:build, :badge, :index, :show, :new, :create]
before_action :authorize_manage_project!, only: [:edit, :integration, :update, :destroy, :toggle_shared_runners, :dumped_yaml]
before_action :authenticate_token!, only: [:build]
before_action :no_cache, only: [:badge]
protect_from_forgery except: :build
- layout 'ci/project', except: [:index, :gitlab]
+ layout 'ci/project', except: :index
def index
- @projects = Ci::Project.ordered_by_last_commit_date.public_only.page(params[:page]) unless current_user
- end
-
- def gitlab
@limit, @offset = (params[:limit] || PROJECTS_BATCH).to_i, (params[:offset] || 0).to_i
@page = @offset == 0 ? 1 : (@offset / @limit + 1)
- @gl_projects = current_user.authorized_projects
- @gl_projects = @gl_projects.where("name LIKE ?", "%#{params[:search]}%") if params[:search]
- @gl_projects = @gl_projects.page(@page).per(@limit)
+ if current_user
+ @projects = ProjectListBuilder.new.execute(current_user, params[:search])
- @projects = Ci::Project.where(gitlab_id: @gl_projects.map(&:id)).ordered_by_last_commit_date
- @total_count = @gl_projects.size
+ @projects = @projects.page(@page).per(@limit)
- @gl_projects = @gl_projects.where.not(id: @projects.map(&:gitlab_id))
+ @total_count = @projects.size
+ end
respond_to do |format|
format.json do
- pager_json("ci/projects/gitlab", @total_count)
+ pager_json("ci/projects/index", @total_count)
end
+ format.html
end
- rescue
- @error = 'Failed to fetch GitLab projects'
end
def show
diff --git a/app/finders/trending_projects_finder.rb b/app/finders/trending_projects_finder.rb
index f3f4d461efa..9ea342cb26d 100644
--- a/app/finders/trending_projects_finder.rb
+++ b/app/finders/trending_projects_finder.rb
@@ -2,21 +2,12 @@ class TrendingProjectsFinder
def execute(current_user, start_date = nil)
start_date ||= Date.today - 1.month
+ projects = projects_for(current_user)
+
# Determine trending projects based on comments count
# for period of time - ex. month
- trending_project_ids = Note.
- select("notes.project_id, count(notes.project_id) as pcount").
- where('notes.created_at > ?', start_date).
- group("project_id").
- reorder("pcount DESC").
- map(&:project_id)
-
- sql_order_ids = trending_project_ids.reverse.
- map { |project_id| "id = #{project_id}" }.join(", ")
-
- # Get list of projects that user allowed to see
- projects = projects_for(current_user)
- projects.where(id: trending_project_ids).reorder(sql_order_ids)
+ projects.joins(:notes).where('notes.created_at > ?', start_date).
+ group("projects.id").reorder("count(notes.id) DESC")
end
private
diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb
index 5e70de23f29..1d36969cd62 100644
--- a/app/helpers/groups_helper.rb
+++ b/app/helpers/groups_helper.rb
@@ -31,12 +31,12 @@ module GroupsHelper
end
end
- def group_title(group, name, url)
+ def group_title(group, name = nil, url = nil)
+ full_title = link_to(simple_sanitize(group.name), group_path(group))
+ full_title += ' &middot; '.html_safe + link_to(simple_sanitize(name), url) if name
+
content_tag :span do
- link_to(
- simple_sanitize(group.name), group_path(group)
- ) + ' &middot; '.html_safe +
- link_to(simple_sanitize(name), url)
+ full_title
end
end
end
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 6a2de0de77c..a2b83c50c2e 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -317,41 +317,6 @@ module ProjectsHelper
@ref || @repository.try(:root_ref)
end
- def detect_project_title(project)
- name, url =
- if current_controller? 'wikis'
- ['Wiki', get_project_wiki_path(project)]
- elsif current_controller? 'project_members'
- ['Members', namespace_project_project_members_path(project.namespace, project)]
- elsif current_controller? 'labels'
- ['Labels', namespace_project_labels_path(project.namespace, project)]
- elsif current_controller? 'members'
- ['Members', project_files_path(project)]
- elsif current_controller? 'commits'
- ['Commits', project_commits_path(project)]
- elsif current_controller? 'graphs'
- ['Graphs', namespace_project_graph_path(project.namespace, project, current_ref)]
- elsif current_controller? 'network'
- ['Network', namespace_project_network_path(project.namespace, project, current_ref)]
- elsif current_controller? 'milestones'
- ['Milestones', namespace_project_milestones_path(project.namespace, project)]
- elsif current_controller? 'snippets'
- ['Snippets', namespace_project_snippets_path(project.namespace, project)]
- elsif current_controller? 'issues'
- ['Issues', namespace_project_issues_path(project.namespace, project)]
- elsif current_controller? 'merge_requests'
- ['Merge Requests', namespace_project_merge_requests_path(project.namespace, project)]
- elsif current_controller? 'tree', 'blob'
- ['Files', project_files_path(project)]
- elsif current_path? 'projects#activity'
- ['Activity', activity_project_path(project)]
- else
- [nil, nil]
- end
-
- project_title(project, name, url)
- end
-
private
def filename_path(project, filename)
diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index 330b8bbf9d2..a36ae0b766c 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -118,6 +118,11 @@
.col-sm-10
= f.text_area :sign_in_text, class: 'form-control', rows: 4
.help-block Markdown enabled
+ .form-group
+ = f.label :help_page_text, class: 'control-label col-sm-2'
+ .col-sm-10
+ = f.text_area :help_page_text, class: 'form-control', rows: 4
+ .help-block Markdown enabled
.form-actions
= f.submit 'Save', class: 'btn btn-primary'
diff --git a/app/views/ci/projects/_form.html.haml b/app/views/ci/projects/_form.html.haml
index d50e1a83b06..e782fd8a0f7 100644
--- a/app/views/ci/projects/_form.html.haml
+++ b/app/views/ci/projects/_form.html.haml
@@ -96,6 +96,5 @@
.form-actions
= f.submit 'Save changes', class: 'btn btn-save'
- = link_to 'Cancel', projects_path, class: 'btn'
- unless @project.new_record?
= link_to 'Remove Project', ci_project_path(@project), method: :delete, data: { confirm: 'Project will be removed. Are you sure?' }, class: 'btn btn-danger pull-right'
diff --git a/app/views/ci/projects/_gl_projects.html.haml b/app/views/ci/projects/_gl_projects.html.haml
deleted file mode 100644
index 7bd30b37caf..00000000000
--- a/app/views/ci/projects/_gl_projects.html.haml
+++ /dev/null
@@ -1,15 +0,0 @@
-- @gl_projects.sort_by(&:name_with_namespace).each do |project|
- %tr.light
- %td
- = project.name_with_namespace
- %td
- %small Not added to CI
- %td
- %td
- - if Ci::Project.already_added?(project)
- %strong.cgreen
- Added
- - else
- = form_tag ci_projects_path do
- = hidden_field_tag :project, project.to_json(methods: [:name_with_namespace, :path_with_namespace, :ssh_url_to_repo])
- = submit_tag 'Add project to CI', class: 'btn btn-default btn-sm'
diff --git a/app/views/ci/projects/_project.html.haml b/app/views/ci/projects/_project.html.haml
index 47415265b44..29e9f023dda 100644
--- a/app/views/ci/projects/_project.html.haml
+++ b/app/views/ci/projects/_project.html.haml
@@ -1,22 +1,38 @@
-- last_commit = project.last_commit
-%tr{class: commit_status_css_class(last_commit) }
- %td
- = link_to [:ci, project] do
- = project.name
- %td
- - if last_commit
- #{last_commit.status} (#{commit_link(last_commit)})
- - if project.last_commit_date
- = time_ago_in_words project.last_commit_date
- ago
- - else
- No builds yet
- %td
- - if project.public
- %i.fa.fa-globe
- Public
- - else
- %i.fa.fa-lock
- Private
- %td
- = project.commits.count
+- if project.gitlab_ci_project
+ - ci_project = project.gitlab_ci_project
+ - last_commit = ci_project.last_commit
+ %tr{class: commit_status_css_class(last_commit) }
+ %td
+ = link_to [:ci, ci_project] do
+ = ci_project.name
+ %td
+ - if last_commit
+ %span.ci-status<
+ = last_commit.status
+ = commit_link(last_commit)
+ &middot;
+ - if ci_project.last_commit_date
+ = time_ago_in_words ci_project.last_commit_date
+ ago
+ - else
+ No builds yet
+ %td
+ - if ci_project.public
+ %i.fa.fa-globe
+ Public
+ - else
+ %i.fa.fa-lock
+ Private
+ %td
+ = ci_project.commits.count
+- else
+ %tr.light
+ %td
+ = project.name_with_namespace
+ %td
+ %small Not added to CI
+ %td
+ %td
+ = form_tag ci_projects_path do
+ = hidden_field_tag :project, project.to_json(methods: [:name_with_namespace, :path_with_namespace, :ssh_url_to_repo])
+ = submit_tag 'Add project to CI', class: 'btn btn-default btn-sm'
diff --git a/app/views/ci/projects/_search.html.haml b/app/views/ci/projects/_search.html.haml
index 6d84b25a6af..4ab43a403f7 100644
--- a/app/views/ci/projects/_search.html.haml
+++ b/app/views/ci/projects/_search.html.haml
@@ -5,13 +5,7 @@
.input-group-addon
%i.fa.fa-search
-
:coffeescript
$('.ci-search-form').submit ->
- NProgress.start()
- query = $('.ci-search-form .search-input').val()
- $.get '#{gitlab_ci_projects_path}', { search: query }, (data) ->
- $(".projects").html data.html
- NProgress.done()
- CiPager.init "#{gitlab_ci_projects_path}" + "?search=" + query, #{Ci::ProjectsController::PROJECTS_BATCH}, false
+ CiPager.init "#{ci_projects_path}" + "?search=" + query, #{Ci::ProjectsController::PROJECTS_BATCH}, false
false
diff --git a/app/views/ci/projects/gitlab.html.haml b/app/views/ci/projects/gitlab.html.haml
deleted file mode 100644
index 2101aa932a4..00000000000
--- a/app/views/ci/projects/gitlab.html.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-- if @offset == 0
- .gray-content-block.clearfix.light.second-block
- .pull-left.fetch-status
- - if params[:search].present?
- by keyword: "#{params[:search]}",
- #{@total_count} projects, #{@projects.size} of them added to CI
-
- .wide-table-holder
- %table.table.projects-table.content-list
- %thead
- %tr
- %th Project Name
- %th Last commit
- %th Access
- %th Commits
-
- = render @projects
-
- = render "gl_projects"
-
- %p.text-center.hide.loading
- %i.fa.fa-refresh.fa-spin
-
-- else
- = render @projects
-
- = render "gl_projects"
diff --git a/app/views/ci/projects/index.html.haml b/app/views/ci/projects/index.html.haml
index 60ab29a66cf..8de205d57aa 100644
--- a/app/views/ci/projects/index.html.haml
+++ b/app/views/ci/projects/index.html.haml
@@ -1,13 +1,30 @@
- if current_user
- .gray-content-block.top-block
- = render "search"
- .projects
- %p.fetch-status.light
- %i.fa.fa-refresh.fa-spin
+ - if @offset > 0
+ = render @projects
+ - else
+ .gray-content-block.top-block
+ = render "search"
+ .projects
+ .gray-content-block.clearfix.light.second-block
+ .pull-left.fetch-status
+ - if params[:search].present?
+ by keyword: "#{params[:search]}",
+ #{@total_count} projects
+
+ .wide-table-holder
+ %table.table.projects-table.content-list
+ %thead
+ %tr
+ %th Project Name
+ %th Last commit
+ %th Access
+ %th Commits
+
+ = render @projects
+ %p.text-center.hide.loading
+ %i.fa.fa-refresh.fa-spin
:coffeescript
- $.get '#{gitlab_ci_projects_path}', (data) ->
- $(".projects").html data.html
- CiPager.init "#{gitlab_ci_projects_path}", #{Ci::ProjectsController::PROJECTS_BATCH}, false
+ CiPager.init "#{ci_projects_path}", #{Ci::ProjectsController::PROJECTS_BATCH}, false
- else
= render 'public'
diff --git a/app/views/groups/milestones/_header_title.html.haml b/app/views/groups/milestones/_header_title.html.haml
new file mode 100644
index 00000000000..d7fabf53587
--- /dev/null
+++ b/app/views/groups/milestones/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title group_title(@group, "Milestones", group_milestones_path(@group))
diff --git a/app/views/groups/milestones/show.html.haml b/app/views/groups/milestones/show.html.haml
index 8f2decb851f..0c213f42186 100644
--- a/app/views/groups/milestones/show.html.haml
+++ b/app/views/groups/milestones/show.html.haml
@@ -1,4 +1,6 @@
- page_title @group_milestone.title, "Milestones"
+= render "header_title"
+
%h4.page-title
.issue-box{ class: "issue-box-#{@group_milestone.closed? ? 'closed' : 'open'}" }
- if @group_milestone.closed?
diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml
index bf4b7234b21..f492aaf4c0a 100644
--- a/app/views/help/index.html.haml
+++ b/app/views/help/index.html.haml
@@ -17,6 +17,9 @@
Used by more than 100,000 organizations, GitLab is the most popular solution to manage git repositories on-premises.
%br
Read more about GitLab at #{link_to promo_host, promo_url, target: '_blank'}.
+ - if current_application_settings.help_page_text.present?
+ %hr
+ = markdown(current_application_settings.help_page_text)
%hr
diff --git a/app/views/layouts/ci/_nav_admin.html.haml b/app/views/layouts/ci/_nav_admin.html.haml
index d0ca4c421ef..e9974c85733 100644
--- a/app/views/layouts/ci/_nav_admin.html.haml
+++ b/app/views/layouts/ci/_nav_admin.html.haml
@@ -1,9 +1,9 @@
%ul.nav.nav-sidebar
= nav_link do
- = link_to admin_root_path, title: 'Back to dashboard', data: {placement: 'right'}, class: 'back-link' do
+ = link_to admin_root_path, title: 'Back to admin', data: {placement: 'right'}, class: 'back-link' do
= icon('caret-square-o-left fw')
%span
- Back to Admin
+ Back to admin
%li.separate-item
= nav_link path: 'projects#index' do
diff --git a/app/views/layouts/dashboard.html.haml b/app/views/layouts/dashboard.html.haml
index fad7de69432..cb96bcc2cf4 100644
--- a/app/views/layouts/dashboard.html.haml
+++ b/app/views/layouts/dashboard.html.haml
@@ -1,6 +1,5 @@
- page_title "Dashboard"
-- unless @header_title
- - header_title "Dashboard", root_path
+- header_title "Dashboard", root_path unless header_title
- sidebar "dashboard"
= render template: "layouts/application"
diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml
index 4f00d01d4cd..31888c5580e 100644
--- a/app/views/layouts/group.html.haml
+++ b/app/views/layouts/group.html.haml
@@ -1,6 +1,5 @@
- page_title @group.name
-- unless @header_title
- - header_title @group.name, group_path(@group)
-- sidebar "group" unless sidebar
+- header_title group_title(@group) unless header_title
+- sidebar "group" unless sidebar
= render template: "layouts/application"
diff --git a/app/views/layouts/group_settings.html.haml b/app/views/layouts/group_settings.html.haml
index e303a561628..a1a1fc2f858 100644
--- a/app/views/layouts/group_settings.html.haml
+++ b/app/views/layouts/group_settings.html.haml
@@ -1,4 +1,5 @@
- page_title "Settings"
+- header_title group_title(@group, "Settings", edit_group_path(@group))
- sidebar "group_settings"
= render template: "layouts/group"
diff --git a/app/views/layouts/nav/_dashboard.html.haml b/app/views/layouts/nav/_dashboard.html.haml
index f172e9b4ae8..3bda7c46959 100644
--- a/app/views/layouts/nav/_dashboard.html.haml
+++ b/app/views/layouts/nav/_dashboard.html.haml
@@ -46,6 +46,8 @@
= icon('question-circle fw')
%span
Help
+
+ %li.separate-item
= nav_link(controller: :profile) do
= link_to profile_path, title: 'Profile settings', data: {placement: 'bottom'} do
= icon('user fw')
diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml
index b80ce0dfc75..dfa6cc5702e 100644
--- a/app/views/layouts/profile.html.haml
+++ b/app/views/layouts/profile.html.haml
@@ -1,6 +1,5 @@
- page_title "Profile Settings"
-- unless @header_title
- - header_title "Profile Settings", profile_path
+- header_title "Profile Settings", profile_path unless header_title
- sidebar "profile"
= render template: "layouts/application"
diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml
index 5c4dd67f0ec..78dafcd8bfa 100644
--- a/app/views/layouts/project.html.haml
+++ b/app/views/layouts/project.html.haml
@@ -1,6 +1,6 @@
- page_title @project.name_with_namespace
-- header_title detect_project_title(@project)
-- sidebar "project" unless sidebar
+- header_title project_title(@project) unless header_title
+- sidebar "project" unless sidebar
- content_for :scripts_body_top do
- if current_user
diff --git a/app/views/layouts/project_settings.html.haml b/app/views/layouts/project_settings.html.haml
index 43401668334..59ce38f67bb 100644
--- a/app/views/layouts/project_settings.html.haml
+++ b/app/views/layouts/project_settings.html.haml
@@ -1,4 +1,5 @@
- page_title "Settings"
+- header_title project_title(@project, "Settings", edit_project_path(@project))
- sidebar "project_settings"
= render template: "layouts/project"
diff --git a/app/views/projects/activity.html.haml b/app/views/projects/activity.html.haml
index 5f6e5f3b644..555ed76426d 100644
--- a/app/views/projects/activity.html.haml
+++ b/app/views/projects/activity.html.haml
@@ -1,2 +1,4 @@
- page_title "Activity"
+- header_title project_title(@project, "Activity", activity_project_path(@project))
+
= render 'projects/activity'
diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml
index c1ec42aefca..6518c4173e1 100644
--- a/app/views/projects/blame/show.html.haml
+++ b/app/views/projects/blame/show.html.haml
@@ -1,4 +1,6 @@
- page_title "Blame", @blob.path, @ref
+- header_title project_title(@project, "Files", project_files_path(@project))
+
%h3.page-title Blame view
#tree-holder.tree-holder
diff --git a/app/views/projects/blob/_header_title.html.haml b/app/views/projects/blob/_header_title.html.haml
new file mode 100644
index 00000000000..78c5ef20a5f
--- /dev/null
+++ b/app/views/projects/blob/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Files", project_files_path(@project))
diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml
index 648f15418e0..a811adc5094 100644
--- a/app/views/projects/blob/edit.html.haml
+++ b/app/views/projects/blob/edit.html.haml
@@ -1,4 +1,6 @@
- page_title "Edit", @blob.path, @ref
+= render "header_title"
+
.file-editor
%ul.center-top-menu.no-bottom.js-edit-mode
%li.active
diff --git a/app/views/projects/blob/new.html.haml b/app/views/projects/blob/new.html.haml
index 071c3bb7da8..1950586b112 100644
--- a/app/views/projects/blob/new.html.haml
+++ b/app/views/projects/blob/new.html.haml
@@ -1,3 +1,6 @@
+- page_title "New File", @path.presence, @ref
+= render "header_title"
+
.gray-content-block.top-block
Create a new file or
= link_to 'upload', '#modal-upload-blob',
diff --git a/app/views/projects/blob/show.html.haml b/app/views/projects/blob/show.html.haml
index a536d1cf272..fa4be4a1bc4 100644
--- a/app/views/projects/blob/show.html.haml
+++ b/app/views/projects/blob/show.html.haml
@@ -1,4 +1,5 @@
- page_title @blob.path, @ref
+= render "header_title"
= render 'projects/last_push'
diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml
index 6e2dc2d2710..03ade02a0c8 100644
--- a/app/views/projects/branches/index.html.haml
+++ b/app/views/projects/branches/index.html.haml
@@ -1,4 +1,5 @@
- page_title "Branches"
+= render "projects/commits/header_title"
= render "projects/commits/head"
.gray-content-block
.pull-right
diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml
index 29e82b93883..f5577042ca4 100644
--- a/app/views/projects/branches/new.html.haml
+++ b/app/views/projects/branches/new.html.haml
@@ -1,4 +1,6 @@
- page_title "New Branch"
+= render "projects/commits/header_title"
+
- if @error
.alert.alert-danger
%button{ type: "button", class: "close", "data-dismiss" => "alert"} &times;
diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml
index 60b112e67d4..f8681024d1b 100644
--- a/app/views/projects/commit/show.html.haml
+++ b/app/views/projects/commit/show.html.haml
@@ -1,4 +1,5 @@
- page_title "#{@commit.title} (#{@commit.short_id})", "Commits"
+= render "projects/commits/header_title"
= render "commit_box"
= render "projects/diffs/diffs", diffs: @diffs, project: @project
= render "projects/notes/notes_with_form", view: params[:view]
diff --git a/app/views/projects/commits/_header_title.html.haml b/app/views/projects/commits/_header_title.html.haml
new file mode 100644
index 00000000000..e4385893dd9
--- /dev/null
+++ b/app/views/projects/commits/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Commits", project_commits_path(@project))
diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml
index a01a99458a0..2dd99cc8215 100644
--- a/app/views/projects/commits/show.html.haml
+++ b/app/views/projects/commits/show.html.haml
@@ -1,4 +1,5 @@
- page_title "Commits", @ref
+= render "header_title"
= content_for :meta_tags do
- if current_user
= auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.private_token), title: "#{@project.name}:#{@ref} commits")
diff --git a/app/views/projects/compare/index.html.haml b/app/views/projects/compare/index.html.haml
index 43d00726c48..02be5a2d07f 100644
--- a/app/views/projects/compare/index.html.haml
+++ b/app/views/projects/compare/index.html.haml
@@ -1,4 +1,5 @@
- page_title "Compare"
+= render "projects/commits/header_title"
= render "projects/commits/head"
.gray-content-block
diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml
index 8800ffdf482..39755efd2fd 100644
--- a/app/views/projects/compare/show.html.haml
+++ b/app/views/projects/compare/show.html.haml
@@ -1,4 +1,5 @@
- page_title "#{params[:from]}...#{params[:to]}"
+= render "projects/commits/header_title"
= render "projects/commits/head"
diff --git a/app/views/projects/graphs/_header_title.html.haml b/app/views/projects/graphs/_header_title.html.haml
new file mode 100644
index 00000000000..1e2f61cd22b
--- /dev/null
+++ b/app/views/projects/graphs/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Graphs", namespace_project_graph_path(@project.namespace, @project, current_ref))
diff --git a/app/views/projects/graphs/commits.html.haml b/app/views/projects/graphs/commits.html.haml
index a357736bf52..bf0cac539b8 100644
--- a/app/views/projects/graphs/commits.html.haml
+++ b/app/views/projects/graphs/commits.html.haml
@@ -1,4 +1,5 @@
-- page_title "Commit statistics"
+- page_title "Commits", "Graphs"
+= render "header_title"
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs_commits'
= render 'head'
diff --git a/app/views/projects/graphs/show.html.haml b/app/views/projects/graphs/show.html.haml
index ecdd0eaf52f..bd342911e49 100644
--- a/app/views/projects/graphs/show.html.haml
+++ b/app/views/projects/graphs/show.html.haml
@@ -1,4 +1,5 @@
-- page_title "Contributor statistics"
+- page_title "Contributors", "Graphs"
+= render "header_title"
.tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs'
= render 'head'
diff --git a/app/views/projects/issues/_header_title.html.haml b/app/views/projects/issues/_header_title.html.haml
new file mode 100644
index 00000000000..99f03549c44
--- /dev/null
+++ b/app/views/projects/issues/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Issues", namespace_project_issues_path(@project.namespace, @project))
diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml
index 24314d11404..d6260ab2900 100644
--- a/app/views/projects/issues/index.html.haml
+++ b/app/views/projects/issues/index.html.haml
@@ -1,4 +1,6 @@
- page_title "Issues"
+= render "header_title"
+
= content_for :meta_tags do
- if current_user
= auto_discovery_link_tag(:atom, namespace_project_issues_url(@project.namespace, @project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
diff --git a/app/views/projects/issues/new.html.haml b/app/views/projects/issues/new.html.haml
index da6edd5c2d2..153447baa1b 100644
--- a/app/views/projects/issues/new.html.haml
+++ b/app/views/projects/issues/new.html.haml
@@ -1,2 +1,4 @@
- page_title "New Issue"
+= render "header_title"
+
= render "form"
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml
index 09080642293..5cb814c9ea8 100644
--- a/app/views/projects/issues/show.html.haml
+++ b/app/views/projects/issues/show.html.haml
@@ -1,4 +1,6 @@
- page_title "#{@issue.title} (##{@issue.iid})", "Issues"
+= render "header_title"
+
.issue
.issue-details.issuable-details
.page-title
diff --git a/app/views/projects/labels/_header_title.html.haml b/app/views/projects/labels/_header_title.html.haml
new file mode 100644
index 00000000000..abe28da483b
--- /dev/null
+++ b/app/views/projects/labels/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Labels", namespace_project_labels_path(@project.namespace, @project))
diff --git a/app/views/projects/labels/edit.html.haml b/app/views/projects/labels/edit.html.haml
index 645402667fd..bc4ab0ca27c 100644
--- a/app/views/projects/labels/edit.html.haml
+++ b/app/views/projects/labels/edit.html.haml
@@ -1,4 +1,6 @@
- page_title "Edit", @label.name, "Labels"
+= render "header_title"
+
%h3
Edit label
%span.light #{@label.name}
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml
index 284adb40e97..97175f8232b 100644
--- a/app/views/projects/labels/index.html.haml
+++ b/app/views/projects/labels/index.html.haml
@@ -1,4 +1,5 @@
- page_title "Labels"
+= render "header_title"
.gray-content-block.top-block
- if can? current_user, :admin_label, @project
diff --git a/app/views/projects/labels/new.html.haml b/app/views/projects/labels/new.html.haml
index b3ef17025c3..342ad4f3f95 100644
--- a/app/views/projects/labels/new.html.haml
+++ b/app/views/projects/labels/new.html.haml
@@ -1,4 +1,6 @@
- page_title "New Label"
+= render "header_title"
+
%h3 New label
.back-link
= link_to namespace_project_labels_path(@project.namespace, @project) do
diff --git a/app/views/projects/merge_requests/_header_title.html.haml b/app/views/projects/merge_requests/_header_title.html.haml
new file mode 100644
index 00000000000..669a9b06bdf
--- /dev/null
+++ b/app/views/projects/merge_requests/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Merge Requests", namespace_project_merge_requests_path(@project.namespace, @project))
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index 61e04dce5ab..0b0f52c653c 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -1,4 +1,6 @@
- page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
+= render "header_title"
+
- if params[:view] == 'parallel'
- fluid_layout true
diff --git a/app/views/projects/merge_requests/edit.html.haml b/app/views/projects/merge_requests/edit.html.haml
index 7e5cb07f249..303ca0a880b 100644
--- a/app/views/projects/merge_requests/edit.html.haml
+++ b/app/views/projects/merge_requests/edit.html.haml
@@ -1,4 +1,6 @@
- page_title "Edit", "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
+= render "header_title"
+
%h3.page-title
= "Edit merge request ##{@merge_request.iid}"
%hr
diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml
index d3a576977c2..086298e5af1 100644
--- a/app/views/projects/merge_requests/index.html.haml
+++ b/app/views/projects/merge_requests/index.html.haml
@@ -1,4 +1,6 @@
- page_title "Merge Requests"
+= render "header_title"
+
= render 'projects/last_push'
.project-issuable-filter
.controls
diff --git a/app/views/projects/merge_requests/invalid.html.haml b/app/views/projects/merge_requests/invalid.html.haml
index 15bd4e2fafd..fc03ee73a3d 100644
--- a/app/views/projects/merge_requests/invalid.html.haml
+++ b/app/views/projects/merge_requests/invalid.html.haml
@@ -1,4 +1,6 @@
- page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
+= render "header_title"
+
.merge-request
= render "projects/merge_requests/show/mr_title"
= render "projects/merge_requests/show/mr_box"
diff --git a/app/views/projects/merge_requests/new.html.haml b/app/views/projects/merge_requests/new.html.haml
index b038a640f67..9fdde80c6d9 100644
--- a/app/views/projects/merge_requests/new.html.haml
+++ b/app/views/projects/merge_requests/new.html.haml
@@ -1,4 +1,6 @@
- page_title "New Merge Request"
+= render "header_title"
+
- if @merge_request.can_be_created
= render 'new_submit'
- else
diff --git a/app/views/projects/milestones/_header_title.html.haml b/app/views/projects/milestones/_header_title.html.haml
new file mode 100644
index 00000000000..5f4b6982a6d
--- /dev/null
+++ b/app/views/projects/milestones/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Milestones", namespace_project_milestones_path(@project.namespace, @project))
diff --git a/app/views/projects/milestones/edit.html.haml b/app/views/projects/milestones/edit.html.haml
index c09815a212a..e9dc0b77462 100644
--- a/app/views/projects/milestones/edit.html.haml
+++ b/app/views/projects/milestones/edit.html.haml
@@ -1,2 +1,3 @@
- page_title "Edit", @milestone.title, "Milestones"
+= render "header_title"
= render "form"
diff --git a/app/views/projects/milestones/index.html.haml b/app/views/projects/milestones/index.html.haml
index 2b8fd671587..a207385bd43 100644
--- a/app/views/projects/milestones/index.html.haml
+++ b/app/views/projects/milestones/index.html.haml
@@ -1,4 +1,5 @@
- page_title "Milestones"
+= render "header_title"
= render 'shared/milestones_filter'
.gray-content-block
diff --git a/app/views/projects/milestones/new.html.haml b/app/views/projects/milestones/new.html.haml
index 47149dfea41..9ba9acb6f77 100644
--- a/app/views/projects/milestones/new.html.haml
+++ b/app/views/projects/milestones/new.html.haml
@@ -1,2 +1,3 @@
- page_title "New Milestone"
+= render "header_title"
= render "form"
diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml
index 7b1681df336..4eeb0621e52 100644
--- a/app/views/projects/milestones/show.html.haml
+++ b/app/views/projects/milestones/show.html.haml
@@ -1,4 +1,6 @@
- page_title @milestone.title, "Milestones"
+= render "header_title"
+
%h4.page-title
.issue-box{ class: issue_box_class(@milestone) }
- if @milestone.closed?
diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml
index 52b5b8b877e..16005161df6 100644
--- a/app/views/projects/network/show.html.haml
+++ b/app/views/projects/network/show.html.haml
@@ -1,4 +1,5 @@
- page_title "Network", @ref
+= header_title project_title(@project, "Network", namespace_project_network_path(@project.namespace, @project, current_ref))
= render "head"
.project-network
.controls
diff --git a/app/views/projects/project_members/_header_title.html.haml b/app/views/projects/project_members/_header_title.html.haml
new file mode 100644
index 00000000000..a31f0a37fa2
--- /dev/null
+++ b/app/views/projects/project_members/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Members", namespace_project_project_members_path(@project.namespace, @project))
diff --git a/app/views/projects/project_members/import.html.haml b/app/views/projects/project_members/import.html.haml
index 6914543f6da..189906498cb 100644
--- a/app/views/projects/project_members/import.html.haml
+++ b/app/views/projects/project_members/import.html.haml
@@ -1,4 +1,6 @@
- page_title "Import members"
+= render "header_title"
+
%h3.page-title
Import members from another project
%p.light
diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml
index a40d1513671..9a0a824b811 100644
--- a/app/views/projects/project_members/index.html.haml
+++ b/app/views/projects/project_members/index.html.haml
@@ -1,4 +1,5 @@
- page_title "Members"
+= render "header_title"
.gray-content-block.top-block
.clearfix.js-toggle-container
diff --git a/app/views/projects/snippets/_header_title.html.haml b/app/views/projects/snippets/_header_title.html.haml
new file mode 100644
index 00000000000..04f0bbe9853
--- /dev/null
+++ b/app/views/projects/snippets/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, "Snippets", namespace_project_snippets_path(@project.namespace, @project))
diff --git a/app/views/projects/snippets/edit.html.haml b/app/views/projects/snippets/edit.html.haml
index 945f0084dff..e69f2d99709 100644
--- a/app/views/projects/snippets/edit.html.haml
+++ b/app/views/projects/snippets/edit.html.haml
@@ -1,4 +1,6 @@
- page_title "Edit", @snippet.title, "Snippets"
+= render "header_title"
+
%h3.page-title
Edit snippet
%hr
diff --git a/app/views/projects/snippets/index.html.haml b/app/views/projects/snippets/index.html.haml
index 45d4de6a385..3fed2c9949d 100644
--- a/app/views/projects/snippets/index.html.haml
+++ b/app/views/projects/snippets/index.html.haml
@@ -1,4 +1,6 @@
- page_title "Snippets"
+= render "header_title"
+
%h3.page-title
Snippets
- if can? current_user, :create_project_snippet, @project
diff --git a/app/views/projects/snippets/new.html.haml b/app/views/projects/snippets/new.html.haml
index e38d95c45e7..67cd69fd215 100644
--- a/app/views/projects/snippets/new.html.haml
+++ b/app/views/projects/snippets/new.html.haml
@@ -1,4 +1,6 @@
- page_title "New Snippets"
+= render "header_title"
+
%h3.page-title
New snippet
%hr
diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml
index 8cbb813c758..be7d4d486fa 100644
--- a/app/views/projects/snippets/show.html.haml
+++ b/app/views/projects/snippets/show.html.haml
@@ -1,4 +1,6 @@
- page_title @snippet.title, "Snippets"
+= render "header_title"
+
%h3.page-title
= @snippet.title
diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml
index 1503a4330f4..85d76eae3b5 100644
--- a/app/views/projects/tags/index.html.haml
+++ b/app/views/projects/tags/index.html.haml
@@ -1,4 +1,5 @@
- page_title "Tags"
+= render "projects/commits/header_title"
= render "projects/commits/head"
.gray-content-block
diff --git a/app/views/projects/tags/new.html.haml b/app/views/projects/tags/new.html.haml
index 172fafdeeff..9f5c1be125c 100644
--- a/app/views/projects/tags/new.html.haml
+++ b/app/views/projects/tags/new.html.haml
@@ -1,4 +1,6 @@
- page_title "New Tag"
+= render "projects/commits/header_title"
+
- if @error
.alert.alert-danger
%button{ type: "button", class: "close", "data-dismiss" => "alert"} &times;
diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml
index c9e59428e78..dec4677f830 100644
--- a/app/views/projects/tree/show.html.haml
+++ b/app/views/projects/tree/show.html.haml
@@ -1,4 +1,5 @@
- page_title @path.presence || "Files", @ref
+- header_title project_title(@project, "Files", project_files_path(@project))
= content_for :meta_tags do
- if current_user
= auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.private_token), title: "#{@project.name}:#{@ref} commits")
diff --git a/app/views/projects/wikis/_header_title.html.haml b/app/views/projects/wikis/_header_title.html.haml
new file mode 100644
index 00000000000..408adc36ca6
--- /dev/null
+++ b/app/views/projects/wikis/_header_title.html.haml
@@ -0,0 +1 @@
+- header_title project_title(@project, 'Wiki', get_project_wiki_path(@project))
diff --git a/app/views/projects/wikis/edit.html.haml b/app/views/projects/wikis/edit.html.haml
index 3f1dce1050c..0b709c3695b 100644
--- a/app/views/projects/wikis/edit.html.haml
+++ b/app/views/projects/wikis/edit.html.haml
@@ -1,4 +1,6 @@
- page_title "Edit", @page.title, "Wiki"
+= render "header_title"
+
= render 'nav'
.pull-right
= render 'main_links'
diff --git a/app/views/projects/wikis/empty.html.haml b/app/views/projects/wikis/empty.html.haml
index ead99412406..c7e490c3cd1 100644
--- a/app/views/projects/wikis/empty.html.haml
+++ b/app/views/projects/wikis/empty.html.haml
@@ -1,4 +1,6 @@
- page_title "Wiki"
+= render "header_title"
+
%h3.page-title Empty page
%hr
.error_message
diff --git a/app/views/projects/wikis/git_access.html.haml b/app/views/projects/wikis/git_access.html.haml
index 226fd3b2290..6417ef4a38b 100644
--- a/app/views/projects/wikis/git_access.html.haml
+++ b/app/views/projects/wikis/git_access.html.haml
@@ -1,4 +1,6 @@
- page_title "Git Access", "Wiki"
+= render "header_title"
+
= render 'nav'
.gray-content-block
.row
diff --git a/app/views/projects/wikis/history.html.haml b/app/views/projects/wikis/history.html.haml
index 7c81ad53d32..bfbef823b35 100644
--- a/app/views/projects/wikis/history.html.haml
+++ b/app/views/projects/wikis/history.html.haml
@@ -1,4 +1,6 @@
-- page_title "History", @page.title, "Wiki"
+- page_title "History", @page.title.capitalize, "Wiki"
+= render "header_title"
+
= render 'nav'
.gray-content-block
%h3.page-title
diff --git a/app/views/projects/wikis/pages.html.haml b/app/views/projects/wikis/pages.html.haml
index 7fb91507eb2..03e6a522b25 100644
--- a/app/views/projects/wikis/pages.html.haml
+++ b/app/views/projects/wikis/pages.html.haml
@@ -1,4 +1,6 @@
- page_title "All Pages", "Wiki"
+= render "header_title"
+
= render 'nav'
.gray-content-block
%h3.page-title
diff --git a/app/views/projects/wikis/show.html.haml b/app/views/projects/wikis/show.html.haml
index 126810811ec..55fbf5a8b6e 100644
--- a/app/views/projects/wikis/show.html.haml
+++ b/app/views/projects/wikis/show.html.haml
@@ -1,4 +1,6 @@
-- page_title @page.title, "Wiki"
+- page_title @page.title.capitalize, "Wiki"
+= render "header_title"
+
= render 'nav'
.gray-content-block
diff --git a/app/views/shared/projects/_list.html.haml b/app/views/shared/projects/_list.html.haml
index 021e3b689a1..330b0626d63 100644
--- a/app/views/shared/projects/_list.html.haml
+++ b/app/views/shared/projects/_list.html.haml
@@ -8,7 +8,7 @@
= render "shared/projects/project", project: project,
avatar: avatar, stars: stars, css_class: css_class
- - if projects.count > projects_limit
+ - if projects.size > projects_limit
%li.bottom.center
.light
#{projects_limit} of #{pluralize(projects.count, 'project')} displayed.
diff --git a/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb b/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb
new file mode 100644
index 00000000000..37a27f11935
--- /dev/null
+++ b/db/migrate/20150916114643_add_help_page_text_to_application_settings.rb
@@ -0,0 +1,5 @@
+class AddHelpPageTextToApplicationSettings < ActiveRecord::Migration
+ def change
+ add_column :application_settings, :help_page_text, :text
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 151f34e1965..bf5a88f10e8 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -45,6 +45,7 @@ ActiveRecord::Schema.define(version: 20150916145038) do
t.string "after_sign_out_path"
t.integer "session_expire_delay", default: 10080, null: false
t.text "import_sources"
+ t.text "help_page_text"
end
create_table "audit_events", force: true do |t|
diff --git a/doc/ssh/README.md b/doc/ssh/README.md
index 7cdcd11c04c..7b294a70fe7 100644
--- a/doc/ssh/README.md
+++ b/doc/ssh/README.md
@@ -72,6 +72,8 @@ access can happen through being a direct member of the project, or through
a group. See `def accessible_deploy_keys` in `app/models/user.rb` for more
information.
+Deploy keys can be shared between projects, you just need to add them to each project.
+
## Applications
### Eclipse
diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb
index 7a6aec23af8..6acbf46eb20 100644
--- a/features/steps/admin/settings.rb
+++ b/features/steps/admin/settings.rb
@@ -7,6 +7,7 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
step 'I modify settings and save form' do
uncheck 'Gravatar enabled'
fill_in 'Home page URL', with: 'https://about.gitlab.com/'
+ fill_in 'Help page text', with: 'Example text'
click_button 'Save'
end
diff --git a/lib/ci/project_list_builder.rb b/lib/ci/project_list_builder.rb
new file mode 100644
index 00000000000..da26f9a9f47
--- /dev/null
+++ b/lib/ci/project_list_builder.rb
@@ -0,0 +1,21 @@
+module Ci
+ class ProjectListBuilder
+ def execute(current_user, search = nil)
+ projects = current_user.authorized_projects
+ projects = projects.search(search) if search
+
+ projects.
+ joins("LEFT JOIN ci_projects ON projects.id = ci_projects.gitlab_id
+ LEFT JOIN #{last_commit_subquery} AS last_commit ON #{Ci::Project.table_name}.id = last_commit.project_id").
+ reorder("ci_projects.id is NULL ASC,
+ CASE WHEN last_commit.committed_at IS NULL THEN 1 ELSE 0 END,
+ last_commit.committed_at DESC")
+ end
+
+ private
+
+ def last_commit_subquery
+ "(SELECT project_id, MAX(committed_at) committed_at FROM #{Ci::Commit.table_name} GROUP BY project_id)"
+ end
+ end
+end
diff --git a/spec/controllers/ci/projects_controller_spec.rb b/spec/controllers/ci/projects_controller_spec.rb
index 015788a05e1..c7a3cd50c20 100644
--- a/spec/controllers/ci/projects_controller_spec.rb
+++ b/spec/controllers/ci/projects_controller_spec.rb
@@ -84,7 +84,7 @@ describe Ci::ProjectsController do
end
it "searches projects" do
- xhr :get, :gitlab, { search: "str", format: "js" }.with_indifferent_access
+ xhr :get, :index, { search: "str", format: "json" }.with_indifferent_access
expect(response).to be_success
expect(response.code).to eq('200')