Skip to content

Commit 2153cb7

Browse files
authored
Merge branch 'main' into block-features-form-option-icon
2 parents b51633e + 737f0d5 commit 2153cb7

File tree

26 files changed

+585
-443
lines changed

26 files changed

+585
-443
lines changed

.circleci/config.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 2.1
44
jobs:
55
build:
66
docker:
7-
- image: cimg/ruby:4.0.2-node
7+
- image: noesya/cimg-ruby-activestorage-preview:4.0.2
88
environment:
99
RAILS_ENV: test
1010
RACK_ENV: test
@@ -26,13 +26,6 @@ jobs:
2626
keys:
2727
- v1-dependencies-{{ checksum "Gemfile.lock" }}
2828

29-
# Install binaries for Active Storage Previews
30-
- run:
31-
name: Install binaries for Active Storage Previews
32-
command: |
33-
sudo apt-get update
34-
sudo apt-get install ffmpeg poppler-utils libvips-dev -y
35-
3629
# Bundler configuration
3730
- run:
3831
name: Configure Bundler

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ gem "image_processing"
4646
gem "invisible_captcha", "~> 2.3"
4747
gem "jbuilder"
4848
gem "jquery-rails"
49-
gem "jquery-ui-rails", "~> 7.0"
49+
gem "jquery-ui-rails", "~> 8.0"
5050
gem "jsbundling-rails", "~> 1.3"
5151
gem "kamifusen"#, path: "../kamifusen"
5252
gem "kaminari"

Gemfile.lock

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ GIT
1111

