houston/houston-core

View on GitHub
app/views/layouts/application.html.erb

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en" class="
  <%= "mobile" if mobile? %>">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title><%= title %></title>
    <%= csrf_meta_tags %>
    <%= action_cable_meta_tag %>
    <meta name="relative_url_root" content="<%= main_app.root_url %>" />
    <meta name="revision" content="<%= revision %>" />
    <meta name="env" content="<%= Rails.env %>" />
    <meta name="s3-bucket" content="<%= Houston.config.s3[:bucket] %>" />
    <%= render_layout_extensions("application", :meta) %>
    <%= yield :meta %>

    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
    <![endif]-->

    <!-- Le styles -->
    <%= stylesheet_link_tag "houston/vendor", media: "all" %>
    <%= stylesheet_link_tag "houston/application", media: "all" %>
    <%= stylesheet_link_tag "houston/print", media: "print" %>
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">

    <%= render_layout_extensions("application", :stylesheets) %>
    <%= yield :stylesheets %><%# so that Engines can hook in and add styles %>

    <!-- Le fav and touch icons -->
    <% unless unfurling? %>
      <link rel="icon" type="image/x-icon" href="<%= ENV['RAILS_RELATIVE_URL_ROOT'] %>/favicon.png" />
    <% end %>
  </head>
  <body>

    <% if mobile? %>
      <%= render "layouts/mobile_navigation" if layout_show_navigation? %>

      <div class="<%= layout_container_fluid? ? "container-fluid" : "container" %>" id="body">
        <%= yield :title %>
    <% else %>
      <%= render "layouts/navigation" if layout_show_navigation? %>

      <%= yield :title %>

      <div class="<%= layout_container_fluid? ? "container-fluid" : "container" %>" id="body">
    <% end %>

      <%= yield -%>

    </div> <!-- /container -->

    <%= render_layout_extensions("application", :footers) %>

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" %>
    <%= javascript_include_tag "houston/vendor" %>
    <%= javascript_include_tag "houston/application" %>
    <script type="text/javascript">
      $(function() {
        <% if flash[:alert] %>
        alertify.log(<%=raw flash[:alert].to_json %>);
        <% end %>
        <% if flash[:notice] %>
        alertify.success(<%=raw flash[:notice].to_json %>);
        <% end %>
        <% if flash[:error] %>
        alertify.error(<%=raw flash[:error].to_json %>);
        <% end %>

        <% if current_user %>
        window.userId = <%= current_user.id %>;
        window.user = new User(<%= raw({
          id: current_user.id,
          email: current_user.email,
          name: current_user.name,
          role: current_user.role
        }.to_json) %>);
        <% end %>
      });
    </script>

    <%= render_layout_extensions("application", :scripts) %>
    <%= yield :javascripts %><%# so that Engines can hook in and add scripts %>

    <%= google_analytics_script_tag %>
  </body>
</html>