Mattias Bodlund 7 months ago
parent
commit
bc9b1c09d0
9 changed files with 57 additions and 10 deletions
  1. +1
    -1
      Gemfile.lock
  2. +17
    -1
      app/assets/stylesheets/application.css
  3. +7
    -0
      app/controllers/languages_controller.rb
  4. +1
    -1
      app/views/languages/_intro.html.erb
  5. +13
    -0
      app/views/languages/index.html.erb
  6. +11
    -0
      app/views/questions/show.html.erb
  7. +2
    -2
      config/importmap.rb
  8. +2
    -2
      vendor/javascript/@rails--request.js.js
  9. +3
    -3
      vendor/javascript/trix.js

+ 1
- 1
Gemfile.lock View File

@ -208,7 +208,7 @@ GEM
psych (5.2.3) psych (5.2.3)
date date
stringio stringio
public_suffix (6.0.1)
public_suffix (6.0.2)
puma (6.6.0) puma (6.6.0)
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.8.1) racc (1.8.1)


+ 17
- 1
app/assets/stylesheets/application.css View File

@ -226,6 +226,23 @@ main {
justify-content: end; justify-content: end;
} }
.background-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
pointer-events: none;
& img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
}
@media (min-width: 474px) { @media (min-width: 474px) {
main { main {
justify-content: center; justify-content: center;
@ -246,7 +263,6 @@ main {
grid-template-rows: auto; grid-template-rows: auto;
gap: 8px; gap: 8px;
} }
.intro-container, .intro-container,


+ 7
- 0
app/controllers/languages_controller.rb View File

@ -6,11 +6,18 @@ class LanguagesController < ApplicationController
helper_method :accept_language helper_method :accept_language
def index def index
@node = Node.roots.viewable.first
not_found unless @node
end end
def show def show
@accept_language = params[:locale] @accept_language = params[:locale]
@node = Node.roots.viewable.first
not_found unless @node
render :index render :index
end end


+ 1
- 1
app/views/languages/_intro.html.erb View File

@ -1,4 +1,4 @@
<% Node.roots.viewable.first.attachments.limit(2).each_with_index do |attachment, i| %>
<% @node.attachments.limit(2).each_with_index do |attachment, i| %>
<%= tag.div attachment.body.html_safe, class: i == 0 ? "intro-content-header" : "intro-content-body" %> <%= tag.div attachment.body.html_safe, class: i == 0 ? "intro-content-header" : "intro-content-body" %>
<% end %> <% end %>


+ 13
- 0
app/views/languages/index.html.erb View File

@ -1,5 +1,16 @@
<%- content_for :title, t('project_name') %> <%- content_for :title, t('project_name') %>
<% Array(@node.assets.select{ |asset| asset.file.image? }.first).each do |asset| %>
<div class="background-container">
<%= image_tag rails_storage_proxy_path(asset.file.representation(resize_to_limit: [800,nil], format: :jpg)),
srcset: "#{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [800,nil], format: :jpg))} 800w,
#{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [1600,nil], format: :jpg))} 1600w,
#{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [2400,nil], format: :jpg))} 2400w",
sizes: "100vw"
%>
</div>
<% end %>
<div class="intro-container"> <div class="intro-container">
@ -30,3 +41,5 @@
</div> </div>
</div> </div>

+ 11
- 0
app/views/questions/show.html.erb View File

@ -3,6 +3,17 @@
content_for :meta_description, question.page_description content_for :meta_description, question.page_description
%> %>
<% Array(question.assets.select{ |asset| asset.file.image? }.first).each do |asset| %>
<div class="background-container">
<%= image_tag rails_storage_proxy_path(asset.file.representation(resize_to_limit: [800,nil], format: :jpg)),
srcset: "#{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [800,nil], format: :jpg))} 800w,
#{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [1600,nil], format: :jpg))} 1600w,
#{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [2400,nil], format: :jpg))} 2400w",
sizes: "100vw"
%>
</div>
<% end %>
<%= form_with model: @answer, url: url_for(controller: 'answers', action: 'create') do |form| %> <%= form_with model: @answer, url: url_for(controller: 'answers', action: 'create') do |form| %>
<div class="question-container"> <div class="question-container">


+ 2
- 2
config/importmap.rb View File

@ -7,10 +7,10 @@ pin_all_from "app/javascript/controllers", under: "controllers"
pin "sortablejs" # @1.15.6 pin "sortablejs" # @1.15.6
pin "stimulus-use" # @0.52.3 pin "stimulus-use" # @0.52.3
pin "@rails/request.js", to: "@rails--request.js.js" # @0.0.11
pin "@rails/request.js", to: "@rails--request.js.js" # @0.0.12
pin "@rails/activestorage", to: "@rails--activestorage.js" # @8.0.200 pin "@rails/activestorage", to: "@rails--activestorage.js" # @8.0.200
pin "tom-select", to: "tom-select--dist--js--tom-select.base.min.js.js" # @2.4.3 pin "tom-select", to: "tom-select--dist--js--tom-select.base.min.js.js" # @2.4.3
pin "trix" # @2.1.13
pin "trix" # @2.1.14
# site_helper # site_helper
pin "application", preload: false pin "application", preload: false


+ 2
- 2
vendor/javascript/@rails--request.js.js
File diff suppressed because it is too large
View File


+ 3
- 3
vendor/javascript/trix.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save