1212
GIT
1313
remote: https://github.com/jaimeiniesta/metainspector.git
14-
revision: d5b60b1d748d51a7dde3cfb8442b738610a6cd96
14+
revision: 102ca37d4eb26af2362a0f8b199ec5d22ad983b6
1515
specs:
16-
metainspector (5.17.0)
17-
addressable (~> 2.8.4)
16+
metainspector (5.17.1)
17+
addressable (~> 2.9.0)
1818
faraday (~> 2.5)
1919
faraday-cookie_jar (~> 0.0)
2020
faraday-encoding (~> 0.0)
@@ -137,14 +137,14 @@ GEM
137137
add_to_calendar (0.5.1)
138138
tzinfo (>= 1.1, < 3)
139139
tzinfo-data (~> 1.2020)
140-
addressable (2.8.9)
140+
addressable (2.9.0)
141141
public_suffix (>= 2.0.2, < 8.0)
142142
annotaterb (4.22.0)
143143
activerecord (>= 6.0.0)
144144
activesupport (>= 6.0.0)
145145
ast (2.4.3)
146146
aws-eventstream (1.4.0)
147-
aws-partitions (1.1234.0)
147+
aws-partitions (1.1238.0)
148148
aws-sdk-core (3.244.0)
149149
aws-eventstream (~> 1, >= 1.3.0)
150150
aws-partitions (~> 1, >= 1.992.0)
@@ -156,7 +156,7 @@ GEM
156156
aws-sdk-kms (1.123.0)
157157
aws-sdk-core (~> 3, >= 3.244.0)
158158
aws-sigv4 (~> 1.5)
159-
aws-sdk-s3 (1.218.0)
159+
aws-sdk-s3 (1.219.0)
160160
aws-sdk-core (~> 3, >= 3.244.0)
161161
aws-sdk-kms (~> 1)
162162
aws-sigv4 (~> 1.5)
@@ -168,7 +168,7 @@ GEM
168168
erubi (>= 1.0.0)
169169
rack (>= 0.9.0)
170170
rouge (>= 1.0.0)
171-
bigdecimal (4.1.0)
171+
bigdecimal (4.1.1)
172172
bindex (0.8.1)
173173
bootsnap (1.23.0)
174174
msgpack (~> 1.2)
@@ -183,7 +183,7 @@ GEM
183183
addressable (~> 2.3, >= 2.3.0)
184184
json (~> 2.1, >= 2.1.0)
185185
typhoeus (~> 1.0, >= 1.0.1)
186-
bugsnag (6.29.0)
186+
bugsnag (6.30.0)
187187
concurrent-ruby (~> 1.0)
188188
builder (3.3.0)
189189
byebug (13.0.0)
@@ -262,7 +262,7 @@ GEM
262262
encryptor (3.0.0)
263263
enum_help (0.0.20)
264264
activesupport (>= 3.0.0)
265-
erb (6.0.2)
265+
erb (6.0.3)
266266
erubi (1.13.1)
267267
et-orbi (1.4.0)
268268
tzinfo
@@ -287,7 +287,7 @@ GEM
287287
faraday-gzip (3.1.0)
288288
faraday (>= 2.0, < 3)
289289
zlib (~> 3.0)
290-
faraday-http-cache (2.6.1)
290+
faraday-http-cache (2.7.0)
291291
faraday (>= 0.8)
292292
faraday-multipart (1.2.0)
293293
multipart-post (~> 2.0)
@@ -330,7 +330,7 @@ GEM
330330
terminal-table (>= 1.5.1)
331331
globalid (1.3.0)
332332
activesupport (>= 6.1)
333-
good_job (4.14.1)
333+
good_job (4.16.0)
334334
activejob (>= 6.1.0)
335335
activerecord (>= 6.1.0)
336336
concurrent-ruby (>= 1.3.1)
@@ -356,7 +356,7 @@ GEM
356356
hashie (5.1.0)
357357
logger
358358
htmlentities (4.4.2)
359-
http-cookie (1.1.0)
359+
http-cookie (1.1.4)
360360
domain_name (~> 0.5)
361361
httparty (0.24.2)
362362
csv
@@ -390,7 +390,7 @@ GEM
390390
rails-dom-testing (>= 1, < 3)
391391
railties (>= 4.2.0)
392392
thor (>= 0.14, < 2.0)
393-
jquery-ui-rails (7.0.0)
393+
jquery-ui-rails (8.0.0)
394394
railties (>= 3.2.16)
395395
jsbundling-rails (1.3.1)
396396
railties (>= 6.0.0)
@@ -445,7 +445,7 @@ GEM
445445
mini_magick (5.3.1)
446446
logger
447447
mini_mime (1.1.5)
448-
minitest (6.0.3)
448+
minitest (6.0.4)
449449
drb (~> 2.0)
450450
prism (~> 1.5)
451451
msgpack (1.8.0)
@@ -505,11 +505,11 @@ GEM
505505
stringio
506506
time
507507
uri
508-
opentelemetry-api (1.8.0)
508+
opentelemetry-api (1.9.0)
509509
logger
510-
opentelemetry-common (0.23.0)
510+
opentelemetry-common (0.24.0)
511511
opentelemetry-api (~> 1.0)
512-
opentelemetry-exporter-otlp-logs (0.3.0)
512+
opentelemetry-exporter-otlp-logs (0.4.0)
513513
google-protobuf (>= 3.18)
514514
googleapis-common-protos-types (~> 1.3)
515515
opentelemetry-api (~> 1.1)
@@ -518,24 +518,25 @@ GEM
518518
opentelemetry-logs-sdk (~> 0.1)
519519
opentelemetry-sdk
520520
opentelemetry-semantic_conventions
521-
opentelemetry-instrumentation-base (0.25.0)
521+
opentelemetry-instrumentation-base (0.26.0)
522522
opentelemetry-api (~> 1.7)
523523
opentelemetry-common (~> 0.21)
524524
opentelemetry-registry (~> 0.1)
525-
opentelemetry-logs-api (0.2.0)
525+
opentelemetry-logs-api (0.3.0)
526526
opentelemetry-api (~> 1.0)
527-
opentelemetry-logs-sdk (0.4.0)
527+
opentelemetry-logs-sdk (0.5.1)
528528
opentelemetry-api (~> 1.2)
529529
opentelemetry-logs-api (~> 0.1)
530530
opentelemetry-sdk (~> 1.3)
531-
opentelemetry-registry (0.4.0)
531+
opentelemetry-registry (0.5.0)
532532
opentelemetry-api (~> 1.1)
533-
opentelemetry-sdk (1.10.0)
533+
opentelemetry-sdk (1.11.0)
534+
logger
534535
opentelemetry-api (~> 1.1)
535536
opentelemetry-common (~> 0.20)
536537
opentelemetry-registry (~> 0.2)
537538
opentelemetry-semantic_conventions
538-
opentelemetry-semantic_conventions (1.36.0)
539+
opentelemetry-semantic_conventions (1.37.0)
539540
opentelemetry-api (~> 1.0)
540541
orm_adapter (0.5.0)
541542
orthotypo (2.0.0)
@@ -552,8 +553,8 @@ GEM
552553
pg (1.6.3-x86_64-linux)
553554
pg_query (6.2.2)
554555
google-protobuf (>= 3.25.3)
555-
pghero (3.7.0)
556-
activerecord (>= 7.1)
556+
pghero (3.8.0)
557+
activerecord (>= 7.2)
557558
popper_js (2.11.8)
558559
pp (0.6.3)
559560
prettyprint
@@ -563,7 +564,7 @@ GEM
563564
date
564565
stringio
565566
public_suffix (7.0.5)
566-
puma (7.2.0)
567+
puma (8.0.0)
567568
nio4r (~> 2.0)
568569
raabro (1.4.0)
569570
racc (1.8.1)
@@ -574,7 +575,7 @@ GEM
574575
base64 (>= 0.1.0)
575576
logger (>= 1.6.0)
576577
rack (>= 3.0.0, < 4)
577-
rack-session (2.1.1)
578+
rack-session (2.1.2)
578579
base64 (>= 0.1.0)
579580
rack (>= 3.0.0)
580581
rack-test (2.2.0)
@@ -617,7 +618,7 @@ GEM
617618
thor (~> 1.0, >= 1.2.2)
618619
tsort (>= 0.2)
619620
zeitwerk (~> 2.6)
620-
rake (13.3.1)
621+
rake (13.4.2)
621622
randexp (0.1.7)
622623
rb-fsevent (0.11.2)
623624
rb-inotify (0.11.1)
@@ -632,7 +633,7 @@ GEM
632633
redis-client (>= 0.22.0)
633634
redis-client (0.28.0)
634635
connection_pool
635-
regexp_parser (2.11.3)
636+
regexp_parser (2.12.0)
636637
reline (0.6.3)
637638
io-console (~> 0.5)
638639
requests (1.0.2)
@@ -716,7 +717,7 @@ GEM
716717
rexml (~> 3.2, >= 3.2.5)
717718
rubyzip (>= 1.2.2, < 3.0)
718719
websocket (~> 1.0)
719-
set (1.1.2)
720+
set (1.1.3)
720721
simple-navigation (4.4.1)
721722
activesupport (>= 2.3.2)
722723
ostruct
@@ -858,7 +859,7 @@ DEPENDENCIES
858859
invisible_captcha (~> 2.3)
859860
jbuilder
860861
jquery-rails
861-
jquery-ui-rails (~> 7.0)
862+
jquery-ui-rails (~> 8.0)
862863
jsbundling-rails (~> 1.3)
863864
kamifusen
864865
kaminari

