Sha256: 1a47243ad35a2acd1e364ff4178e3b89505497b220e23c6073032359534bf1a3

Contents?: true

Size: 1.24 KB

Versions: 22

Compression:

Stored size: 1.24 KB

Contents

- truncated = simple_format(truncate(comment.comment.gsub("\n", " "), :length => 125))
- formatted = defined?(RedCloth) ? RedCloth.new(comment.comment).to_html : simple_format(comment.comment)
- collapsable = formatted.size > 150
- commentable = comment.commentable

%li.comment.highlight[comment]
  .body
    = link_to avatar_for(comment.user, :size => :small), user_path(comment.user)
    %ul.tools
      - if can?(:update, commentable)
        %li= link_to_edit(comment)
      - if can?(:destroy, commentable)
        %li= link_to_delete(comment)

    = link_to(comment.user.full_name, user_path(comment.user)) + ","
    %tt
      = t(:added_note, value: timeago(comment.created_at) ).html_safe
      - if collapsable && can?(:read, commentable)
        = " | "
        = link_to_function(comment.collapsed? ? t(:more) : t(:less), "crm.flip_note_or_email(this, '#{t(:more)}', '#{t(:less)}')", :class => "toggle")

    - if can?(:read, commentable)
      - if collapsable
        %dt{ hidden_if(comment.expanded?), :id => dom_id(comment, :truncated) }
          = truncated
        %dt.textile{ hidden_if(comment.collapsed?), :id => dom_id(comment, :formatted) }
          = sanitize auto_link(formatted)
      - else
        %dt.textile= sanitize auto_link(formatted)

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 app/views/comments/_comment.html.haml
fat_free_crm-0.15.2 app/views/comments/_comment.html.haml
fat_free_crm-0.16.4 app/views/comments/_comment.html.haml
fat_free_crm-0.14.1 app/views/comments/_comment.html.haml
fat_free_crm-0.15.1 app/views/comments/_comment.html.haml
fat_free_crm-0.16.3 app/views/comments/_comment.html.haml
fat_free_crm-0.16.2 app/views/comments/_comment.html.haml
fat_free_crm-0.16.1 app/views/comments/_comment.html.haml
fat_free_crm-0.16.0 app/views/comments/_comment.html.haml
fat_free_crm-0.15.0 app/views/comments/_comment.html.haml
fat_free_crm-0.15.0.beta.2 app/views/comments/_comment.html.haml
fat_free_crm-0.15.0.beta app/views/comments/_comment.html.haml
fat_free_crm-0.14.0 app/views/comments/_comment.html.haml
reduced_fat_crm-0.15.0.beta app/views/comments/_comment.html.haml
reduced_fat_crm-0.14.0 app/views/comments/_comment.html.haml
fat_free_crm-0.13.6 app/views/comments/_comment.html.haml
fat_free_crm-0.13.5 app/views/comments/_comment.html.haml
fat_free_crm-0.13.4 app/views/comments/_comment.html.haml
fat_free_crm-0.13.3 app/views/comments/_comment.html.haml
fat_free_crm-0.13.2 app/views/comments/_comment.html.haml