<link rel"stylesheet" type="text/css" href="application.css">

<h1 style="font-family:'Droid Sans';margin-left:50px;margin-top:50px;">
	Election 2016
</h1>

<h5 style="margin-left:50px";>
Candidates
</h5>
<h5> <%= link_to "Add Candidate", new_admin_candidate_path %>

<hr>

<% if user_signed_in? %>
  <h5 style="margin-left:50px;">Hello <%= current_user.email %>! Your user ID is <%= current_user.id%>.</h5>

<hr>
<table width="100%" style="margin:100px;">
  <tr>
    <th>Position</th>
    <th>First Name</th>
    <th>Last Name</th>
    <th>Nickname</th>
    <th>Slogan</th>
  </tr>
  <% @candidates.each do |c| %>
    <tr>
      <td><%= c.position.name %></td>
      <td><%= c.first_name %></td>
      <td><%= c.last_name %></td>
      <td><%= c.nickname %></td>
      <td><%= c.slogan %></td>
      <td>
        <%= link_to "Show ", candidate_path(candidate.id) %> 
                <%= link_to "Edit", edit_admin_candidate_path(a.id) %>
        <%= link_to "Delete", admin_candidate_path(a.id), method: :delete, data: { confirm: 'Are you sure?' } %>
      </td>
    </tr>
  <% end %>
</table>
<br>

<h4 style="margin:100px;"><%= link_to "Home", root_path %></h4>

<% end %>