index.html.erb 1.35 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
<% provide(:candidate, "active") %>
<% provide(:title, "Candidates") %> 
<style>
	h1{
		letter-spacing: 2px;
	}
</style>

<div class ="container">
	<div class="row">
		<div class="col-md-12">
			<left>
				<h1>Candidates</h1>
			</left>
			<% if @positions.size > 0 %>
				<%@positions.each do |p|%>
				<hr>
				<h3><%=p.name%></h3>
				<div class="btn btn-info" role ="button">
					<%= link_to "Add a Candidate", new_admin_candidate_path, :method => "get" %>
				</div>
						<% if p.candidates.size > 0 %>
							<table class="table table-hover">
							<thead>
								<th width ="40%"><center>Name</center></th>
								<th><center>Slogan</center></th>
							</thead>

							<%p.candidates.each do |c|%>
								<tr>
									<td>
										<center>
											<%=link_to c.full_name, admin_candidate_path(c.id)%>
										</center>
									</td>
									<td>
										<center>
											<%=c.slogan%>
										</center>
									</td>
								</tr>
							<%end%>
						<%else%>
							<h4><center>No candidates available.</center></h4>
						<%end%>
					</table>
				<%end%>
			<% else %>
				<h4><center>No positions and candidates available.</center></h4>
				<center>
					<div class="btn btn-info" role ="button">
						<%=link_to "Create a Position", new_admin_position_path, :method => "get" %>
					</div>
				</center>
			<% end %>
		</div> 
	</div>
</div>