danielweinmann/unlock

View on GitHub
app/views/initiatives/contributions/_contribution.html.slim

Summary

Maintainability
Test Coverage
li.contribution
  = link_to initiative_contribution_path(contribution.initiative.id, contribution) do
    .image
      - if contribution.hide_name?
        = image_tag('user.svg')
      - else
        = contribution.user.display_image
    .info
      h4 
        - if contribution.hide_name?
          = Contribution.human_attribute_name(:hide_name?)
        - else
          = truncate contribution.user.display_name, length: 40
      - unless contribution.hide_value? && !policy(contribution.initiative).update?
        h5= contribution.display_value
      em #{time_ago_in_words(contribution.created_at)}