Commit 20ed913c authored by Galen Evilla's avatar Galen Evilla

basic web design! please improve this haha!

parent 8f091499
<%= simple_form_for([:admin, @candidate]) do |f| %>
<div class="col-sm-12">
<%= f.input :first_name, label: 'First Name: '%>
</div>
<%= f.input :last_name, label: 'Last Name: '%>
<%= f.input :slogan, label: 'Slogan: '%>
<%= f.association :position, label: 'Position: '%>
......
<% provide(:candidate, "active") %>
<% provide(:title, "Edit Candidate" ) %>
<h1>Edit Candidate's Information</h1>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Edit Candidate's Information</h1>
<%= render partial: "form" %>
<%= render partial: "form" %>
<%= link_to "Back to Candidates", admin_candidates_path %>
\ No newline at end of file
<%= link_to "Back to Candidates", admin_candidates_path %>
</div>
</div>
</div>
\ No newline at end of file
......@@ -10,7 +10,7 @@
</center>
<%@positions.each do |p|%>
<hr>
<h1><center><%=p.name%></center></h1>
<h3><center><%=p.name%></center></h3>
<table class="table table-hover">
<thead>
<th><center>Name</center></th>
......
<% provide(:candidate, "active") %>
<% provide(:title, "New Candidate" ) %>
<h1>New Candidate</h1>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>New Candidate</h1>
<%= render partial: "form" %>
<%= render partial: "form" %>
<%= link_to "Back to Candidates", admin_candidates_path %>
</div>
</div>
</div>
<% provide(:candidate, "active") %>
<% provide(:title, "#{@candidate.full_name}" ) %>
<h1>Name of the Candidate: <%= @candidate.full_name%></h1>
<div class="container">
<div class="row">
<div class="col-md-12">
<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%>
<br>
<h3>Position: <%= @candidate.position.name %></h3>
<h3>Position: <%= @candidate.position.name %></h3>
<%
m=0
f=0
......@@ -24,30 +27,31 @@
end
end
%>
<%end%>
<hr>
<h3>Slogan: <%= @candidate.slogan%></h3>
<hr>
<table width="100%">
<%end%>
<br>
<h3>Slogan: <%= @candidate.slogan%></h3>
<br>
<center>
<table class="table table-hover">
<h4>Gender of Voters</h4>
<tr>
<th>Male Voters</th>
<th>Female Voters</th>
<th>LGBT Voters</th>
<th>Total Votes</th>
<th><center>Male Voters</center></th>
<th><center>Female Voters</center></th>
<th><center>LGBT Voters</center></th>
<th><center>Total Votes</center></th>
</tr>
<tr>
<td><%= m%> <progress value="<%= m%>" max="<%= @candidate.votes.count %>" > </td>
<td><%= f%> <progress value="<%= f%>" max="<%= @candidate.votes.count %>" ></td>
<td><%= l%> <progress value="<%= l%>" max="<%= @candidate.votes.count %>" ></td>
<td><%= @candidate.votes.count %></td>
<td><center><%= m%> Votes <br> <progress value="<%= m%>" max="<%= @candidate.votes.count %>" ></center></td>
<td><center><%= f%> Votes <br> <progress value="<%= f%>" max="<%= @candidate.votes.count %>" ></center></td>
<td><center><%= l%> Votes <br> <progress value="<%= l%>" max="<%= @candidate.votes.count %>" ></center></td>
<td><center><%= @candidate.votes.count %></center></td>
</tr>
</table>
<hr>
</table>
</center>
<hr>
<h3>Voters who voted for <%= @candidate.full_name%></h3>
<ul>
<h3>Voters who voted for <%= @candidate.full_name%></h3>
<ul>
<li>
<% @candidate.votes.each do |v|%>
<%= "#{v.user.full_name}"%>
......@@ -56,7 +60,10 @@
</p>
</li>
<%end%>
</ul>
</ul>
<hr>
<%= link_to "Back to Candidates", admin_candidates_path %>
\ No newline at end of file
<hr>
<%= link_to "Back to Candidates", admin_candidates_path %>
</div>
</div>
</div>
\ No newline at end of file
<% provide(:position, "active") %>
<% provide(:title, "Edit Position" ) %>
<h1>Edit Position</h1>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Edit Position</h1>
<%= render partial: "form" %>
<%= render partial: "form" %>
<%= link_to "Back to Candidates", admin_candidates_path %>
\ No newline at end of file
<%= link_to "Back to Candidates", admin_candidates_path %>
</div>
</div>
</div>
\ No newline at end of file
<% provide(:position, "active") %>
<% provide(:title, "Positions") %>
<h1>Positions</h1>
<%=link_to "Add New Position", new_admin_position_path%>
<hr>
<% @positions.each do |p| %>
<h2><%= link_to p.name, admin_position_path(p.id) %></h2>
<ul>
<% p.candidates.each do |c|%>
<li><%=link_to c.full_name, admin_candidate_path(c.id)%></li>
<% end %>
</ul>
<% end %>
\ No newline at end of file
<div class ="container">
<div class="row">
<div class="col-md-12">
<center>
<h1>Positions</h1>
<%=link_to "Add New Position", new_admin_position_path%>
</center>
<%@positions.each do |p|%>
<hr>
<h3><center><%= link_to p.name, admin_position_path(p.id) %></center></h3>
<table class="table table-hover">
<thead>
<th><center>Name</center></th>
</thead>
<%p.candidates.each do |c|%>
<tr>
<td>
<center>
<%=link_to c.full_name, admin_candidate_path(c.id)%>
</center>
</td>
</tr>
<%end%>
</table>
<%end%>
</div>
</div>
</div>
<% provide(:position, "active") %>
<% provide(:title, "New Position" ) %>
<h1>New Position</h1>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>New Position</h1>
<%= render partial: "form" %>
<%= render partial: "form" %>
<%= link_to "Back to Candidates", admin_candidates_path %>
</div>
</div>
</div>
<% provide(:position, "active") %>
<% provide(:title, "#{@position.name}" ) %>
<h1><%= @position.name%></h1>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1><%= @position.name%></h1>
<%=link_to "Edit", edit_admin_position_path(@position.id)%>
<br>
<%=link_to "Delete", admin_position_path(@position.id), method: :delete%>
<br>
<hr>
<h2>Candidates for <%=@position.name%></h2>
<%=link_to "Edit", edit_admin_position_path(@position.id)%>
<br>
<%=link_to "Delete", admin_position_path(@position.id), method: :delete%>
<br>
<hr>
<h2>Candidates for <%=@position.name%></h2>
<ul>
<ul>
<%@position.candidates.each do |c|%>
<li><%=link_to c.full_name, admin_candidate_path(c.id)%></li>
<%end%>
</ul>
</ul>
<%= link_to "<Back to Positions", admin_positions_path %>
\ No newline at end of file
<%= link_to "Back to Positions", admin_positions_path %>
</div>
</div>
</div>
\ No newline at end of file
<h2>Sign up</h2>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Sign up</h2>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), :html => { :role => 'form'}) do |f| %>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), :html => { :role => 'form'}) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
......@@ -18,6 +21,9 @@
<div class="form-actions">
<%= f.button :submit, "Sign up" %>
</div>
<% end %>
<% end %>
<%= render "devise/shared/links" %>
<%= render "devise/shared/links" %>
</div>
</div>
</div>
<h2>Log in</h2>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Log in</h2>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %>
......@@ -10,6 +13,9 @@
<div class="form-actions">
<%= f.button :submit, "Log in" %>
</div>
<% end %>
<% end %>
<%= render "devise/shared/links" %>
<%= render "devise/shared/links" %>
</div>
</div>
</div>
<hr>
<footer class="footer">
<div class="container">
<p>&copy; 2016 HalalanPhMIS21, Inc.</p>
</div>
</footer>
\ No newline at end of file
......@@ -20,14 +20,15 @@
</ul>
<ul class="nav navbar-nav navbar-right">
<%if user_signed_in?%>
<li class="<%= yield(:vote) %>" ><a href="/voting/votes">Vote now</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Hello, <%= current_user.first_name%>!<b class="caret"></b></a>
<ul class="dropdown-menu">
<li> <a href="/profile">My Profile</a></li>
<li><a href="/profile">My Profile</a></li>
<li><%= link_to "Logout", destroy_user_session_path, method: :delete %></li>
</u1>
</ul>
</li>
<li class="<%= yield(:vote) %>" ><a href="/voting/votes">Vote now</a></li>
<%else%>
<li><%= link_to "Log-in", new_user_session_path %></li>
<li><%= link_to "Register", new_user_registration_path %></li>
......
......@@ -9,8 +9,11 @@
<body>
<%= render '/layouts/navbar' %>
<%= yield %>
</body>
<%= render '/layouts/footer' %>
</html>
......@@ -3,14 +3,12 @@
<div class="container">
<div class="row">
<div class="col-md-7">
<div class="col-md-12">
<h1 class="heading">About The Developers</h1>
<h3><a href="/about/evilla">Evilla, Galen Solo E.</a></h3>
<h3><a href="/about/gomez">Gomez, Feliz Marie B.</a></h3>
<h3><a href="/about/guian">Guian, April D.</a></h3>
<h3><a href="/about/principe">Principe, Jasmine Nicole G.</a></h3>
</div>
</div>
</div>
<h2>Hey <%=current_user.first_name%>!</h2>
<br>
You Voted for:
<br>
<ul>
<div class ="container">
<div class="row">
<div class="col-md-12">
<h2>Hey <%=current_user.first_name%>!</h2>
<br>
You Voted for:
<br>
<ul>
<%current_user.votes.each do |v|%>
<li>
<%="#{v.candidate.position.name}: #{v.candidate.full_name}"%>
......@@ -12,4 +14,7 @@ You Voted for:
</p>
</li>
<%end%>
</ul>
\ No newline at end of file
</ul>
</div>
</div>
</div>
\ No newline at end of file
<% provide(:vote, "active") %>
<% provide(:title, "Vote now!") %>
<h1><center>VOTES</center></h1>
<div class ="container">
<div class="row">
<div class="col-md-12">
<h1><center>VOTES</center></h1>
<hr>
<hr>
<h2><center>Hello, <%= current_user.full_name %>!</center></h2>
<h4>Vote now for:</h4>
<ul>
<h2><center>Hello, <%= current_user.full_name %>!</center></h2>
<h4>Vote now for:</h4>
<ul>
<%@positions.each do |p|%>
<li><%=p.name%><br>
<%voted_for = false%>
......@@ -27,8 +28,10 @@
<%end%>
</li>
<%end%>
</ul>
<hr>
<br>
</ul>
<hr>
<br>
</div>
</div>
</div>
\ No newline at end of file
<% provide(:vote, "active") %>
<% provide(:title, "Vote") %>
<h1>Vote</h1>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Vote</h1>
<%= render partial: "form" %>
<%= render partial: "form" %>
<%= link_to "Back to Votes", voting_votes_path %>
<%= link_to "Back to Votes", voting_votes_path %>
</div>
</div>
</div>
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.error_notification_class = 'alert alert-danger'
config.button_class = 'btn btn-default'
config.boolean_label_class = nil
config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.optional :maxlength
b.optional :pattern
b.optional :min_max
b.optional :readonly
b.use :label, class: 'control-label'
b.use :input, class: 'form-control'
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.optional :maxlength
b.optional :readonly
b.use :label, class: 'control-label'
b.use :input
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.optional :readonly
b.wrapper tag: 'div', class: 'checkbox' do |ba|
ba.use :label_input
end
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.optional :readonly
b.use :label, class: 'control-label'
b.use :input
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.optional :maxlength
b.optional :pattern
b.optional :min_max
b.optional :readonly
b.use :label, class: 'col-sm-3 control-label'
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
ba.use :input, class: 'form-control'
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
end
config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.optional :maxlength
b.optional :readonly
b.use :label, class: 'col-sm-3 control-label'
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
ba.use :input
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
end
config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.optional :readonly
b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr|
wr.wrapper tag: 'div', class: 'checkbox' do |ba|
ba.use :label_input
end
wr.use :error, wrap_with: { tag: 'span', class: 'help-block' }
wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
end
config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.optional :readonly
b.use :label, class: 'col-sm-3 control-label'
b.wrapper tag: 'div', class: 'col-sm-9' do |ba|
ba.use :input
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
end
config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.optional :maxlength
b.optional :pattern
b.optional :min_max
b.optional :readonly
b.use :label, class: 'sr-only'
b.use :input, class: 'form-control'
b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
b.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.optional :readonly
b.use :label, class: 'control-label'
b.wrapper tag: 'div', class: 'form-inline' do |ba|
ba.use :input, class: 'form-control'
ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
end
end
# Wrappers for forms and inputs using the Bootstrap toolkit.
# Check the Bootstrap docs (http://getbootstrap.com)
# to learn about the different styles for forms and inputs,
# buttons and other elements.
config.default_wrapper = :vertical_form
config.wrapper_mappings = {
check_boxes: :vertical_radio_and_checkboxes,
radio_buttons: :vertical_radio_and_checkboxes,
file: :vertical_file_input,
boolean: :vertical_boolean,
datetime: :multi_select,
date: :multi_select,
time: :multi_select
}
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