Commit e296d3d4 authored by Wills Gomez's avatar Wills Gomez

fixed the nav bar and other page changes

parent 37e830e0
<h1>Name of the Candidate: <%= @candidate.full_name%></h1>
<%=link_to "Edit", edit_admin_candidate_path(@candidate.id)%>
<br>
<%=link_to "Delete", admin_candidate_path(@candidate.id), method: :delete%>
<h1><center><%= @candidate.full_name%></center></h1>
<center><%=link_to "Edit", edit_admin_candidate_path(@candidate.id)%>
<%=link_to "Delete", admin_candidate_path(@candidate.id), method: :delete%></center>
<br>
<h3>Position: <%= @candidate.position.name %></h3>
<%
......
<h1>Positions</h1>
<h1><center>POSITIONS</center></h1>
<center><%=link_to "Add New Position", new_admin_position_path%></center>
<%=link_to "Add New Position", new_admin_position_path%>
<hr>
<% @positions.each do |c| %>
......
......@@ -14,18 +14,19 @@
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li><a href="/profile">Hello, <%= current_user.first_name%>!</a></li>
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Candidates", admin_candidates_path %></li>
<li><%= link_to "Positions", admin_positions_path %></li>
<li><a href="/voting/votes">Vote now</li>
<li> <a href="/about">About</a> </li>
<%if user_signed_in?%>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Hello, <%= current_user.first_name%>!<b class="caret"></b></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="/profile">My Profile</a> </li>
<li><a href="/voting/votes">Vote now</li>
<li><%= link_to "Logout", destroy_user_session_path, method: :delete %></li>
</u1>
</li>
......
<div class ="index">
<h1><center>Current Vote Tally</center></h1>
<br>
<br>
<% if user_signed_in? %>
<% case current_user.role %>
<% when 'voter' %>
<h3>Welcome, Voter</h3>
<% when 'admin' %>
<h3>Welcome, Administrator</h3>
<% end %>
<% else %>
<h3>Welcome</h3>
<% end %>
<%@positions.each do |p|%>
<div class ="section">
<div class ="box">
<h4><center><%=p.name%></center></h4>
<h2><center><%=p.name%></center></h2>
<table>
<thead>
<th><center>&nbsp;</center></th>
<th><center>Name</center></th>
<th colspan="2"><center>Votes</center></th>
<th><center>Votes</center></th>
<th><center>&nbsp;</center></th>
</thead>
<%total = 0%>
......@@ -35,7 +26,6 @@
<td></td>
<td><center><%=link_to c.full_name, admin_candidate_path(c.id)%></center></td>
<td><center><%=c.votes.count%></center></td>
<td><center><progress value="<%=c.votes.count%>" max="<%=total%>" >(<%=c.votes.count%>)</center></td>
</tr>
<%end%>
</table>
......
......@@ -12,7 +12,7 @@
<% p.candidates.each do |c|%>
<%c.votes.each do |v|%>
<%if v.user_id == current_user.id%>
You have already voted for <%= v.candidate.full_name%>
- <%= v.candidate.full_name%>
<%voted_for = true%>
<% end %>
<%end%>
......
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