From c4fa4bd1889561e990266bf2f56adee02992e44d Mon Sep 17 00:00:00 2001 From: Absurdon Date: Sun, 11 Jun 2017 15:09:30 +0200 Subject: [PATCH] Added proposal actions --- app/views/match_proposals/index.html.erb | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/views/match_proposals/index.html.erb b/app/views/match_proposals/index.html.erb index 83950dd..4ebf18c 100644 --- a/app/views/match_proposals/index.html.erb +++ b/app/views/match_proposals/index.html.erb @@ -8,16 +8,31 @@ Team Time Status + <% if @match.can_make_proposal?(cuser) %> Actions + <% end %> <% @match.match_proposals.each do |proposal| %> <%= proposal.team.name %> <%= longtime proposal.proposed_time %> <%= proposal.status_strings[proposal.status] %> - test + <% if @match.can_make_proposal?(cuser) %> + + <%= form_for proposal, url: match_proposal_path(@match, proposal) do |f| %> + <%= f.hidden_field :status, value: 0 %> + <%= link_to_function icon('check'), "proposalStateSubmit(#{MatchProposal::STATUS_CONFIRMED},#{proposal.id})" %> + <%= link_to_function icon('times'), "proposalStateSubmit(#{MatchProposal::STATUS_REJECTED},#{proposal.id})" %> + <% end %> + + <% end %> <% end %> + <% end %> <%= link_to 'Back', match_path(@match), class: 'button' %><%= link_to 'Propose match time', new_match_proposal_path(@match), class: 'button' %> \ No newline at end of file