about summary refs log tree commit diff stats
path: root/app/views/quotes/_quote.html.haml
blob: acbab102012e88337ebe2407aeae97ce59e4bb95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%article.quote.h-entry{ :id => "quote-#{quote.id}" }
  %data.p-name{ value: "\##{quote.id}" }
  %data.u-url{ value: url_for(quote) }
  %header.quote-header{ :id => "quote-header-#{quote.id}" }
    = link_to_unless (quote.new_record? or current_page?(quote)), "\##{quote.id}", quote, :class => "quote-link"
    %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
    %span.quote-rating{ :id => "quote-rating-#{quote.id}" }= "+#{quote.upvotes}/-#{quote.downvotes}"
    %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
    %time.dt-published{ datetime: quote.created_at.strftime("%Y-%m-%dT%H:%M:%SZ%z") }= 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.e-content= raw quote_format(h(quote.content))
  - if !quote.new_record? and quote.has_extra?
    .quote-footer
      - if quote.has_notes?
        .quote-notes= auto_link(quote.notes, :link => :urls)
      - if quote.has_tags?
        %ul.quote-tags
          - quote.tags.each do |tag|
            %li= link_to tag.name, tag_quotes_path(tag.name)