Skip to content

Commit

Permalink
fix: image in file field stretched (backport 2505 from avo 3) (#2506)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Feb 22, 2024
1 parent 356686a commit 91104b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% if file.present? %>
<div class="flex flex-col h-full">
<% if file.representable? && is_image? %>
<%= image_tag helpers.main_app.url_for(file), class: "rounded-lg max-w-full #{@extra_classes}" %>
<%= image_tag helpers.main_app.url_for(file), class: "rounded-lg max-w-full self-start #{@extra_classes}" %>
<% elsif is_audio? %>
<%= audio_tag(helpers.main_app.url_for(file), controls: true, preload: false, class: 'w-full') %>
<% elsif is_video? %>
Expand Down
9 changes: 5 additions & 4 deletions avo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ require "avo/version"
Gem::Specification.new do |spec|
spec.name = "avo"
spec.version = Avo::VERSION
spec.authors = ["Adrian Marin", "Mihai Marin"]
spec.authors = ["Adrian Marin", "Mihai Marin", "Paul Bob"]
spec.email = ["avo@avohq.io"]
spec.homepage = "https://avohq.io"
spec.summary = "Configuration-based, no-maintenance, extendable Ruby on Rails admin panel framework."
spec.description = "Avo abstracts away the common parts of building apps, letting your engineers work on your app's essential components. The result is a full-featured admin panel that works out of the box, ready to give to your end-users."
spec.license = "Commercial"
spec.summary = "Admin panel framework and Content Management System for Ruby on Rails."
spec.description = "Avo is a very custom Content Management System for Ruby on Rails that saves engineers and teams months of development time by building user interfaces and logic using configuration rather than traditional coding; When configuration is not enough, you can fallback to familiar Ruby on Rails code."
spec.license = "LGPL-3.0"
spec.licenses = ["LGPL-3.0", "Commercial"]

# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
# to allow pushing to a single host or delete this section to allow pushing to any host.
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/app/avo/resources/post_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PostResource < Avo::BaseResource
enforce_suggestions: true,
suggestions_max_items: 2,
help: "The only allowed values here are `one`, `two`, and `three`"
field :cover_photo, as: :file, is_image: true, as_avatar: :rounded, full_width: true, hide_on: [], accept: "image/*", display_filename: false#, format_using: -> { value.variant(resize_to_limit: [100, 100]).processed.image }
field :cover_photo, as: :file, is_image: true, as_avatar: :rounded, full_width: true, hide_on: [], accept: "image/*", display_filename: false, stacked: true#, format_using: -> { value.variant(resize_to_limit: [100, 100]).processed.image }
field :cover_photo, as: :external_image, name: "Cover photo", required: true, hide_on: :all, link_to_resource: true, as_avatar: :rounded, format_using: -> { value.present? ? value&.url : nil }
field :audio, as: :file, is_audio: true, accept: "audio/*"
field :excerpt, as: :text, hide_on: :all, as_description: true do |model|
Expand Down

0 comments on commit 91104b6

Please sign in to comment.