-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44eb0fb
commit 9414b9c
Showing
5 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
module Admin | ||
class IframeController < Decidim::Admin::ApplicationController | ||
def index | ||
enforce_permission_to :read, :admin_dashboard | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<iframe plausible-embed src="<%= ENV["PLAUSIBLE_IFRAME"] %>" scrolling="no" frameborder="0" loading="lazy" style="width: 1px; min-width: 100%; height: 1600px;"></iframe> | ||
<div style="font-size: 14px; padding-bottom: 14px;">Stats powered by <a target="_blank" style="color: #4F46E5; text-decoration: underline;" href="https://plausible.io">Plausible Analytics</a></div> | ||
<script async src="https://<%= ENV["PLAUSIBLE_HOST"] %>/js/embed.host.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% if ENV["PLAUSIBLE_HOST"].present? %> | ||
<script defer data-domain="coopmmunity.eu" src="https://<%= ENV.fetch("PLAUSIBLE_HOST") %>/js/script.js"></script> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
Decidim.menu :admin_menu do |menu| | ||
menu.add_item :custom_iframe, | ||
"Estadístiques web", | ||
Rails.application.routes.url_helpers.admin_iframe_index_path, | ||
icon_name: "bar-chart-2-line", | ||
position: 10, | ||
if: ENV.fetch("PLAUSIBLE_IFRAME", nil).present? | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
require "sidekiq/web" | ||
require "sidekiq/cron/web" | ||
|
||
Rails.application.routes.draw do | ||
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development? | ||
|
||
mount Decidim::Core::Engine => "/" | ||
authenticate :user, ->(u) { u.admin? } do | ||
mount Sidekiq::Web => "/sidekiq" | ||
end | ||
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html | ||
|
||
namespace :admin do | ||
resources :iframe, only: [:index] | ||
end | ||
|
||
mount Decidim::Core::Engine => "/" | ||
end |