mconf/mconf-web

View on GitHub
app/views/posts/_post.html.haml

Summary

Maintainability
Test Coverage
- thread_class ||= nil
.thread{:id => "parent-#{post.id}", :class => "#{thread_class}"}
  .logo-in-thread
    - if post.author
      = link_logo_image(post.author, :size => '32', :title => post.author.name, :url => user_path(post.author), :class => "logo logo-user")
    - else
      = logo_initials(:user, :size => '32', :class => "logo logo-user")
  .thread-content
    .thread-title
      = icon_comment t('post.home.one', :space => post.space.name)
      - if post.author && post.author.enabled?
        = link_to post.author.name, user_path(post.author), { :class => "thread-author" }
      - else
        %span.post-author= t('_other.user.removed')
    .thread-description
      %p= post.text
    %ul.thread-action-links
      - if can?(:update, post)
        %li= link_to t('edit').downcase, edit_space_post_path(post.space, post), { :name => post.id, :title => t('edit'), :class => "open-modal" }
      - if can?(:destroy, post)
        %li= link_to t('remove').downcase, space_post_path(post.space,post), { :method => :delete, :title => t('delete.one'), :data => { :confirm => t('delete.confirm', :element => post.title) } }