Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
This commit is contained in:
commit
0d0c539c04
248 changed files with 1750 additions and 735 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -37,6 +37,6 @@ public/assets/
|
|||
public/uploads.*
|
||||
public/uploads/
|
||||
rails_best_practices_output.html
|
||||
tags
|
||||
/tags
|
||||
tmp/
|
||||
vendor/bundle/*
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
Please view this file on the master branch, on stable branches it's out of date.
|
||||
|
||||
v 7.11.0 (unreleased)
|
||||
- Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu)
|
||||
- Don't allow a merge request to be merged when its title starts with "WIP".
|
||||
- Add a page title to every page.
|
||||
- Get Gitorious importer to work again.
|
||||
- Fix clone URL field and X11 Primary selection (Dmitry Medvinsky)
|
||||
- Ignore invalid lines in .gitmodules
|
||||
|
@ -11,6 +13,7 @@ v 7.11.0 (unreleased)
|
|||
- 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`)
|
||||
- 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.
|
||||
|
@ -21,7 +24,7 @@ v 7.11.0 (unreleased)
|
|||
- Include commit comments in MR from a forked project.
|
||||
- Fix adding new group members from admin area
|
||||
- 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)
|
||||
- Fix bug where Slack service channel was not saved in admin template settings. (Stan Hu)
|
||||
- Move snippets UI to fluid layout
|
||||
|
|
|
@ -8,7 +8,6 @@ class Dispatcher
|
|||
|
||||
initPageScripts: ->
|
||||
page = $('body').attr('data-page')
|
||||
project_id = $('body').attr('data-project-id')
|
||||
|
||||
unless page
|
||||
return false
|
||||
|
|
|
@ -35,7 +35,12 @@ pre {
|
|||
/* Link to current header. */
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
position: relative;
|
||||
&:hover > :last-child {
|
||||
|
||||
a.anchor {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:hover > a.anchor {
|
||||
$size: 16px;
|
||||
position: absolute;
|
||||
right: 100%;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#
|
||||
# Automatically sets the layout and ensures an administrator is logged in
|
||||
class Admin::ApplicationController < ApplicationController
|
||||
layout 'admin'
|
||||
before_action :authenticate_admin!
|
||||
layout 'admin'
|
||||
|
||||
def authenticate_admin!
|
||||
return render_404 unless current_user.is_admin?
|
||||
|
|
|
@ -3,6 +3,7 @@ require 'gon'
|
|||
class ApplicationController < ActionController::Base
|
||||
include Gitlab::CurrentSettings
|
||||
include GitlabRoutingHelper
|
||||
include PageLayoutHelper
|
||||
|
||||
PER_PAGE = 20
|
||||
|
||||
|
|
3
app/controllers/dashboard/application_controller.rb
Normal file
3
app/controllers/dashboard/application_controller.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Dashboard::ApplicationController < ApplicationController
|
||||
layout 'dashboard'
|
||||
end
|
|
@ -1,4 +1,4 @@
|
|||
class Dashboard::GroupsController < ApplicationController
|
||||
class Dashboard::GroupsController < Dashboard::ApplicationController
|
||||
def index
|
||||
@group_members = current_user.group_members.page(params[:page]).per(PER_PAGE)
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Dashboard::MilestonesController < ApplicationController
|
||||
class Dashboard::MilestonesController < Dashboard::ApplicationController
|
||||
before_action :load_projects
|
||||
|
||||
def index
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Dashboard::ProjectsController < ApplicationController
|
||||
class Dashboard::ProjectsController < Dashboard::ApplicationController
|
||||
before_action :event_filter
|
||||
|
||||
def starred
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
class DashboardController < ApplicationController
|
||||
respond_to :html
|
||||
|
||||
class DashboardController < Dashboard::ApplicationController
|
||||
before_action :load_projects, except: [:projects]
|
||||
before_action :event_filter, only: :show
|
||||
|
||||
respond_to :html
|
||||
|
||||
def show
|
||||
@projects = @projects.includes(:namespace)
|
||||
|
|
3
app/controllers/explore/application_controller.rb
Normal file
3
app/controllers/explore/application_controller.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Explore::ApplicationController < ApplicationController
|
||||
layout 'explore'
|
||||
end
|
|
@ -1,9 +1,7 @@
|
|||
class Explore::GroupsController < ApplicationController
|
||||
class Explore::GroupsController < Explore::ApplicationController
|
||||
skip_before_action :authenticate_user!,
|
||||
:reject_blocked, :set_current_user_for_observers
|
||||
|
||||
layout "explore"
|
||||
|
||||
def index
|
||||
@groups = GroupsFinder.new.execute(current_user)
|
||||
@groups = @groups.search(params[:search]) if params[:search].present?
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
class Explore::ProjectsController < ApplicationController
|
||||
class Explore::ProjectsController < Explore::ApplicationController
|
||||
skip_before_action :authenticate_user!,
|
||||
:reject_blocked
|
||||
|
||||
layout 'explore'
|
||||
|
||||
def index
|
||||
@projects = ProjectsFinder.new.execute(current_user)
|
||||
@tags = @projects.tags_on(:tags)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
class Groups::ApplicationController < ApplicationController
|
||||
layout 'group'
|
||||
|
||||
private
|
||||
|
||||
|
@ -17,12 +18,4 @@ class Groups::ApplicationController < ApplicationController
|
|||
return render_404
|
||||
end
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
if current_user
|
||||
'group'
|
||||
else
|
||||
'public_group'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class Groups::AvatarsController < ApplicationController
|
||||
layout "profile"
|
||||
|
||||
def destroy
|
||||
@group = Group.find_by(path: params[:group_id])
|
||||
@group.remove_avatar!
|
||||
|
|
|
@ -6,8 +6,6 @@ class Groups::GroupMembersController < Groups::ApplicationController
|
|||
before_action :authorize_read_group!
|
||||
before_action :authorize_admin_group!, except: [:index, :leave]
|
||||
|
||||
layout :determine_layout
|
||||
|
||||
def index
|
||||
@project = @group.projects.find(params[:project_id]) if params[:project_id]
|
||||
@members = @group.group_members
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class Groups::MilestonesController < ApplicationController
|
||||
layout 'group'
|
||||
|
||||
class Groups::MilestonesController < Groups::ApplicationController
|
||||
before_action :authorize_group_milestone!, only: :update
|
||||
|
||||
def index
|
||||
|
|
|
@ -11,7 +11,6 @@ class GroupsController < Groups::ApplicationController
|
|||
# Load group projects
|
||||
before_action :load_projects, except: [:new, :create, :projects, :edit, :update]
|
||||
before_action :event_filter, only: :show
|
||||
before_action :set_title, only: [:new, :create]
|
||||
|
||||
layout :determine_layout
|
||||
|
||||
|
@ -119,17 +118,11 @@ class GroupsController < Groups::ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def set_title
|
||||
@title = 'New Group'
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
if [:new, :create].include?(action_name.to_sym)
|
||||
'navless'
|
||||
elsif current_user
|
||||
'group'
|
||||
'application'
|
||||
else
|
||||
'public_group'
|
||||
'group'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
class HelpController < ApplicationController
|
||||
layout 'help'
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
category = clean_path_info(path_params[:category])
|
||||
file = path_params[:file]
|
||||
@category = clean_path_info(path_params[:category])
|
||||
@file = path_params[:file]
|
||||
|
||||
respond_to do |format|
|
||||
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)
|
||||
@markdown = File.read(path)
|
||||
|
@ -22,7 +24,7 @@ class HelpController < ApplicationController
|
|||
|
||||
# Allow access to images in the doc folder
|
||||
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)
|
||||
send_file(path, disposition: 'inline')
|
||||
|
|
|
@ -72,6 +72,7 @@ class Import::GoogleCodeController < Import::BaseController
|
|||
end
|
||||
|
||||
@repos = client.repos
|
||||
@incompatible_repos = client.incompatible_repos
|
||||
|
||||
@already_added_projects = current_user.created_projects.where(import_type: "google_code")
|
||||
already_added_projects_names = @already_added_projects.pluck(:import_source)
|
||||
|
|
|
@ -4,8 +4,6 @@ class InvitesController < ApplicationController
|
|||
|
||||
respond_to :html
|
||||
|
||||
layout 'navless'
|
||||
|
||||
def show
|
||||
|
||||
end
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
|
||||
include PageLayoutHelper
|
||||
|
||||
before_action :authenticate_user!
|
||||
layout "profile"
|
||||
|
||||
layout 'profile'
|
||||
|
||||
def index
|
||||
head :forbidden and return
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
|
||||
before_action :authenticate_resource_owner!
|
||||
layout "profile"
|
||||
|
||||
layout 'profile'
|
||||
|
||||
def new
|
||||
if pre_auth.authorizable?
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
|
||||
layout "profile"
|
||||
include PageLayoutHelper
|
||||
|
||||
layout 'profile'
|
||||
|
||||
def destroy
|
||||
Doorkeeper::AccessToken.revoke_all_for(params[:id], current_resource_owner)
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class Profiles::AccountsController < ApplicationController
|
||||
layout "profile"
|
||||
|
||||
class Profiles::AccountsController < Profiles::ApplicationController
|
||||
def show
|
||||
@user = current_user
|
||||
end
|
||||
|
|
3
app/controllers/profiles/application_controller.rb
Normal file
3
app/controllers/profiles/application_controller.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Profiles::ApplicationController < ApplicationController
|
||||
layout 'profile'
|
||||
end
|
|
@ -1,6 +1,4 @@
|
|||
class Profiles::AvatarsController < ApplicationController
|
||||
layout "profile"
|
||||
|
||||
class Profiles::AvatarsController < Profiles::ApplicationController
|
||||
def destroy
|
||||
@user = current_user
|
||||
@user.remove_avatar!
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class Profiles::EmailsController < ApplicationController
|
||||
layout "profile"
|
||||
|
||||
class Profiles::EmailsController < Profiles::ApplicationController
|
||||
def index
|
||||
@primary = current_user.email
|
||||
@public_email = current_user.public_email
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
class Profiles::KeysController < ApplicationController
|
||||
layout "profile"
|
||||
class Profiles::KeysController < Profiles::ApplicationController
|
||||
skip_before_action :authenticate_user!, only: [:get_keys]
|
||||
|
||||
def index
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class Profiles::NotificationsController < ApplicationController
|
||||
layout 'profile'
|
||||
|
||||
class Profiles::NotificationsController < Profiles::ApplicationController
|
||||
def show
|
||||
@user = current_user
|
||||
@notification = current_user.notification
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
class Profiles::PasswordsController < ApplicationController
|
||||
layout :determine_layout
|
||||
|
||||
class Profiles::PasswordsController < Profiles::ApplicationController
|
||||
skip_before_action :check_password_expiration, only: [:new, :create]
|
||||
|
||||
before_action :set_user
|
||||
before_action :set_title
|
||||
before_action :authorize_change_password!
|
||||
|
||||
layout :determine_layout
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
|
@ -66,13 +65,9 @@ class Profiles::PasswordsController < ApplicationController
|
|||
@user = current_user
|
||||
end
|
||||
|
||||
def set_title
|
||||
@title = "New password"
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
if [:new, :create].include?(action_name.to_sym)
|
||||
'navless'
|
||||
'application'
|
||||
else
|
||||
'profile'
|
||||
end
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
class ProfilesController < ApplicationController
|
||||
class ProfilesController < Profiles::ApplicationController
|
||||
include ActionView::Helpers::SanitizeHelper
|
||||
|
||||
before_action :user
|
||||
before_action :authorize_change_username!, only: :update_username
|
||||
skip_before_action :require_email, only: [:show, :update]
|
||||
|
||||
layout 'profile'
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
class Projects::ApplicationController < ApplicationController
|
||||
before_action :project
|
||||
before_action :repository
|
||||
layout :determine_layout
|
||||
layout 'project'
|
||||
|
||||
def authenticate_user!
|
||||
# Restrict access to Projects area only
|
||||
|
@ -17,14 +17,6 @@ class Projects::ApplicationController < ApplicationController
|
|||
super
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
if current_user
|
||||
'projects'
|
||||
else
|
||||
'public_projects'
|
||||
end
|
||||
end
|
||||
|
||||
def require_branch_head
|
||||
unless @repository.branch_names.include?(@ref)
|
||||
redirect_to(
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class Projects::AvatarsController < Projects::ApplicationController
|
||||
layout 'project'
|
||||
|
||||
before_action :project
|
||||
|
||||
def show
|
||||
|
|
|
@ -18,7 +18,6 @@ class Projects::ForksController < Projects::ApplicationController
|
|||
notice: 'Project was successfully forked.'
|
||||
)
|
||||
else
|
||||
@title = 'Fork project'
|
||||
render :error
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
class Projects::UploadsController < Projects::ApplicationController
|
||||
layout 'project'
|
||||
|
||||
skip_before_action :authenticate_user!, :reject_blocked!, :project,
|
||||
:repository, if: -> { action_name == 'show' && image? }
|
||||
|
||||
|
|
|
@ -6,17 +6,16 @@ class ProjectsController < ApplicationController
|
|||
|
||||
# Authorize
|
||||
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
|
||||
|
||||
layout 'navless', only: [:new, :create, :fork]
|
||||
layout :determine_layout
|
||||
|
||||
def new
|
||||
@project = Project.new
|
||||
end
|
||||
|
||||
def edit
|
||||
render 'edit', layout: 'project_settings'
|
||||
render 'edit'
|
||||
end
|
||||
|
||||
def create
|
||||
|
@ -46,7 +45,7 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
format.js
|
||||
else
|
||||
format.html { render 'edit', layout: 'project_settings' }
|
||||
format.html { render 'edit' }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
@ -72,13 +71,13 @@ class ProjectsController < ApplicationController
|
|||
format.html do
|
||||
if @project.repository_exists?
|
||||
if @project.empty_repo?
|
||||
render 'projects/empty', layout: user_layout
|
||||
render 'projects/empty'
|
||||
else
|
||||
@last_push = current_user.recent_push(@project.id) if current_user
|
||||
render :show, layout: user_layout
|
||||
render :show
|
||||
end
|
||||
else
|
||||
render 'projects/no_repo', layout: user_layout
|
||||
render 'projects/no_repo'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -160,12 +159,14 @@ class ProjectsController < ApplicationController
|
|||
|
||||
private
|
||||
|
||||
def set_title
|
||||
@title = 'New Project'
|
||||
end
|
||||
|
||||
def user_layout
|
||||
current_user ? 'projects' : 'public_projects'
|
||||
def determine_layout
|
||||
if [:new, :create].include?(action_name.to_sym)
|
||||
'application'
|
||||
elsif [:edit, :update].include?(action_name.to_sym)
|
||||
'project_settings'
|
||||
else
|
||||
'project'
|
||||
end
|
||||
end
|
||||
|
||||
def load_events
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
class SearchController < ApplicationController
|
||||
include SearchHelper
|
||||
|
||||
layout 'search'
|
||||
|
||||
def show
|
||||
return if params[:search].nil? || params[:search].blank?
|
||||
|
||||
|
|
|
@ -7,14 +7,11 @@ class SnippetsController < ApplicationController
|
|||
# Allow destroy snippet
|
||||
before_action :authorize_admin_snippet!, only: [:destroy]
|
||||
|
||||
before_action :set_title
|
||||
|
||||
skip_before_action :authenticate_user!, only: [:index, :user_index, :show, :raw]
|
||||
|
||||
layout 'snippets'
|
||||
respond_to :html
|
||||
|
||||
layout :determine_layout
|
||||
|
||||
def index
|
||||
if params[:username].present?
|
||||
@user = User.find_by(username: params[:username])
|
||||
|
@ -98,16 +95,7 @@ class SnippetsController < ApplicationController
|
|||
return render_404 unless can?(current_user, :admin_personal_snippet, @snippet)
|
||||
end
|
||||
|
||||
def set_title
|
||||
@title = 'Snippets'
|
||||
@title_url = snippets_path
|
||||
end
|
||||
|
||||
def snippet_params
|
||||
params.require(:personal_snippet).permit(:title, :content, :file_name, :private, :visibility_level)
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
current_user ? 'snippets' : 'public_users'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
class UsersController < ApplicationController
|
||||
skip_before_action :authenticate_user!
|
||||
before_action :set_user
|
||||
layout :determine_layout
|
||||
|
||||
def show
|
||||
@contributed_projects = contributed_projects.joined(@user).
|
||||
|
@ -13,9 +12,6 @@ class UsersController < ApplicationController
|
|||
# Collect only groups common for both users
|
||||
@groups = @user.groups & GroupsFinder.new.execute(current_user)
|
||||
|
||||
@title = @user.name
|
||||
@title_url = user_path(@user)
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
||||
|
@ -51,14 +47,6 @@ class UsersController < ApplicationController
|
|||
render 'calendar_activities', layout: false
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
if current_user
|
||||
'navless'
|
||||
else
|
||||
'public_users'
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_user
|
||||
|
|
|
@ -34,10 +34,8 @@ module GitlabMarkdownHelper
|
|||
|
||||
# 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, {
|
||||
with_toc_data: true,
|
||||
safe_links_only: true,
|
||||
# Handled further down the line by HTML::Pipeline::SanitizationFilter
|
||||
escape_html: false
|
||||
# Handled further down the line by Gitlab::Markdown::SanitizationFilter
|
||||
escape_html: false
|
||||
}.merge(options))
|
||||
|
||||
# see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
|
||||
|
@ -45,7 +43,6 @@ module GitlabMarkdownHelper
|
|||
no_intra_emphasis: true,
|
||||
tables: true,
|
||||
fenced_code_blocks: true,
|
||||
autolink: true,
|
||||
strikethrough: true,
|
||||
lax_spacing: true,
|
||||
space_after_headers: true,
|
||||
|
|
|
@ -19,24 +19,6 @@ module GroupsHelper
|
|||
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?
|
||||
if current_controller?('groups')
|
||||
current_action?('edit') || current_action?('projects')
|
||||
|
|
|
@ -43,17 +43,6 @@ module IssuesHelper
|
|||
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)
|
||||
# Shows the created at time and the updated at time if different
|
||||
ts = "#{time_ago_with_tooltip(issue.created_at, 'bottom', 'note_created_ago')}"
|
||||
|
@ -110,5 +99,5 @@ module IssuesHelper
|
|||
end
|
||||
|
||||
# Required for Gitlab::Markdown::IssueReferenceFilter
|
||||
module_function :url_for_issue, :title_for_issue
|
||||
module_function :url_for_issue
|
||||
end
|
||||
|
|
26
app/helpers/page_layout_helper.rb
Normal file
26
app/helpers/page_layout_helper.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
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
|
|||
'unknown'
|
||||
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)
|
||||
project = project || @project
|
||||
current_user ? project.url_to_repo : project.http_url_to_repo
|
||||
|
|
4
app/mailers/devise_mailer.rb
Normal file
4
app/mailers/devise_mailer.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
class DeviseMailer < Devise::Mailer
|
||||
default from: "GitLab <#{Gitlab.config.gitlab.email_from}>"
|
||||
default reply_to: Gitlab.config.gitlab.email_reply_to
|
||||
end
|
|
@ -15,6 +15,10 @@ class ExternalIssue
|
|||
@issue_identifier.to_s
|
||||
end
|
||||
|
||||
def title
|
||||
"External Issue #{self}"
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
other.is_a?(self.class) && (to_s == other.to_s)
|
||||
end
|
||||
|
|
|
@ -329,14 +329,18 @@ class Project < ActiveRecord::Base
|
|||
self.id
|
||||
end
|
||||
|
||||
def issue_exists?(issue_id)
|
||||
def get_issue(issue_id)
|
||||
if default_issues_tracker?
|
||||
self.issues.where(iid: issue_id).first.present?
|
||||
issues.find_by(iid: issue_id)
|
||||
else
|
||||
true
|
||||
ExternalIssue.new(issue_id, self)
|
||||
end
|
||||
end
|
||||
|
||||
def issue_exists?(issue_id)
|
||||
get_issue(issue_id)
|
||||
end
|
||||
|
||||
def default_issue_tracker
|
||||
gitlab_issue_tracker_service || create_gitlab_issue_tracker_service
|
||||
end
|
||||
|
@ -350,11 +354,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def default_issues_tracker?
|
||||
if external_issue_tracker
|
||||
false
|
||||
else
|
||||
true
|
||||
end
|
||||
!external_issue_tracker
|
||||
end
|
||||
|
||||
def external_issues_trackers
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Settings"
|
||||
%h3.page-title Application settings
|
||||
%hr
|
||||
= render 'form'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Edit", @application.name, "Applications"
|
||||
%h3.page-title Edit application
|
||||
- @url = admin_application_path(@application)
|
||||
= render 'form', application: @application
|
||||
= render 'form', application: @application
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Applications"
|
||||
%h3.page-title
|
||||
System OAuth applications
|
||||
%p.light
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "New Application"
|
||||
%h3.page-title New application
|
||||
- @url = admin_applications_path
|
||||
= render 'form', application: @application
|
||||
= render 'form', application: @application
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title @application.name, "Applications"
|
||||
%h3.page-title
|
||||
Application: #{@application.name}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Background Jobs"
|
||||
%h3.page-title Background Jobs
|
||||
%p.light GitLab uses #{link_to "sidekiq", "http://sidekiq.org/"} library for async job processing
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Broadcast Messages"
|
||||
%h3.page-title
|
||||
Broadcast Messages
|
||||
%p.light
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Deploy Keys"
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
Public deploy keys (#{@deploy_keys.count})
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "New Deploy Key"
|
||||
%h3.page-title New public deploy key
|
||||
%hr
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title @deploy_key.title, "Deploy Keys"
|
||||
.row
|
||||
.col-md-4
|
||||
.panel.panel-default
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Edit", @group.name, "Groups"
|
||||
%h3.page-title Edit group: #{@group.name}
|
||||
%hr
|
||||
= render 'form'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Groups"
|
||||
%h3.page-title
|
||||
Groups (#{@groups.total_count})
|
||||
= link_to 'New Group', new_admin_group_path, class: "btn btn-new pull-right"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "New Group"
|
||||
%h3.page-title New group
|
||||
%hr
|
||||
= render 'form'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title @group.name, "Groups"
|
||||
%h3.page-title
|
||||
Group: #{@group.name}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "System Hooks"
|
||||
%h3.page-title
|
||||
System hooks
|
||||
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
- page_title @key.title, "Keys"
|
||||
= render "profiles/keys/key_details", admin: true
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Logs"
|
||||
- loggers = [Gitlab::GitLogger, Gitlab::AppLogger,
|
||||
Gitlab::ProductionLogger, Gitlab::SidekiqLogger]
|
||||
%ul.nav.nav-tabs.log-tabs
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Projects"
|
||||
= render 'shared/show_aside'
|
||||
|
||||
.row
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title @project.name_with_namespace, "Projects"
|
||||
%h3.page-title
|
||||
Project: #{@project.name_with_namespace}
|
||||
= link_to edit_project_path(@project), class: "btn pull-right" do
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
- page_title @service.title, "Service Templates"
|
||||
= render 'form'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Service Templates"
|
||||
%h3.page-title Service templates
|
||||
%p.light Service template allows you to set default values for project services
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Edit", @user.name, "Users"
|
||||
%h3.page-title
|
||||
Edit user: #{@user.name}
|
||||
.back-link
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Users"
|
||||
= render 'shared/show_aside'
|
||||
|
||||
.row
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "New User"
|
||||
%h3.page-title
|
||||
New user
|
||||
%hr
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title @user.name, "Users"
|
||||
%h3.page-title
|
||||
User:
|
||||
= @user.name
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Groups"
|
||||
%h3.page-title
|
||||
Group Membership
|
||||
- if current_user.can_create_group?
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Issues"
|
||||
= content_for :meta_tags do
|
||||
- if current_user
|
||||
= auto_discovery_link_tag(:atom, issues_dashboard_url(format: :atom, private_token: current_user.private_token), title: "#{current_user.name} issues")
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Merge Requests"
|
||||
%h3.page-title
|
||||
Merge Requests
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Milestones"
|
||||
%h3.page-title
|
||||
Milestones
|
||||
%span.pull-right #{@dashboard_milestones.count} milestones
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title @dashboard_milestone.title, "Milestones"
|
||||
%h4.page-title
|
||||
.issue-box{ class: "issue-box-#{@dashboard_milestone.closed? ? 'closed' : 'open'}" }
|
||||
- if @dashboard_milestone.closed?
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Starred Projects"
|
||||
- if @projects.any?
|
||||
= render 'shared/show_aside'
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Sign up"
|
||||
= render 'devise/shared/signup_box'
|
||||
|
||||
= render 'devise/shared/sign_in_link'
|
||||
= render 'devise/shared/sign_in_link'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Sign in"
|
||||
%div
|
||||
- if signin_enabled? || ldap_enabled?
|
||||
= render 'devise/shared/signin_box'
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
- page_title "Edit", @application.name, "Applications"
|
||||
%h3.page-title Edit application
|
||||
= render 'form', application: @application
|
||||
= render 'form', application: @application
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Applications"
|
||||
%h3.page-title Your applications
|
||||
%p= link_to 'New Application', new_oauth_application_path, class: 'btn btn-success'
|
||||
%table.table.table-striped
|
||||
|
@ -13,4 +14,4 @@
|
|||
%td= link_to application.name, oauth_application_path(application)
|
||||
%td= application.redirect_uri
|
||||
%td= link_to 'Edit', edit_oauth_application_path(application), class: 'btn btn-link'
|
||||
%td= render 'delete_form', application: application
|
||||
%td= render 'delete_form', application: application
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title @application.name, "Applications"
|
||||
%h3.page-title
|
||||
Application: #{@application.name}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Access Denied"
|
||||
%h1 403
|
||||
%h3 Access Denied
|
||||
%hr
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Encoding Error"
|
||||
%h1 500
|
||||
%h3 Encoding Error
|
||||
%hr
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Git Resource Not Found"
|
||||
%h1 404
|
||||
%h3 Git Resource Not found
|
||||
%hr
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Not Found"
|
||||
%h1 404
|
||||
%h3 The resource you were looking for doesn't exist.
|
||||
%hr
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Auth Error"
|
||||
%h1 422
|
||||
%h3 Sign-in using #{@provider} auth failed
|
||||
%hr
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Groups"
|
||||
.clearfix
|
||||
.pull-left
|
||||
= form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f|
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Projects"
|
||||
.clearfix
|
||||
= render 'filter'
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Starred Projects"
|
||||
.explore-trending-block
|
||||
%p.lead
|
||||
%i.fa.fa-star
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Trending Projects"
|
||||
.explore-title
|
||||
%h3
|
||||
Explore GitLab
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
%ul.sidebar-subnav
|
||||
= nav_link(path: 'groups#edit') do
|
||||
= link_to edit_group_path(@group), title: 'Group', data: {placement: 'right'} do
|
||||
= icon('pencil-square-o')
|
||||
%span
|
||||
Group
|
||||
= nav_link(path: 'groups#projects') do
|
||||
= link_to projects_group_path(@group), title: 'Projects', data: {placement: 'right'} do
|
||||
= icon('folder')
|
||||
%span
|
||||
Projects
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Settings"
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%strong= @group.name
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Members"
|
||||
- show_roles = should_user_see_group_roles?(current_user, @group)
|
||||
|
||||
%h3.page-title
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Issues"
|
||||
= content_for :meta_tags do
|
||||
- if current_user
|
||||
= auto_discovery_link_tag(:atom, issues_group_url(@group, format: :atom, private_token: current_user.private_token), title: "#{@group.name} issues")
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Merge Requests"
|
||||
%h3.page-title
|
||||
Merge Requests
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
- page_title "Milestones"
|
||||
%h3.page-title
|
||||
Milestones
|
||||
%span.pull-right #{@group_milestones.count} milestones
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue