<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";>
	<%= link_to "Add Position", new_position_path %>
	<%= link_to "Add Candidate", new_candidate_path %>
</h5>

<hr>

<% if user_signed_in? %>
  Hello <%= current_user.email %>! Your user ID is <%= current_user.id%>.

<hr>
<table width="100%">
  <tr>
    <th>First Name</th>
    <th>Last Name</th>
    <th>Slogan</th>
  </tr>
  <% @candidates.each do |candidate| %>
    <tr>
      <td><%= candidate.first_name %></td>
      <td><%= candidate.last_name %></td>
      <td><%= candidate.slogan %></td>
      <td>
        <%= link_to "Show ", candidate_path(candidate.id) %> |

		<%= link_to "Edit", edit_candidate_path(candidate.id) %> |

		<%= link_to "Delete", candidate_path(candidate.id), method: :delete, data: { confirm: 'Are you sure?'} %>
      </td>
    </tr>
  <% end %>
</table>
<br>

<%= link_to "Home", root_path %>

<% else %>

<h3>
  You are not signed in. Please <%= link_to "Login", new_user_session_path %>
</h3>

<% end %>