dhoss/Kodiak

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

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
  <head>
  <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="alternate" type="application/rss+xml" title="Stonecold Devin RSS Feed" href="https://www.stonecolddev.in/feed.rss">
    <title><%= content_for?(:title) ? yield(:title) :  Setting.get("site_text")['settings']["headings"]["site_title"] %></title>
    <%= csrf_meta_tags %>
    <%= stylesheet_link_tag "//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/css/bootstrap.min.css" %>
    <%= stylesheet_link_tag "application", :media => "all" %>
    <%= stylesheet_link_tag controller_name, :media => "all" %>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    

    <!-- For third-generation iPad with high-resolution Retina display: -->
    <!-- Size should be 144 x 144 pixels -->
    <%= favicon_link_tag 'apple-touch-icon-144x144-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '144x144' %>

    <!-- For iPhone with high-resolution Retina display: -->
    <!-- Size should be 114 x 114 pixels -->
    <%= favicon_link_tag 'apple-touch-icon-114x114-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '114x114' %>

    <!-- For first- and second-generation iPad: -->
    <!-- Size should be 72 x 72 pixels -->
    <%= favicon_link_tag 'apple-touch-icon-72x72-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png', :sizes => '72x72' %>

    <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
    <!-- Size should be 57 x 57 pixels -->
    <%= favicon_link_tag 'apple-touch-icon-precomposed.png', :rel => 'apple-touch-icon-precomposed', :type => 'image/png' %>

    <!-- For all other devices -->
    <!-- Size should be 32 x 32 pixels -->
    <%= favicon_link_tag 'favicon.ico', :rel => 'shortcut icon' %>
   <% if Rails.env == "production" %>
    <!-- pingdom RUM -->
    <script>
      var _prum = [['id', '541bf1e1abe53d695828c003'],
                   ['mark', 'firstbyte', (new Date()).getTime()]];
      (function() {
        var s = document.getElementsByTagName('script')[0]
          , p = document.createElement('script');
            p.async = 'async';
            p.src = '//rum-static.pingdom.net/prum.min.js';
            s.parentNode.insertBefore(p, s);
      })();
    </script>
  <% end %>

  </head>
  <body>
     <div class="blog-masthead">
       <div class="container">
<div class="navbar navbar-default" role="navigation">
  <!-- Brand and toggle get grouped for better mobile display -->
  <div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <% cache [ 'banner-title', expires_in: 5.minutes ] do %>
      <%= link_to Setting.get("site_text")["settings"]["headings"]["banner_title"], "/", class: "navbar-brand" %>
    <% end %>
  </div>
       <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav nav-pills">
          <li><a href="/">Home</a></li>
          
          <% if user_signed_in? %>
            <li class="dropdown">
              <%= link_to "Profile", user_path(current_user) %>
              <ul class="dropdown-menu">
                <li><%= link_to current_user.name, user_path(current_user) %></li>
                <li><%= link_to "Sign out", destroy_user_session_path,:method => :delete %></li>
              </ul>
            </li>
          <% else %>
            <li><%= link_to "Sign up", new_user_registration_path %></li>
            <li><%= link_to "Sign in", new_user_session_path %></li>
            <li><%= link_to "Sign in with Twitter", user_omniauth_authorize_path(:twitter) %></li>
          <% end %>
        <li class="dropdown">
          <%= link_to raw('Posts <b class="caret"></b>'), posts_path, data: { toggle: "dropdown" }, class: "dropdown-toggle" %>
          <ul class="dropdown-menu">
            <li><%= link_to "View All", posts_path %></li>
          <% if can? :create, Post -%> 
              <li><%= link_to "New Post", new_post_path %></li>
              <li><%= link_to "Drafts", drafts_path %></li>
          <% end %>
          </ul><!--/.dropdown-menu -->
          </li><!--/.dropdown-->
          <% if user_signed_in? %>
           <% if current_user.role? "admin" %>
        <li class="dropdown pull-right">
            <a href="#" data-toggle="dropdown" class="dropdown-toggle">Admin <b class="caret"></b></a>
            <ul class="dropdown-menu">
                <li><a href="#">Manage Posts</a></li>
                <li><a href="#">Manage Users</a></li>
                <li><a href="#">Manage Attachments</a></li>
                <li class="divider"></li>
                <li><%= link_to 'Settings', settings_path %></a></li>
            </ul>
            </li>
          <% end %>
        <% end %>
     </ul>
  </div>
