andela/eventx

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

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <%= stylesheet_link_tag "application",
    "https://fonts.googleapis.com/css?family=Great+Vibes",
    "https://fonts.googleapis.com/icon?family=Material+Icons",
    "https://fonts.googleapis.com/css?family=Open+Sans:300,600",
    media: "all", "data-turbolinks-track" => true %>
    <%= javascript_include_tag "application",
    "https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places&key=AIzaSyAy8oTJkGBEFjUoc5jjcanrtbKfL9B-x3o",
    "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.9.0/lodash.js",
    "data-turbolinks-track" => false %>

    <%= csrf_meta_tags %>
    <% if @event && @event.id %>
      <%
      set_meta_tags title: @event.title,
        type:  "event",
        image: @event.image,
        description: @event.description[0..150],
        url: (request.base_url + event_path(@event))
      %>
      <%
        set_meta_tags twitter: {
          card: "summary",
          title: @event.title,
          image: @event.image,
          description: @event.description[0..150],
          url: (request.base_url + event_path(@event))
        }
      %>
      <%
        set_meta_tags og: {
          title: @event.title,
          type:  "event",
          image: @event.image,
          description: @event.description[0..150],
          url: (request.base_url + event_path(@event))
        }
        %>
    <% end %>
    <%= display_meta_tags site: "EventX" %>
  </head>

  <body>
    <% if flash[:notice].present? %>
      <div>
        <script type="text/javascript">
            Materialize.toast("<%= flash[:notice].to_s %>", 3000, "rounded")
        </script>
      </div>
    <% end %>
    <main>
      <%= yield %>
    </main>
    <%= render "layouts/login_modal" unless current_user %>
    <%= render "layouts/footer"%>
  </body>
</html>