metamaps--metamaps/app/views/layouts/application.html.erb

40 lines
1.8 KiB
Text
Raw Normal View History

2016-02-03 21:38:41 +08: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
#%>
2016-03-24 21:26:07 -07:00
<%= render :partial => 'layouts/head' %>
<body class="<%= authenticated? ? "authenticated" : "unauthenticated" %> controller-<%= controller_name %> action-<%= action_name %>">
2017-03-12 12:26:49 -04:00
<div class="main" id="react-app"></div>
<%= yield %>
2017-03-11 01:49:27 -05:00
<% if authenticated? %>
<% # for creating and pulling in topics and synapses %>
<% if controller_name == 'maps' && action_name == "conversation" %>
<%= render :partial => 'maps/newtopicsecret' %>
<% else %>
<%= render :partial => 'maps/newtopic' %>
<% end %>
<%= render :partial => 'maps/newsynapse' %>
<% # for populating the change metacode list on the topic card %>
<%= render :partial => 'shared/metacodeoptions' %>
<% end %>
2017-03-12 12:26:49 -04:00
<div class="hidden"><%= render :partial => 'shared/filterBox' %></div>
<div id="loading"></div>
2017-03-12 03:26:00 -04:00
<script type="text/javascript">
2017-03-12 12:26:49 -04:00
Metamaps.ServerData.unreadNotificationsCount = <%= current_user ? user_unread_notification_count : 0 %>
Metamaps.ServerData.mapIsStarred = <%= current_user && @map && current_user.starred_map?(@map) ? true : false %>
2017-03-12 03:26:00 -04:00
Metamaps.ServerData.mobileTitle = "<%= yield(:mobile_title) %>"
2017-03-13 12:22:52 -04:00
Metamaps.ServerData.ActiveMapper = <%= authenticated? ? current_user.to_json({follows: true, email: true, follow_settings: true}).html_safe : nil %>
<% if devise_error_messages? %>
Metamaps.ServerData.toast = "<%= devise_error_messages! %>"
<% elsif notice %>
Metamaps.ServerData.toast = "<%= notice %>"
<% elsif alert %>
Metamaps.ServerData.toast = "<%= alert %>"
<% end %>
2017-03-12 12:26:49 -04:00
Metamaps.Loading.setup()
2017-03-12 03:26:00 -04:00
</script>
2016-03-24 21:26:07 -07:00
<%= render :partial => 'layouts/foot' %>