Skip to content
Snippets Groups Projects
Unverified Commit 4d74dde8 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

Merge branch 'master' of github.com:noesya/osuny

parents c8bf6a2f 7fbb73ae
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,13 @@ class MediaController < ApplicationController
if @blob.variable?
variant_service = VariantService.compute(@blob, params[:filename_with_transformations], params[:format])
transformations = variant_service.transformations
blob_or_variant_url = transformations.empty? ? url_for(@blob) : url_for(@blob.variant(transformations))
if transformations.empty?
blob_or_variant_url = url_for @blob
else
variant = @blob.variant transformations
@size = variant.processed.image.byte_size
blob_or_variant_url = url_for variant
end
else
blob_or_variant_url = url_for(@blob)
end
......
......@@ -80,7 +80,6 @@ class Communication::Website::Menu::Item < ApplicationRecord
target = nil
active = website.send "menu_item_kind_#{kind}?"
return nil unless active
published = about&.published && about&.published_at
case self.kind
when 'blank'
target = ''
......@@ -95,7 +94,7 @@ class Communication::Website::Menu::Item < ApplicationRecord
when 'news'
target = "/#{website.static_pathname_posts}"
when 'news_article'
target = "/#{website.static_pathname_posts}#{about.path}" if published
target = "/#{website.static_pathname_posts}#{about.path}" if about&.published && about&.published_at
when 'staff'
target = "/#{website.static_pathname_staff}"
when 'administrators'
......@@ -109,11 +108,11 @@ class Communication::Website::Menu::Item < ApplicationRecord
when 'research_volumes'
target = "/#{website.static_pathname_research_volumes}"
when 'research_volume'
target = "/#{website.static_pathname_research_volumes}#{about.path}" if published
target = "/#{website.static_pathname_research_volumes}#{about.path}" if about&.published && about&.published_at
when 'research_articles'
target = "/#{website.static_pathname_research_articles}"
when 'research_article'
target = "/#{website.static_pathname_research_articles}#{about.path}" if published
target = "/#{website.static_pathname_research_articles}#{about.path}" if about&.published && about&.published_at
else
target = about&.path
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment