fix apps pages and missing routes
This commit is contained in:
parent
4a3d78816e
commit
598d1192e3
5 changed files with 59 additions and 67 deletions
|
@ -1,3 +1,18 @@
|
|||
<div id="loading"></div>
|
||||
<script type="text/javascript">
|
||||
Metamaps.ServerData.unreadNotificationsCount = <%= current_user ? user_unread_notification_count : 0 %>
|
||||
Metamaps.ServerData.mapIsStarred = <%= current_user && @map && current_user.starred_map?(@map) ? true : false %>
|
||||
Metamaps.ServerData.mobileTitle = "<%= yield(:mobile_title) %>"
|
||||
Metamaps.ServerData.ActiveMapper = <%= current_user ? 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 %>
|
||||
Metamaps.Loading.setup()
|
||||
</script>
|
||||
<%= render :partial => 'layouts/lightboxes' %>
|
||||
<%= render :partial => 'layouts/templates' %>
|
||||
<%= render :partial => 'shared/metacodeBgColors' %>
|
||||
|
|
|
@ -21,19 +21,4 @@
|
|||
<%= render :partial => 'shared/metacodeoptions' %>
|
||||
<% end %>
|
||||
<div class="hidden"><%= render :partial => 'shared/filterBox' %></div>
|
||||
<div id="loading"></div>
|
||||
<script type="text/javascript">
|
||||
Metamaps.ServerData.unreadNotificationsCount = <%= current_user ? user_unread_notification_count : 0 %>
|
||||
Metamaps.ServerData.mapIsStarred = <%= current_user && @map && current_user.starred_map?(@map) ? true : false %>
|
||||
Metamaps.ServerData.mobileTitle = "<%= yield(:mobile_title) %>"
|
||||
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 %>
|
||||
Metamaps.Loading.setup()
|
||||
</script>
|
||||
<%= render :partial => 'layouts/foot' %>
|
||||
|
|
|
@ -6,55 +6,26 @@
|
|||
#%>
|
||||
|
||||
<%= render :partial => 'layouts/head' %>
|
||||
|
||||
<body class="<%= current_user ? 'authenticated' : 'unauthenticated' %>">
|
||||
|
||||
<a class='feedback-icon' target='_blank' href='https://hylo.com/c/metamaps'></a>
|
||||
|
||||
<%= content_tag :div, class: "main" do %>
|
||||
|
||||
<% if params[:controller] == 'doorkeeper/applications' || params[:controller] == 'doorkeeper/authorized_applications'
|
||||
classes = 'appsPage'
|
||||
else
|
||||
classes = ''
|
||||
end
|
||||
%>
|
||||
|
||||
<div class="wrapper <%= classes %>" id="wrapper">
|
||||
|
||||
<%= render :partial => 'layouts/upperelements', :locals => {:noHardHomeLink => true } %>
|
||||
|
||||
<%= yield %>
|
||||
|
||||
<div id="exploreMapsHeader">
|
||||
<div class="exploreMapsBar exploreElement">
|
||||
<div class="exploreMapsMenu">
|
||||
<div class="exploreMapsCenter">
|
||||
<% if current_user && current_user.admin %>
|
||||
<a href="<%= oauth_applications_path %>" class="activeMaps exploreMapsButton <%= params[:controller] == 'doorkeeper/applications' ? 'active' : nil %>">
|
||||
<div class="exploreMapsIcon"></div>Registered Apps
|
||||
</a>
|
||||
<% end %>
|
||||
<a href="<%= oauth_authorized_applications_path %>" class="authedApps exploreMapsButton <%= params[:controller] == 'doorkeeper/authorized_applications' ? 'active' : nil %>">
|
||||
<div class="exploreMapsIcon"></div>Authorized Apps
|
||||
</a>
|
||||
<a href="/" class="myMaps exploreMapsButton">
|
||||
<div class="exploreMapsIcon"></div>Maps
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="toast" class="toast">
|
||||
<% if devise_error_messages? %>
|
||||
<%= devise_error_messages! %>
|
||||
<% elsif notice %>
|
||||
<%= notice %>
|
||||
<% end %>
|
||||
</p>
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
<div class="main" id="react-app"></div>
|
||||
<%= yield %>
|
||||
<div id="exploreMapsHeader">
|
||||
<div class="exploreMapsBar exploreElement">
|
||||
<div class="exploreMapsMenu">
|
||||
<div class="exploreMapsCenter">
|
||||
<% if current_user && current_user.admin %>
|
||||
<a href="<%= oauth_applications_path %>" class="activeMaps exploreMapsButton <%= params[:controller] == 'doorkeeper/applications' ? 'active' : nil %>">
|
||||
<div class="exploreMapsIcon"></div>Registered Apps
|
||||
</a>
|
||||
<% end %>
|
||||
<a href="<%= oauth_authorized_applications_path %>" class="authedApps exploreMapsButton <%= params[:controller] == 'doorkeeper/authorized_applications' ? 'active' : nil %>">
|
||||
<div class="exploreMapsIcon"></div>Authorized Apps
|
||||
</a>
|
||||
<a href="/" class="myMaps exploreMapsButton">
|
||||
<div class="exploreMapsIcon"></div>Maps
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= render :partial => 'layouts/foot' %>
|
||||
|
|
|
@ -122,7 +122,7 @@ const ReactApp = {
|
|||
toggleMapInfoBox: InfoBox.toggleBox,
|
||||
infoBoxHtml: InfoBox.html,
|
||||
toggleFilterBox: Filter.toggleBox,
|
||||
filterBoxHtml: $('.filterBox')[0].outerHTML,
|
||||
filterBoxHtml: $('.filterBox')[0] && $('.filterBox')[0].outerHTML,
|
||||
openImportLightbox: () => ImportDialog.show(),
|
||||
forkMap: Map.fork,
|
||||
openHelpLightbox: () => self.openLightbox('cheatsheet'),
|
||||
|
|
|
@ -34,7 +34,11 @@ export default function makeRoutes (currentUser) {
|
|||
<IndexRoute component={nullComponent} />
|
||||
<Route path=":id" component={nullComponent} />
|
||||
</Route>
|
||||
<Route path="users/:id/edit" component={nullComponent} />
|
||||
<Route path="users">
|
||||
<Route path=":id/edit" component={nullComponent} />
|
||||
<Route path="password/new" component={nullComponent} />
|
||||
<Route path="password/edit" component={nullComponent} />
|
||||
</Route>
|
||||
<Route path="metacodes">
|
||||
<IndexRoute component={nullComponent} />
|
||||
<Route path="new" component={nullComponent} />
|
||||
|
@ -45,5 +49,22 @@ export default function makeRoutes (currentUser) {
|
|||
<Route path="new" component={nullComponent} />
|
||||
<Route path=":id/edit" component={nullComponent} />
|
||||
</Route>
|
||||
<Route path="oauth">
|
||||
<Route path="token/info" component={nullComponent} />
|
||||
<Route path="authorize">
|
||||
<IndexRoute component={nullComponent} />
|
||||
<Route path=":code" component={nullComponent} />
|
||||
</Route>
|
||||
<Route path="authorized_applications">
|
||||
<IndexRoute component={nullComponent} />
|
||||
<Route path=":id" component={nullComponent} />
|
||||
</Route>
|
||||
<Route path="applications">
|
||||
<IndexRoute component={nullComponent} />
|
||||
<Route path="new" component={nullComponent} />
|
||||
<Route path=":id" component={nullComponent} />
|
||||
<Route path=":id/edit" component={nullComponent} />
|
||||
</Route>
|
||||
</Route>
|
||||
</Route>
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue