Commit c8612200 authored by Norence Ilicito's avatar Norence Ilicito

admin module

parent 168e4c7b
<link rel"stylesheet" type="text/css" href="application.css">
<%= simple_form_for([:admin,@candidate]) do |f| %>
<%= f.association :position %>
<%= f.input :first_name %>
<%= f.input :last_name %>
<%= f.input :nickname %>
<%= f.input :slogan %>
<%= f.submit %>
<% end %>
<link rel"stylesheet" type="text/css" href="application.css">
<h1>Edit Candidate</h1>
<%= render partial: "form" %>
<%= link_to "Back to Candidates", admin_candidates_path %>
<link rel"stylesheet" type="text/css" href="application.css">
<body>
<div class="box fade-in one">
<h1 style="margin-left:100px;margin-top:100px;font-family:Droid Sans">Election 2016</h1>
<h3 style="color:#0080ff;margin-left:100px">
<%= link_to "MIS 21 - B DataBAES", "/about" %>
</h3>
<h4 style="color:#0080ff;margin-left:100px">
<% if user_signed_in? %>
Hello <%= current_user.email %>! <br>
<h4 style="margin-left:100px"><%= link_to "Profile", "/profiles"%>&nbsp;&nbsp;<%= link_to('Log Out', destroy_user_session_path, :method => :delete) %></h4>
<% else %>
<h5 style="color:#0080ff;margin-left:100px">
You're not signed in.
<%= link_to "Login", new_user_session_path %>
<%= link_to "Register", new_user_registration_path %>
<%= link_to "Admin", "admin/index.html.erb" %>
</h5>
<% end %>
</h4>
<h2> List of Candidate </h2>
<%= link_to("Add Candidate", new_admin_candidate_path) %>
<table width="100%" style="margin:100px;">
<tr>
<th>Candidate ID </th>
<th>First Name</th>
<th>Last Name</th>
<th>Slogan</th>
<th>Number of Votes</th>
</tr>
<% @candidates.each do |candidate| %>
<tr>
<td><%= candidate.id %></td>
<td><%= candidate.first_name %></td>
<td><%= candidate.last_name %></td>
<td><%= candidate.slogan %></td>
<td><%= candidate.votes.count %> </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>
</div>
</body>
<link rel"stylesheet" type="text/css" href="application.css">
<h1>New Candidate</h1>
<%= render partial: "form" %>
<%= link_to "Back to Candidates", admin_candidates_path %>
<link rel"stylesheet" type="text/css" href="application.css">
<h1><%= @candidate.nickname %></h1>
<br>
<ul>
<li><%= @candidate.first_name %></li>
<li><%= @candidate.last_name %></li>
<li><%= @candidate.slogan %></li>
</ul>
<hr>
<%= link_to "Back to Candidates", admin_candidates_path %>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
You're not signed in. You're not signed in.
<%= link_to "Login", new_user_session_path %> <%= link_to "Login", new_user_session_path %>
<%= link_to "Register", new_user_registration_path %> <%= link_to "Register", new_user_registration_path %>
<%= link_to "Admin", "admin/index.html.erb" %>
</h5> </h5>
<% 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