Commit 2122d7b9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' into ci-build-list

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parents e8666898 1eb3dde4
...@@ -53,6 +53,7 @@ v 8.0.0 (unreleased) ...@@ -53,6 +53,7 @@ v 8.0.0 (unreleased)
- Add FogBugz project import (Jared Szechy) - Add FogBugz project import (Jared Szechy)
- Sort users autocomplete lists by user (Allister Antosik) - Sort users autocomplete lists by user (Allister Antosik)
- Webhook for issue now contains repository field (Jungkook Park) - 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 v 7.14.3
- No changes - No changes
......
...@@ -928,6 +928,3 @@ DEPENDENCIES ...@@ -928,6 +928,3 @@ DEPENDENCIES
webmock (~> 1.21.0) webmock (~> 1.21.0)
whenever (~> 0.8.4) whenever (~> 0.8.4)
wikicloth (= 0.8.1) wikicloth (= 0.8.1)
BUNDLED WITH
1.10.6
...@@ -46,6 +46,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -46,6 +46,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:gravatar_enabled, :gravatar_enabled,
:twitter_sharing_enabled, :twitter_sharing_enabled,
:sign_in_text, :sign_in_text,
:help_page_text,
:home_page_url, :home_page_url,
:after_sign_out_path, :after_sign_out_path,
:max_attachment_size, :max_attachment_size,
......
...@@ -10,9 +10,7 @@ module Ci ...@@ -10,9 +10,7 @@ module Ci
def authenticate_public_page! def authenticate_public_page!
unless project.public unless project.public
unless current_user authenticate_user!
redirect_to(new_user_sessions_path) and return
end
return access_denied! unless can?(current_user, :read_project, gl_project) return access_denied! unless can?(current_user, :read_project, gl_project)
end end
......
...@@ -5,38 +5,32 @@ module Ci ...@@ -5,38 +5,32 @@ module Ci
before_action :authenticate_user!, except: [:build, :badge, :index, :show] before_action :authenticate_user!, except: [:build, :badge, :index, :show]
before_action :authenticate_public_page!, only: :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 :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 :authorize_manage_project!, only: [:edit, :integration, :update, :destroy, :toggle_shared_runners, :dumped_yaml]
before_action :authenticate_token!, only: [:build] before_action :authenticate_token!, only: [:build]
before_action :no_cache, only: [:badge] before_action :no_cache, only: [:badge]
protect_from_forgery except: :build protect_from_forgery except: :build
layout 'ci/project', except: [:index, :gitlab] layout 'ci/project', except: :index
def 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 @limit, @offset = (params[:limit] || PROJECTS_BATCH).to_i, (params[:offset] || 0).to_i
@page = @offset == 0 ? 1 : (@offset / @limit + 1) @page = @offset == 0 ? 1 : (@offset / @limit + 1)
@gl_projects = current_user.authorized_projects if current_user
@gl_projects = @gl_projects.where("name LIKE ?", "%#{params[:search]}%") if params[:search] @projects = ProjectListBuilder.new.execute(current_user, params[:search])
@gl_projects = @gl_projects.page(@page).per(@limit)
@projects = Ci::Project.where(gitlab_id: @gl_projects.map(&:id)).ordered_by_last_commit_date @projects = @projects.page(@page).per(@limit)
@total_count = @gl_projects.size
@gl_projects = @gl_projects.where.not(id: @projects.map(&:gitlab_id)) @total_count = @projects.size
end
respond_to do |format| respond_to do |format|
format.json do format.json do
pager_json("ci/projects/gitlab", @total_count) pager_json("ci/projects/index", @total_count)
end end
format.html
end end
rescue
@error = 'Failed to fetch GitLab projects'
end end
def show def show
......
...@@ -2,21 +2,12 @@ class TrendingProjectsFinder ...@@ -2,21 +2,12 @@ class TrendingProjectsFinder
def execute(current_user, start_date = nil) def execute(current_user, start_date = nil)
start_date ||= Date.today - 1.month start_date ||= Date.today - 1.month
projects = projects_for(current_user)
# Determine trending projects based on comments count # Determine trending projects based on comments count
# for period of time - ex. month # for period of time - ex. month
trending_project_ids = Note. projects.joins(:notes).where('notes.created_at > ?', start_date).
select("notes.project_id, count(notes.project_id) as pcount"). group("projects.id").reorder("count(notes.id) DESC")
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)
end end
private private
......
...@@ -31,12 +31,12 @@ module GroupsHelper ...@@ -31,12 +31,12 @@ module GroupsHelper
end end
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 content_tag :span do
link_to( full_title
simple_sanitize(group.name), group_path(group)
) + ' &middot; '.html_safe +
link_to(simple_sanitize(name), url)
end end
end end
end end
...@@ -317,41 +317,6 @@ module ProjectsHelper ...@@ -317,41 +317,6 @@ module ProjectsHelper
@ref || @repository.try(:root_ref) @ref || @repository.try(:root_ref)
end 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 private
def filename_path(project, filename) def filename_path(project, filename)
......
...@@ -118,6 +118,11 @@ ...@@ -118,6 +118,11 @@
.col-sm-10 .col-sm-10
= f.text_area :sign_in_text, class: 'form-control', rows: 4 = f.text_area :sign_in_text, class: 'form-control', rows: 4
.help-block Markdown enabled .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 .form-actions
= f.submit 'Save', class: 'btn btn-primary' = f.submit 'Save', class: 'btn btn-primary'
...@@ -96,6 +96,5 @@ ...@@ -96,6 +96,5 @@
.form-actions .form-actions
= f.submit 'Save changes', class: 'btn btn-save' = f.submit 'Save changes', class: 'btn btn-save'
= link_to 'Cancel', projects_path, class: 'btn'
- unless @project.new_record? - 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' = 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'
- @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'
- last_commit = project.last_commit - if project.gitlab_ci_project
%tr{class: commit_status_css_class(last_commit) } - ci_project = project.gitlab_ci_project
%td - last_commit = ci_project.last_commit
= link_to [:ci, project] do %tr{class: commit_status_css_class(last_commit) }
= project.name %td
%td = link_to [:ci, ci_project] do
- if last_commit = ci_project.name
#{last_commit.status} (#{commit_link(last_commit)}) %td
- if project.last_commit_date - if last_commit
= time_ago_in_words project.last_commit_date %span.ci-status<
ago = last_commit.status
- else = commit_link(last_commit)
No builds yet &middot;
%td - if ci_project.last_commit_date
- if project.public = time_ago_in_words ci_project.last_commit_date
%i.fa.fa-globe ago
Public - else
- else No builds yet
%i.fa.fa-lock %td
Private - if ci_project.public
%td %i.fa.fa-globe
= project.commits.count 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'
...@@ -5,13 +5,7 @@ ...@@ -5,13 +5,7 @@
.input-group-addon .input-group-addon
%i.fa.fa-search %i.fa.fa-search
:coffeescript :coffeescript
$('.ci-search-form').submit -> $('.ci-search-form').submit ->
NProgress.start() CiPager.init "#{ci_projects_path}" + "?search=" + query, #{Ci::ProjectsController::PROJECTS_BATCH}, false
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
false false
- 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"
- if current_user - if current_user
.gray-content-block.top-block - if @offset > 0
= render "search" = render @projects
.projects - else
%p.fetch-status.light .gray-content-block.top-block
%i.fa.fa-refresh.fa-spin = 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 :coffeescript
$.get '#{gitlab_ci_projects_path}', (data) -> CiPager.init "#{ci_projects_path}", #{Ci::ProjectsController::PROJECTS_BATCH}, false
$(".projects").html data.html
CiPager.init "#{gitlab_ci_projects_path}", #{Ci::ProjectsController::PROJECTS_BATCH}, false
- else - else
= render 'public' = render 'public'
- header_title group_title(@group, "Milestones", group_milestones_path(@group))
- page_title @group_milestone.title, "Milestones" - page_title @group_milestone.title, "Milestones"
= render "header_title"
%h4.page-title %h4.page-title
.issue-box{ class: "issue-box-#{@group_milestone.closed? ? 'closed' : 'open'}" } .issue-box{ class: "issue-box-#{@group_milestone.closed? ? 'closed' : 'open'}" }
- if @group_milestone.closed? - if @group_milestone.closed?
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
Used by more than 100,000 organizations, GitLab is the most popular solution to manage git repositories on-premises. Used by more than 100,000 organizations, GitLab is the most popular solution to manage git repositories on-premises.
%br %br
Read more about GitLab at #{link_to promo_host, promo_url, target: '_blank'}. 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 %hr
......
%ul.nav.nav-sidebar %ul.nav.nav-sidebar
= nav_link do = 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') = icon('caret-square-o-left fw')
%span %span
Back to Admin Back to admin
%li.separate-item %li.separate-item
= nav_link path: 'projects#index' do = nav_link path: 'projects#index' do
......
- page_title "Dashboard" - page_title "Dashboard"
- unless @header_title - header_title "Dashboard", root_path unless header_title
- header_title "Dashboard", root_path
- sidebar "dashboard" - sidebar "dashboard"
= render template: "layouts/application" = render template: "layouts/application"
- page_title @group.name - page_title @group.name
- unless @header_title - header_title group_title(@group) unless header_title
- header_title @group.name, group_path(@group) - sidebar "group" unless sidebar
- sidebar "group" unless sidebar
= render template: "layouts/application" = render template: "layouts/application"
- page_title "Settings" - page_title "Settings"
- header_title group_title(@group, "Settings", edit_group_path(@group))
- sidebar "group_settings" - sidebar "group_settings"
= render template: "layouts/group" = render template: "layouts/group"
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
= icon('question-circle fw') = icon('question-circle fw')
%span %span
Help Help
%li.separate-item
= nav_link(controller: :profile) do = nav_link(controller: :profile) do
= link_to profile_path, title: 'Profile settings', data: {placement: 'bottom'} do = link_to profile_path, title: 'Profile settings', data: {placement: 'bottom'} do
= icon('user fw') = icon('user fw')
......
- page_title "Profile Settings" - page_title "Profile Settings"
- unless @header_title - header_title "Profile Settings", profile_path unless header_title
- header_title "Profile Settings", profile_path
- sidebar "profile" - sidebar "profile"
= render template: "layouts/application" = render template: "layouts/application"
- page_title @project.name_with_namespace - page_title @project.name_with_namespace
- header_title detect_project_title(@project) - header_title project_title(@project) unless header_title
- sidebar "project" unless sidebar - sidebar "project" unless sidebar
- content_for :scripts_body_top do - content_for :scripts_body_top do
- if current_user - if current_user
......
- page_title "Settings" - page_title "Settings"
- header_title project_title(@project, "Settings", edit_project_path(@project))
- sidebar "project_settings" - sidebar "project_settings"
= render template: "layouts/project" = render template: "layouts/project"
- page_title "Activity" - page_title "Activity"
- header_title project_title(@project, "Activity", activity_project_path(@project))
= render 'projects/activity' = render 'projects/activity'
- page_title "Blame", @blob.path, @ref - page_title "Blame", @blob.path, @ref
- header_title project_title(@project, "Files", project_files_path(@project))
%h3.page-title Blame view %h3.page-title Blame view
#tree-holder.tree-holder #tree-holder.tree-holder
......
- header_title project_title(@project, "Files", project_files_path(@project))
- page_title "Edit", @blob.path, @ref - page_title "Edit", @blob.path, @ref
= render "header_title"
.file-editor .file-editor
%ul.center-top-menu.no-bottom.js-edit-mode %ul.center-top-menu.no-bottom.js-edit-mode
%li.active %li.active
......
- page_title "New File", @path.presence, @ref
= render "header_title"
.gray-content-block.top-block .gray-content-block.top-block
Create a new file or Create a new file or
= link_to 'upload', '#modal-upload-blob', = link_to 'upload', '#modal-upload-blob',
......
- page_title @blob.path, @ref - page_title @blob.path, @ref
= render "header_title"
= render 'projects/last_push' = render 'projects/last_push'
......
- page_title "Branches" - page_title "Branches"
= render "projects/commits/header_title"
= render "projects/commits/head" = render "projects/commits/head"
.gray-content-block .gray-content-block
.pull-right .pull-right
......
- page_title "New Branch" - page_title "New Branch"
= render "projects/commits/header_title"
- if @error - if @error
.alert.alert-danger .alert.alert-danger
%button{ type: "button", class: "close", "data-dismiss" => "alert"} &times; %button{ type: "button", class: "close", "data-dismiss" => "alert"} &times;
......
- page_title "#{@commit.title} (#{@commit.short_id})", "Commits" - page_title "#{@commit.title} (#{@commit.short_id})", "Commits"
= render "projects/commits/header_title"
= render "commit_box" = render "commit_box"
= render "projects/diffs/diffs", diffs: @diffs, project: @project = render "projects/diffs/diffs", diffs: @diffs, project: @project
= render "projects/notes/notes_with_form", view: params[:view] = render "projects/notes/notes_with_form", view: params[:view]
- header_title project_title(@project, "Commits", project_commits_path(@project))
- page_title "Commits", @ref - page_title "Commits", @ref
= render "header_title"
= content_for :meta_tags do = content_for :meta_tags do
- if current_user - 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") = 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")
......
- page_title "Compare" - page_title "Compare"
= render "projects/commits/header_title"
= render "projects/commits/head" = render "projects/commits/head"
.gray-content-block .gray-content-block
......
- page_title "#{params[:from]}...#{params[:to]}" - page_title "#{params[:from]}...#{params[:to]}"
= render "projects/commits/header_title"
= render "projects/commits/head" = render "projects/commits/head"
......
- header_title project_title(@project, "Graphs", namespace_project_graph_path(@project.namespace, @project, current_ref))
- page_title "Commit statistics" - page_title "Commits", "Graphs"
= render "header_title"
.tree-ref-holder .tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs_commits' = render 'shared/ref_switcher', destination: 'graphs_commits'
= render 'head' = render 'head'
......
- page_title "Contributor statistics" - page_title "Contributors", "Graphs"
= render "header_title"
.tree-ref-holder .tree-ref-holder
= render 'shared/ref_switcher', destination: 'graphs' = render 'shared/ref_switcher', destination: 'graphs'
= render 'head' = render 'head'
......
- header_title project_title(@project, "Issues", namespace_project_issues_path(@project.namespace, @project))
- page_title "Issues" - page_title "Issues"
= render "header_title"
= content_for :meta_tags do = content_for :meta_tags do
- if current_user - 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") = auto_discovery_link_tag(:atom, namespace_project_issues_url(@project.namespace, @project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
......
- page_title "New Issue" - page_title "New Issue"
= render "header_title"
= render "form" = render "form"
- page_title "#{@issue.title} (##{@issue.iid})", "Issues" - page_title "#{@issue.title} (##{@issue.iid})", "Issues"
= render "header_title"
.issue .issue
.issue-details.issuable-details .issue-details.issuable-details
.page-title .page-title
......
- header_title project_title(@project, "Labels", namespace_project_labels_path(@project.namespace, @project))
- page_title "Edit", @label.name, "Labels" - page_title "Edit", @label.name, "Labels"
= render "header_title"
%h3 %h3
Edit label Edit label
%span.light #{@label.name} %span.light #{@label.name}
......
- page_title "Labels" - page_title "Labels"
= render "header_title"
.gray-content-block.top-block .gray-content-block.top-block
- if can? current_user, :admin_label, @project - if can? current_user, :admin_label, @project
......
- page_title "New Label" - page_title "New Label"
= render "header_title"
%h3 New label %h3 New label
.back-link .back-link
= link_to namespace_project_labels_path(@project.namespace, @project) do = link_to namespace_project_labels_path(@project.namespace, @project) do
......
- header_title project_title(@project, "Merge Requests", namespace_project_merge_requests_path(@project.namespace, @project))
- page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests" - page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
= render "header_title"
- if params[:view] == 'parallel' - if params[:view] == 'parallel'
- fluid_layout true - fluid_layout true
......
- page_title "Edit", "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests" - page_title "Edit", "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
= render "header_title"
%h3.page-title %h3.page-title
= "Edit merge request ##{@merge_request.iid}" = "Edit merge request ##{@merge_request.iid}"
%hr %hr
......
- page_title "Merge Requests" - page_title "Merge Requests"
= render "header_title"
= render 'projects/last_push' = render 'projects/last_push'
.project-issuable-filter .project-issuable-filter
.controls .controls
......
- page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests" - page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
= render "header_title"
.merge-request .merge-request
= render "projects/merge_requests/show/mr_title" = render "projects/merge_requests/show/mr_title"
= render "projects/merge_requests/show/mr_box" = render "projects/merge_requests/show/mr_box"
......
- page_title "New Merge Request" - page_title "New Merge Request"
= render "header_title"
- if @merge_request.can_be_created - if @merge_request.can_be_created
= render 'new_submit' = render 'new_submit'
- else - else
......
- header_title project_title(@project, "Milestones", namespace_project_milestones_path(@project.namespace, @project))
- page_title "Edit", @milestone.title, "Milestones" - page_title "Edit", @milestone.title, "Milestones"
= render "header_title"
= render "form" = render "form"
- page_title "Milestones" - page_title "Milestones"
= render "header_title"
= render 'shared/milestones_filter' = render 'shared/milestones_filter'
.gray-content-block .gray-content-block
......
- page_title "New Milestone" - page_title "New Milestone"
= render "header_title"
= render "form" = render "form"
- page_title @milestone.title, "Milestones" - page_title @milestone.title, "Milestones"
= render "header_title"
%h4.page-title %h4.page-title
.issue-box{ class: issue_box_class(@milestone) } .issue-box{ class: issue_box_class(@milestone) }
- if @milestone.closed? - if @milestone.closed?
......
- page_title "Network", @ref - page_title "Network", @ref
= header_title project_title(@project, "Network", namespace_project_network_path(@project.namespace, @project, current_ref))
= render "head" = render "head"
.project-network .project-network
.controls .controls
......
- header_title project_title(@project, "Members", namespace_project_project_members_path(@project.namespace, @project))
- page_title "Import members" - page_title "Import members"
= render "header_title"
%h3.page-title %h3.page-title
Import members from another project Import members from another project
%p.light %p.light
......
- page_title "Members" - page_title "Members"
= render "header_title"
.gray-content-block.top-block .gray-content-block.top-block
.clearfix.js-toggle-container .clearfix.js-toggle-container
......
- header_title project_title(@project, "Snippets", namespace_project_snippets_path(@project.namespace, @project))
- page_title "Edit", @snippet.title, "Snippets" - page_title "Edit", @snippet.title, "Snippets"
= render "header_title"
%h3.page-title %h3.page-title
Edit snippet Edit snippet
%hr %hr
......
- page_title "Snippets" - page_title "Snippets"
= render "header_title"
%h3.page-title %h3.page-title
Snippets Snippets
- if can? current_user, :create_project_snippet, @project - if can? current_user, :create_project_snippet, @project
......
- page_title "New Snippets" - page_title "New Snippets"
= render "header_title"
%h3.page-title %h3.page-title
New snippet New snippet
%hr %hr
......
- page_title @snippet.title, "Snippets" - page_title @snippet.title, "Snippets"
= render "header_title"
%h3.page-title %h3.page-title
= @snippet.title = @snippet.title
......
- page_title "Tags" - page_title "Tags"
= render "projects/commits/header_title"
= render "projects/commits/head" = render "projects/commits/head"
.gray-content-block .gray-content-block
......
- page_title "New Tag" - page_title "New Tag"
= render "projects/commits/header_title"
- if @error - if @error
.alert.alert-danger .alert.alert-danger
%button{ type: "button", class: "close", "data-dismiss" => "alert"} &times; %button{ type: "button", class: "close", "data-dismiss" => "alert"} &times;
......
- page_title @path.presence || "Files", @ref - page_title @path.presence || "Files", @ref
- header_title project_title(@project, "Files", project_files_path(@project))
= content_for :meta_tags do = content_for :meta_tags do
- if current_user - 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") = 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")
......
- header_title project_title(@project, 'Wiki', get_project_wiki_path(@project))
- page_title "Edit", @page.title, "Wiki" - page_title "Edit", @page.title, "Wiki"
= render "header_title"
= render 'nav' = render 'nav'
.pull-right .pull-right
= render 'main_links' = render 'main_links'
......
- page_title "Wiki" - page_title "Wiki"
= render "header_title"
%h3.page-title Empty page %h3.page-title Empty page
%hr %hr
.error_message .error_message
......
- page_title "Git Access", "Wiki" - page_title "Git Access", "Wiki"
= render "header_title"
= render 'nav' = render 'nav'
.gray-content-block .gray-content-block
.row .row
......
- page_title "History", @page.title, "Wiki" - page_title "History", @page.title.capitalize, "Wiki"
= render "header_title"
= render 'nav' = render 'nav'
.gray-content-block .gray-content-block
%h3.page-title %h3.page-title
......
- page_title "All Pages", "Wiki" - page_title "All Pages", "Wiki"
= render "header_title"
= render 'nav' = render 'nav'
.gray-content-block .gray-content-block
%h3.page-title %h3.page-title
......
- page_title @page.title, "Wiki" - page_title @page.title.capitalize, "Wiki"
= render "header_title"
= render 'nav' = render 'nav'
.gray-content-block .gray-content-block
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
= render "shared/projects/project", project: project, = render "shared/projects/project", project: project,
avatar: avatar, stars: stars, css_class: css_class avatar: avatar, stars: stars, css_class: css_class
- if projects.count > projects_limit - if projects.size > projects_limit
%li.bottom.center %li.bottom.center
.light .light
#{projects_limit} of #{pluralize(projects.count, 'project')} displayed. #{projects_limit} of #{pluralize(projects.count, 'project')} displayed.
......
class AddHelpPageTextToApplicationSettings < ActiveRecord::Migration
def change
add_column :application_settings, :help_page_text, :text
end
end
...@@ -45,6 +45,7 @@ ActiveRecord::Schema.define(version: 20150916145038) do ...@@ -45,6 +45,7 @@ ActiveRecord::Schema.define(version: 20150916145038) do
t.string "after_sign_out_path" t.string "after_sign_out_path"
t.integer "session_expire_delay", default: 10080, null: false t.integer "session_expire_delay", default: 10080, null: false
t.text "import_sources" t.text "import_sources"
t.text "help_page_text"
end end
create_table "audit_events", force: true do |t| create_table "audit_events", force: true do |t|
......
...@@ -72,6 +72,8 @@ access can happen through being a direct member of the project, or through ...@@ -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 a group. See `def accessible_deploy_keys` in `app/models/user.rb` for more
information. information.
Deploy keys can be shared between projects, you just need to add them to each project.
## Applications ## Applications
### Eclipse ### Eclipse
......
...@@ -7,6 +7,7 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps ...@@ -7,6 +7,7 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps
step 'I modify settings and save form' do step 'I modify settings and save form' do
uncheck 'Gravatar enabled' uncheck 'Gravatar enabled'
fill_in 'Home page URL', with: 'https://about.gitlab.com/' fill_in 'Home page URL', with: 'https://about.gitlab.com/'
fill_in 'Help page text', with: 'Example text'
click_button 'Save' click_button 'Save'
end end
......
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
...@@ -84,7 +84,7 @@ describe Ci::ProjectsController do ...@@ -84,7 +84,7 @@ describe Ci::ProjectsController do
end end
it "searches projects" do 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).to be_success
expect(response.code).to eq('200') expect(response.code).to eq('200')
......
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