set up for using secret css/js
This commit is contained in:
parent
00ecb0f6bb
commit
7a70ad4a73
4 changed files with 47 additions and 2 deletions
|
@ -23,6 +23,23 @@ class MapsController < ApplicationController
|
||||||
format.ttl { redirect_to action: :export, format: :ttl }
|
format.ttl { redirect_to action: :export, format: :ttl }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# GET maps/:id/conversation
|
||||||
|
def conversation
|
||||||
|
respond_to do |format|
|
||||||
|
format.html do
|
||||||
|
UserMap.where(map: @map, user: current_user).map(&:mark_invite_notifications_as_read)
|
||||||
|
@allmappers = @map.contributors
|
||||||
|
@allcollaborators = @map.editors
|
||||||
|
@alltopics = policy_scope(@map.topics)
|
||||||
|
@allsynapses = policy_scope(@map.synapses)
|
||||||
|
@allmappings = policy_scope(@map.mappings)
|
||||||
|
@allmessages = @map.messages.sort_by(&:created_at)
|
||||||
|
@allstars = @map.stars
|
||||||
|
@allrequests = @map.access_requests
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# GET maps/new
|
# GET maps/new
|
||||||
def new
|
def new
|
||||||
|
|
|
@ -29,8 +29,13 @@
|
||||||
<meta name="twitter:url" content="<%= request.original_url %>" />
|
<meta name="twitter:url" content="<%= request.original_url %>" />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
<% if controller_name == "maps" && action_name == "conversation" %>
|
||||||
<%= javascript_include_tag "application" %>
|
<%= stylesheet_link_tag "application_secret", :media => "all" %>
|
||||||
|
<%= javascript_include_tag "application_secret" %>
|
||||||
|
<% else %>
|
||||||
|
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||||
|
<%= javascript_include_tag "application" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<!-- typekit for vinyl font -->
|
<!-- typekit for vinyl font -->
|
||||||
<script type="text/javascript" src="https://use.typekit.net/tki2nyo.js"></script>
|
<script type="text/javascript" src="https://use.typekit.net/tki2nyo.js"></script>
|
||||||
|
|
22
app/views/maps/conversation.html.erb
Normal file
22
app/views/maps/conversation.html.erb
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<%#
|
||||||
|
# @file
|
||||||
|
# Code to display a map
|
||||||
|
# /maps/:id
|
||||||
|
#%>
|
||||||
|
|
||||||
|
<% content_for :title, @map.name + " | Metamaps" %>
|
||||||
|
<% content_for :mobile_title, @map.name %>
|
||||||
|
<script>
|
||||||
|
Metamaps.currentSection = "map";
|
||||||
|
Metamaps.currentPage = <%= @map.id.to_s %>;
|
||||||
|
Metamaps.ServerData = Metamaps.ServerData || {}
|
||||||
|
Metamaps.ServerData.ActiveMap = <%= @map.to_json.html_safe %>;
|
||||||
|
Metamaps.ServerData.Mappers = <%= @allmappers.to_json.html_safe %>;
|
||||||
|
Metamaps.ServerData.Collaborators = <%= @allcollaborators.to_json.html_safe %>;
|
||||||
|
Metamaps.ServerData.Topics = <%= @alltopics.to_json(user: current_user).html_safe %>;
|
||||||
|
Metamaps.ServerData.Synapses = <%= @allsynapses.to_json.html_safe %>;
|
||||||
|
Metamaps.ServerData.Mappings = <%= @allmappings.to_json.html_safe %>;
|
||||||
|
Metamaps.ServerData.Messages = <%= @allmessages.to_json.html_safe %>;
|
||||||
|
Metamaps.ServerData.Stars = <%= @allstars.to_json.html_safe %>;
|
||||||
|
Metamaps.ServerData.VisualizeType = "ForceDirected";
|
||||||
|
</script>
|
|
@ -18,6 +18,7 @@ Metamaps::Application.routes.draw do
|
||||||
|
|
||||||
resources :maps, except: [:index, :edit] do
|
resources :maps, except: [:index, :edit] do
|
||||||
member do
|
member do
|
||||||
|
get :conversation
|
||||||
get :export
|
get :export
|
||||||
post 'events/:event', action: :events
|
post 'events/:event', action: :events
|
||||||
get :contains
|
get :contains
|
||||||
|
|
Loading…
Add table
Reference in a new issue