Commit 47918d06 authored by Wills Gomez's avatar Wills Gomez

last minute push

parents d6825da1 a1448dc5
<%= simple_form_for([:admin, @candidate]) do |f| %> <%= simple_form_for([:admin, @candidate]) do |f| %>
<%= f.association :position, label: 'Position: '%>
<%= f.input :first_name, label: 'First Name: '%> <%= f.input :first_name, label: 'First Name: '%>
<%= f.input :last_name, label: 'Last Name: '%> <%= f.input :last_name, label: 'Last Name: '%>
<%= f.input :slogan, label: 'Slogan: '%> <%= f.input :slogan, label: 'Slogan: '%>
<%= f.association :position, label: 'Position: '%>
<%= f.submit %> <%= f.submit %>
<% end %> <% end %>
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<left> <left>
<h1>Candidates</h1> <h1>CANDIDATES</h1>
<%=link_to "Add a candidate", new_admin_candidate_path%> <%= button_to "Add a Candidate", new_admin_candidate_path, :method => "get" %>
</left> </left>
<%@positions.each do |p|%> <%@positions.each do |p|%>
<hr> <hr>
<h3><center><%=p.name%></center></h3> <h3><center><%=p.name%></center></h3>
<<<<<<< HEAD
<table> <table>
<table class="table table-hover"> <table class="table table-hover">
...@@ -18,6 +19,9 @@ ...@@ -18,6 +19,9 @@
<th witdth = "40%"><center>Name</center></th> <th witdth = "40%"><center>Name</center></th>
<th><center>Slogan</center></th> <th><center>Slogan</center></th>
</thead> </thead>
=======
<table>
>>>>>>> a1448dc5a8392d3e8fd508db23a835cd0eab52ce
<%p.candidates.each do |c|%> <%p.candidates.each do |c|%>
<tr> <tr>
<td> <td>
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12"> <h1>New Candidate</h1>
<h1>New Candidate</h1> <div class="col-md-3">
<br>
<%= render partial: "form" %> <%= render partial: "form" %>
<br>
<%= link_to "Back to Candidates", admin_candidates_path %> <%= link_to "< Back to Candidates", admin_candidates_path %>
</div> </div>
</div> </div>
</div> </div>
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<left> <left>
<h1>Positions</h1> <h1>POSITIONS</h1>
<%=link_to "Add New Position", new_admin_position_path%> <%=button_to "Create a Position", new_admin_position_path, :method => "get" %>
</left> </left>
<%@positions.each do |p|%> <%@positions.each do |p|%>
<hr> <hr>
<h3><center><%= link_to p.name, admin_position_path(p.id) %></center></h3> <h3><left><%= link_to p.name, admin_position_path(p.id) %></left></h3>
<%end%> <%end%>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12"> <h1>New Position</h1>
<h1>New Position</h1> <div class="col-md-3">
<br>
<%= render partial: "form" %> <%= render partial: "form" %>
<br>
<%= link_to "Back to Candidates", admin_candidates_path %> <%= link_to "< Back to Candidates", admin_candidates_path %>
</div> </div>
</div> </div>
</div> </div>
......
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-3">
<h2>Sign up</h2> <h2>Sign up</h2>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), :html => { :role => 'form'}) do |f| %> <%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), :html => { :role => 'form'}) do |f| %>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
%> %>
<%= simple_form_for([:voting, @vote]) do |f| %> <%= simple_form_for([:voting, @vote]) do |f| %>
I cast my vote for
<%= f.association :candidate, collection: Candidate.where(position_id:@pos), label_method: :full_name, value_method: :id %> <%= f.association :candidate, collection: Candidate.where(position_id:@pos), label_method: :full_name, value_method: :id %>
<%= f.input :comment, label: 'Comment:'%> <%= f.input :comment, label: 'Comment:'%>
<%= f.submit label: 'Cast Vote' %> <%= f.submit label: 'Cast Vote' %>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<h4>Vote now for:</h4> <h4>Vote now for:</h4>
<ul> <ul>
<%@positions.each do |p|%> <%@positions.each do |p|%>
<li><%=p.name%><br> <br>
<%voted_for = false%> <%voted_for = false%>
<% p.candidates.each do |c|%> <% p.candidates.each do |c|%>
<%c.votes.each do |v|%> <%c.votes.each do |v|%>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<%=link_to "Vote for a #{p.name}", "/voting/new/#{p.id}" %> <%=link_to "Vote for a #{p.name}", "/voting/new/#{p.id}" %>
<%else%> <%else%>
<%end%> <%end%>
</li>
<%end%> <%end%>
</ul> </ul>
<hr> <hr>
......
...@@ -3,12 +3,13 @@ ...@@ -3,12 +3,13 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-3">
<h1>Vote</h1> <h1>Vote</h1>
<%= render partial: "form" %> <%= render partial: "form" %>
<%= link_to "Back to Votes", voting_votes_path %> <br>
<%= link_to "< Back to Votes", voting_votes_path %>
</div> </div>
</div> </div>
</div> </div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment