metamaps--metamaps/app/views/layouts/application.html.erb
2014-02-05 00:03:44 -05:00

98 lines
3.4 KiB
Text

<%#
# @file
# Main application file. Holds scaffolding present on every page.
# Then a certain non-partial view (no _ preceding filename) will be
# displayed within, based on URL
#%>
<!DOCTYPE html>
<html>
<head>
<title><%=h yield(:title) %></title>
<% if authenticated? %>
<script type="text/javascript">
var userid = <%= user.id %>;
var username = "<%= user.name %>";
</script>
<% else %>
<script type="text/javascript">
var userid = null;
var username = null;
</script>
<% end %>
<script>
var imgArray = new Object();
<% Metacode.all.each do |m| %>
imgArray['<%= m.name %>'] = new Image(); imgArray['<%= m.name %>'].src = '/assets/<%= m.icon %>';
<% end %>
</script>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<script type="text/javascript" src="//use.typekit.net/tki2nyo.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<script type="text/javascript" src="//use.typekit.net/obp7wss.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<%= csrf_meta_tags %>
</head>
<body>
<% if notice %>
<p class="notice metamaps"><%= notice %></p>
<% end %>
<% if alert %>
<p class="alert metamaps"><%= alert %></p>
<% end %>
<%= content_tag :div, class: authenticated? ? "main authenticated" : "main unauthenticated" do %>
<div class="wrapper" id="wrapper">
<div class="sidebarSearch">
<div class="sidebarSearchIcon"></div>
<input type="text" class="sidebarSearchField"></input>
<div class="clearfloat"></div>
<%= render :partial => 'layouts/searchtemplates' %>
</div>
<div class="sidebarAccount">
<div class="sidebarAccountIcon"></div>
<div class="sidebarAccountBox <%= authenticated? ? 'loggedin' : 'loggedout' %>">
<%= render :partial => 'layouts/account' %>
</div>
</div>
<%= yield %>
</div>
<div class="footer">
<div class="logo">
<ul class="menu">
<li class="beta">
<div class="inBeta">beta</div>
<button class="button" onclick="BAROMETER.show();">feedback!</button>
</li>
<li class="meta openLightbox" data-open="about">about</li>
<li class="tutorial openLightbox" data-open="tutorial">tutorial</li>
<li class="exploreMaps"><%= link_to "explore maps", maps_url %></li>
</ul>
<div id="mainTitle"><%= link_to "metamaps", root_url %></div><!--<div id="beta">beta</div>-->
</div>
<% if authenticated? %>
<div class="addMap"></div>
<% end %>
</div>
<% end %>
<% if authenticated? %>
<% # this is the create new map form %>
<%= render :partial => 'maps/new' %>
<% end %>
<style type='text/css'>@import url('http://getbarometer.s3.amazonaws.com/assets/barometer/css/barometer.css');</style>
<script src='http://getbarometer.s3.amazonaws.com/assets/barometer/javascripts/barometer.js' type='text/javascript'></script>
<script type="text/javascript" charset="utf-8">
BAROMETER.load('Scqak8nyHdFEkezKMNeQp');
</script>
<%= render :partial => 'layouts/lightboxes' %>
<%= render :partial => 'layouts/ga' if Rails.env.production? %>
</body>
</html>