Commit 68ee3972 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ce-to-ee' into 'master'

CE to EE

See merge request !385
parents 8d1fb78e 68ac2060
...@@ -37,6 +37,6 @@ public/assets/ ...@@ -37,6 +37,6 @@ public/assets/
public/uploads.* public/uploads.*
public/uploads/ public/uploads/
rails_best_practices_output.html rails_best_practices_output.html
tags /tags
tmp/ tmp/
vendor/bundle/* vendor/bundle/*
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 7.11.0 (unreleased) v 7.11.0 (unreleased)
- Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu)
- Add application setting to restrict user signups to e-mail domains (Stan Hu)
- Don't allow a merge request to be merged when its title starts with "WIP".
- Add a page title to every page.
- Allow primary email to be set to an email that you've already added.
- Fix Error 500 when searching Wiki pages (Stan Hu)
- Get Gitorious importer to work again. - Get Gitorious importer to work again.
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky) - Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
- Ignore invalid lines in .gitmodules - Ignore invalid lines in .gitmodules
- Fix "Cannot move project" error message from popping up after a successful transfer (Stan Hu) - Fix "Cannot move project" error message from popping up after a successful transfer (Stan Hu)
- Redirect to sign in page after signing out. - Redirect to sign in page after signing out.
- Fix "Hello @username." references not working by no longer allowing usernames to end in period. - Fix "Hello @username." references not working by no longer allowing usernames to end in period.
- Fix "Revspec not found" errors when viewing diffs in a forked project with submodules (Stan Hu)
- -
- Fix broken file browsing with relative submodule in personal projects (Stan Hu)
- Fix DB error when trying to tag a repository (Stan Hu)
- Add "Reply quoting selected text" shortcut key (`r`) - Add "Reply quoting selected text" shortcut key (`r`)
- Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention. - Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention.
- Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention. - Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention.
- Added GitLab Event header for project hooks
- -
- Show Atom feed buttons everywhere where applicable. - Show Atom feed buttons everywhere where applicable.
- Add project activity atom feed. - Add project activity atom feed.
- Don't crash when an MR from a fork has a cross-reference comment from the target project on of its commits. - Don't crash when an MR from a fork has a cross-reference comment from the target project on one of its commits.
- Include commit comments in MR from a forked project. - Include commit comments in MR from a forked project.
- - Fix adding new group members from admin area
- Group milestones by title in the dashboard and all other issue views.
- Query issues, merge requests and milestones with their IID through API (Julien Bianchi)
- Add default project and snippet visibility settings to the admin web UI. - Add default project and snippet visibility settings to the admin web UI.
- Show incompatible projects in Google Code import status (Stan Hu)
- Fix bug where commit data would not appear in some subdirectories (Stan Hu)
- Unescape branch names in compare commit (Stan Hu)
-
- Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu) - Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu)
- Move snippets UI to fluid layout - Move snippets UI to fluid layout
- Improve UI for sidebar. Increase separation between navigation and content - Improve UI for sidebar. Increase separation between navigation and content
- Improve new project command options (Ben Bodenmiller) - Improve new project command options (Ben Bodenmiller)
- Add common method to force UTF-8 and use it to properly handle non-ascii OAuth user properties (Onur Küçük)
- Prevent sending empty messages to HipChat (Chulki Lee) - Prevent sending empty messages to HipChat (Chulki Lee)
- Improve UI for mobile phones on dashboard and project pages - Improve UI for mobile phones on dashboard and project pages
- Add room notification and message color option for HipChat - Add room notification and message color option for HipChat
- Allow to use non-ASCII letters and dashes in project and namespace name. (Jakub Jirutka)
- Add footnotes support to Markdown (Guillaume Delbergue)
- Add current_sign_in_at to UserFull REST api.
v 7.10.0 v 7.10.0
- Ignore submodules that are defined in .gitmodules but are checked in as directories. - Ignore submodules that are defined in .gitmodules but are checked in as directories.
...@@ -111,7 +129,6 @@ v 7.9.0 (unreleased) ...@@ -111,7 +129,6 @@ v 7.9.0 (unreleased)
- Fixed link paths for HTTP and SSH on the admin project view (Jeremy Maziarz) - Fixed link paths for HTTP and SSH on the admin project view (Jeremy Maziarz)
- Fix and improve help rendering (Sullivan Sénéchal) - Fix and improve help rendering (Sullivan Sénéchal)
- Fix final line in EmailsOnPush email diff being rendered as error. - Fix final line in EmailsOnPush email diff being rendered as error.
- Authometic setup GitLab CI project for forks if origin project has GitLab CI enabled
- Prevent duplicate Buildkite service creation. - Prevent duplicate Buildkite service creation.
- Fix git over ssh errors 'fatal: protocol error: bad line length character' - Fix git over ssh errors 'fatal: protocol error: bad line length character'
- Automatically setup GitLab CI project for forks if origin project has GitLab CI enabled - Automatically setup GitLab CI project for forks if origin project has GitLab CI enabled
......
...@@ -209,6 +209,7 @@ group :development do ...@@ -209,6 +209,7 @@ group :development do
gem "letter_opener" gem "letter_opener"
gem 'quiet_assets', '~> 1.0.1' gem 'quiet_assets', '~> 1.0.1'
gem 'rack-mini-profiler', require: false gem 'rack-mini-profiler', require: false
gem 'rerun', '~> 0.10.0'
# Better errors handler # Better errors handler
gem 'better_errors' gem 'better_errors'
......
...@@ -47,7 +47,7 @@ GEM ...@@ -47,7 +47,7 @@ GEM
astrolabe (1.3.0) astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0) parser (>= 2.2.0.pre.3, < 3.0)
attr_required (1.0.0) attr_required (1.0.0)
autoprefixer-rails (5.1.6) autoprefixer-rails (5.1.11)
execjs execjs
json json
awesome_print (1.2.0) awesome_print (1.2.0)
...@@ -60,7 +60,7 @@ GEM ...@@ -60,7 +60,7 @@ GEM
erubis (>= 2.6.6) erubis (>= 2.6.6)
binding_of_caller (0.7.2) binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
bootstrap-sass (3.3.3) bootstrap-sass (3.3.4.1)
autoprefixer-rails (>= 5.0.0.1) autoprefixer-rails (>= 5.0.0.1)
sass (>= 3.2.19) sass (>= 3.2.19)
brakeman (3.0.1) brakeman (3.0.1)
...@@ -154,7 +154,7 @@ GEM ...@@ -154,7 +154,7 @@ GEM
escape_utils (0.2.4) escape_utils (0.2.4)
eventmachine (1.0.4) eventmachine (1.0.4)
excon (0.32.1) excon (0.32.1)
execjs (2.0.2) execjs (2.5.2)
expression_parser (0.9.0) expression_parser (0.9.0)
factory_girl (4.3.0) factory_girl (4.3.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
...@@ -167,7 +167,7 @@ GEM ...@@ -167,7 +167,7 @@ GEM
faraday (>= 0.7.4, < 0.9) faraday (>= 0.7.4, < 0.9)
fastercsv (1.5.5) fastercsv (1.5.5)
ffaker (1.22.1) ffaker (1.22.1)
ffi (1.9.3) ffi (1.9.8)
fog (1.21.0) fog (1.21.0)
fog-brightbox fog-brightbox
fog-core (~> 1.21, >= 1.21.1) fog-core (~> 1.21, >= 1.21.1)
...@@ -323,8 +323,8 @@ GEM ...@@ -323,8 +323,8 @@ GEM
addressable (~> 2.3) addressable (~> 2.3)
letter_opener (1.1.2) letter_opener (1.1.2)
launchy (~> 2.2) launchy (~> 2.2)
listen (2.3.1) listen (2.10.0)
celluloid (>= 0.15.2) celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3) rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9) rb-inotify (>= 0.9)
lumberjack (1.0.4) lumberjack (1.0.4)
...@@ -456,8 +456,8 @@ GEM ...@@ -456,8 +456,8 @@ GEM
raindrops (0.13.0) raindrops (0.13.0)
rake (10.4.2) rake (10.4.2)
raphael-rails (2.1.2) raphael-rails (2.1.2)
rb-fsevent (0.9.3) rb-fsevent (0.9.4)
rb-inotify (0.9.2) rb-inotify (0.9.5)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
...@@ -482,6 +482,8 @@ GEM ...@@ -482,6 +482,8 @@ GEM
redis-store (1.1.4) redis-store (1.1.4)
redis (>= 2.2) redis (>= 2.2)
request_store (1.0.5) request_store (1.0.5)
rerun (0.10.0)
listen (~> 2.7, >= 2.7.3)
rest-client (1.6.7) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
rinku (1.7.3) rinku (1.7.3)
...@@ -764,6 +766,7 @@ DEPENDENCIES ...@@ -764,6 +766,7 @@ DEPENDENCIES
redcarpet (~> 3.2.3) redcarpet (~> 3.2.3)
redis-rails redis-rails
request_store request_store
rerun (~> 0.10.0)
rspec-rails (= 2.99) rspec-rails (= 2.99)
rubocop (= 0.28.0) rubocop (= 0.28.0)
rugments rugments
......
...@@ -8,7 +8,6 @@ class Dispatcher ...@@ -8,7 +8,6 @@ class Dispatcher
initPageScripts: -> initPageScripts: ->
page = $('body').attr('data-page') page = $('body').attr('data-page')
project_id = $('body').attr('data-project-id')
unless page unless page
return false return false
......
...@@ -137,6 +137,12 @@ ...@@ -137,6 +137,12 @@
color: #666; color: #666;
} }
.nav-pills > .active > a > span > .badge {
background-color: #fff;
color: $gl-primary;
}
/** /**
* fix to keep tooltips position in top navigation bar * fix to keep tooltips position in top navigation bar
* *
......
...@@ -342,17 +342,8 @@ table { ...@@ -342,17 +342,8 @@ table {
} }
.search_box { .search_box {
position: relative; @extend .well;
padding: 30px;
text-align: center; text-align: center;
background-color: #F9F9F9;
border: 1px solid #DDDDDD;
border-radius: 0px;
}
.search_glyph {
color: #555;
font-size: 42px;
} }
.task-status { .task-status {
......
...@@ -10,7 +10,10 @@ header { ...@@ -10,7 +10,10 @@ header {
border: none; border: none;
width: 100%; width: 100%;
.navbar-inner { .container {
width: 100% !important;
padding: 0;
background: #FFF; background: #FFF;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
filter: none; filter: none;
...@@ -123,11 +126,6 @@ header { ...@@ -123,11 +126,6 @@ header {
} }
} }
.container {
width: 100% !important;
padding: 0px;
}
/** /**
* *
* Logo holder * Logo holder
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
} }
} }
.navbar-inner .title { .container .title {
margin-left: 6px !important; margin-left: 6px !important;
max-width: 70% !important; max-width: 70% !important;
} }
......
...@@ -35,7 +35,12 @@ pre { ...@@ -35,7 +35,12 @@ pre {
/* Link to current header. */ /* Link to current header. */
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
position: relative; position: relative;
&:hover > :last-child {
a.anchor {
display: none;
}
&:hover > a.anchor {
$size: 16px; $size: 16px;
position: absolute; position: absolute;
right: 100%; right: 100%;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
&.affix { &.affix {
position: fixed; position: fixed;
top: 70px; top: 70px;
width: 220px; margin-right: 35px;
} }
} }
} }
......
@mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) { @mixin gitlab-theme($color-light, $color, $color-darker, $color-dark) {
header { header {
&.navbar-gitlab { &.navbar-gitlab {
.navbar-inner { .app_logo {
.app_logo { background-color: $color-darker;
background-color: $color-darker;
a { a {
color: $color-light; color: $color-light;
} }
&:hover { &:hover {
background-color: $color-dark; background-color: $color-dark;
a { a {
color: #FFF; color: #FFF;
}
} }
} }
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# #
# Automatically sets the layout and ensures an administrator is logged in # Automatically sets the layout and ensures an administrator is logged in
class Admin::ApplicationController < ApplicationController class Admin::ApplicationController < ApplicationController
layout 'admin'
before_action :authenticate_admin! before_action :authenticate_admin!
layout 'admin'
def authenticate_admin! def authenticate_admin!
return render_404 unless current_user.is_admin? return render_404 unless current_user.is_admin?
......
...@@ -42,7 +42,8 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -42,7 +42,8 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:max_attachment_size, :max_attachment_size,
:default_project_visibility, :default_project_visibility,
:default_snippet_visibility, :default_snippet_visibility,
restricted_visibility_levels: [] :restricted_signup_domains_raw,
restricted_visibility_levels: [],
) )
end end
end end
...@@ -33,7 +33,7 @@ class Admin::HooksController < Admin::ApplicationController ...@@ -33,7 +33,7 @@ class Admin::HooksController < Admin::ApplicationController
owner_name: "Someone", owner_name: "Someone",
owner_email: "example@gitlabhq.com" owner_email: "example@gitlabhq.com"
} }
@hook.execute(data, 'system_hooks') @hook.execute(data)
redirect_to :back redirect_to :back
end end
......
...@@ -102,8 +102,7 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -102,8 +102,7 @@ class Admin::UsersController < Admin::ApplicationController
email = user.emails.find(params[:email_id]) email = user.emails.find(params[:email_id])
email.destroy email.destroy
user.set_notification_email user.update_secondary_emails!
user.save if user.notification_email_changed?
respond_to do |format| respond_to do |format|
format.html { redirect_to :back, notice: "Successfully removed email." } format.html { redirect_to :back, notice: "Successfully removed email." }
......
...@@ -3,6 +3,7 @@ require 'gon' ...@@ -3,6 +3,7 @@ require 'gon'
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
include Gitlab::CurrentSettings include Gitlab::CurrentSettings
include GitlabRoutingHelper include GitlabRoutingHelper
include PageLayoutHelper
PER_PAGE = 20 PER_PAGE = 20
...@@ -182,18 +183,6 @@ class ApplicationController < ActionController::Base ...@@ -182,18 +183,6 @@ class ApplicationController < ActionController::Base
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end end
def default_url_options
if !Rails.env.test?
port = Gitlab.config.gitlab.port unless Gitlab.config.gitlab_on_standard_port?
{ host: Gitlab.config.gitlab.host,
protocol: Gitlab.config.gitlab.protocol,
port: port,
script_name: Gitlab.config.gitlab.relative_url_root }
else
super
end
end
def default_headers def default_headers
headers['X-Frame-Options'] = 'DENY' headers['X-Frame-Options'] = 'DENY'
headers['X-XSS-Protection'] = '1; mode=block' headers['X-XSS-Protection'] = '1; mode=block'
...@@ -304,40 +293,15 @@ class ApplicationController < ActionController::Base ...@@ -304,40 +293,15 @@ class ApplicationController < ActionController::Base
@filter_params @filter_params
end end
def set_filter_values(collection)
assignee_id = @filter_params[:assignee_id]
author_id = @filter_params[:author_id]
milestone_id = @filter_params[:milestone_id]
@sort = @filter_params[:sort]
@assignees = User.where(id: collection.pluck(:assignee_id))
@authors = User.where(id: collection.pluck(:author_id))
@milestones = Milestone.where(id: collection.pluck(:milestone_id))
if assignee_id.present? && !assignee_id.to_i.zero?
@assignee = @assignees.find_by(id: assignee_id)
end
if author_id.present? && !author_id.to_i.zero?
@author = @authors.find_by(id: author_id)
end
if milestone_id.present? && !milestone_id.to_i.zero?
@milestone = @milestones.find_by(id: milestone_id)
end
end
def get_issues_collection def get_issues_collection
set_filters_params set_filters_params
issues = IssuesFinder.new.execute(current_user, @filter_params) issues = IssuesFinder.new.execute(current_user, @filter_params)
set_filter_values(issues)
issues issues
end end
def get_merge_requests_collection def get_merge_requests_collection
set_filters_params set_filters_params
merge_requests = MergeRequestsFinder.new.execute(current_user, @filter_params) merge_requests = MergeRequestsFinder.new.execute(current_user, @filter_params)
set_filter_values(merge_requests)
merge_requests merge_requests
end end
......
class Dashboard::ApplicationController < ApplicationController
layout 'dashboard'
end
class Dashboard::GroupsController < ApplicationController class Dashboard::GroupsController < Dashboard::ApplicationController
def index def index
@group_members = current_user.group_members.page(params[:page]).per(PER_PAGE) @group_members = current_user.group_members.page(params[:page]).per(PER_PAGE)
end end
......
class Dashboard::MilestonesController < ApplicationController class Dashboard::MilestonesController < Dashboard::ApplicationController
before_action :load_projects before_action :load_projects
def index def index
......
class Dashboard::ProjectsController < ApplicationController class Dashboard::ProjectsController < Dashboard::ApplicationController
before_action :event_filter before_action :event_filter
def starred def starred
......
class DashboardController < ApplicationController class DashboardController < Dashboard::ApplicationController
respond_to :html
before_action :load_projects, except: [:projects] before_action :load_projects, except: [:projects]
before_action :event_filter, only: :show before_action :event_filter, only: :show
respond_to :html
def show def show
@projects = @projects.includes(:namespace) @projects = @projects.includes(:namespace)
......
class Explore::ApplicationController < ApplicationController
layout 'explore'
end
class Explore::GroupsController < ApplicationController class Explore::GroupsController < Explore::ApplicationController
skip_before_action :authenticate_user!, skip_before_action :authenticate_user!,
:reject_blocked, :set_current_user_for_observers :reject_blocked, :set_current_user_for_observers
layout "explore"
def index def index
@groups = GroupsFinder.new.execute(current_user) @groups = GroupsFinder.new.execute(current_user)
@groups = @groups.search(params[:search]) if params[:search].present? @groups = @groups.search(params[:search]) if params[:search].present?
......
class Explore::ProjectsController < ApplicationController class Explore::ProjectsController < Explore::ApplicationController
skip_before_action :authenticate_user!, skip_before_action :authenticate_user!,
:reject_blocked :reject_blocked
layout 'explore'
def index def index
@projects = ProjectsFinder.new.execute(current_user) @projects = ProjectsFinder.new.execute(current_user)
@tags = @projects.tags_on(:tags) @tags = @projects.tags_on(:tags)
......
class Groups::ApplicationController < ApplicationController class Groups::ApplicationController < ApplicationController
layout 'group'
private private
...@@ -21,12 +22,4 @@ class Groups::ApplicationController < ApplicationController ...@@ -21,12 +22,4 @@ class Groups::ApplicationController < ApplicationController
def group def group
@group ||= Group.find_by(path: params[:group_id]) @group ||= Group.find_by(path: params[:group_id])
end end
def determine_layout
if current_user
'group'
else
'public_group'
end
end
end end
class Groups::AvatarsController < ApplicationController class Groups::AvatarsController < ApplicationController
layout "profile"
def destroy def destroy
@group = Group.find_by(path: params[:group_id]) @group = Group.find_by(path: params[:group_id])
@group.remove_avatar! @group.remove_avatar!
......
...@@ -6,8 +6,6 @@ class Groups::GroupMembersController < Groups::ApplicationController ...@@ -6,8 +6,6 @@ class Groups::GroupMembersController < Groups::ApplicationController
before_action :authorize_read_group! before_action :authorize_read_group!
before_action :authorize_admin_group!, except: [:index, :leave] before_action :authorize_admin_group!, except: [:index, :leave]
layout :determine_layout
def index def index
@project = @group.projects.find(params[:project_id]) if params[:project_id] @project = @group.projects.find(params[:project_id]) if params[:project_id]
@members = @group.group_members @members = @group.group_members
......
class Groups::MilestonesController < ApplicationController class Groups::MilestonesController < Groups::ApplicationController
layout 'group'
before_action :authorize_group_milestone!, only: :update before_action :authorize_group_milestone!, only: :update
def index def index
......
...@@ -11,7 +11,6 @@ class GroupsController < Groups::ApplicationController ...@@ -11,7 +11,6 @@ class GroupsController < Groups::ApplicationController
# Load group projects # Load group projects
before_action :load_projects, except: [:new, :create, :projects, :edit, :update] before_action :load_projects, except: [:new, :create, :projects, :edit, :update]
before_action :event_filter, only: :show before_action :event_filter, only: :show
before_action :set_title, only: [:new, :create]
layout :determine_layout layout :determine_layout
...@@ -121,17 +120,11 @@ class GroupsController < Groups::ApplicationController ...@@ -121,17 +120,11 @@ class GroupsController < Groups::ApplicationController
end end
end end
def set_title
@title = 'New Group'
end
def determine_layout def determine_layout
if [:new, :create].include?(action_name.to_sym) if [:new, :create].include?(action_name.to_sym)
'navless' 'application'
elsif current_user
'group'
else else
'public_group' 'group'
end end
end end
......
class HelpController < ApplicationController class HelpController < ApplicationController
layout 'help'
def index def index
end end
def show def show
category = clean_path_info(path_params[:category]) @category = clean_path_info(path_params[:category])
file = path_params[:file] @file = path_params[:file]
respond_to do |format| respond_to do |format|
format.any(:markdown, :md, :html) do format.any(:markdown, :md, :html) do
path = Rails.root.join('doc', category, "#{file}.md") path = Rails.root.join('doc', @category, "#{@file}.md")
if File.exist?(path) if File.exist?(path)
@markdown = File.read(path) @markdown = File.read(path)
...@@ -22,7 +24,7 @@ class HelpController < ApplicationController ...@@ -22,7 +24,7 @@ class HelpController < ApplicationController
# Allow access to images in the doc folder # Allow access to images in the doc folder
format.any(:png, :gif, :jpeg) do format.any(:png, :gif, :jpeg) do
path = Rails.root.join('doc', category, "#{file}.#{params[:format]}") path = Rails.root.join('doc', @category, "#{@file}.#{params[:format]}")
if File.exist?(path) if File.exist?(path)
send_file(path, disposition: 'inline') send_file(path, disposition: 'inline')
......
...@@ -72,6 +72,7 @@ class Import::GoogleCodeController < Import::BaseController ...@@ -72,6 +72,7 @@ class Import::GoogleCodeController < Import::BaseController
end end
@repos = client.repos @repos = client.repos
@incompatible_repos = client.incompatible_repos
@already_added_projects = current_user.created_projects.where(import_type: "google_code") @already_added_projects = current_user.created_projects.where(import_type: "google_code")
already_added_projects_names = @already_added_projects.pluck(:import_source) already_added_projects_names = @already_added_projects.pluck(:import_source)
......
...@@ -4,8 +4,6 @@ class InvitesController < ApplicationController ...@@ -4,8 +4,6 @@ class InvitesController < ApplicationController
respond_to :html respond_to :html
layout 'navless'
def show def show
end end
......
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
include PageLayoutHelper
before_action :authenticate_user! before_action :authenticate_user!
layout "profile"
layout 'profile'
def index def index
head :forbidden and return head :forbidden and return
......
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
before_action :authenticate_resource_owner! before_action :authenticate_resource_owner!
layout "profile"
layout 'profile'
def new def new
if pre_auth.authorizable? if pre_auth.authorizable?
......
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
layout "profile" include PageLayoutHelper
layout 'profile'
def destroy def destroy
Doorkeeper::AccessToken.revoke_all_for(params[:id], current_resource_owner) Doorkeeper::AccessToken.revoke_all_for(params[:id], current_resource_owner)
......
class Profiles::AccountsController < ApplicationController class Profiles::AccountsController < Profiles::ApplicationController
layout "profile"
def show def show
@user = current_user @user = current_user
end end
......
class Profiles::ApplicationController < ApplicationController
layout 'profile'
end
class Profiles::AvatarsController < ApplicationController class Profiles::AvatarsController < Profiles::ApplicationController
layout "profile"
def destroy def destroy
@user = current_user @user = current_user
@user.remove_avatar! @user.remove_avatar!
......
class Profiles::EmailsController < ApplicationController class Profiles::EmailsController < Profiles::ApplicationController
layout "profile"
def index def index
@primary = current_user.email @primary = current_user.email
@public_email = current_user.public_email
@emails = current_user.emails @emails = current_user.emails
end end
def create def create
@email = current_user.emails.new(email_params) @email = current_user.emails.new(email_params)
flash[:alert] = @email.errors.full_messages.first unless @email.save if @email.save
NotificationService.new.new_email(@email)
else
flash[:alert] = @email.errors.full_messages.first
end
redirect_to profile_emails_url redirect_to profile_emails_url
end end
...@@ -19,9 +20,7 @@ class Profiles::EmailsController < ApplicationController ...@@ -19,9 +20,7 @@ class Profiles::EmailsController < ApplicationController
@email = current_user.emails.find(params[:id]) @email = current_user.emails.find(params[:id])
@email.destroy @email.destroy
current_user.set_notification_email current_user.update_secondary_emails!
current_user.set_public_email
current_user.save if current_user.notification_email_changed? or current_user.public_email_changed?
respond_to do |format| respond_to do |format|
format.html { redirect_to profile_emails_url } format.html { redirect_to profile_emails_url }
......
class Profiles::KeysController < ApplicationController class Profiles::KeysController < Profiles::ApplicationController
layout "profile"
skip_before_action :authenticate_user!, only: [:get_keys] skip_before_action :authenticate_user!, only: [:get_keys]
def index def index
......
class Profiles::NotificationsController < ApplicationController class Profiles::NotificationsController < Profiles::ApplicationController
layout 'profile'
def show def show
@user = current_user @user = current_user
@notification = current_user.notification @notification = current_user.notification
......
class Profiles::PasswordsController < ApplicationController class Profiles::PasswordsController < Profiles::ApplicationController
layout :determine_layout
skip_before_action :check_password_expiration, only: [:new, :create] skip_before_action :check_password_expiration, only: [:new, :create]
before_action :set_user before_action :set_user
before_action :set_title
before_action :authorize_change_password! before_action :authorize_change_password!
layout :determine_layout
def new def new
end end
...@@ -66,13 +65,9 @@ class Profiles::PasswordsController < ApplicationController ...@@ -66,13 +65,9 @@ class Profiles::PasswordsController < ApplicationController
@user = current_user @user = current_user
end end
def set_title
@title = "New password"
end
def determine_layout def determine_layout
if [:new, :create].include?(action_name.to_sym) if [:new, :create].include?(action_name.to_sym)
'navless' 'application'
else else
'profile' 'profile'
end end
......
class ProfilesController < ApplicationController class ProfilesController < Profiles::ApplicationController
include ActionView::Helpers::SanitizeHelper include ActionView::Helpers::SanitizeHelper
before_action :user before_action :user
before_action :authorize_change_username!, only: :update_username before_action :authorize_change_username!, only: :update_username
skip_before_action :require_email, only: [:show, :update] skip_before_action :require_email, only: [:show, :update]
layout 'profile'
def show def show
end end
......
class Projects::ApplicationController < ApplicationController class Projects::ApplicationController < ApplicationController
before_action :project before_action :project
before_action :repository before_action :repository
layout :determine_layout layout 'project'
def authenticate_user! def authenticate_user!
# Restrict access to Projects area only # Restrict access to Projects area only
...@@ -17,14 +17,6 @@ class Projects::ApplicationController < ApplicationController ...@@ -17,14 +17,6 @@ class Projects::ApplicationController < ApplicationController
super super
end end
def determine_layout
if current_user
'projects'
else
'public_projects'
end
end
def require_branch_head def require_branch_head
unless @repository.branch_names.include?(@ref) unless @repository.branch_names.include?(@ref)
redirect_to( redirect_to(
......
class Projects::AvatarsController < Projects::ApplicationController class Projects::AvatarsController < Projects::ApplicationController
layout 'project'
before_action :project before_action :project
def show def show
......
require 'addressable/uri'
class Projects::CompareController < Projects::ApplicationController class Projects::CompareController < Projects::ApplicationController
# Authorize # Authorize
before_action :require_non_empty_project before_action :require_non_empty_project
...@@ -7,8 +9,8 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -7,8 +9,8 @@ class Projects::CompareController < Projects::ApplicationController
end end
def show def show
base_ref = params[:from] base_ref = Addressable::URI.unescape(params[:from])
head_ref = params[:to] head_ref = Addressable::URI.unescape(params[:to])
compare_result = CompareService.new.execute( compare_result = CompareService.new.execute(
current_user, current_user,
......
...@@ -18,7 +18,6 @@ class Projects::ForksController < Projects::ApplicationController ...@@ -18,7 +18,6 @@ class Projects::ForksController < Projects::ApplicationController
notice: 'Project was successfully forked.' notice: 'Project was successfully forked.'
) )
else else
@title = 'Fork project'
render :error render :error
end end
end end
......
...@@ -124,13 +124,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -124,13 +124,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request.check_if_can_be_merged @merge_request.check_if_can_be_merged
end end
render json: { merge_status: @merge_request.merge_status_name } render json: { merge_status: @merge_request.automerge_status }
end end
def automerge def automerge
return access_denied! unless allowed_to_merge? return access_denied! unless allowed_to_merge?
if @merge_request.open? && @merge_request.can_be_merged? if @merge_request.automergeable?
AutoMergeWorker.perform_async(@merge_request.id, current_user.id, params) AutoMergeWorker.perform_async(@merge_request.id, current_user.id, params)
@status = true @status = true
else else
......
class Projects::ServicesController < Projects::ApplicationController class Projects::ServicesController < Projects::ApplicationController
ALLOWED_PARAMS = [:title, :token, :type, :active, :api_key, :subdomain, ALLOWED_PARAMS = [:title, :token, :type, :active, :api_key, :api_version, :subdomain,
:room, :recipients, :project_url, :webhook, :room, :recipients, :project_url, :webhook,
:user_key, :device, :priority, :sound, :bamboo_url, :username, :password, :user_key, :device, :priority, :sound, :bamboo_url, :username, :password,
:build_key, :server, :teamcity_url, :build_type, :build_key, :server, :teamcity_url, :build_type,
......
class Projects::UploadsController < Projects::ApplicationController class Projects::UploadsController < Projects::ApplicationController
layout 'project'
skip_before_action :authenticate_user!, :reject_blocked!, :project, skip_before_action :authenticate_user!, :reject_blocked!, :project,
:repository, if: -> { action_name == 'show' && image? } :repository, if: -> { action_name == 'show' && image? }
......
...@@ -6,17 +6,16 @@ class ProjectsController < ApplicationController ...@@ -6,17 +6,16 @@ class ProjectsController < ApplicationController
# Authorize # Authorize
before_action :authorize_admin_project!, only: [:edit, :update, :destroy, :transfer, :archive, :unarchive] before_action :authorize_admin_project!, only: [:edit, :update, :destroy, :transfer, :archive, :unarchive]
before_action :set_title, only: [:new, :create]
before_action :event_filter, only: :show before_action :event_filter, only: :show
layout 'navless', only: [:new, :create, :fork] layout :determine_layout
def new def new
@project = Project.new @project = Project.new
end end
def edit def edit
render 'edit', layout: 'project_settings' render 'edit'
end end
def create def create
...@@ -46,7 +45,7 @@ class ProjectsController < ApplicationController ...@@ -46,7 +45,7 @@ class ProjectsController < ApplicationController
end end
format.js format.js
else else
format.html { render 'edit', layout: 'project_settings' } format.html { render 'edit' }
format.js format.js
end end
end end
...@@ -72,13 +71,13 @@ class ProjectsController < ApplicationController ...@@ -72,13 +71,13 @@ class ProjectsController < ApplicationController
format.html do format.html do
if @project.repository_exists? if @project.repository_exists?
if @project.empty_repo? if @project.empty_repo?
render 'projects/empty', layout: user_layout render 'projects/empty'
else else
@last_push = current_user.recent_push(@project.id) if current_user @last_push = current_user.recent_push(@project.id) if current_user
render :show, layout: user_layout render :show
end end
else else
render 'projects/no_repo', layout: user_layout render 'projects/no_repo'
end end
end end
...@@ -160,12 +159,14 @@ class ProjectsController < ApplicationController ...@@ -160,12 +159,14 @@ class ProjectsController < ApplicationController
private private
def set_title def determine_layout
@title = 'New Project' if [:new, :create].include?(action_name.to_sym)
end 'application'
elsif [:edit, :update].include?(action_name.to_sym)
def user_layout 'project_settings'
current_user ? 'projects' : 'public_projects' else
'project'
end
end end
def load_events def load_events
......
class SearchController < ApplicationController class SearchController < ApplicationController
include SearchHelper include SearchHelper
layout 'search'
def show def show
return if params[:search].nil? || params[:search].blank? return if params[:search].nil? || params[:search].blank?
@search_term = params[:search]
if params[:project_id].present? if params[:project_id].present?
@project = Project.find_by(id: params[:project_id]) @project = Project.find_by(id: params[:project_id])
@project = nil unless can?(current_user, :download_code, @project) @project = nil unless can?(current_user, :download_code, @project)
end end
if params[:group_id].present? if params[:group_id].present?
@group = Group.find_by(id: params[:group_id]) @group = Group.find_by(id: params[:group_id])
@group = nil unless can?(current_user, :read_group, @group) @group = nil unless can?(current_user, :read_group, @group)
end end
@scope = params[:scope] @scope = params[:scope]
@show_snippets = params[:snippets].eql? 'true' @show_snippets = params[:snippets].eql? 'true'
@search_results = @search_results =
if @project if @project
unless %w(blobs notes issues merge_requests wiki_blobs). unless %w(blobs notes issues merge_requests wiki_blobs).
include?(@scope) include?(@scope)
...@@ -37,6 +41,7 @@ class SearchController < ApplicationController ...@@ -37,6 +41,7 @@ class SearchController < ApplicationController
end end
Search::GlobalService.new(current_user, params).execute Search::GlobalService.new(current_user, params).execute
end end
@objects = @search_results.objects(@scope, params[:page]) @objects = @search_results.objects(@scope, params[:page])
end end
......
...@@ -7,14 +7,11 @@ class SnippetsController < ApplicationController ...@@ -7,14 +7,11 @@ class SnippetsController < ApplicationController
# Allow destroy snippet # Allow destroy snippet
before_action :authorize_admin_snippet!, only: [:destroy] before_action :authorize_admin_snippet!, only: [:destroy]
before_action :set_title
skip_before_action :authenticate_user!, only: [:index, :user_index, :show, :raw] skip_before_action :authenticate_user!, only: [:index, :user_index, :show, :raw]
layout 'snippets'
respond_to :html respond_to :html
layout :determine_layout
def index def index
if params[:username].present? if params[:username].present?
@user = User.find_by(username: params[:username]) @user = User.find_by(username: params[:username])
...@@ -98,16 +95,7 @@ class SnippetsController < ApplicationController ...@@ -98,16 +95,7 @@ class SnippetsController < ApplicationController
return render_404 unless can?(current_user, :admin_personal_snippet, @snippet) return render_404 unless can?(current_user, :admin_personal_snippet, @snippet)
end end
def set_title
@title = 'Snippets'
@title_url = snippets_path
end
def snippet_params def snippet_params
params.require(:personal_snippet).permit(:title, :content, :file_name, :private, :visibility_level) params.require(:personal_snippet).permit(:title, :content, :file_name, :private, :visibility_level)
end end
def determine_layout
current_user ? 'snippets' : 'public_users'
end
end end
...@@ -2,7 +2,6 @@ class UnsubscribesController < ApplicationController ...@@ -2,7 +2,6 @@ class UnsubscribesController < ApplicationController
skip_before_action :authenticate_user!, skip_before_action :authenticate_user!,
:reject_blocked, :set_current_user_for_observers, :reject_blocked, :set_current_user_for_observers,
:add_abilities :add_abilities
layout 'public_users'
def show def show
@user = get_user @user = get_user
......
class UsersController < ApplicationController class UsersController < ApplicationController
skip_before_action :authenticate_user! skip_before_action :authenticate_user!
before_action :set_user before_action :set_user
layout :determine_layout
def show def show
@contributed_projects = contributed_projects.joined(@user). @contributed_projects = contributed_projects.joined(@user).
...@@ -13,9 +12,6 @@ class UsersController < ApplicationController ...@@ -13,9 +12,6 @@ class UsersController < ApplicationController
# Collect only groups common for both users # Collect only groups common for both users
@groups = @user.groups & GroupsFinder.new.execute(current_user) @groups = @user.groups & GroupsFinder.new.execute(current_user)
@title = @user.name
@title_url = user_path(@user)
respond_to do |format| respond_to do |format|
format.html format.html
...@@ -51,14 +47,6 @@ class UsersController < ApplicationController ...@@ -51,14 +47,6 @@ class UsersController < ApplicationController
render 'calendar_activities', layout: false render 'calendar_activities', layout: false
end end
def determine_layout
if current_user
'navless'
else
'public_users'
end
end
private private
def set_user def set_user
......
...@@ -113,8 +113,9 @@ class IssuableFinder ...@@ -113,8 +113,9 @@ class IssuableFinder
end end
def by_milestone(items) def by_milestone(items)
if params[:milestone_id].present? if params[:milestone_title].present?
items = items.where(milestone_id: (params[:milestone_id] == NONE ? nil : params[:milestone_id])) milestone_ids = (params[:milestone_title] == NONE ? nil : Milestone.where(title: params[:milestone_title]).pluck(:id))
items = items.where(milestone_id: milestone_ids)
end end
items items
......
...@@ -140,8 +140,8 @@ module DiffHelper ...@@ -140,8 +140,8 @@ module DiffHelper
end end
end end
def submodule_link(blob, ref) def submodule_link(blob, ref, repository = @repository)
tree, commit = submodule_links(blob, ref) tree, commit = submodule_links(blob, ref, repository)
commit_id = if commit.nil? commit_id = if commit.nil?
blob.id[0..10] blob.id[0..10]
else else
......
...@@ -34,10 +34,8 @@ module GitlabMarkdownHelper ...@@ -34,10 +34,8 @@ module GitlabMarkdownHelper
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch # see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch
rend = Redcarpet::Render::GitlabHTML.new(self, user_color_scheme_class, { rend = Redcarpet::Render::GitlabHTML.new(self, user_color_scheme_class, {
with_toc_data: true, # Handled further down the line by Gitlab::Markdown::SanitizationFilter
safe_links_only: true, escape_html: false
# Handled further down the line by HTML::Pipeline::SanitizationFilter
escape_html: false
}.merge(options)) }.merge(options))
# see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use # see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
...@@ -45,11 +43,11 @@ module GitlabMarkdownHelper ...@@ -45,11 +43,11 @@ module GitlabMarkdownHelper
no_intra_emphasis: true, no_intra_emphasis: true,
tables: true, tables: true,
fenced_code_blocks: true, fenced_code_blocks: true,
autolink: true,
strikethrough: true, strikethrough: true,
lax_spacing: true, lax_spacing: true,
space_after_headers: true, space_after_headers: true,
superscript: true superscript: true,
footnotes: true
) )
end end
......
...@@ -19,24 +19,6 @@ module GroupsHelper ...@@ -19,24 +19,6 @@ module GroupsHelper
end end
end end
def group_head_title
title = @group.name
title = if current_action?(:issues)
"Issues - " + title
elsif current_action?(:merge_requests)
"Merge requests - " + title
elsif current_action?(:members)
"Members - " + title
elsif current_action?(:edit)
"Settings - " + title
else
title
end
title
end
def group_settings_page? def group_settings_page?
if current_controller?('groups') if current_controller?('groups')
current_action?('edit') || current_action?('projects') current_action?('edit') || current_action?('projects')
......
...@@ -43,17 +43,6 @@ module IssuesHelper ...@@ -43,17 +43,6 @@ module IssuesHelper
end end
end end
def title_for_issue(issue_iid, project = @project)
return '' if project.nil?
if project.default_issues_tracker?
issue = project.issues.where(iid: issue_iid).first
return issue.title if issue
end
''
end
def issue_timestamp(issue) def issue_timestamp(issue)
# Shows the created at time and the updated at time if different # Shows the created at time and the updated at time if different
ts = "#{time_ago_with_tooltip(issue.created_at, 'bottom', 'note_created_ago')}" ts = "#{time_ago_with_tooltip(issue.created_at, 'bottom', 'note_created_ago')}"
...@@ -110,5 +99,5 @@ module IssuesHelper ...@@ -110,5 +99,5 @@ module IssuesHelper
end end
# Required for Gitlab::Markdown::IssueReferenceFilter # Required for Gitlab::Markdown::IssueReferenceFilter
module_function :url_for_issue, :title_for_issue module_function :url_for_issue
end end
...@@ -28,6 +28,7 @@ module MilestonesHelper ...@@ -28,6 +28,7 @@ module MilestonesHelper
Milestone.where(project_id: @projects) Milestone.where(project_id: @projects)
end.active end.active
options_from_collection_for_select(milestones, 'id', 'title', params[:milestone_id]) grouped_milestones = Milestones::GroupService.new(milestones).execute
options_from_collection_for_select(grouped_milestones, 'title', 'title', params[:milestone_title])
end end
end end
module PageLayoutHelper
def page_title(*titles)
@page_title ||= []
@page_title.push(*titles.compact) if titles.any?
@page_title.join(" | ")
end
def header_title(title = nil, title_url = nil)
if title
@header_title = title
@header_title_url = title_url
else
@header_title_url ? link_to(@header_title, @header_title_url) : @header_title
end
end
def sidebar(name = nil)
if name
@sidebar = name
else
@sidebar
end
end
end
...@@ -192,46 +192,6 @@ module ProjectsHelper ...@@ -192,46 +192,6 @@ module ProjectsHelper
'unknown' 'unknown'
end end
def project_head_title
title = @project.name_with_namespace
title = if current_controller?(:tree)
"#{@project.path}\/#{@path} at #{@ref} - " + title
elsif current_controller?(:issues)
if current_action?(:show)
"Issue ##{@issue.iid} - #{@issue.title} - " + title
else
"Issues - " + title
end
elsif current_controller?(:blob)
if current_action?(:new) || current_action?(:create)
"New file at #{@ref}"
elsif current_action?(:show)
"#{@blob.path} at #{@ref}"
elsif @blob
"Edit file #{@blob.path} at #{@ref}"
end
elsif current_controller?(:commits)
"Commits at #{@ref} - " + title
elsif current_controller?(:merge_requests)
if current_action?(:show)
"Merge request ##{@merge_request.iid} - " + title
else
"Merge requests - " + title
end
elsif current_controller?(:wikis)
"Wiki - " + title
elsif current_controller?(:network)
"Network graph - " + title
elsif current_controller?(:graphs)
"Graphs - " + title
else
title
end
title
end
def default_url_to_repo(project = nil) def default_url_to_repo(project = nil)
project = project || @project project = project || @project
current_user ? project.url_to_repo : project.http_url_to_repo current_user ? project.url_to_repo : project.http_url_to_repo
......
...@@ -2,8 +2,8 @@ module SubmoduleHelper ...@@ -2,8 +2,8 @@ module SubmoduleHelper
include Gitlab::ShellAdapter include Gitlab::ShellAdapter
# links to files listing for submodule if submodule is a project on this server # links to files listing for submodule if submodule is a project on this server
def submodule_links(submodule_item, ref = nil) def submodule_links(submodule_item, ref = nil, repository = @repository)
url = @repository.submodule_url_for(ref, submodule_item.path) url = repository.submodule_url_for(ref, submodule_item.path)
return url, nil unless url =~ /([^\/:]+)\/([^\/]+\.git)\Z/ return url, nil unless url =~ /([^\/:]+)\/([^\/]+\.git)\Z/
...@@ -63,7 +63,7 @@ module SubmoduleHelper ...@@ -63,7 +63,7 @@ module SubmoduleHelper
namespace = components.pop.gsub(/^\.\.$/, '') namespace = components.pop.gsub(/^\.\.$/, '')
if namespace.empty? if namespace.empty?
namespace = @project.group.path namespace = @project.namespace.name
end end
[ [
......
...@@ -47,7 +47,7 @@ module VisibilityLevelHelper ...@@ -47,7 +47,7 @@ module VisibilityLevelHelper
haml_tag :span do haml_tag :span do
case level case level
when Gitlab::VisibilityLevel::PRIVATE when Gitlab::VisibilityLevel::PRIVATE
haml_concat "The snippet is visible only for me" haml_concat "The snippet is visible only for me."
when Gitlab::VisibilityLevel::INTERNAL when Gitlab::VisibilityLevel::INTERNAL
haml_concat "The snippet is visible for any logged in user." haml_concat "The snippet is visible for any logged in user."
when Gitlab::VisibilityLevel::PUBLIC when Gitlab::VisibilityLevel::PUBLIC
......
...@@ -6,6 +6,8 @@ module WikiHelper ...@@ -6,6 +6,8 @@ module WikiHelper
case wiki_page case wiki_page
when Symbol when Symbol
wiki_page wiki_page
when String
wiki_page
else else
wiki_page.slug wiki_page.slug
end end
......
class DeviseMailer < Devise::Mailer
default from: "GitLab <#{Gitlab.config.gitlab.email_from}>"
default reply_to: Gitlab.config.gitlab.email_reply_to
end
...@@ -17,11 +17,6 @@ class Notify < ActionMailer::Base ...@@ -17,11 +17,6 @@ class Notify < ActionMailer::Base
attr_accessor :current_user attr_accessor :current_user
helper_method :current_user, :can? helper_method :current_user, :can?
default_url_options[:host] = Gitlab.config.gitlab.host
default_url_options[:protocol] = Gitlab.config.gitlab.protocol
default_url_options[:port] = Gitlab.config.gitlab.port unless Gitlab.config.gitlab_on_standard_port?
default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root
default from: Proc.new { default_sender_address.format } default from: Proc.new { default_sender_address.format }
default reply_to: Gitlab.config.gitlab.email_reply_to default reply_to: Gitlab.config.gitlab.email_reply_to
...@@ -70,7 +65,7 @@ class Notify < ActionMailer::Base ...@@ -70,7 +65,7 @@ class Notify < ActionMailer::Base
# Only the displayed name changes; the actual email address is always the same. # Only the displayed name changes; the actual email address is always the same.
def sender(sender_id, send_from_user_email = false) def sender(sender_id, send_from_user_email = false)
return unless sender = User.find(sender_id) return unless sender = User.find(sender_id)
address = default_sender_address address = default_sender_address
address.display_name = sender.name address.display_name = sender.name
......
...@@ -2,13 +2,11 @@ ...@@ -2,13 +2,11 @@
# #
# Table name: application_settings # Table name: application_settings
# #
# id :integer not null, primary key # id :integer not null, primary key
# default_projects_limit :integer # default_projects_limit :integer
# default_branch_protection :integer
# signup_enabled :boolean # signup_enabled :boolean
# signin_enabled :boolean # signin_enabled :boolean
# gravatar_enabled :boolean # gravatar_enabled :boolean
# twitter_sharing_enabled :boolean
# sign_in_text :text # sign_in_text :text
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
...@@ -17,13 +15,16 @@ ...@@ -17,13 +15,16 @@
# twitter_sharing_enabled :boolean default(TRUE) # twitter_sharing_enabled :boolean default(TRUE)
# help_text :text # help_text :text
# restricted_visibility_levels :text # restricted_visibility_levels :text
# max_attachment_size :integer default(10) # max_attachment_size :integer default(10), not null
# default_project_visibility :integer # default_project_visibility :integer
# default_snippet_visibility :integer # default_snippet_visibility :integer
# restricted_signup_domains :text
# #
class ApplicationSetting < ActiveRecord::Base class ApplicationSetting < ActiveRecord::Base
serialize :restricted_visibility_levels serialize :restricted_visibility_levels
serialize :restricted_signup_domains, Array
attr_accessor :restricted_signup_domains_raw
validates :home_page_url, validates :home_page_url,
allow_blank: true, allow_blank: true,
...@@ -56,11 +57,29 @@ class ApplicationSetting < ActiveRecord::Base ...@@ -56,11 +57,29 @@ class ApplicationSetting < ActiveRecord::Base
restricted_visibility_levels: Settings.gitlab['restricted_visibility_levels'], restricted_visibility_levels: Settings.gitlab['restricted_visibility_levels'],
max_attachment_size: Settings.gitlab['max_attachment_size'], max_attachment_size: Settings.gitlab['max_attachment_size'],
default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'], default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'],
default_snippet_visibility: Settings.gitlab.default_projects_features['visibility_level'] default_snippet_visibility: Settings.gitlab.default_projects_features['visibility_level'],
restricted_signup_domains: Settings.gitlab['restricted_signup_domains']
) )
end end
def home_page_url_column_exist def home_page_url_column_exist
ActiveRecord::Base.connection.column_exists?(:application_settings, :home_page_url) ActiveRecord::Base.connection.column_exists?(:application_settings, :home_page_url)
end end
def restricted_signup_domains_raw
self.restricted_signup_domains.join("\n") unless self.restricted_signup_domains.nil?
end
def restricted_signup_domains_raw=(values)
self.restricted_signup_domains = []
self.restricted_signup_domains = values.split(
/\s*[,;]\s* # comma or semicolon, optionally surrounded by whitespace
| # or
\s # any whitespace character
| # or
[\r\n] # any number of newline characters
/x)
self.restricted_signup_domains.reject! { |d| d.empty? }
end
end end
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# key :text # key :text
# public :boolean default(FALSE)
# title :string(255) # title :string(255)
# type :string(255) # type :string(255)
# fingerprint :string(255) # fingerprint :string(255)
# public :boolean default(FALSE), not null
# #
class DeployKey < Key class DeployKey < Key
......
...@@ -18,7 +18,6 @@ class Email < ActiveRecord::Base ...@@ -18,7 +18,6 @@ class Email < ActiveRecord::Base
validates :email, presence: true, email: { strict_mode: true }, uniqueness: true validates :email, presence: true, email: { strict_mode: true }, uniqueness: true
validate :unique_email, if: ->(email) { email.email_changed? } validate :unique_email, if: ->(email) { email.email_changed? }
after_create :notify
before_validation :cleanup_email before_validation :cleanup_email
def cleanup_email def cleanup_email
...@@ -28,8 +27,4 @@ class Email < ActiveRecord::Base ...@@ -28,8 +27,4 @@ class Email < ActiveRecord::Base
def unique_email def unique_email
self.errors.add(:email, 'has already been taken') if User.exists?(email: self.email) self.errors.add(:email, 'has already been taken') if User.exists?(email: self.email)
end end
def notify
NotificationService.new.new_email(self)
end
end end
...@@ -15,6 +15,10 @@ class ExternalIssue ...@@ -15,6 +15,10 @@ class ExternalIssue
@issue_identifier.to_s @issue_identifier.to_s
end end
def title
"External Issue #{self}"
end
def ==(other) def ==(other)
other.is_a?(self.class) && (to_s == other.to_s) other.is_a?(self.class) && (to_s == other.to_s)
end end
......
...@@ -30,15 +30,12 @@ class WebHook < ActiveRecord::Base ...@@ -30,15 +30,12 @@ class WebHook < ActiveRecord::Base
validates :url, presence: true, validates :url, presence: true,
format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" } format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }
def execute(data, hook_name) def execute(data)
parsed_url = URI.parse(url) parsed_url = URI.parse(url)
if parsed_url.userinfo.blank? if parsed_url.userinfo.blank?
WebHook.post(url, WebHook.post(url,
body: data.to_json, body: data.to_json,
headers: { headers: { "Content-Type" => "application/json" },
"Content-Type" => "application/json",
"X-Gitlab-Event" => hook_name.singularize.titleize
},
verify: false) verify: false)
else else
post_url = url.gsub("#{parsed_url.userinfo}@", "") post_url = url.gsub("#{parsed_url.userinfo}@", "")
...@@ -48,10 +45,7 @@ class WebHook < ActiveRecord::Base ...@@ -48,10 +45,7 @@ class WebHook < ActiveRecord::Base
} }
WebHook.post(post_url, WebHook.post(post_url,
body: data.to_json, body: data.to_json,
headers: { headers: { "Content-Type" => "application/json" },
"Content-Type" => "application/json",
"X-Gitlab-Event" => hook_name.singularize.titleize
},
verify: false, verify: false,
basic_auth: auth) basic_auth: auth)
end end
...@@ -60,7 +54,7 @@ class WebHook < ActiveRecord::Base ...@@ -60,7 +54,7 @@ class WebHook < ActiveRecord::Base
false false
end end
def async_execute(data, hook_name) def async_execute(data)
Sidekiq::Client.enqueue(ProjectWebHookWorker, id, data, hook_name) Sidekiq::Client.enqueue(ProjectWebHookWorker, id, data)
end end
end end
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
# title :string(255) # title :string(255)
# type :string(255) # type :string(255)
# fingerprint :string(255) # fingerprint :string(255)
# public :boolean default(FALSE), not null
# #
require 'digest/md5' require 'digest/md5'
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
# access_level :integer not null # access_level :integer not null
# source_id :integer not null # source_id :integer not null
# source_type :string(255) not null # source_type :string(255) not null
# user_id :integer not null # user_id :integer
# notification_level :integer not null # notification_level :integer not null
# type :string(255) # type :string(255)
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# created_by_id :integer # created_by_id :integer
# invite_email :string # invite_email :string(255)
# invite_token :string # invite_token :string(255)
# invite_accepted_at :datetime # invite_accepted_at :datetime
# #
......
...@@ -6,11 +6,15 @@ ...@@ -6,11 +6,15 @@
# access_level :integer not null # access_level :integer not null
# source_id :integer not null # source_id :integer not null
# source_type :string(255) not null # source_type :string(255) not null
# user_id :integer not null # user_id :integer
# notification_level :integer not null # notification_level :integer not null
# type :string(255) # type :string(255)
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# created_by_id :integer
# invite_email :string(255)
# invite_token :string(255)
# invite_accepted_at :datetime
# #
class GroupMember < Member class GroupMember < Member
......
...@@ -6,11 +6,15 @@ ...@@ -6,11 +6,15 @@
# access_level :integer not null # access_level :integer not null
# source_id :integer not null # source_id :integer not null
# source_type :string(255) not null # source_type :string(255) not null
# user_id :integer not null # user_id :integer
# notification_level :integer not null # notification_level :integer not null
# type :string(255) # type :string(255)
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# created_by_id :integer
# invite_email :string(255)
# invite_token :string(255)
# invite_accepted_at :datetime
# #
class ProjectMember < Member class ProjectMember < Member
......
...@@ -202,6 +202,8 @@ class MergeRequest < ActiveRecord::Base ...@@ -202,6 +202,8 @@ class MergeRequest < ActiveRecord::Base
end end
def automerge!(current_user, commit_message = nil) def automerge!(current_user, commit_message = nil)
return unless automergeable?
MergeRequests::AutoMergeService. MergeRequests::AutoMergeService.
new(target_project, current_user). new(target_project, current_user).
execute(self, commit_message) execute(self, commit_message)
...@@ -211,6 +213,22 @@ class MergeRequest < ActiveRecord::Base ...@@ -211,6 +213,22 @@ class MergeRequest < ActiveRecord::Base
opened? || reopened? opened? || reopened?
end end
def work_in_progress?
title =~ /\A\[?WIP\]?:? /i
end
def automergeable?
open? && !work_in_progress? && can_be_merged?
end
def automerge_status
if work_in_progress?
"work_in_progress"
else
merge_status_name
end
end
def mr_and_commit_notes def mr_and_commit_notes
# Fetch comments only from last 100 commits # Fetch comments only from last 100 commits
commits_for_notes_limit = 100 commits_for_notes_limit = 100
......
...@@ -334,14 +334,18 @@ class Project < ActiveRecord::Base ...@@ -334,14 +334,18 @@ class Project < ActiveRecord::Base
self.id self.id
end end
def issue_exists?(issue_id) def get_issue(issue_id)
if default_issues_tracker? if default_issues_tracker?
self.issues.where(iid: issue_id).first.present? issues.find_by(iid: issue_id)
else else
true ExternalIssue.new(issue_id, self)
end end
end end
def issue_exists?(issue_id)
get_issue(issue_id)
end
def default_issue_tracker def default_issue_tracker
gitlab_issue_tracker_service || create_gitlab_issue_tracker_service gitlab_issue_tracker_service || create_gitlab_issue_tracker_service
end end
...@@ -355,11 +359,7 @@ class Project < ActiveRecord::Base ...@@ -355,11 +359,7 @@ class Project < ActiveRecord::Base
end end
def default_issues_tracker? def default_issues_tracker?
if external_issue_tracker !external_issue_tracker
false
else
true
end
end end
def external_issues_trackers def external_issues_trackers
...@@ -496,7 +496,7 @@ class Project < ActiveRecord::Base ...@@ -496,7 +496,7 @@ class Project < ActiveRecord::Base
def execute_hooks(data, hooks_scope = :push_hooks) def execute_hooks(data, hooks_scope = :push_hooks)
hooks.send(hooks_scope).each do |hook| hooks.send(hooks_scope).each do |hook|
hook.async_execute(data, hooks_scope.to_s) hook.async_execute(data)
end end
if group if group
group.hooks.send(hooks_scope).each do |hook| group.hooks.send(hooks_scope).each do |hook|
......
# == Schema Information # == Schema Information
# #
# Table name: project_import_datas # Table name: project_import_data
# #
# id :integer not null, primary key # id :integer not null, primary key
# project_id :integer # project_id :integer
# data :text # data :text
# #
require 'carrierwave/orm/activerecord' require 'carrierwave/orm/activerecord'
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
# Base class for CI services # Base class for CI services
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
class CustomIssueTrackerService < IssueTrackerService class CustomIssueTrackerService < IssueTrackerService
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
class EmailsOnPushService < Service class EmailsOnPushService < Service
......
...@@ -2,14 +2,20 @@ ...@@ -2,14 +2,20 @@
# #
# Table name: services # Table name: services
# #
# id :integer not null, primary key # id :integer not null, primary key
# type :string(255) # type :string(255)
# title :string(255) # title :string(255)
# project_id :integer not null # project_id :integer
# created_at :datetime # created_at :datetime
# updated_at :datetime # updated_at :datetime
# active :boolean default(FALSE), not null # active :boolean default(FALSE), not null
# properties :text # properties :text
# template :boolean default(FALSE)
# push_events :boolean default(TRUE)
# issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
class ExternalWikiService < Service class ExternalWikiService < Service
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
require "flowdock-git-hook" require "flowdock-git-hook"
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
require "gemnasium/gitlab_service" require "gemnasium/gitlab_service"
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
class GitlabCiService < CiService class GitlabCiService < CiService
......
...@@ -21,11 +21,6 @@ ...@@ -21,11 +21,6 @@
class GitlabIssueTrackerService < IssueTrackerService class GitlabIssueTrackerService < IssueTrackerService
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
default_url_options[:host] = Gitlab.config.gitlab.host
default_url_options[:protocol] = Gitlab.config.gitlab.protocol
default_url_options[:port] = Gitlab.config.gitlab.port unless Gitlab.config.gitlab_on_standard_port?
default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root
prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url prop_accessor :title, :description, :project_url, :issues_url, :new_issue_url
def default? def default?
......
...@@ -15,12 +15,13 @@ ...@@ -15,12 +15,13 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
class HipchatService < Service class HipchatService < Service
MAX_COMMITS = 3 MAX_COMMITS = 3
prop_accessor :token, :room, :server, :notify, :color prop_accessor :token, :room, :server, :notify, :color, :api_version
validates :token, presence: true, if: :activated? validates :token, presence: true, if: :activated?
def title def title
...@@ -41,6 +42,8 @@ class HipchatService < Service ...@@ -41,6 +42,8 @@ class HipchatService < Service
{ type: 'text', name: 'room', placeholder: 'Room name or ID' }, { type: 'text', name: 'room', placeholder: 'Room name or ID' },
{ type: 'checkbox', name: 'notify' }, { type: 'checkbox', name: 'notify' },
{ type: 'select', name: 'color', choices: ['yellow', 'red', 'green', 'purple', 'gray', 'random'] }, { type: 'select', name: 'color', choices: ['yellow', 'red', 'green', 'purple', 'gray', 'random'] },
{ type: 'text', name: 'api_version',
placeholder: 'Leave blank for default (v2)' },
{ type: 'text', name: 'server', { type: 'text', name: 'server',
placeholder: 'Leave blank for default. https://hipchat.example.com' } placeholder: 'Leave blank for default. https://hipchat.example.com' }
] ]
...@@ -60,7 +63,7 @@ class HipchatService < Service ...@@ -60,7 +63,7 @@ class HipchatService < Service
private private
def gate def gate
options = { api_version: 'v2' } options = { api_version: api_version || 'v2' }
options[:server_url] = server unless server.blank? options[:server_url] = server unless server.blank?
@gate ||= HipChat::Client.new(token, options) @gate ||= HipChat::Client.new(token, options)
end end
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
require 'uri' require 'uri'
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
# issues_events :boolean default(TRUE) # issues_events :boolean default(TRUE)
# merge_requests_events :boolean default(TRUE) # merge_requests_events :boolean default(TRUE)
# tag_push_events :boolean default(TRUE) # tag_push_events :boolean default(TRUE)
# note_events :boolean default(TRUE), not null
# #
# To add new service you should build a class inherited from Service # To add new service you should build a class inherited from Service
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
# password_automatically_set :boolean default(FALSE) # password_automatically_set :boolean default(FALSE)
# bitbucket_access_token :string(255) # bitbucket_access_token :string(255)
# bitbucket_access_token_secret :string(255) # bitbucket_access_token_secret :string(255)
# location :string(255)
# public_email :string(255) default(""), not null # public_email :string(255) default(""), not null
# #
...@@ -139,13 +140,16 @@ class User < ActiveRecord::Base ...@@ -139,13 +140,16 @@ class User < ActiveRecord::Base
validate :avatar_type, if: ->(user) { user.avatar_changed? } validate :avatar_type, if: ->(user) { user.avatar_changed? }
validate :unique_email, if: ->(user) { user.email_changed? } validate :unique_email, if: ->(user) { user.email_changed? }
validate :owns_notification_email, if: ->(user) { user.notification_email_changed? } validate :owns_notification_email, if: ->(user) { user.notification_email_changed? }
validate :owns_public_email, if: ->(user) { user.public_email_changed? }
validates :avatar, file_size: { maximum: 200.kilobytes.to_i } validates :avatar, file_size: { maximum: 200.kilobytes.to_i }
before_validation :generate_password, on: :create before_validation :generate_password, on: :create
before_validation :restricted_signup_domains, on: :create
before_validation :sanitize_attrs before_validation :sanitize_attrs
before_validation :set_notification_email, if: ->(user) { user.email_changed? } before_validation :set_notification_email, if: ->(user) { user.email_changed? }
before_validation :set_public_email, if: ->(user) { user.public_email_changed? } before_validation :set_public_email, if: ->(user) { user.public_email_changed? }
after_update :update_emails_with_primary_email, if: ->(user) { user.email_changed? }
before_save :ensure_authentication_token before_save :ensure_authentication_token
after_save :ensure_namespace_correct after_save :ensure_namespace_correct
after_initialize :set_projects_limit after_initialize :set_projects_limit
...@@ -303,13 +307,29 @@ class User < ActiveRecord::Base ...@@ -303,13 +307,29 @@ class User < ActiveRecord::Base
end end
def unique_email def unique_email
self.errors.add(:email, 'has already been taken') if Email.exists?(email: self.email) if !self.emails.exists?(email: self.email) && Email.exists?(email: self.email)
self.errors.add(:email, 'has already been taken')
end
end end
def owns_notification_email def owns_notification_email
self.errors.add(:notification_email, "is not an email you own") unless self.all_emails.include?(self.notification_email) self.errors.add(:notification_email, "is not an email you own") unless self.all_emails.include?(self.notification_email)
end end
def owns_public_email
self.errors.add(:public_email, "is not an email you own") unless self.all_emails.include?(self.public_email)
end
def update_emails_with_primary_email
primary_email_record = self.emails.find_by(email: self.email)
if primary_email_record
primary_email_record.destroy
self.emails.create(email: self.email_was)
self.update_secondary_emails!
end
end
# Groups user has access to # Groups user has access to
def authorized_groups def authorized_groups
@authorized_groups ||= begin @authorized_groups ||= begin
...@@ -476,10 +496,16 @@ class User < ActiveRecord::Base ...@@ -476,10 +496,16 @@ class User < ActiveRecord::Base
def set_public_email def set_public_email
if self.public_email.blank? || !self.all_emails.include?(self.public_email) if self.public_email.blank? || !self.all_emails.include?(self.public_email)
self.public_email = '' self.public_email = nil
end end
end end
def update_secondary_emails!
self.set_notification_email
self.set_public_email
self.save if self.notification_email_changed? || self.public_email_changed?
end
def set_projects_limit def set_projects_limit
connection_default_value_defined = new_record? && !projects_limit_changed? connection_default_value_defined = new_record? && !projects_limit_changed?
return unless self.projects_limit.nil? || connection_default_value_defined return unless self.projects_limit.nil? || connection_default_value_defined
...@@ -643,4 +669,27 @@ class User < ActiveRecord::Base ...@@ -643,4 +669,27 @@ class User < ActiveRecord::Base
select(:project_id). select(:project_id).
uniq.map(&:project_id) uniq.map(&:project_id)
end end
def restricted_signup_domains
email_domains = current_application_settings.restricted_signup_domains
unless email_domains.blank?
match_found = email_domains.any? do |domain|
escaped = Regexp.escape(domain).gsub('\*','.*?')
regexp = Regexp.new "^#{escaped}$", Regexp::IGNORECASE
email_domain = Mail::Address.new(self.email).domain
email_domain =~ regexp
end
unless match_found
self.errors.add :email,
'is not whitelisted. ' +
'Email domains valid for registration are: ' +
email_domains.join(', ')
return false
end
end
true
end
end end
...@@ -7,12 +7,12 @@ class SystemHooksService ...@@ -7,12 +7,12 @@ class SystemHooksService
def execute_hooks(data) def execute_hooks(data)
SystemHook.all.each do |sh| SystemHook.all.each do |sh|
async_execute_hook(sh, data, 'system_hooks') async_execute_hook sh, data
end end
end end
def async_execute_hook(hook, data, hook_name) def async_execute_hook(hook, data)
Sidekiq::Client.enqueue(SystemHookWorker, hook.id, data, hook_name) Sidekiq::Client.enqueue(SystemHookWorker, hook.id, data)
end end
def build_event_data(model, event) def build_event_data(model, event)
......
class TestHookService class TestHookService
def execute(hook, current_user) def execute(hook, current_user)
data = Gitlab::PushDataBuilder.build_sample(project(hook), current_user) data = Gitlab::PushDataBuilder.build_sample(project(hook), current_user)
hook.execute(data, 'push_hooks') hook.execute(data)
end end
private private
......
- page_title "Preview | Appearance"
%h3.page-title %h3.page-title
Appearance settings - Preview Appearance settings - Preview
%hr %hr
......
- page_title "Appearance"
%h3.page-title %h3.page-title
Appearance settings Appearance settings
%p.light %p.light
......
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
= f.label :default_branch_protection, class: 'control-label col-sm-2' = f.label :default_branch_protection, class: 'control-label col-sm-2'
.col-sm-10 .col-sm-10
= f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control' = f.select :default_branch_protection, options_for_select(Gitlab::Access.protection_options, @application_setting.default_branch_protection), {}, class: 'form-control'
.form-group .form-group.project-visibility-level-holder
= f.label :default_project_visibility, class: 'control-label col-sm-2' = f.label :default_project_visibility, class: 'control-label col-sm-2'
.col-sm-10 .col-sm-10
= render('shared/visibility_radios', model_method: :default_project_visibility, form: f, selected_level: @application_setting.default_project_visibility, form_model: 'Project') = render('shared/visibility_radios', model_method: :default_project_visibility, form: f, selected_level: @application_setting.default_project_visibility, form_model: 'Project')
.form-group .form-group.project-visibility-level-holder
= f.label :default_snippet_visibility, class: 'control-label col-sm-2' = f.label :default_snippet_visibility, class: 'control-label col-sm-2'
.col-sm-10 .col-sm-10
= render('shared/visibility_radios', model_method: :default_snippet_visibility, form: f, selected_level: @application_setting.default_snippet_visibility, form_model: 'Snippet') = render('shared/visibility_radios', model_method: :default_snippet_visibility, form: f, selected_level: @application_setting.default_snippet_visibility, form_model: 'Snippet')
...@@ -77,6 +77,11 @@ ...@@ -77,6 +77,11 @@
= f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'control-label col-sm-2' = f.label :max_attachment_size, 'Maximum attachment size (MB)', class: 'control-label col-sm-2'
.col-sm-10 .col-sm-10
= f.number_field :max_attachment_size, class: 'form-control' = f.number_field :max_attachment_size, class: 'form-control'
.form-group
= f.label :restricted_signup_domains, 'Restricted domains for sign-ups', class: 'control-label col-sm-2'
.col-sm-10
= f.text_area :restricted_signup_domains_raw, placeholder: 'domain.com', class: 'form-control'
.help-block Ex: domain.com, *.domain.com. Wildcards allowed. Use separate lines for multiple entries.
.form-actions .form-actions
= f.submit 'Save', class: 'btn btn-primary' = f.submit 'Save', class: 'btn btn-primary'
- page_title "Settings"
%h3.page-title Application settings %h3.page-title Application settings
%hr %hr
= render 'form' = render 'form'
- page_title "Edit", @application.name, "Applications"
%h3.page-title Edit application %h3.page-title Edit application
- @url = admin_application_path(@application) - @url = admin_application_path(@application)
= render 'form', application: @application = render 'form', application: @application
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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