crowdint/cfp

View on GitHub
app/views/cfp/proposals/_proposal.html.haml

Summary

Maintainability
Test Coverage
= content_tag_for :tr, proposal, :class => "row" do
  %td= proposal.title
  - if proposal.can_be_seen_by?(current_user)
    %td= link_to t('actions.show'), proposal_path(proposal)
  - if proposal.can_be_edited_by?(current_user)
    %td
      = link_to t('actions.edit'), edit_proposal_path(proposal)
    %td
      = link_to t('actions.delete'), proposal_path(proposal), method: :delete, data: t('actions.sure')
  - else
    %td
    %td
  - if current_user.can_review?
    %td
      = proposal.user_name
    %td
      = proposal.average_ranking
    %td
      = link_to t('actions.discuss'), proposal_comments_path(proposal)