app/views/layouts/admin.html.erb in tkh_admin_panel-0.9 vs app/views/layouts/admin.html.erb in tkh_admin_panel-0.9.1
- old
+ new
@@ -1,74 +1,85 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale.to_s %>">
<head>
<meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= t("admin_panel_for") + ' ' + Setting.first.try(:site_name) %></title>
- <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <%= stylesheet_link_tag "admin", :media => "all" %>
+ <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
+ <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
+ <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
+ <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
- <!-- Le styles -->
- <%= stylesheet_link_tag "admin", :media => "all" %>
- <!-- Le fav and touch icons -->
- <%= favicon_link_tag %>
- <link href="images/apple-touch-icon.png" rel="apple-touch-icon">
- <link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72">
- <link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon" sizes="114x114">
- <%= csrf_meta_tag %>
+ <%= favicon_link_tag %>
+ <%= csrf_meta_tag %>
<% # This line ensures javascript code can access the current locale from Rails %>
<script type="text/javascript">var tkh_locale = '<%= I18n.locale.to_s %>';</script>
</head>
<body>
-
- <div class="navbar navbar-fixed-top navbar-inverse">
- <div class="navbar-inner">
- <div class="container">
- <ul class="nav">
- <%= content_tag :li, link_to(Setting.first.try(:site_name), root_path) %>
- <%= content_tag :li, link_to(t('blog.itself'), blog_path) %>
- <%= render 'shared/login_info_for_navbar' %>
- </ul>
- </div>
- </div>
+
+ <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <ul class="nav navbar-nav">
+ <%= content_tag :li, link_to(Setting.first.try(:site_name), root_path) %>
+ <%= content_tag :li, link_to( 'blog', blog_path) %>
+ </ul>
+ <ul class="nav navbar-nav navbar-right navbar-login-info">
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= current_user.email %> <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><%= link_to 'log out', logout_path %></li>
+ </ul>
+ </li>
+ </ul>
</div>
-
- <div class="container-fluid">
- <div class="row-fluid">
- <div class="span12">
- <h1>
- <%= t "admin_panel" %><br />
- <%= image_tag 'admin-logo.png', alt: 'Ten Thousand Hours logo' %>
- </h1>
- <%= render 'shared/flash_messages' %>
- </div>
- </div>
-
- <div class="row-fluid">
- <div id="main-content" class="span9">
+
+ <div class="container">
+
+ <div class="row">
+ <div class="col-xs-12">
+ <h1><%= t 'admin_panel' %><br />
+ <%= link_to image_tag('admin/admin-logo.jpg'), root_path %><br /><br />
+ </h1>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-xs-12 col-sm-9 col-lg-10">
+ <% flash.each do |name, msg| %>
+ <div class="alert alert-<%= name == :notice ? "success" : "danger" %>">
+ <a class="close" data-dismiss="alert">×</a>
+ <%= msg %>
+ </div>
+ <% end %>
<%= yield %>
</div>
- <div id="sidebar" class="span3">
- <%= render 'shared/language_switcher' %>
- <%= yield :admin_sidebar %>
- </div>
- </div><!--/row-->
+
+ <div class="col-xs-12 col-sm-3 col-lg-2">
+ <%= render 'shared/language_switcher' %>
+ <%= yield :admin_sidebar %>
+ </div>
+ </div>
+
+ <div class="row">
+ <footer class="col-xs-12">
+ <hr>
+ <p><b>Ten Thousand Hours</b><br />
+ <%= link_to "http://tenthousandhours.eu", "http://tenthousandhours.eu" %><br />
+ <%= link_to "Contact TKH", "http://tenthousandhours.eu/pages/5-contact-form" %><br /><br />
+ <%= image_tag 'admin/tkh-logo.png', alt: 'Ten Thousand Hours logo' %><br />
+ </p>
+ </footer>
+ </div>
+
</div> <!-- /container -->
-
- <div class="row-fluid">
- <footer class="span12">
- <hr>
- <p><b>Ten Thousand Hours</b><br />
- <%= link_to "http://tenthousandhours.eu", "http://tenthousandhours.eu" %><br />
- <%= link_to "Contact TKH", "http://tenthousandhours.eu/pages/5-contact-form" %><br /></p>
- </footer>
- </div>
-
- <!-- Le javascript
- ================================================== -->
- <!-- Placed at the end of the document so the pages load faster -->
+
<%= javascript_include_tag "admin" %>
+
+ <% # the twitter typeahead javascript library needs all typeahead form fields to be present in DOM. this is an ugly hack %>
+ <% if controller.controller_name == 'pages' %>
+ <%= javascript_include_tag 'admin/pages' %>
+ <% end %>
</body>
</html>