2013-01-11 23:49:59 +00:00
|
|
|
<%#
|
2014-07-31 01:10:10 +00:00
|
|
|
# @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
|
|
|
|
#%>
|
2013-01-11 23:49:59 +00:00
|
|
|
|
2012-10-10 15:52:50 +00:00
|
|
|
<!DOCTYPE html>
|
2014-08-10 17:06:58 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title><%=h yield(:title) %></title>
|
|
|
|
<%= csrf_meta_tags %>
|
|
|
|
<meta name="viewport" content="width=device-width, user-scalable=no">
|
|
|
|
|
|
|
|
<%= 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>
|
|
|
|
|
|
|
|
<!-- app code -->
|
|
|
|
<script type="text/javascript">
|
2014-08-10 23:35:18 +00:00
|
|
|
require.config({baseUrl: '/famous/'});
|
2014-08-10 17:06:58 +00:00
|
|
|
require(['main']);
|
|
|
|
</script>
|
2012-10-10 15:52:50 +00:00
|
|
|
</head>
|
2014-08-10 17:06:58 +00:00
|
|
|
|
2014-10-11 01:24:31 +00:00
|
|
|
<body data-env="<%= Rails.env %>">
|
2013-07-10 18:02:38 +00:00
|
|
|
|
2014-07-31 01:10:10 +00:00
|
|
|
<% if notice %>
|
2014-08-11 22:57:34 +00:00
|
|
|
<p id="toast"><%= notice %></p>
|
2014-07-31 01:10:10 +00:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= content_tag :div, class: authenticated? ? "main authenticated" : "main unauthenticated" do %>
|
|
|
|
|
2014-08-10 17:06:58 +00:00
|
|
|
<% classes = action_name == "home" ? "homePage" : ""
|
|
|
|
classes += action_name == "home" && authenticated? ? " explorePage" : ""
|
|
|
|
classes += controller_name == "maps" && action_name == "index" ? " explorePage" : ""
|
2014-10-17 03:54:26 +00:00
|
|
|
if controller_name == "maps" && action_name == "show"
|
|
|
|
classes += " mapPage"
|
|
|
|
if @map.authorize_to_edit(current_user)
|
|
|
|
classes += " canEditMap"
|
|
|
|
end
|
|
|
|
if @map.permission == "commons"
|
|
|
|
classes += " commonsMap"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
classes += controller_name == "topics" && action_name == "show" ? " topicPage" : ""
|
2014-08-10 17:06:58 +00:00
|
|
|
%>
|
|
|
|
|
|
|
|
<div class="wrapper <%= classes %>" id="wrapper">
|
2014-08-02 02:50:23 +00:00
|
|
|
|
2014-10-18 23:26:34 +00:00
|
|
|
<% if authenticated? %>
|
2014-08-10 17:06:58 +00:00
|
|
|
<%= render :partial => 'layouts/upperelements' %>
|
2014-10-18 23:26:34 +00:00
|
|
|
<% end %>
|
2014-08-10 17:06:58 +00:00
|
|
|
|
2014-08-10 23:13:25 +00:00
|
|
|
<%= yield %>
|
2014-07-31 01:10:10 +00:00
|
|
|
|
|
|
|
<% if authenticated? %>
|
2014-10-18 23:26:34 +00:00
|
|
|
<div class="showcard mapElement mapElementHidden" id="showcard"></div> <!-- the topic card -->
|
|
|
|
<% # for creating and pulling in topics and synapses %>
|
|
|
|
<%= render :partial => 'maps/newtopic' %>
|
|
|
|
<%= render :partial => 'maps/newsynapse' %>
|
|
|
|
<% # for populating the change metacode list on the topic card %>
|
|
|
|
<%= render :partial => 'shared/metacodeoptions' %>
|
|
|
|
<%= render :partial => 'layouts/lowermapelements' %>
|
2014-07-31 01:10:10 +00:00
|
|
|
<% end %>
|
|
|
|
|
2014-08-10 17:06:58 +00:00
|
|
|
<div id="famousOverlay"></div>
|
2014-08-12 23:20:46 +00:00
|
|
|
<div id="loading"></div>
|
2014-07-27 19:57:35 +00:00
|
|
|
</div>
|
2014-07-31 01:10:10 +00:00
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= render :partial => 'layouts/lightboxes' %>
|
|
|
|
<%= render :partial => 'layouts/templates' %>
|
2014-09-30 02:26:12 +00:00
|
|
|
<%= render :partial => 'shared/metacodeBgColors' %>
|
2014-07-31 01:10:10 +00:00
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
<% if authenticated? %>
|
|
|
|
Metamaps.Active.Mapper = <%= user.to_json.html_safe %>
|
2014-08-10 17:06:58 +00:00
|
|
|
<% else %>
|
2014-07-31 01:10:10 +00:00
|
|
|
Metamaps.Active.Mapper = null;
|
|
|
|
<% end %>
|
2014-08-10 17:06:58 +00:00
|
|
|
Metamaps.Metacodes = <%= Metacode.all.to_json.html_safe %>;
|
2014-07-31 01:10:10 +00:00
|
|
|
|
2014-08-10 17:06:58 +00:00
|
|
|
Metamaps.Loading = {
|
2014-09-09 22:17:39 +00:00
|
|
|
loader: new CanvasLoader('loading'),
|
|
|
|
hide: function () {
|
|
|
|
$('#loading').hide();
|
|
|
|
},
|
|
|
|
show: function () {
|
|
|
|
$('#loading').show();
|
|
|
|
}
|
2014-08-10 17:06:58 +00:00
|
|
|
};
|
|
|
|
Metamaps.Loading.loader.setColor('#4fb5c0'); // default is '#000000'
|
|
|
|
Metamaps.Loading.loader.setDiameter(28); // default is 40
|
|
|
|
Metamaps.Loading.loader.setDensity(41); // default is 40
|
|
|
|
Metamaps.Loading.loader.setRange(0.9); // default is 1.3
|
|
|
|
Metamaps.Loading.loader.show(); // Hidden by default
|
2014-10-07 19:19:10 +00:00
|
|
|
|
|
|
|
// set up uservoice with signed in user
|
2014-10-07 23:14:25 +00:00
|
|
|
<% if authenticated? && ENV['SSO_KEY'] %>
|
2014-10-07 19:39:11 +00:00
|
|
|
USERVOICE.load(Metamaps.Active.Mapper.name, Metamaps.Active.Mapper.id, "<%= user.email %>", "<%= current_sso_token %>");
|
2014-10-07 19:19:10 +00:00
|
|
|
<% else %>
|
|
|
|
USERVOICE.load();
|
|
|
|
<% end %>
|
2014-07-31 01:10:10 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<%= render :partial => 'layouts/googleanalytics' if Rails.env.production? %>
|
2012-10-10 15:52:50 +00:00
|
|
|
</body>
|
2012-12-31 04:04:30 +00:00
|
|
|
</html>
|