oneclickorgs/one-click-orgs

View on GitHub
app/views/resolution_proposals/show.html.haml

Summary

Maintainability
Test Coverage
%h2
  = @resolution_proposal.title

%p
  A suggested resolution submitted by
  = image_tag(@resolution_proposal.proposer.gravatar_url(24), :alt => @resolution_proposal.proposer.name, :class => 'gravatar', :width => '24', :height => '24')
  = link_to(@resolution_proposal.proposer.name, @resolution_proposal.proposer)
  = @resolution_proposal.creation_date.to_s(:at_on)

- if @resolution_proposal.description?
  %h3 Description
  = render :partial => 'proposals/description', :locals => {:proposal => @resolution_proposal}

- if current_user == @resolution_proposal.proposer
  - if @resolution_proposal.open?
    .section
      %p
        If necessary, you can force this proposal to be opened for electronic voting.
        You will need the support of
        = pluralize(co.members_required_to_force_resolution, "member")
        to do this.
      %p
        Members can indicate their support by visiting this special link:
        %br
        = link_to(support_resolution_proposal_url(@resolution_proposal), support_resolution_proposal_path(@resolution_proposal))
  - elsif @resolution_proposal.accepted?
    .section
      %p
        Your proposal has been supported by
        = pluralize(@resolution_proposal.votes_for, "member")
        and has now been opened for electronic voting.

%h3 Comments
- @comments.each do |comment|
  .comment
    %p.attribution
      = image_tag(comment.author.gravatar_url(24), :alt => comment.author.name, :class => 'gravatar', :width => '24', :height => '24')
      = link_to(comment.author.name, member_path(comment.author))
      = comment.created_at.to_s(:at_on) + ':'
    = simple_format(html_escape(comment.body))
= form_for(@comment, :url => resolution_proposal_comments_path(:resolution_proposal_id => @resolution_proposal)) do |f|
  %p
    = f.label :body, "Add a comment to this suggested resolution:"
    = f.text_area :body
  %p
    = f.submit "Save comment"