about summary refs log tree commit diff stats
path: root/app/views/quotes/_quote.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/quotes/_quote.html.haml')
-rw-r--r--app/views/quotes/_quote.html.haml22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/views/quotes/_quote.html.haml b/app/views/quotes/_quote.html.haml new file mode 100644 index 0000000..acbab10 --- /dev/null +++ b/app/views/quotes/_quote.html.haml
@@ -0,0 +1,22 @@
1%article.quote.h-entry{ :id => "quote-#{quote.id}" }
2 %data.p-name{ value: "\##{quote.id}" }
3 %data.u-url{ value: url_for(quote) }
4 %header.quote-header{ :id => "quote-header-#{quote.id}" }
5 = link_to_unless (quote.new_record? or current_page?(quote)), "\##{quote.id}", quote, :class => "quote-link"
6 %span.vote-link{ :id => "quote-upvote-link-#{quote.id}" }= link_to_unless (quote.new_record? or quote.already_upvoted?(request.remote_ip)), "Up", upvote_quote_path(quote.id), :remote => true, :rel => "nofollow", :class => "quote-upvote-link", method: :post
7 %span.quote-rating{ :id => "quote-rating-#{quote.id}" }= "+#{quote.upvotes}/-#{quote.downvotes}"
8 %span.vote-link{ :id => "quote-downvote-link-#{quote.id}" }= link_to_unless (quote.new_record? or quote.already_downvoted?(request.remote_ip)), "Down", downvote_quote_path(quote.id), :remote => true, :rel => "nofollow", :class => "quote-downvote-link", method: :post
9 %time.dt-published{ datetime: quote.created_at.strftime("%Y-%m-%dT%H:%M:%SZ%z") }= quote.published_date
10 - if user_signed_in? and !quote.new_record?
11 = link_to "Edit", edit_admin_quote_path(quote), :class => "quote-edit-link"
12 - if quote.audio.attached?
13 .audioplayer= audio_tag(rails_blob_url(quote.audio), controls: true)
14 %blockquote.quote-body.e-content= raw quote_format(h(quote.content))
15 - if !quote.new_record? and quote.has_extra?
16 .quote-footer
17 - if quote.has_notes?
18 .quote-notes= auto_link(quote.notes, :link => :urls)
19 - if quote.has_tags?
20 %ul.quote-tags
21 - quote.tags.each do |tag|
22 %li= link_to tag.name, tag_quotes_path(tag.name)