oneclickorgs/one-click-orgs

View on GitHub
app/views/proposals/index.html.haml

Summary

Maintainability
Test Coverage
%h3 Proposals

%p= "..."

%h4 Open Proposals
%table.proposals
  %tr
    %th Title
    %th End in
    %th Vote
  - for proposal in @proposals
    %tr{:class => cycle('odd', 'even')}
      %td
        = proposal.title
        (
        = link_to(proposal.proposer.name, member_path(proposal.proposer))
        )
        = render 'proposals/description', :proposal => proposal
        %p= link_to("More details", proposal_path(proposal))
      %td.timestamp
        = distance_of_time_in_words_to_now(proposal.end_date)
      %td.vote
        = render 'proposals/vote', :proposal => proposal
  
%h4 Recent Decisions
%table.decisions
  %tr
    %th Title
    %th Decision made
    %th For/against
  - reset_cycle
  - for decision in @decisions
    %tr{:class => cycle('odd', 'even')}
      %td
        = decision.proposal.title
        (
        = link_to(decision.proposal.proposer.name, member_path(decision.proposal.proposer))
        )
        = render 'proposals/description', :proposal => decision.proposal
        %p= link_to("More details", proposal_path(decision.proposal))
      %td.timestamp= decision.proposal.close_date.to_s(:long)
      %td.vote= render 'proposals/vote_count', :proposal => decision.proposal

%h4 Recent Failed Proposals
%table.failed_proposals
  %tr
    %th Title
    %th Proposal failed
    %th For/against
  - reset_cycle
  - for failed_proposal in @failed_proposals
    %tr{:class => cycle('odd', 'even')}
      %td
        = failed_proposal.title
        (
        = link_to(failed_proposal.proposer.name, member_path(failed_proposal.proposer))
        )
        = render 'proposals/description', :proposal => failed_proposal
        %p= link_to("More details", proposal_path(failed_proposal))
      %td.timestamp= failed_proposal.close_date.to_s(:long)
      %td.vote= render 'proposals/vote_count', :proposal => failed_proposal