Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
4c8721b2
Commit
4c8721b2
authored
Mar 01, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor UI header for logged out users
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
b4c842b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
47 deletions
+28
-47
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+1
-5
app/views/layouts/header/_default.html.haml
app/views/layouts/header/_default.html.haml
+27
-22
app/views/layouts/header/_public.html.haml
app/views/layouts/header/_public.html.haml
+0
-20
No files found.
app/views/layouts/application.html.haml
View file @
4c8721b2
...
...
@@ -5,11 +5,7 @@
-# Ideally this would be inside the head, but turbolinks only evaluates page-specific JS in the body.
=
yield
:scripts_body_top
-
if
current_user
=
render
"layouts/header/default"
,
title:
header_title
-
else
=
render
"layouts/header/public"
,
title:
header_title
=
render
"layouts/header/default"
,
title:
header_title
=
render
'layouts/page'
,
sidebar:
sidebar
=
yield
:scripts_body
app/views/layouts/header/_default.html.haml
View file @
4c8721b2
...
...
@@ -13,30 +13,35 @@
%li
.visible-sm.visible-xs
=
link_to
search_path
,
title:
'Search'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'search'
)
-
if
session
[
:impersonator_id
]
%li
.impersonation
=
link_to
stop_impersonation_admin_users_path
,
method: :delete
,
title:
'Stop Impersonation'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'user-secret fw'
)
-
if
current_user
.
is_admin?
-
if
current_user
-
if
session
[
:impersonator_id
]
%li
.impersonation
=
link_to
stop_impersonation_admin_users_path
,
method: :delete
,
title:
'Stop Impersonation'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'user-secret fw'
)
-
if
current_user
.
is_admin?
%li
=
link_to
admin_root_path
,
title:
'Admin Area'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'wrench fw'
)
%li
=
link_to
admin_root_path
,
title:
'Admin Area'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'wrench fw'
)
%li
=
link_to
dashboard_todos_path
,
title:
'Todos'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
%span
.badge.todos-pending-count
=
todos_pending_count
-
if
current_user
.
can_create_project?
=
link_to
dashboard_todos_path
,
title:
'Todos'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
%span
.badge.todos-pending-count
=
todos_pending_count
-
if
current_user
.
can_create_project?
%li
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'plus fw'
)
-
if
Gitlab
::
Sherlock
.
enabled?
%li
=
link_to
sherlock_transactions_path
,
title:
'Sherlock Transactions'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'tachometer fw'
)
%li
=
link_to
new_project_path
,
title:
'New project'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'plus fw'
)
-
if
Gitlab
::
Sherlock
.
enabled?
%li
=
link_to
sherlock_transactions_path
,
title:
'Sherlock Transactions'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'tachometer fw'
)
%li
=
link_to
destroy_user_session_path
,
class:
'logout'
,
method: :delete
,
title:
'Sign out'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'sign-out'
)
=
link_to
destroy_user_session_path
,
class:
'logout'
,
method: :delete
,
title:
'Sign out'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'sign-out'
)
-
else
.pull-right
=
link_to
"Sign in"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'btn btn-sign-in btn-success'
%h1
.title
=
title
...
...
app/views/layouts/header/_public.html.haml
deleted
100644 → 0
View file @
b4c842b3
%header
.navbar.navbar-fixed-top.navbar-gitlab
{
class:
nav_header_class
}
%div
{
class:
fluid_layout
?
"container-fluid"
:
"container-fluid"
}
.header-content
-
unless
current_controller?
(
'sessions'
)
.pull-right
=
link_to
"Sign in"
,
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
class:
'btn btn-sign-in btn-success'
.navbar-collapse.collapse
%ul
.nav.navbar-nav.pull-right
-
unless
@disable_search_panel
%li
.hidden-sm.hidden-xs
=
render
'layouts/search'
%li
.visible-sm.visible-xs
=
link_to
search_path
,
title:
'Search'
,
data:
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}
do
=
icon
(
'search'
)
%h1
.title
=
title
=
render
'shared/outdated_browser'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment