Commit cfbff017 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'you-get-a-title-and-you-get-a-title-and-everyone-gets-a-title' into 'master'

Add a page title to every page.

![You get a title, and you get a title; everyone gets a title!](https://i.imgflip.com/kvmq8.jpg)

The `page_title` helper pushes the provided string at the end of the title, but because of the order that layouts are rendered in by ActionView, the result is always this:

```
<title from view> |
<title from as specified in the controller or by its layout> |
<title from layouts/_head>
```

For example: `Merge Requests | GitLab.org / Gitlab Community Edition | GitLab`.

All a developer needs to know is to put a `page_title` call describing the page in question at the start of every template.

To get everything where I wanted it to go without too much duplication, I had to make some changes around layouts, sidebars and controllers.

See merge request !593
parents 812c7a85 a2eee318
......@@ -37,6 +37,6 @@ public/assets/
public/uploads.*
public/uploads/
rails_best_practices_output.html
tags
/tags
tmp/
vendor/bundle/*
......@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.11.0 (unreleased)
- 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
......
......@@ -8,7 +8,6 @@ class Dispatcher
initPageScripts: ->
page = $('body').attr('data-page')
project_id = $('body').attr('data-project-id')
unless page
return false
......
......@@ -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
......
class Dashboard::ApplicationController < ApplicationController
layout 'dashboard'
end
class Dashboard::GroupsController < ApplicationController
class Dashboard::GroupsController < Dashboard::ApplicationController
def index
@group_members = current_user.group_members.page(params[:page]).per(PER_PAGE)
end
......
class Dashboard::MilestonesController < ApplicationController
class Dashboard::MilestonesController < Dashboard::ApplicationController
before_action :load_projects
def index
......
class Dashboard::ProjectsController < ApplicationController
class Dashboard::ProjectsController < Dashboard::ApplicationController
before_action :event_filter
def starred
......
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)
......
class Explore::ApplicationController < ApplicationController
layout 'explore'
end
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?
......
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)
......
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
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
......
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
......
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')
......
......@@ -4,8 +4,6 @@ class InvitesController < ApplicationController
respond_to :html
layout 'navless'
def show
end
......
class Oauth::ApplicationsController < Doorkeeper::ApplicationsController
include PageLayoutHelper
before_action :authenticate_user!
layout "profile"
layout 'profile'
def index
head :forbidden and return
......
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
before_action :authenticate_resource_owner!
layout "profile"
layout 'profile'
def new
if pre_auth.authorizable?
......
class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicationsController
layout "profile"
include PageLayoutHelper
layout 'profile'
def destroy
Doorkeeper::AccessToken.revoke_all_for(params[:id], current_resource_owner)
......
class Profiles::AccountsController < ApplicationController
layout "profile"
class Profiles::AccountsController < Profiles::ApplicationController
def show
@user = current_user
end
......
class Profiles::ApplicationController < ApplicationController
layout 'profile'
end
class Profiles::AvatarsController < ApplicationController
layout "profile"
class Profiles::AvatarsController < Profiles::ApplicationController
def destroy
@user = current_user
@user.remove_avatar!
......
class Profiles::EmailsController < ApplicationController
layout "profile"
class Profiles::EmailsController < Profiles::ApplicationController
def index
@primary = current_user.email
@public_email = current_user.public_email
......
class Profiles::KeysController < ApplicationController
layout "profile"
class Profiles::KeysController < Profiles::ApplicationController
skip_before_action :authenticate_user!, only: [:get_keys]
def index
......
class Profiles::NotificationsController < ApplicationController
layout 'profile'
class Profiles::NotificationsController < Profiles::ApplicationController
def show
@user = current_user
@notification = current_user.notification
......
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
......
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
......
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(
......
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
......
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
......
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
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
......
......@@ -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')
......
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
......
- page_title "Settings"
%h3.page-title Application settings
%hr
= render 'form'
- page_title "Edit", @application.name, "Applications"
%h3.page-title Edit application
- @url = admin_application_path(@application)
= render 'form', application: @application
\ No newline at end of file
= render 'form', application: @application
- page_title "Applications"
%h3.page-title
System OAuth applications
%p.light
......
- page_title "New Application"
%h3.page-title New application
- @url = admin_applications_path
= render 'form', application: @application
\ No newline at end of file
= render 'form', application: @application
- page_title @application.name, "Applications"
%h3.page-title
Application: #{@application.name}
......
- page_title "Background Jobs"
%h3.page-title Background Jobs
%p.light GitLab uses #{link_to "sidekiq", "http://sidekiq.org/"} library for async job processing
......
- page_title "Broadcast Messages"
%h3.page-title
Broadcast Messages
%p.light
......
- page_title "Deploy Keys"
.panel.panel-default
.panel-heading
Public deploy keys (#{@deploy_keys.count})
......
- page_title "New Deploy Key"
%h3.page-title New public deploy key
%hr
......
- page_title @deploy_key.title, "Deploy Keys"
.row
.col-md-4
.panel.panel-default
......
- page_title "Edit", @group.name, "Groups"
%h3.page-title Edit group: #{@group.name}
%hr
= render 'form'
- page_title "Groups"
%h3.page-title
Groups (#{@groups.total_count})
= link_to 'New Group', new_admin_group_path, class: "btn btn-new pull-right"
......
- page_title "New Group"
%h3.page-title New group
%hr
= render 'form'
- page_title @group.name, "Groups"
%h3.page-title
Group: #{@group.name}
......
- page_title "System Hooks"
%h3.page-title
System hooks
......
- page_title @key.title, "Keys"
= render "profiles/keys/key_details", admin: true
- page_title "Logs"
- loggers = [Gitlab::GitLogger, Gitlab::AppLogger,
Gitlab::ProductionLogger, Gitlab::SidekiqLogger]
%ul.nav.nav-tabs.log-tabs
......
- page_title "Projects"
= render 'shared/show_aside'
.row
......
- 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
......
- page_title @service.title, "Service Templates"
= render 'form'
- page_title "Service Templates"
%h3.page-title Service templates
%p.light Service template allows you to set default values for project services
......
- page_title "Edit", @user.name, "Users"
%h3.page-title
Edit user: #{@user.name}
.back-link
......
- page_title "Users"
= render 'shared/show_aside'
.row
......
- page_title "New User"
%h3.page-title
New user
%hr
......
- page_title @user.name, "Users"
%h3.page-title
User:
= @user.name
......
- page_title "Groups"
%h3.page-title
Group Membership
- if current_user.can_create_group?
......
- 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")
......
- page_title "Merge Requests"
%h3.page-title
Merge Requests
......
- page_title "Milestones"
%h3.page-title
Milestones
%span.pull-right #{@dashboard_milestones.count} milestones
......
- page_title @dashboard_milestone.title, "Milestones"
%h4.page-title
.issue-box{ class: "issue-box-#{@dashboard_milestone.closed? ? 'closed' : 'open'}" }
- if @dashboard_milestone.closed?
......
- page_title "Starred Projects"
- if @projects.any?
= render 'shared/show_aside'
......
- page_title "Sign up"
= render 'devise/shared/signup_box'
= render 'devise/shared/sign_in_link'
\ No newline at end of file
= render 'devise/shared/sign_in_link'
- page_title "Sign in"
%div
- if signin_enabled? || ldap_enabled?
= render 'devise/shared/signin_box'
......
- page_title "Edit", @application.name, "Applications"
%h3.page-title Edit application
= render 'form', application: @application
\ No newline at end of file
= render 'form', application: @application
- 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
\ No newline at end of file
%td= render 'delete_form', application: application
- page_title @application.name, "Applications"
%h3.page-title
Application: #{@application.name}
......
- page_title "Access Denied"
%h1 403
%h3 Access Denied
%hr
......
- page_title "Encoding Error"
%h1 500
%h3 Encoding Error
%hr
......
- page_title "Git Resource Not Found"
%h1 404
%h3 Git Resource Not found
%hr
......
- page_title "Not Found"
%h1 404
%h3 The resource you were looking for doesn't exist.
%hr
......
- page_title "Auth Error"
%h1 422
%h3 Sign-in using #{@provider} auth failed
%hr
......
- page_title "Groups"
.clearfix
.pull-left
= form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f|
......
- page_title "Projects"
.clearfix
= render 'filter'
......
- page_title "Starred Projects"
.explore-trending-block
%p.lead
%i.fa.fa-star
......
- page_title "Trending Projects"
.explore-title
%h3
Explore GitLab
......
%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
- page_title "Settings"
.panel.panel-default
.panel-heading
%strong= @group.name
......
- page_title "Members"
- show_roles = should_user_see_group_roles?(current_user, @group)
%h3.page-title
......
- 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")
......
- page_title "Merge Requests"
%h3.page-title
Merge Requests
......
- page_title "Milestones"
%h3.page-title
Milestones
%span.pull-right #{@group_milestones.count} milestones
......
- page_title @group_milestone.title, "Milestones"
%h4.page-title
.issue-box{ class: "issue-box-#{@group_milestone.closed? ? 'closed' : 'open'}" }
- if @group_milestone.closed?
......
- page_title 'New Group'
- header_title 'New Group'
= form_for @group, html: { class: 'group-form form-horizontal' } do |f|
- if @group.errors.any?
.alert.alert-danger
......
- page_title "Projects"
.panel.panel-default
.panel-heading
%strong= @group.name
......
- page_title @file.humanize, *@category.split("/").reverse.map(&:humanize)
.documentation.wiki
= markdown @markdown.gsub('$your_email', current_user.email)
- page_title "UI Development Kit", "Help"
- lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed fermentum nisi sapien, non consequat lectus aliquam ultrices. Suspendisse sodales est euismod nunc condimentum, a consectetur diam ornare."
.gitlab-ui-dev-kit
......
- page_title "Bitbucket import"
%h3.page-title
%i.fa.fa-bitbucket
Import projects from Bitbucket
......
- page_title "GitHub import"
%h3.page-title
%i.fa.fa-github
Import projects from GitHub
......
- page_title "GitLab.com import"
%h3.page-title
%i.fa.fa-heart
Import projects from GitLab.com
......
- page_title "Gitorious import"
%h3.page-title
%i.icon-gitorious.icon-gitorious-big
Import projects from Gitorious.org
......
- page_title "Google Code import"
%h3.page-title
%i.fa.fa-google
Import projects from Google Code
......
- page_title "User map", "Google Code import"
%h3.page-title
%i.fa.fa-google
Import projects from Google Code
......
- page_title "Google Code import"
%h3.page-title
%i.fa.fa-google
Import projects from Google Code
......
- page_title "Invitation"
%h3.page-title Invitation
%p
......
- page_title "GitLab"
%head
%meta{charset: "utf-8"}
%meta{'http-equiv' => 'X-UA-Compatible', content: 'IE=edge'}
%meta{content: "GitLab Community Edition", name: "description"}
%title
= "#{title} | " if defined?(title)
GitLab
%title= page_title
= favicon_link_tag 'favicon.ico'
= stylesheet_link_tag "application", :media => "all"
......
.page-with-sidebar{ class: nav_sidebar_class }
= render "layouts/broadcast"
.sidebar-wrapper
- if defined?(sidebar)
= render(sidebar)
- if defined?(sidebar) && sidebar
= render "layouts/nav/#{sidebar}"
- elsif current_user
= render 'layouts/nav/dashboard'
.collapse-nav
......
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: "Admin area"
%body{class: "#{app_theme} admin", :'data-page' => body_data_page}
= render "layouts/head_panel", title: link_to("Admin area", admin_root_path)
= render 'layouts/page', sidebar: 'layouts/nav/admin'
- page_title "Admin area"
- header_title "Admin area", admin_root_path
- sidebar "admin"
= render template: "layouts/application"
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: "Dashboard"
%body{class: "#{app_theme} application", :'data-page' => body_data_page }
= render "layouts/head_panel", title: link_to("Dashboard", root_path)
= render 'layouts/page', sidebar: 'layouts/nav/dashboard'
= render "layouts/head"
%body{class: "#{app_theme}", :'data-page' => body_data_page}
- if current_user
= render "layouts/head_panel", title: header_title
- else
= render "layouts/public_head_panel", title: header_title
= render 'layouts/page', sidebar: sidebar
- page_title "Dashboard"
- header_title "Dashboard", root_path
- sidebar "dashboard"
= render template: "layouts/application"
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: "Error"
= render "layouts/head"
%body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "" if current_user
.container.navless-container
......
- page_title = 'Explore GitLab'
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: page_title
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast"
- if current_user
= render "layouts/head_panel", title: link_to(page_title, explore_root_path)
- else
= render "layouts/public_head_panel", title: link_to(page_title, explore_root_path)
- page_title "Explore"
- header_title "Explore GitLab", explore_root_path
- sidebar "explore"
= render 'layouts/page', sidebar: 'layouts/nav/explore'
= render template: "layouts/application"
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: group_head_title
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/head_panel", title: link_to(@group.name, group_path(@group))
= render 'layouts/page', sidebar: 'layouts/nav/group'
- page_title @group.name
- header_title @group.name, group_path(@group)
- sidebar "group"
= render template: "layouts/application"
- page_title "Help"
- header_title "Help", help_path
= render template: "layouts/application"
......@@ -39,4 +39,15 @@
= icon ('angle-down fw')
- if group_settings_page?
= render 'groups/settings_nav'
%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
%ul.project-navigation.nav.nav-sidebar
- if @project_settings_nav
= nav_link do
= link_to project_path(@project), title: 'Back to project', data: {placement: 'right'} do
= icon('caret-square-o-left fw')
= nav_link(path: 'projects#show', html_options: {class: 'home'}) do
= link_to project_path(@project), title: 'Project', class: 'shortcuts-project', data: {placement: 'right'} do
= icon('dashboard fw')
%span
Project
- if project_nav_tab? :files
= nav_link(controller: %w(tree blob blame edit_tree new_tree)) do
= link_to namespace_project_tree_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Files', class: 'shortcuts-tree', data: {placement: 'right'} do
= icon('files-o fw')
%span
Back to project
Files
%li.separate-item
= render 'projects/settings_nav'
- else
= nav_link(path: 'projects#show', html_options: {class: 'home'}) do
= link_to project_path(@project), title: 'Project', class: 'shortcuts-project', data: {placement: 'right'} do
= icon('dashboard fw')
- if project_nav_tab? :commits
= nav_link(controller: %w(commit commits compare repositories tags branches)) do
= link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Commits', class: 'shortcuts-commits', data: {placement: 'right'} do
= icon('history fw')
%span
Project
- if project_nav_tab? :files
= nav_link(controller: %w(tree blob blame edit_tree new_tree)) do
= link_to namespace_project_tree_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Files', class: 'shortcuts-tree', data: {placement: 'right'} do
= icon('files-o fw')
%span
Files
- if project_nav_tab? :commits
= nav_link(controller: %w(commit commits compare repositories tags branches)) do
= link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Commits', class: 'shortcuts-commits', data: {placement: 'right'} do
= icon('history fw')
%span
Commits
Commits
- if project_nav_tab? :network
= nav_link(controller: %w(network)) do
= link_to namespace_project_network_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Network', class: 'shortcuts-network', data: {placement: 'right'} do
= icon('code-fork fw')
%span
Network
- if project_nav_tab? :network
= nav_link(controller: %w(network)) do
= link_to namespace_project_network_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Network', class: 'shortcuts-network', data: {placement: 'right'} do
= icon('code-fork fw')
%span
Network
- if project_nav_tab? :graphs
= nav_link(controller: %w(graphs)) do
= link_to namespace_project_graph_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Graphs', class: 'shortcuts-graphs', data: {placement: 'right'} do
= icon('area-chart fw')
%span
Graphs
- if project_nav_tab? :graphs
= nav_link(controller: %w(graphs)) do
= link_to namespace_project_graph_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Graphs', class: 'shortcuts-graphs', data: {placement: 'right'} do
= icon('area-chart fw')
%span
Graphs
- if project_nav_tab? :milestones
= nav_link(controller: :milestones) do
= link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones', data: {placement: 'right'} do
= icon('clock-o fw')
%span
Milestones
- if project_nav_tab? :milestones
= nav_link(controller: :milestones) do
= link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones', data: {placement: 'right'} do
= icon('clock-o fw')
%span
Milestones
- if project_nav_tab? :issues
= nav_link(controller: :issues) do
= link_to url_for_project_issues(@project, only_path: true), title: 'Issues', class: 'shortcuts-issues', data: {placement: 'right'} do
= icon('exclamation-circle fw')
%span
Issues
- if @project.default_issues_tracker?
%span.count.issue_counter= @project.issues.opened.count
- if project_nav_tab? :issues
= nav_link(controller: :issues) do
= link_to url_for_project_issues(@project, only_path: true), title: 'Issues', class: 'shortcuts-issues', data: {placement: 'right'} do
= icon('exclamation-circle fw')
%span
Issues
- if @project.default_issues_tracker?
%span.count.issue_counter= @project.issues.opened.count
- if project_nav_tab? :merge_requests
= nav_link(controller: :merge_requests) do
= link_to namespace_project_merge_requests_path(@project.namespace, @project), title: 'Merge Requests', class: 'shortcuts-merge_requests', data: {placement: 'right'} do
= icon('tasks fw')
%span
Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count
- if project_nav_tab? :merge_requests
= nav_link(controller: :merge_requests) do
= link_to namespace_project_merge_requests_path(@project.namespace, @project), title: 'Merge Requests', class: 'shortcuts-merge_requests', data: {placement: 'right'} do
= icon('tasks fw')
%span
Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count
- if project_nav_tab? :labels
= nav_link(controller: :labels) do
= link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels', data: {placement: 'right'} do
= icon('tags fw')
%span
Labels
- if project_nav_tab? :labels
= nav_link(controller: :labels) do
= link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels', data: {placement: 'right'} do
= icon('tags fw')
%span
Labels
- if project_nav_tab? :wiki
= nav_link(controller: :wikis) do
= link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki', data: {placement: 'right'} do
= icon('book fw')
%span
Wiki
- if project_nav_tab? :wiki
= nav_link(controller: :wikis) do
= link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki', data: {placement: 'right'} do
= icon('book fw')
%span
Wiki
- if project_nav_tab? :snippets
= nav_link(controller: :snippets) do
= link_to namespace_project_snippets_path(@project.namespace, @project), title: 'Snippets', class: 'shortcuts-snippets', data: {placement: 'right'} do
= icon('file-text-o fw')
%span
Snippets
- if project_nav_tab? :snippets
= nav_link(controller: :snippets) do
= link_to namespace_project_snippets_path(@project.namespace, @project), title: 'Snippets', class: 'shortcuts-snippets', data: {placement: 'right'} do
= icon('file-text-o fw')
%span
Snippets
- if project_nav_tab? :settings
= nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do
= link_to edit_project_path(@project), title: 'Settings', class: 'stat-tab tab no-highlight', data: {placement: 'right'} do
= icon('cogs fw')
%span
Settings
- if project_nav_tab? :settings
= nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do
= link_to edit_project_path(@project), title: 'Settings', class: 'stat-tab tab no-highlight', data: {placement: 'right'} do
= icon('cogs fw')
%span
Settings
%ul.project-navigation.nav.nav-sidebar
= nav_link do
= link_to project_path(@project), title: 'Back to project', data: {placement: 'right'} do
= icon('caret-square-o-left fw')
%span
Back to project
%li.separate-item
%ul.project-settings-nav.sidebar-subnav
= nav_link(path: 'projects#edit') do
= link_to edit_project_path(@project), title: 'Project', class: 'stat-tab tab', data: {placement: 'right'} do
= icon('pencil-square-o')
%span
Project
= nav_link(controller: [:project_members, :teams]) do
= link_to namespace_project_project_members_path(@project.namespace, @project), title: 'Members', class: 'team-tab tab', data: {placement: 'right'} do
= icon('users')
%span
Members
= nav_link(controller: :deploy_keys) do
= link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys', data: {placement: 'right'} do
= icon('key')
%span
Deploy Keys
= nav_link(controller: :hooks) do
= link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Web Hooks', data: {placement: 'right'} do
= icon('link')
%span
Web Hooks
= nav_link(controller: :services) do
= link_to namespace_project_services_path(@project.namespace, @project), title: 'Services', data: {placement: 'right'} do
= icon('cogs')
%span
Services
= nav_link(controller: :protected_branches) do
= link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches', data: {placement: 'right'} do
= icon('lock')
%span
Protected branches
%ul.nav.nav-sidebar
= nav_link(path: user_snippets_path(current_user), html_options: {class: 'home'}) do
= link_to user_snippets_path(current_user), title: 'Your snippets', data: {placement: 'right'} do
= icon('dashboard fw')
%span
Your Snippets
- if current_user
= nav_link(path: user_snippets_path(current_user), html_options: {class: 'home'}) do
= link_to user_snippets_path(current_user), title: 'Your snippets', data: {placement: 'right'} do
= icon('dashboard fw')
%span
Your Snippets
= nav_link(path: snippets_path) do
= link_to snippets_path, title: 'Discover snippets', data: {placement: 'right'} do
= icon('globe fw')
......
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: @title
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/broadcast"
= render "layouts/head_panel", title: defined?(@title_url) ? link_to(@title, @title_url) : @title
= render 'layouts/page'
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: "Profile"
%body{class: "#{app_theme} profile", :'data-page' => body_data_page}
= render "layouts/head_panel", title: link_to("Profile", profile_path)
= render 'layouts/page', sidebar: 'layouts/nav/profile'
- page_title "Profile"
- header_title "Profile", profile_path
- sidebar "profile"
= render template: "layouts/application"
- page_title @project.name_with_namespace
- header_title project_title(@project)
- sidebar "project" unless sidebar
- content_for :embedded_scripts do
= render "layouts/init_auto_complete" if current_user
= render template: "layouts/application"
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: @project.name_with_namespace
%body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id }
= render "layouts/head_panel", title: project_title(@project)
= render "layouts/init_auto_complete"
- @project_settings_nav = true
= render 'layouts/page', sidebar: 'layouts/nav/project'
- page_title "Settings"
- sidebar "project_settings"
= render template: "layouts/project"
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: project_head_title
%body{class: "#{app_theme} project", :'data-page' => body_data_page, :'data-project-id' => @project.id }
= render "layouts/head_panel", title: project_title(@project)
= render "layouts/init_auto_complete"
= render 'layouts/page', sidebar: 'layouts/nav/project'
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: group_head_title
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/public_head_panel", title: link_to(@group.name, group_path(@group))
= render 'layouts/page', sidebar: 'layouts/nav/group'
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: @project.name_with_namespace
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/public_head_panel", title: project_title(@project)
= render 'layouts/page', sidebar: 'layouts/nav/project'
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: @title
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/public_head_panel", title: defined?(@title_url) ? link_to(@title, @title_url) : @title
= render 'layouts/page'
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: "Search"
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/head_panel", title: link_to("Search", search_path)
= render 'layouts/page'
- page_title "Search"
- header_title "Search", search_path
= render template: "layouts/application"
!!! 5
%html{ lang: "en"}
= render "layouts/head", title: "Dashboard"
%body{class: "#{app_theme} application", :'data-page' => body_data_page }
= render "layouts/head_panel", title: link_to("Snippets", snippets_path)
= render 'layouts/page', sidebar: 'layouts/nav/snippets'
- page_title 'Snippets'
- header_title 'Snippets', snippets_path
- sidebar "snippets"
= render template: "layouts/application"
- page_title "Account"
- if current_user.ldap_user?
.alert.alert-info
Some options are unavailable for LDAP accounts
......
- page_title "Applications"
%h3.page-title
Application Settings
%p.light
......
- page_title "Design"
%h3.page-title
Design Settings
%p.light
......
- page_title "Emails"
%h3.page-title
Email Settings
%p.light
......
- page_title "History"
%h3.page-title
Your Account History
%p.light
......
- page_title "SSH Keys"
%h3.page-title
SSH Keys Settings
.pull-right
......
- page_title "Add SSH Keys"
%h3.page-title Add an SSH Key
%p.light
Paste your public key here. Read more about how to generate a key on #{link_to "the SSH help page", help_page_path("ssh", "README")}.
......
- page_title @key.title, "SSH Keys"
= render "key_details"
- page_title "Notifications"
%h3.page-title
Notifications Settings
%p.light
......
- page_title "Password"
%h3.page-title Password Settings
%p.light
- if @user.password_automatically_set?
......
- page_title "New Password"
- header_title "New Password"
%h3.page-title Setup new password
%hr
= form_for @user, url: profile_password_path, method: :post, html: { class: 'form-horizontal '} do |f|
......
- page_title "Settings"
%h3.page-title
Profile Settings
%p.light
......
%ul.project-settings-nav.sidebar-subnav
= nav_link(path: 'projects#edit') do
= link_to edit_project_path(@project), title: 'Project', class: 'stat-tab tab', data: {placement: 'right'} do
= icon('pencil-square-o')
%span
Project
= nav_link(controller: [:project_members, :teams]) do
= link_to namespace_project_project_members_path(@project.namespace, @project), title: 'Members', class: 'team-tab tab', data: {placement: 'right'} do
= icon('users')
%span
Members
= nav_link(controller: :deploy_keys) do
= link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys', data: {placement: 'right'} do
= icon('key')
%span
Deploy Keys
= nav_link(controller: :hooks) do
= link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Web Hooks', data: {placement: 'right'} do
= icon('link')
%span
Web Hooks
= nav_link(controller: :services) do
= link_to namespace_project_services_path(@project.namespace, @project), title: 'Services', data: {placement: 'right'} do
= icon('cogs')
%span
Services
= nav_link(controller: :protected_branches) do
= link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches', data: {placement: 'right'} do
= icon('lock')
%span
Protected branches
- page_title "Blame", @blob.path, @ref
%h3.page-title Blame view
#tree-holder.tree-holder
......
- page_title "Edit", @blob.path, @ref
.file-editor
%ul.nav.nav-tabs.js-edit-mode
%li.active
......
- page_title "New File", @ref
%h3.page-title New file
.file-editor
= form_tag(namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post, class: 'form-horizontal form-new-file') do
......
- page_title @blob.path, @ref
%div.tree-ref-holder
= render 'shared/ref_switcher', destination: 'blob', path: @path
......
- page_title "Branches"
= render "projects/commits/head"
%h3.page-title
Branches
......
- page_title "New Branch"
- if @error
.alert.alert-danger
%button{ type: "button", class: "close", "data-dismiss" => "alert"} &times;
......
- page_title "#{@commit.title} (#{@commit.short_id})", "Commits"
= render "commit_box"
= render "projects/diffs/diffs", diffs: @diffs, project: @project
= render "projects/notes/notes_with_form"
- page_title "Commits", @ref
= content_for :meta_tags do
- if current_user
= auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.private_token), title: "#{@project.name}:#{@ref} commits")
......
- page_title "Compare"
= render "projects/commits/head"
%h3.page-title
......
- page_title "#{params[:from]}...#{params[:to]}"
= render "projects/commits/head"
%h3.page-title
......
- page_title "Deploy Keys"
%h3.page-title
Deploy keys allow read-only access to the repository
......
- page_title "New Deploy Key"
%h3.page-title New Deploy key
%hr
......
- page_title @key.title, "Deploy Keys"
%h3.page-title
Deploy key:
= @key.title
......
- page_title "Fork project"
- if @forked_project && !@forked_project.saved?
.alert.alert-danger.alert-block
%h4
......
- page_title "Fork project"
%h3.page-title Fork project
%p.lead
Click to fork the project to a user or group
......
- page_title "Commit statistics"
= render 'head'
%p.lead
......
- page_title "Contributor statistics"
= render 'head'
.loading-graph
.center
......
- page_title "Web Hooks"
%h3.page-title
Web hooks
......
- page_title "Import repository"
%h3.page-title
- if @project.import_failed?
Import failed. Retry?
......
- page_title "Import in progress"
.save-project-loader
.center
%h2
......
- page_title "Edit", "#{@issue.title} (##{@issue.iid})", "Issues"
= render "form"
- page_title "Issues"
= content_for :meta_tags do
- if current_user
= auto_discovery_link_tag(:atom, namespace_project_issues_url(@project.namespace, @project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
......
- page_title "#{@issue.title} (##{@issue.iid})", "Issues"
.issue
.issue-details
%h4.page-title
......
- page_title "Edit", @label.name, "Labels"
%h3
Edit label
%span.light #{@label.name}
......
- page_title "Labels"
- if can? current_user, :admin_label, @project
= link_to new_namespace_project_label_path(@project.namespace, @project), class: "pull-right btn btn-new" do
New label
......
- page_title "New Label"
%h3 New label
.back-link
= link_to namespace_project_labels_path(@project.namespace, @project) do
......
- page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
.merge-request{'data-url' => merge_request_path(@merge_request)}
.merge-request-details
= render "projects/merge_requests/show/mr_title"
......
- page_title "Edit", "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
%h3.page-title
= "Edit merge request ##{@merge_request.iid}"
%hr
......
- page_title "Merge Requests"
.append-bottom-10
.pull-right
= render 'shared/issuable_search_form', path: namespace_project_merge_requests_path(@project.namespace, @project)
......
- page_title "#{@merge_request.title} (##{@merge_request.iid})", "Merge Requests"
.merge-request
= render "projects/merge_requests/show/mr_title"
= render "projects/merge_requests/show/mr_box"
......
- page_title "New Merge Request"
- if @merge_request.can_be_created
= render 'new_submit'
- else
......
- page_title "Edit", @milestone.title, "Milestones"
= render "form"
- page_title "Milestones"
.pull-right
- if can? current_user, :admin_milestone, @project
= link_to new_namespace_project_milestone_path(@project.namespace, @project), class: "pull-right btn btn-new", title: "New Milestone" do
......
- page_title "New Milestone"
= render "form"
- page_title @milestone.title, "Milestones"
%h4.page-title
.issue-box{ class: issue_box_class(@milestone) }
- if @milestone.closed?
......
- page_title "Network", @ref
= render "head"
.project-network
.controls
......
- page_title 'New Project'
- header_title 'New Project'
.project-edit-container
.project-edit-errors
= render 'projects/errors'
......
- page_title "Import members"
%h3.page-title
Import members from another project
%p.light
......
- page_title "Members"
%h3.page-title
Users with access to this project
......
- page_title "Protected branches"
%h3.page-title Protected branches
%p.light Keep stable branches secure and force developers to use Merge Requests
%hr
......
- page_title @service.title, "Services"
= render 'form'
- page_title "Services"
%h3.page-title Project services
%p.light Project services allow you to integrate GitLab with other applications
......
- page_title "Edit", @snippet.title, "Snippets"
%h3.page-title
Edit snippet
%hr
......
- page_title "Snippets"
%h3.page-title
Snippets
- if can? current_user, :write_project_snippet, @project
......
- page_title "New Snippets"
%h3.page-title
New snippet
%hr
......
- page_title @snippet.title, "Snippets"
%h3.page-title
= @snippet.title
......
- page_title "Tags"
= render "projects/commits/head"
%h3.page-title
......
- page_title "New Tag"
- if @error
.alert.alert-danger
%button{ type: "button", class: "close", "data-dismiss" => "alert"} &times;
......
- page_title @path.presence || "Files", @ref
= content_for :meta_tags do
- if current_user
= auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.private_token), title: "#{@project.name}:#{@ref} commits")
......
- page_title "Edit", @page.title, "Wiki"
= render 'nav'
.pull-right
= render 'main_links'
......
- page_title "Wiki"
%h3.page-title Empty page
%hr
.error_message
......
- page_title "Git Access", "Wiki"
= render 'nav'
.row
.col-sm-6
......
- page_title "History", @page.title, "Wiki"
= render 'nav'
%h3.page-title
%span.light History for
......
- page_title "All Pages", "Wiki"
= render 'nav'
%h3.page-title
All Pages
......
- page_title @page.title, "Wiki"
= render 'nav'
%h3.page-title
= @page.title
......
- page_title @search_term
= render 'search/form'
%hr
- if @search_term
......
- page_title "Your Snippets"
%h3.page-title
Your Snippets
.pull-right
......
- page_title "Edit", @snippet.title, "Snippets"
%h3.page-title
Edit snippet
%hr
......
- page_title "Public Snippets"
%h3.page-title
Public snippets
......
- page_title "New Snippet"
%h3.page-title
New snippet
%hr
......
- page_title @snippet.title, "Snippets"
%h3.page-title
= @snippet.title
......
- page_title "Snippets", @user.name
%h3.page-title
= image_tag avatar_icon(@user.email), class: "avatar s24"
= @user.name
......
- page_title @user.name
- header_title @user.name, user_path(@user)
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, user_url(@user, format: :atom), title: "#{@user.name} activity")
......
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