</div>
  </div>
     
  <div class="container">

       <!-- stonecold-responsive -->
       <ins class="adsbygoogle"
            style="display:block"
            data-ad-client="ca-pub-8235962495693803"
            data-ad-slot="9909766461"
            data-ad-format="auto"></ins>

      <% cache [ 'blog-header', expires_in: 5.minutes ] do %>
        <div class="blog-header">
          <h1 class="blog-title"><%= link_to Setting.get("site_text")["settings"]["headings"]["banner_title"], "/" %> </h1>
          <p class="lead blog-description"><%= content_for?(:tag_line) ? yield(:tag_line) : Setting.get("site_text")["settings"]["headings"]["tag_line"] %> </p>
        </div>
      <% end %>

      <div class="row">

        <div class="col-sm-8 blog-main">
          <%= render partial: "shared/flash_messages", flash: flash %> 
          <%= yield %>
          

        </div><!-- /.blog-main -->

        <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
          <div class="sidebar-module sidebar-module-inset">
            <h4>About</h4>
            <% cache [ 'about-section', expires_in: 5.minutes ] do %>
              <%= Setting.get("site_text")["settings"]["page_sections"]["about"] %>
            <% end %>
          </div>
          <div class="sidebar-module sidebar-module-inset">
            <%= render partial: 'search/form' %>
          </div>
          <div class="sidebar-module">
            <h4>Recent Activity</h4>
            <hr />
            <p>Posts:</p>
            <ol class="list-unstyled">
              <% cache @recent_posts do %>
                <% @recent_posts.each do |post| %>
                  <li><%= link_to post.title, post %> on <%= post.published_on.to_s(:posted_on) %> by <%= link_to post.user.name, post.user %></li>
                <% end %>
              <% end %>
            </ol>
            <hr />
          </div>
          <div class="sidebar-module">
            <h4>Categories</h4>
            <ol class="list-unstyled">
              <% cache @categories_section do %>
                <% @categories_section.each do |c| %>
                  <li><%= link_to c.name, c %></li>
                <% end %>
              <% end %>
            </ol>
          </div>
          <div class="sidebar-module">
            <h4>Archives</h4>
            <ol class="list-unstyled">
              <% cache ['year_month_pairs', expires_in: 30.minutes] do %>
                <% @year_month_pairs.each do |ym| %>
                  <%# turn me into a helper %>
                  <li><a href="/<%= ym.year.to_i %>/<%= sprintf '%02d', ym.month.to_i %>">
                    <%= Date::MONTHNAMES[ym.month.to_i] %> <%= ym.year.to_i %></a></li>
                <% end %>
              <% end %>
            </ol>
          </div>
          <div class="sidebar-module">
            <h4>Elsewhere</h4>
            <ol class="list-unstyled">
              <% cache [ 'elsewhere-section', expires_in: 30.minutes ] do %>
                <% Setting.get("site_text")["settings"]["page_sections"]["other_places"].each do |k,v|%>
                  <li><a href="<%= Setting.get("site_text")["settings"]["page_sections"]["other_places"][k]%>"><%= k %></a></li>
                <% end %>
              <% end %>
            </ol>
          </div>
        </div><!-- /.blog-sidebar -->

      </div><!-- /.row -->
    </div><!-- /.container -->

    <div class="footer">
      <% cache [ 'footer', expires_in: 30.minutes ] do %>
        <p><%= raw Setting.get("site_text")["settings"]["page_sections"]["footer"] %></p>
      <% end %>
      <p>
        <a href="#">Back to top</a>
      </p>
    </div>

    <%= javascript_include_tag 'application', controller_name, async: true %>
    <%= @deferred_content.nil? ? "" : @deferred_content.html_safe %>
<% if Rails.env == "production" %>
   <script>
   (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    ga('create', 'UA-44716474-1', 'auto');
    ga('send', 'pageview');
  </script>
<% end %>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
  </body>
</html>