Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hero size #34

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ GEM
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
aws-eventstream (1.3.0)
aws-partitions (1.933.0)
aws-partitions (1.934.0)
aws-sdk-core (3.196.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand Down Expand Up @@ -838,7 +838,7 @@ GEM
web-push (3.0.1)
jwt (~> 2.0)
openssl (~> 3.0)
webmock (3.23.0)
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down

This file was deleted.

7 changes: 2 additions & 5 deletions app/packs/stylesheets/partials/_homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
background-image: var(--hero-image);
}
.hero {
padding: 12rem 0 !important;
gap: normal !important;
height: auto !important;
}
}
.hero__title {
font-weight: 400 !important;
letter-spacing: 0.1;
font-size: 3rem;
line-height: 1.2;
text-shadow: 1px 1px 5px #000;
}
.hero__subtitle {
text-shadow: 1px 1px 5px #000;
text-align: center;
color: white;
font-size: 1.5rem;
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/iframe/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<iframe plausible-embed src="<%= ENV.fetch("ADMIN_IFRAME_URL") %>" scrolling="no" frameborder="0" loading="lazy" style="width: 1px; min-width: 100%; height: 1600px;"></iframe>
<iframe plausible-embed src="<%= ENV.fetch("ADMIN_IFRAME_URL", nil) %>" 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://analytics.barcelonadema-participa.cat/js/embed.host.js"></script>
15 changes: 7 additions & 8 deletions config/initializers/custom_admin_iframe.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# frozen_string_literal: true

if ENV.fetch("ADMIN_IFRAME_URL", nil).present?
Decidim.menu :admin_menu do |menu|
menu.add_item :custom_iframe,
"Estadísques web",
Rails.application.routes.url_helpers.admin_iframe_index_path,
icon_name: "pie-chart",
position: 10
end
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("ADMIN_IFRAME_URL", nil).present?
end
5 changes: 2 additions & 3 deletions spec/lib/overrides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
package: "decidim-conferences",
files: {
"/app/controllers/decidim/conferences/conferences_controller.rb" => "4e1bd7427cfd12c79391b451e07a2e2a",
"/app/models/decidim/conference.rb" => "095732cb2451adfb9db7a46078dc3a51",
"/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb" => "7f24462f802a2c277697205511103d90",
"/app/views/decidim/conferences/conferences/show.html.erb" => "93fa0d48a6117d3b1cb210ad1f17da7e"
"/app/models/decidim/conference.rb" => "50732d8b25ff80aa88d39a5b4a6661a8",
"/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb" => "7f24462f802a2c277697205511103d90"
}
},
{
Expand Down
37 changes: 37 additions & 0 deletions spec/system/admin_custom_iframe_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: true

require "rails_helper"

describe "Admin" do
context "when admin access to dashboard" do
let(:organization) { create(:organization) }
let!(:user) { create(:user, :confirmed, organization:) }
let!(:admin) { create(:user, :admin, :confirmed, organization:) }
let(:url) { "http://example.org" }

before do
allow(ENV).to receive(:fetch).and_call_original
allow(ENV).to receive(:fetch).with("ADMIN_IFRAME_URL", nil).and_return(url)
switch_to_host(organization.host)
login_as admin, scope: :user

visit decidim_admin.root_path
end

it "displays custom iframe in the admin menu" do
click_on "Estadístiques web"
within ".layout-content" do
expect(page).to have_content("Estadístiques web")
expect(page).to have_css("iframe[src='#{url}']")
end
end

context "when no url is set" do
let(:url) { nil }

it "does not display custom iframe in the admin menu" do
expect(page).to have_no_content("Estadístiques web")
end
end
end
end
Loading