From 4ecc5d37609c3de8d3b013a738f3704f1e70c61a Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 22 Oct 2023 00:06:48 -0400 Subject: Audio quotes! --- app/views/admin/quotes/_form.html.haml | 5 +++++ app/views/quotes/_quote.html.haml | 2 ++ 2 files changed, 7 insertions(+) (limited to 'app/views') diff --git a/app/views/admin/quotes/_form.html.haml b/app/views/admin/quotes/_form.html.haml index 920835b..13948ca 100644 --- a/app/views/admin/quotes/_form.html.haml +++ b/app/views/admin/quotes/_form.html.haml @@ -24,4 +24,9 @@ .published-field = f.label :state = f.select :state, Quote.state.options + .details-module.image-uploads + %h4 Audio + - if f.object.audio.attached? + = audio_tag(rails_blob_url(f.object.audio), controls: true) + = f.file_field :audio .details-module= f.submit diff --git a/app/views/quotes/_quote.html.haml b/app/views/quotes/_quote.html.haml index 46b0266..db6ab8b 100644 --- a/app/views/quotes/_quote.html.haml +++ b/app/views/quotes/_quote.html.haml @@ -7,6 +7,8 @@ %datetime= quote.published_date - if user_signed_in? and !quote.new_record? = link_to "Edit", edit_admin_quote_path(quote), :class => "quote-edit-link" + - if quote.audio.attached? + .audioplayer= audio_tag(rails_blob_url(quote.audio), controls: true) %blockquote.quote-body= raw quote_format(h(quote.content)) - if !quote.new_record? and quote.has_extra? .quote-footer -- cgit 1.4.1