danielweinmann/unlock

View on GitHub
app/views/initiatives/_initiative.html.slim

Summary

Maintainability
Test Coverage
article.initiative
  a href=initiative_by_permalink_path(initiative) title=initiative.name
    .image= image_tag(initiative.image.url(:medium)) if initiative.image.present?
    .status
      h5
        span.currency= initiative.display_currency
        span.number= initiative.total_value
        div= Initiative.human_attribute_name(:total_value).downcase
      h5
        span.number= initiative.total_contributions
        div
          - words = Initiative.human_attribute_name(:total_contributions).downcase.split(' ')
          = words[0].pluralize(initiative.total_contributions)
          = " #{words[1]}".pluralize(initiative.total_contributions)
    .info
      h3= truncate initiative.name, length: 48
      h4= truncate strip_tags(initiative.first_text_html), length: 140
      - if current_user && current_user.admin?
        h4= mail_to initiative.user.email, "Por #{initiative.user.name}"