Commit 6de7f94f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'rs-minor-styles' into 'master'

Minor design change grab-bag 🎉

I started with one simple change and found a few more, so here they are.

### Simplify icon style selectors

All FontAwesome icons have an `fa` class, so just use that.

### Don't override color of code blocks in notes

This was a pet peeve of mine.

| Before | After |
|:------:|:-----:|
| ![Screen_Shot_2015-04-23_at_4.14.23_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/c77cb0816bf0f05cb8c4105cdd8b3ec6/Screen_Shot_2015-04-23_at_4.14.23_PM.png) | ![Screen_Shot_2015-04-23_at_4.15.44_PM](https://gitlab.com/gitlab-org/gitlab-ce/uploads/463c1d2052e12444563f5e2c102ac51e/Screen_Shot_2015-04-23_at_4.15.44_PM.png) |

### Items with tooltips don't need a 'data-original-title' attribute

This attribute gets added dynamically by Bootstrap's tooltip JS based on the `title` attribute

### Fix Profile > Design live-updating

`ui_blue` wasn't added to the list of classes to remove, so if a user changed to that theme, any subsequent changes wouldn't be live-updated.

This change refactors Gitlab::Theme a bit to make it harder for this to happen in the future with new themes.

### Remove the `has_bottom_tooltip` class

Bootstrap's tooltip JS can read the placement from a `data-placement` attribute.

Further, when we supply the `selector` option to `tooltip`, tooltips will be added to any dynamically-added elements matching the selector, without us having to re-call the `tooltip` method.

See merge request !569
parents a64b5e3c 1e1785cc
...@@ -132,10 +132,17 @@ $ -> ...@@ -132,10 +132,17 @@ $ ->
), 1 ), 1
# Initialize tooltips # Initialize tooltips
$('.has_tooltip').tooltip() $('body').tooltip({
selector: '.has_tooltip, [data-toggle="tooltip"], .page-sidebar-collapsed .nav-sidebar a'
# Bottom tooltip placement: (_, el) ->
$('.has_bottom_tooltip').tooltip(placement: 'bottom') $el = $(el)
if $el.attr('id') == 'js-shortcuts-home'
# Place the logo tooltip on the right when collapsed, bottom when expanded
$el.parents('header').hasClass('header-collapsed') and 'right' or 'bottom'
else
# Otherwise use the data-placement attribute like normal
$el.data('placement')
})
# Form submitter # Form submitter
$('.trigger-submit').on 'change', -> $('.trigger-submit').on 'change', ->
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
color: #888; color: #888;
text-shadow: 0 1px 1px #fff; text-shadow: 0 1px 1px #fff;
} }
i[class~="fa"] { i.fa {
line-height: 14px; line-height: 14px;
} }
} }
......
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
p > code { p > code {
font-size: inherit; font-size: inherit;
font-weight: inherit; font-weight: inherit;
color: #555;
} }
li { li {
......
...@@ -136,7 +136,7 @@ ul.notes { ...@@ -136,7 +136,7 @@ ul.notes {
display: none; display: none;
float: right; float: right;
[class~="fa"] { i.fa {
font-size: 16px; font-size: 16px;
line-height: 16px; line-height: 16px;
vertical-align: middle; vertical-align: middle;
......
%ul.sidebar-subnav %ul.sidebar-subnav
= nav_link(path: 'groups#edit') do = nav_link(path: 'groups#edit') do
= link_to edit_group_path(@group), title: 'Group' do = link_to edit_group_path(@group), title: 'Group', data: {placement: 'right'} do
%i.fa.fa-pencil-square-o = icon('pencil-square-o')
%span %span
Group Group
= nav_link(path: 'groups#projects') do = nav_link(path: 'groups#projects') do
= link_to projects_group_path(@group), title: 'Projects' do = link_to projects_group_path(@group), title: 'Projects', data: {placement: 'right'} do
%i.fa.fa-folder = icon('folder')
%span %span
Projects Projects
...@@ -2,48 +2,47 @@ ...@@ -2,48 +2,47 @@
.navbar-inner .navbar-inner
.container .container
%div.app_logo %div.app_logo
= link_to root_path, class: "home has_bottom_tooltip", title: "Dashboard" do = link_to root_path, class: 'home', title: 'Dashboard', id: 'js-shortcuts-home', data: {toggle: 'tooltip', placement: 'bottom'} do
= brand_header_logo = brand_header_logo
%h3 GitLab %h3 GitLab
%h1.title= title %h1.title= title
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", type: "button"} %button.navbar-toggle{type: 'button', data: {target: '.navbar-collapse', toggle: 'collapse'}}
%span.sr-only Toggle navigation %span.sr-only Toggle navigation
%i.fa.fa-bars = icon('bars')
.navbar-collapse.collapse .navbar-collapse.collapse
%ul.nav.navbar-nav %ul.nav.navbar-nav
%li.hidden-sm.hidden-xs %li.hidden-sm.hidden-xs
= render "layouts/search" = render 'layouts/search'
%li.visible-sm.visible-xs %li.visible-sm.visible-xs
= link_to search_path, title: "Search", class: 'has_bottom_tooltip', 'data-original-title' => 'Search area' do = link_to search_path, title: 'Search', data: {toggle: 'tooltip', placement: 'bottom'} do
%i.fa.fa-search = icon('search')
%li %li
= link_to help_path, title: 'Help', class: 'has_bottom_tooltip', = link_to help_path, title: 'Help', data: {toggle: 'tooltip', placement: 'bottom'} do
'data-original-title' => 'Help' do = icon('question-circle')
%i.fa.fa-question-circle
%li %li
= link_to explore_root_path, title: "Explore", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do = link_to explore_root_path, title: 'Explore', data: {toggle: 'tooltip', placement: 'bottom'} do
%i.fa.fa-globe = icon('globe')
%li %li
= link_to user_snippets_path(current_user), title: "Your snippets", class: 'has_bottom_tooltip', 'data-original-title' => 'Your snippets' do = link_to user_snippets_path(current_user), title: 'Your snippets', data: {toggle: 'tooltip', placement: 'bottom'} do
%i.fa.fa-clipboard = icon('clipboard')
- if current_user.is_admin? - if current_user.is_admin?
%li %li
= link_to admin_root_path, title: "Admin area", class: 'has_bottom_tooltip', 'data-original-title' => 'Admin area' do = link_to admin_root_path, title: 'Admin area', data: {toggle: 'tooltip', placement: 'bottom'} do
%i.fa.fa-cogs = icon('cogs')
- if current_user.can_create_project? - if current_user.can_create_project?
%li %li
= link_to new_project_path, title: "New project", class: 'has_bottom_tooltip', 'data-original-title' => 'New project' do = link_to new_project_path, title: 'New project', data: {toggle: 'tooltip', placement: 'bottom'} do
%i.fa.fa-plus = icon('plus')
%li %li
= link_to profile_path, title: "Profile settings", class: 'has_bottom_tooltip', 'data-original-title' => 'Profile settings"' do = link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do
%i.fa.fa-user = icon('user')
%li %li
= link_to destroy_user_session_path, class: "logout", method: :delete, title: "Sign out", class: 'has_bottom_tooltip', 'data-original-title' => 'Sign out' do = link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', data: {toggle: 'tooltip', placement: 'bottom'} do
%i.fa.fa-sign-out = icon('sign-out')
%li.hidden-xs %li.hidden-xs
= link_to current_user, class: "profile-pic has_bottom_tooltip", id: 'profile-pic', 'data-original-title' => 'Your profile' do = link_to current_user, class: 'profile-pic', id: 'profile-pic', data: {toggle: 'tooltip', placement: 'bottom'} do
= image_tag avatar_icon(current_user.email, 60), alt: 'User activity' = image_tag avatar_icon(current_user.email, 60), alt: 'User activity'
= render 'shared/outdated_browser' = render 'shared/outdated_browser'
...@@ -15,7 +15,3 @@ ...@@ -15,7 +15,3 @@
= yield = yield
= yield :embedded_scripts = yield :embedded_scripts
:coffeescript
$('.page-sidebar-collapsed .nav-sidebar a').tooltip placement: "right"
...@@ -5,60 +5,60 @@ ...@@ -5,60 +5,60 @@
%span %span
Overview Overview
= nav_link(controller: :projects) do = nav_link(controller: :projects) do
= link_to admin_namespaces_projects_path, title: 'Projects' do = link_to admin_namespaces_projects_path, title: 'Projects', data: {placement: 'right'} do
= icon('cube fw') = icon('cube fw')
%span %span
Projects Projects
= nav_link(controller: :users) do = nav_link(controller: :users) do
= link_to admin_users_path, title: 'Users' do = link_to admin_users_path, title: 'Users', data: {placement: 'right'} do
= icon('user fw') = icon('user fw')
%span %span
Users Users
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to admin_groups_path, title: 'Groups' do = link_to admin_groups_path, title: 'Groups', data: {placement: 'right'} do
= icon('group fw') = icon('group fw')
%span %span
Groups Groups
= nav_link(controller: :deploy_keys) do = nav_link(controller: :deploy_keys) do
= link_to admin_deploy_keys_path, title: 'Deploy Keys' do = link_to admin_deploy_keys_path, title: 'Deploy Keys', data: {placement: 'right'} do
= icon('key fw') = icon('key fw')
%span %span
Deploy Keys Deploy Keys
= nav_link(controller: :logs) do = nav_link(controller: :logs) do
= link_to admin_logs_path, title: 'Logs' do = link_to admin_logs_path, title: 'Logs', data: {placement: 'right'} do
= icon('file-text fw') = icon('file-text fw')
%span %span
Logs Logs
= nav_link(controller: :broadcast_messages) do = nav_link(controller: :broadcast_messages) do
= link_to admin_broadcast_messages_path, title: 'Broadcast Messages' do = link_to admin_broadcast_messages_path, title: 'Broadcast Messages', data: {placement: 'right'} do
= icon('bullhorn fw') = icon('bullhorn fw')
%span %span
Messages Messages
= nav_link(controller: :hooks) do = nav_link(controller: :hooks) do
= link_to admin_hooks_path, title: 'Hooks' do = link_to admin_hooks_path, title: 'Hooks', data: {placement: 'right'} do
= icon('external-link fw') = icon('external-link fw')
%span %span
Hooks Hooks
= nav_link(controller: :background_jobs) do = nav_link(controller: :background_jobs) do
= link_to admin_background_jobs_path, title: 'Background Jobs' do = link_to admin_background_jobs_path, title: 'Background Jobs', data: {placement: 'right'} do
= icon('cog fw') = icon('cog fw')
%span %span
Background Jobs Background Jobs
= nav_link(controller: :applications) do = nav_link(controller: :applications) do
= link_to admin_applications_path, title: 'Applications' do = link_to admin_applications_path, title: 'Applications', data: {placement: 'right'} do
= icon('cloud fw') = icon('cloud fw')
%span %span
Applications Applications
= nav_link(controller: :services) do = nav_link(controller: :services) do
= link_to admin_application_settings_services_path, title: 'Service Templates' do = link_to admin_application_settings_services_path, title: 'Service Templates', data: {placement: 'right'} do
= icon('copy fw') = icon('copy fw')
%span %span
Service Templates Service Templates
= nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do = nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do
= link_to admin_application_settings_path, title: 'Settings' do = link_to admin_application_settings_path, title: 'Settings', data: {placement: 'right'} do
= icon('cogs fw') = icon('cogs fw')
%span %span
Settings Settings
%ul.nav.nav-sidebar %ul.nav.nav-sidebar
= nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
= link_to root_path, title: 'Home', class: 'shortcuts-activity' do = link_to root_path, title: 'Home', class: 'shortcuts-activity', data: {placement: 'right'} do
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Your Projects Your Projects
= nav_link(path: 'projects#starred') do = nav_link(path: 'projects#starred') do
= link_to starred_dashboard_projects_path, title: 'Starred Projects' do = link_to starred_dashboard_projects_path, title: 'Starred Projects', data: {placement: 'right'} do
= icon('star fw') = icon('star fw')
%span %span
Starred Projects Starred Projects
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to dashboard_groups_path, title: 'Groups' do = link_to dashboard_groups_path, title: 'Groups', data: {placement: 'right'} do
= icon('group fw') = icon('group fw')
%span %span
Groups Groups
= nav_link(controller: :milestones) do = nav_link(controller: :milestones) do
= link_to dashboard_milestones_path, title: 'Milestones' do = link_to dashboard_milestones_path, title: 'Milestones', data: {placement: 'right'} do
= icon('clock-o fw') = icon('clock-o fw')
%span %span
Milestones Milestones
= nav_link(path: 'dashboard#issues') do = nav_link(path: 'dashboard#issues') do
= link_to assigned_issues_dashboard_path, title: 'Issues', class: 'shortcuts-issues' do = link_to assigned_issues_dashboard_path, title: 'Issues', class: 'shortcuts-issues', data: {placement: 'right'} do
= icon('exclamation-circle fw') = icon('exclamation-circle fw')
%span %span
Issues Issues
%span.count= current_user.assigned_issues.opened.count %span.count= current_user.assigned_issues.opened.count
= nav_link(path: 'dashboard#merge_requests') do = nav_link(path: 'dashboard#merge_requests') do
= link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'shortcuts-merge_requests' do = link_to assigned_mrs_dashboard_path, title: 'Merge Requests', class: 'shortcuts-merge_requests', data: {placement: 'right'} do
= icon('tasks fw') = icon('tasks fw')
%span %span
Merge Requests Merge Requests
%span.count= current_user.assigned_merge_requests.opened.count %span.count= current_user.assigned_merge_requests.opened.count
= nav_link(controller: :help) do = nav_link(controller: :help) do
= link_to help_path, title: 'Help' do = link_to help_path, title: 'Help', data: {placement: 'right'} do
= icon('question-circle fw') = icon('question-circle fw')
%span %span
Help Help
%ul.nav.nav-sidebar %ul.nav.nav-sidebar
= nav_link(path: 'projects#trending') do = nav_link(path: 'projects#trending') do
= link_to explore_root_path do = link_to explore_root_path, title: 'Trending Projects', data: {placement: 'right'} do
= icon('comments fw') = icon('comments fw')
%span Trending Projects %span Trending Projects
= nav_link(path: 'projects#starred') do = nav_link(path: 'projects#starred') do
= link_to starred_explore_projects_path do = link_to starred_explore_projects_path, title: 'Most-starred Projects', data: {placement: 'right'} do
= icon('star fw') = icon('star fw')
%span Most Starred Projects %span Most-starred Projects
= nav_link(path: 'projects#index') do = nav_link(path: 'projects#index') do
= link_to explore_projects_path do = link_to explore_projects_path, title: 'All Projects', data: {placement: 'right'} do
= icon('bookmark fw') = icon('bookmark fw')
%span All Projects %span All Projects
= nav_link(controller: :groups) do = nav_link(controller: :groups) do
= link_to explore_groups_path do = link_to explore_groups_path, title: 'All Groups', data: {placement: 'right'} do
= icon('group fw') = icon('group fw')
%span All Groups %span All Groups
%ul.nav.nav-sidebar %ul.nav.nav-sidebar
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do = nav_link(path: 'groups#show', html_options: {class: 'home'}) do
= link_to group_path(@group), title: "Home" do = link_to group_path(@group), title: 'Home', data: {placement: 'right'} do
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Activity Activity
- if current_user - if current_user
= nav_link(controller: [:group, :milestones]) do = nav_link(controller: [:group, :milestones]) do
= link_to group_milestones_path(@group), title: 'Milestones' do = link_to group_milestones_path(@group), title: 'Milestones', data: {placement: 'right'} do
= icon('clock-o fw') = icon('clock-o fw')
%span %span
Milestones Milestones
= nav_link(path: 'groups#issues') do = nav_link(path: 'groups#issues') do
= link_to issues_group_path(@group), title: 'Issues' do = link_to issues_group_path(@group), title: 'Issues', data: {placement: 'right'} do
= icon('exclamation-circle fw') = icon('exclamation-circle fw')
%span %span
Issues Issues
- if current_user - if current_user
%span.count= Issue.opened.of_group(@group).count %span.count= Issue.opened.of_group(@group).count
= nav_link(path: 'groups#merge_requests') do = nav_link(path: 'groups#merge_requests') do
= link_to merge_requests_group_path(@group), title: 'Merge Requests' do = link_to merge_requests_group_path(@group), title: 'Merge Requests', data: {placement: 'right'} do
= icon('tasks fw') = icon('tasks fw')
%span %span
Merge Requests Merge Requests
- if current_user - if current_user
%span.count= MergeRequest.opened.of_group(@group).count %span.count= MergeRequest.opened.of_group(@group).count
= nav_link(controller: [:group_members]) do = nav_link(controller: [:group_members]) do
= link_to group_group_members_path(@group), title: 'Members' do = link_to group_group_members_path(@group), title: 'Members', data: {placement: 'right'} do
= icon('users fw') = icon('users fw')
%span %span
Members Members
- if can?(current_user, :admin_group, @group) - if can?(current_user, :admin_group, @group)
= nav_link(html_options: { class: "#{"active" if group_settings_page?} separate-item" }) do = nav_link(html_options: { class: "#{"active" if group_settings_page?} separate-item" }) do
= link_to edit_group_path(@group), title: 'Settings', class: "tab no-highlight" do = link_to edit_group_path(@group), title: 'Settings', class: 'tab no-highlight', data: {placement: 'right'} do
= icon ('cogs fw') = icon ('cogs fw')
%span %span
Settings Settings
......
%ul.nav.nav-sidebar %ul.nav.nav-sidebar
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= link_to profile_path, title: "Profile" do = link_to profile_path, title: 'Profile', data: {placement: 'right'} do
= icon('user fw') = icon('user fw')
%span %span
Profile Profile
= nav_link(controller: :accounts) do = nav_link(controller: :accounts) do
= link_to profile_account_path, title: 'Account' do = link_to profile_account_path, title: 'Account', data: {placement: 'right'} do
= icon('gear fw') = icon('gear fw')
%span %span
Account Account
= nav_link(path: ['profiles#applications', 'applications#edit', 'applications#show', 'applications#new']) do = nav_link(path: ['profiles#applications', 'applications#edit', 'applications#show', 'applications#new']) do
= link_to applications_profile_path, title: 'Applications' do = link_to applications_profile_path, title: 'Applications', data: {placement: 'right'} do
= icon('cloud fw') = icon('cloud fw')
%span %span
Applications Applications
= nav_link(controller: :emails) do = nav_link(controller: :emails) do
= link_to profile_emails_path, title: 'Emails' do = link_to profile_emails_path, title: 'Emails', data: {placement: 'right'} do
= icon('envelope-o fw') = icon('envelope-o fw')
%span %span
Emails Emails
%span.count= current_user.emails.count + 1 %span.count= current_user.emails.count + 1
- unless current_user.ldap_user? - unless current_user.ldap_user?
= nav_link(controller: :passwords) do = nav_link(controller: :passwords) do
= link_to edit_profile_password_path, title: 'Password' do = link_to edit_profile_password_path, title: 'Password', data: {placement: 'right'} do
= icon('lock fw') = icon('lock fw')
%span %span
Password Password
= nav_link(controller: :notifications) do = nav_link(controller: :notifications) do
= link_to profile_notifications_path, title: 'Notifications' do = link_to profile_notifications_path, title: 'Notifications', data: {placement: 'right'} do
= icon('inbox fw') = icon('inbox fw')
%span %span
Notifications Notifications
= nav_link(controller: :keys) do = nav_link(controller: :keys) do
= link_to profile_keys_path, title: 'SSH Keys' do = link_to profile_keys_path, title: 'SSH Keys', data: {placement: 'right'} do
= icon('key fw') = icon('key fw')
%span %span
SSH Keys SSH Keys
%span.count= current_user.keys.count %span.count= current_user.keys.count
= nav_link(path: 'profiles#design') do = nav_link(path: 'profiles#design') do
= link_to design_profile_path, title: 'Design' do = link_to design_profile_path, title: 'Design', data: {placement: 'right'} do
= icon('image fw') = icon('image fw')
%span %span
Design Design
= nav_link(path: 'profiles#history') do = nav_link(path: 'profiles#history') do
= link_to history_profile_path, title: 'History' do = link_to history_profile_path, title: 'History', data: {placement: 'right'} do
= icon('history fw') = icon('history fw')
%span %span
History History
%ul.project-navigation.nav.nav-sidebar %ul.project-navigation.nav.nav-sidebar
- if @project_settings_nav - if @project_settings_nav
= nav_link do = nav_link do
= link_to project_path(@project), title: 'Back to project', class: "" do = link_to project_path(@project), title: 'Back to project', data: {placement: 'right'} do
= icon('caret-square-o-left fw') = icon('caret-square-o-left fw')
%span %span
Back to project Back to project
...@@ -11,49 +11,49 @@ ...@@ -11,49 +11,49 @@
= render 'projects/settings_nav' = render 'projects/settings_nav'
- else - else
= nav_link(path: 'projects#show', html_options: {class: "home"}) do = nav_link(path: 'projects#show', html_options: {class: 'home'}) do
= link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do = link_to project_path(@project), title: 'Project', class: 'shortcuts-project', data: {placement: 'right'} do
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Project Project
- if project_nav_tab? :files - if project_nav_tab? :files
= nav_link(controller: %w(tree blob blame edit_tree new_tree)) do = 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' 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') = icon('files-o fw')
%span %span
Files Files
- if project_nav_tab? :commits - if project_nav_tab? :commits
= nav_link(controller: %w(commit commits compare repositories tags branches)) do = 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' 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') = icon('history fw')
%span %span
Commits Commits
- if project_nav_tab? :network - if project_nav_tab? :network
= nav_link(controller: %w(network)) do = nav_link(controller: %w(network)) do
= link_to namespace_project_network_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Network', class: 'shortcuts-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') = icon('code-fork fw')
%span %span
Network Network
- if project_nav_tab? :graphs - if project_nav_tab? :graphs
= nav_link(controller: %w(graphs)) do = nav_link(controller: %w(graphs)) do
= link_to namespace_project_graph_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Graphs', class: 'shortcuts-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') = icon('area-chart fw')
%span %span
Graphs Graphs
- if project_nav_tab? :milestones - if project_nav_tab? :milestones
= nav_link(controller: :milestones) do = nav_link(controller: :milestones) do
= link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones' do = link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones', data: {placement: 'right'} do
= icon('clock-o fw') = icon('clock-o fw')
%span %span
Milestones Milestones
- if project_nav_tab? :issues - if project_nav_tab? :issues
= nav_link(controller: :issues) do = nav_link(controller: :issues) do
= link_to url_for_project_issues(@project, only_path: true), title: 'Issues', class: 'shortcuts-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') = icon('exclamation-circle fw')
%span %span
Issues Issues
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
- if project_nav_tab? :merge_requests - if project_nav_tab? :merge_requests
= nav_link(controller: :merge_requests) do = nav_link(controller: :merge_requests) do
= link_to namespace_project_merge_requests_path(@project.namespace, @project), title: 'Merge Requests', class: 'shortcuts-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') = icon('tasks fw')
%span %span
Merge Requests Merge Requests
...@@ -70,28 +70,28 @@ ...@@ -70,28 +70,28 @@
- if project_nav_tab? :labels - if project_nav_tab? :labels
= nav_link(controller: :labels) do = nav_link(controller: :labels) do
= link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels' do = link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels', data: {placement: 'right'} do
= icon('tags fw') = icon('tags fw')
%span %span
Labels Labels
- if project_nav_tab? :wiki - if project_nav_tab? :wiki
= nav_link(controller: :wikis) do = nav_link(controller: :wikis) do
= link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki' do = link_to get_project_wiki_path(@project), title: 'Wiki', class: 'shortcuts-wiki', data: {placement: 'right'} do
= icon('book fw') = icon('book fw')
%span %span
Wiki Wiki
- if project_nav_tab? :snippets - if project_nav_tab? :snippets
= nav_link(controller: :snippets) do = nav_link(controller: :snippets) do
= link_to namespace_project_snippets_path(@project.namespace, @project), title: 'Snippets', class: 'shortcuts-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') = icon('file-text-o fw')
%span %span
Snippets Snippets
- if project_nav_tab? :settings - if project_nav_tab? :settings
= nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do = 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" do = link_to edit_project_path(@project), title: 'Settings', class: 'stat-tab tab no-highlight', data: {placement: 'right'} do
= icon('cogs fw') = icon('cogs fw')
%span %span
Settings Settings
%ul.nav.nav-sidebar %ul.nav.nav-sidebar
= nav_link(path: user_snippets_path(current_user), html_options: {class: 'home'}) do = nav_link(path: user_snippets_path(current_user), html_options: {class: 'home'}) do
= link_to user_snippets_path(current_user), title: 'Your snippets' do = link_to user_snippets_path(current_user), title: 'Your snippets', data: {placement: 'right'} do
= icon('dashboard fw') = icon('dashboard fw')
%span %span
Your Snippets Your Snippets
= nav_link(path: snippets_path) do = nav_link(path: snippets_path) do
= link_to snippets_path, title: 'Discover snippets' do = link_to snippets_path, title: 'Discover snippets', data: {placement: 'right'} do
= icon('globe fw') = icon('globe fw')
%span %span
Discover Snippets Discover Snippets
// Remove body class for any previous theme, re-add current one // Remove body class for any previous theme, re-add current one
$('body').removeClass('ui_basic ui_mars ui_modern ui_gray ui_color light_theme dark_theme') $('body').removeClass('<%= Gitlab::Theme.body_classes %>')
$('body').addClass('<%= app_theme %> <%= theme_type %>') $('body').addClass('<%= app_theme %> <%= theme_type %>')
// Re-render the header to reflect the new theme
$('header').html('<%= escape_javascript(render("layouts/head_panel", title: "Profile")) %>')
// Re-initialize header tooltips
$('.has_bottom_tooltip').tooltip({placement: 'bottom'})
%ul.project-settings-nav.sidebar-subnav %ul.project-settings-nav.sidebar-subnav
= nav_link(path: 'projects#edit') do = nav_link(path: 'projects#edit') do
= link_to edit_project_path(@project), title: 'Project', class: "stat-tab tab " do = link_to edit_project_path(@project), title: 'Project', class: 'stat-tab tab', data: {placement: 'right'} do
%i.fa.fa-pencil-square-o = icon('pencil-square-o')
%span %span
Project Project
= nav_link(controller: [:project_members, :teams]) do = nav_link(controller: [:project_members, :teams]) do
= link_to namespace_project_project_members_path(@project.namespace, @project), title: 'Members', class: "team-tab tab" do = link_to namespace_project_project_members_path(@project.namespace, @project), title: 'Members', class: 'team-tab tab', data: {placement: 'right'} do
%i.fa.fa-users = icon('users')
%span %span
Members Members
= nav_link(controller: :deploy_keys) do = nav_link(controller: :deploy_keys) do
= link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys' do = link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys', data: {placement: 'right'} do
%i.fa.fa-key = icon('key')
%span %span
Deploy Keys Deploy Keys
= nav_link(controller: :hooks) do = nav_link(controller: :hooks) do
= link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Web Hooks' do = link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Web Hooks', data: {placement: 'right'} do
%i.fa.fa-link = icon('link')
%span %span
Web Hooks Web Hooks
= nav_link(controller: :services) do = nav_link(controller: :services) do
= link_to namespace_project_services_path(@project.namespace, @project), title: 'Services' do = link_to namespace_project_services_path(@project.namespace, @project), title: 'Services', data: {placement: 'right'} do
%i.fa.fa-cogs = icon('cogs')
%span %span
Services Services
= nav_link(controller: :protected_branches) do = nav_link(controller: :protected_branches) do
= link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches' do = link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches', data: {placement: 'right'} do
%i.fa.fa-lock = icon('lock')
%span %span
Protected branches Protected branches
...@@ -4,7 +4,9 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps ...@@ -4,7 +4,9 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
include SharedProject include SharedProject
step 'I click "New project" link' do step 'I click "New project" link' do
click_link "New project" within('.content') do
click_link "New project"
end
end end
step 'I see "New project" page' do step 'I see "New project" page' do
......
...@@ -7,33 +7,44 @@ module Gitlab ...@@ -7,33 +7,44 @@ module Gitlab
COLOR = 5 unless const_defined?(:COLOR) COLOR = 5 unless const_defined?(:COLOR)
BLUE = 6 unless const_defined?(:BLUE) BLUE = 6 unless const_defined?(:BLUE)
def self.css_class_by_id(id) def self.classes
themes = { @classes ||= {
BASIC => "ui_basic", BASIC => 'ui_basic',
MARS => "ui_mars", MARS => 'ui_mars',
MODERN => "ui_modern", MODERN => 'ui_modern',
GRAY => "ui_gray", GRAY => 'ui_gray',
COLOR => "ui_color", COLOR => 'ui_color',
BLUE => "ui_blue" BLUE => 'ui_blue'
} }
end
def self.css_class_by_id(id)
id ||= Gitlab.config.gitlab.default_theme id ||= Gitlab.config.gitlab.default_theme
classes[id]
themes[id]
end end
def self.type_css_class_by_id(id) def self.types
types = { @types ||= {
BASIC => 'light_theme', BASIC => 'light_theme',
MARS => 'dark_theme', MARS => 'dark_theme',
MODERN => 'dark_theme', MODERN => 'dark_theme',
GRAY => 'dark_theme', GRAY => 'dark_theme',
COLOR => 'dark_theme' COLOR => 'dark_theme',
BLUE => 'light_theme'
} }
end
def self.type_css_class_by_id(id)
id ||= Gitlab.config.gitlab.default_theme id ||= Gitlab.config.gitlab.default_theme
types[id] types[id]
end end
# Convenience method to get a space-separated String of all the theme
# classes that mighty be applied to the `body` element
#
# Returns a String
def self.body_classes
(classes.values + types.values).uniq.join(' ')
end
end end
end end
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