testing
This commit is contained in:
parent
7a70ad4a73
commit
2eb38edd6e
6 changed files with 160 additions and 5 deletions
4
app/assets/javascripts/precompiled-convo.css
Normal file
4
app/assets/javascripts/precompiled-convo.css
Normal file
File diff suppressed because one or more lines are too long
146
app/assets/javascripts/precompiled-convo.js
Normal file
146
app/assets/javascripts/precompiled-convo.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
class MapsController < ApplicationController
|
class MapsController < ApplicationController
|
||||||
before_action :require_user, only: [:create, :update, :destroy, :events]
|
before_action :require_user, only: [:create, :update, :destroy, :events]
|
||||||
before_action :set_map, only: [:show, :update, :destroy, :contains, :events, :export]
|
before_action :set_map, only: [:show, :conversation, :update, :destroy, :contains, :events, :export]
|
||||||
after_action :verify_authorized
|
after_action :verify_authorized
|
||||||
|
|
||||||
# GET maps/:id
|
# GET maps/:id
|
||||||
|
|
|
@ -20,6 +20,10 @@ class MapPolicy < ApplicationPolicy
|
||||||
record.collaborators.include?(user) ||
|
record.collaborators.include?(user) ||
|
||||||
record.user == user
|
record.user == user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def conversation?
|
||||||
|
show?
|
||||||
|
end
|
||||||
|
|
||||||
def create?
|
def create?
|
||||||
user.present?
|
user.present?
|
||||||
|
|
|
@ -29,9 +29,10 @@
|
||||||
<meta name="twitter:url" content="<%= request.original_url %>" />
|
<meta name="twitter:url" content="<%= request.original_url %>" />
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if controller_name == "maps" && action_name == "conversation" %>
|
<% if controller.class.name == 'MapsController' && action_name == "conversation" %>
|
||||||
<%= stylesheet_link_tag "application_secret", :media => "all" %>
|
<%= stylesheet_link_tag "precompiled-convo", :media => "all" %>
|
||||||
<%= javascript_include_tag "application_secret" %>
|
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||||
|
<%= javascript_include_tag "precompiled-convo" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||||
<%= javascript_include_tag "application" %>
|
<%= javascript_include_tag "application" %>
|
||||||
|
|
|
@ -9,5 +9,5 @@ Rails.application.configure do
|
||||||
|
|
||||||
# Precompile additional assets.
|
# Precompile additional assets.
|
||||||
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
||||||
config.assets.precompile += %w(webpacked/metamaps.bundle.js)
|
config.assets.precompile += %w(precompiled-convo.css precompiled-convo.js webpacked/metamaps.bundle.js)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue