<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>Position</th>
  </tr>
  <% @positions.each do |position| %>
    <tr>
      <td><%= position.name %></td>
      <td>
        <%= link_to "Show ", position_path(position.id) %> |

		<%= link_to "Edit", edit_position_path(position.id) %> |

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

<%= link_to "Go to Candidates", candidates_path %> | 
<%= link_to "Home", root_path %>

<% else %>

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

<% end %>