Commit dcb7b837 authored by Galen Evilla's avatar Galen Evilla

edit

parent 8d05d692
...@@ -7,5 +7,7 @@ module Users ...@@ -7,5 +7,7 @@ module Users
@votes = Vote.all @votes = Vote.all
render "pages/profile.html.erb" render "pages/profile.html.erb"
end end
end end
end end
<h1>Admin Edit Post</h1> <% provide(:candidate, "active") %>
<% provide(:title, "Edit Candidate" ) %>
<h1>Edit Candidate's Information</h1>
<%= render partial: "form" %> <%= render partial: "form" %>
......
<% provide(:candidate, "active") %>
<% provide(:title, "Candidates") %>
<center> <center>
<h1>CANDIDATES</h1> <h1>CANDIDATES</h1>
......
<% provide(:candidate, "active") %>
<% provide(:title, "New Candidate" ) %>
<h1>New Candidate</h1> <h1>New Candidate</h1>
<%= render partial: "form" %> <%= render partial: "form" %>
......
<% provide(:candidate, "active") %>
<% provide(:title, "#{@candidate.full_name}" ) %>
<h1>Name of the Candidate: <%= @candidate.full_name%></h1> <h1>Name of the Candidate: <%= @candidate.full_name%></h1>
<%=link_to "Edit", edit_admin_candidate_path(@candidate.id)%> <%=link_to "Edit", edit_admin_candidate_path(@candidate.id)%>
<br> <br>
......
<h1>Admin Edit Post</h1> <% provide(:position, "active") %>
<% provide(:title, "Edit Position" ) %>
<h1>Edit Position</h1>
<%= render partial: "form" %> <%= render partial: "form" %>
......
<% provide(:position, "active") %>
<% provide(:title, "Positions") %>
<h1>Positions</h1> <h1>Positions</h1>
<%=link_to "Add New Position", new_admin_position_path%> <%=link_to "Add New Position", new_admin_position_path%>
......
<% provide(:position, "active") %>
<% provide(:title, "New Position" ) %>
<h1>New Position</h1> <h1>New Position</h1>
<%= render partial: "form" %> <%= render partial: "form" %>
......
<% provide(:position, "active") %>
<% provide(:title, "#{@position.name}" ) %>
<h1><%= @position.name%></h1> <h1><%= @position.name%></h1>
<%=link_to "Edit", edit_admin_position_path(@position.id)%> <%=link_to "Edit", edit_admin_position_path(@position.id)%>
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li><%= link_to "Home", root_path %></li> <li class="<%= yield(:home) %>" ><%= link_to "Home", root_path %></li>
<li><%= link_to "Candidates", admin_candidates_path %></li> <li class="<%= yield(:candidate) %>" ><%= link_to "Candidates", admin_candidates_path %></li>
<li><%= link_to "Positions", admin_positions_path %></li> <li class="<%= yield(:position) %>" ><%= link_to "Positions", admin_positions_path %></li>
<li><a href="/voting/votes">Vote now</li> <li class="<%= yield(:vote) %>" ><a href="/voting/votes">Vote now</li>
<li> <a href="/about">About</a> </li> <li class="<%= yield(:about) %>" ><%= link_to "About", about_path %></li>
<%if user_signed_in?%> <%if user_signed_in?%>
<li class="dropdown"> <li class="dropdown">
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Halalan PH</title> <title><%= yield(:title) %> | Halalan PH</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
......
<% provide(:home, "active") %>
<% provide(:title, "Home") %>
<div class ="index"> <div class ="index">
<h1><center>Current Vote Tally</center></h1> <h1><center>Current Vote Tally</center></h1>
<br> <br>
...@@ -6,7 +9,7 @@ ...@@ -6,7 +9,7 @@
<% if user_signed_in? %> <% if user_signed_in? %>
<% case current_user.role %> <% case current_user.role %>
<% when 'voter' %> <% when 'voter' %>
<h3>Welcome, Voter</h3> <h3>Welcome, <%= current_user.first_name%>! </h3>
<% when 'admin' %> <% when 'admin' %>
<h3>Welcome, Administrator</h3> <h3>Welcome, Administrator</h3>
<% end %> <% end %>
......
<h1>Admin Edit Post</h1>
<%= render partial: "form" %>
<%= link_to "Back to Posts", admin_posts_path %>
\ No newline at end of file
<% provide(:vote, "active") %>
<% provide(:title, "Vote now!") %>
<h1><center>VOTES</center></h1> <h1><center>VOTES</center></h1>
......
<% provide(:vote, "active") %>
<% provide(:title, "Vote") %>
<h1>Vote</h1> <h1>Vote</h1>
<%= render partial: "form" %> <%= render partial: "form" %>
......
<h1><%= @post.title %></h1>
<h3><%= @post.published_at %></h3>
<p>
<%= @post.content %>
</p>
<hr>
<%= link_to "Back to Posts", admin_posts_path %>
...@@ -5,7 +5,7 @@ Rails.application.routes.draw do ...@@ -5,7 +5,7 @@ Rails.application.routes.draw do
resources :users resources :users
get "/profile", to: "users/users#index" get "/profile", to: "users/users#index"
get "/voting/new/:id", to: "voting/votes#new" get "/voting/new/:id", to: "voting/votes#new"
get "/about" => "pages#about", as: :about get "/about" => "pages#about", as: :about
......
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