Skip to content

Commit

Permalink
Add site-switcher to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrene committed Jul 19, 2015
1 parent 8dad04f commit 4324128
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 53 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -23,3 +23,5 @@ config/unicorn.rb

/dumps
*.sh

/app/views/layouts/_admin_site_switcher.html.haml
Binary file added app/assets/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion app/assets/stylesheets/admin/builds.css.scss
Expand Up @@ -13,6 +13,16 @@ body {
.navbar-inverse {
background-color: #273759;
border-color: #273759;

.container-fluid {
padding: 0;
}
}
.site-switcher {
img {
width: 32px;
height: 32px;
}
}

.projects tr td {
Expand All @@ -30,4 +40,4 @@ table.build {
th {
width: 30%;
}
}
}
8 changes: 8 additions & 0 deletions app/views/layouts/_admin_site_switcher.html.haml.sample
@@ -0,0 +1,8 @@
%ul.nav.navbar-nav.navbar-left
%li.dropdown.site-switcher
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
= image_tag("logo.png")
%ul.dropdown-menu
%li
%a{:href => "http://trivelop.de/"}
Personal blog
98 changes: 46 additions & 52 deletions app/views/layouts/admin.html.haml
Expand Up @@ -22,58 +22,52 @@
%body{"data-gossip-server" => gossip_server, "data-gossip-room" => gossip_room}
.navbar.navbar-inverse{:role => "navigation"}
.container-fluid
.navbar-header
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand{:href => "../"}
%span.glyphicon.glyphicon-chevron-left
= link_to "Admin » Overview", admin_overview_path, :class => 'navbar-brand'
.navbar-collapse.collapse
%ul.nav.navbar-nav.navbar-left
%li
%a{:href => admin_builds_path}
= icon :signal
Builds
%li
%a{:href => admin_projects_path(:badge_generated => '1', :fork => '0')}
= icon :truck
Projects
%li
%a{:href => admin_users_path}
= icon :users
Users
%li
%a{:href => admin_cli_path}
= icon :terminal
CLI
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
= icon :calendar
Statistics
%span.caret
%ul.dropdown-menu
%li
%a{:href => daily_admin_statistics_path}
= icon :calendar
Daily
%li
%a{:href => weekly_admin_statistics_path}
= icon :calendar
Weekly
%li
%a{:href => monthly_admin_statistics_path}
= icon :calendar
Monthly
%ul.nav.navbar-nav.navbar-right
%li
%a{:href => root_path, :title => "Homepage", :target => "_blank"}
= icon :home
%li
%a{:href => "https://github.com/inch-ci/inch_ci-web/issues", :title => "GitHub Issues", :target => "_blank"}
= icon :'github-alt'
- if lookup_context.exists?("admin_site_switcher", ["layouts"], true)
= render "layouts/admin_site_switcher"
= link_to "Inch CI » Overview", admin_overview_path, :class => 'navbar-brand'
%ul.nav.navbar-nav.navbar-left
%li
%a{:href => admin_builds_path}
= icon :signal
Builds
%li
%a{:href => admin_projects_path(:badge_generated => '1', :fork => '0')}
= icon :truck
Projects
%li
%a{:href => admin_users_path}
= icon :users
Users
%li
%a{:href => admin_cli_path}
= icon :terminal
CLI
%li.dropdown
%a.dropdown-toggle{"data-toggle" => "dropdown", :href => "#"}
= icon :calendar
Statistics
%span.caret
%ul.dropdown-menu
%li
%a{:href => daily_admin_statistics_path}
= icon :calendar
Daily
%li
%a{:href => weekly_admin_statistics_path}
= icon :calendar
Weekly
%li
%a{:href => monthly_admin_statistics_path}
= icon :calendar
Monthly
%ul.nav.navbar-nav.navbar-right
%li
%a{:href => root_path, :title => "Homepage", :target => "_blank"}
= icon :home
%li
%a{:href => "https://github.com/inch-ci/inch_ci-web/issues", :title => "GitHub Issues", :target => "_blank"}
= icon :'github-alt'

#page-wrapper.active
#content-wrapper
Expand Down

0 comments on commit 4324128

Please sign in to comment.