app/assets/stylesheets/public/showcase.sass

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,24 @@
2626
display: block
2727

2828
.instances
29-
@extend .list-unstyled
30-
display: grid
31-
gap: 0
32-
padding: 0.5px
33-
grid-template-columns: repeat(2, 1fr)
34-
@include media-breakpoint-up(md)
35-
grid-template-columns: repeat(4, 1fr)
36-
@include media-breakpoint-up(lg)
37-
grid-template-columns: repeat(6, 1fr)
29+
margin: 0
3830
li
39-
align-items: center
4031
aspect-ratio: 1
41-
display: flex
42-
justify-content: center
43-
outline-offset: -0.5px
44-
outline: 1px solid #E6E4D9
32+
border: 1px solid #E6E4D9
33+
margin: -0.5px
4534
padding: 2rem
46-
position: relative
47-
img
48-
aspect-ratio: 1
49-
object-fit: contain
50-
width: 100%
35+
article
36+
align-items: center
37+
display: flex
38+
height: 100%
39+
justify-content: center
40+
text-align: center
41+
picture
42+
height: 100%
43+
img
44+
aspect-ratio: 1
45+
height: 100%
46+
max-width: 100%
47+
object-fit: contain
48+
object-position: center
49+
width: 100%
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Showcase::InstancesController < Showcase::ApplicationController
2+
def index
3+
@instances = University.with_websites_in_production
4+
.with_attached_logo
5+
.ordered
6+
end
7+
end

app/controllers/showcase/websites_controller.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ def index
1818
end
1919
end
2020

21-
def show
22-
@website = Communication::Website.find(params[:id])
23-
raise_404_unless(@website.in_showcase && @website.in_production)
24-
end
25-
2621
def tag
2722
@tag = Communication::Website::Showcase::Tag.find_by!(slug: params[:tag])
2823
@websites = @tag.websites.in_showcase
@@ -40,7 +35,8 @@ def feature
4035
@websites = @websites.page(params[:page]).per(100)
4136
end
4237

43-
def instances
44-
@instances = University.with_websites_in_production.ordered
38+
def show
39+
@website = Communication::Website.find(params[:id])
40+
raise_404_unless(@website.in_showcase && @website.in_production)
4541
end
4642
end

app/models/communication/block.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# data :jsonb
88
# deleted_at :datetime
99
# html_class :string
10+
# metadata :jsonb
1011
# migration_identifier :string
1112
# position :integer not null
1213
# published :boolean default(TRUE)

app/models/communication/block/template/video.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def before_validation
5353
protected
5454

5555
def video_provider
56-
@video_provider ||= Video::Provider.find(url.to_s.strip)
56+
@video_provider ||= Video::Provider.find(url.to_s.strip, block)
5757
end
5858

5959
def check_accessibility

app/models/communication/website/permalink.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class Communication::Website::Permalink < ApplicationRecord
3838

3939
validates :path, presence: true
4040
validates :path, uniqueness: { scope: :website_id }, unless: :is_current
41+
validate :root_path_is_reserved_for_home
4142

4243
before_validation :set_university, on: :create
4344
# We should not sync the about object whenever we do something with the permalink, as they can be changed during a sync.
@@ -187,4 +188,9 @@ def regenerate_website_hosting_config
187188
return unless website.persisted?
188189
website.regenerate_hosting_config!
189190
end
191+
192+
def root_path_is_reserved_for_home
193+
return unless path == "/"
194+
errors.add(:path, :reserved_for_home) unless about.about.is_a?(Communication::Website::Page::Home)
195+
end
190196
end

app/models/concerns/as_localization.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,9 @@ def localize_in!(language)
6767
def slug_with_ancestors_slugs
6868
about.ancestors_and_self.map { |ancestor|
6969
l10n = ancestor.localization_for(language)
70-
if l10n.nil? || l10n.try(:draft?)
71-
# If l10n is nil or draft, no slug
72-
nil
73-
else
74-
# otherwise (published or no publication state) we return the slug
75-
l10n.slug
76-
end
70+
# If l10n is nil, no slug
71+
# otherwise (published or not) we return the slug
72+
l10n.try(:slug)
7773
}.compact_blank.join('/')
7874
end
7975

0 commit comments

Comments
 (0)