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| %> <%= simple_form_for([:admin, @candidate]) do |f| %>
<div class="col-sm-12">
<%= f.input :first_name, label: 'First Name: '%> <%= f.input :first_name, label: 'First Name: '%>
</div>
<%= f.input :last_name, label: 'Last Name: '%> <%= f.input :last_name, label: 'Last Name: '%>
<%= f.input :slogan, label: 'Slogan: '%> <%= f.input :slogan, label: 'Slogan: '%>
<%= f.association :position, label: 'Position: '%> <%= f.association :position, label: 'Position: '%>
......
<% provide(:candidate, "active") %> <% provide(:candidate, "active") %>
<% provide(:title, "Edit Candidate" ) %> <% 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 %> <%= link_to "Back to Candidates", admin_candidates_path %>
\ No newline at end of file </div>
</div>
</div>
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</center> </center>
<%@positions.each do |p|%> <%@positions.each do |p|%>
<hr> <hr>
<h1><center><%=p.name%></center></h1> <h3><center><%=p.name%></center></h3>
<table class="table table-hover"> <table class="table table-hover">
<thead> <thead>
<th><center>Name</center></th> <th><center>Name</center></th>
......
<% provide(:candidate, "active") %> <% provide(:candidate, "active") %>
<% provide(:title, "New Candidate" ) %> <% 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(:candidate, "active") %>
<% provide(:title, "#{@candidate.full_name}" ) %> <% 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)%> <%=link_to "Edit", edit_admin_candidate_path(@candidate.id)%>
<br> <br>
<%=link_to "Delete", admin_candidate_path(@candidate.id), method: :delete%> <%=link_to "Delete", admin_candidate_path(@candidate.id), method: :delete%>
<br> <br>
<h3>Position: <%= @candidate.position.name %></h3> <h3>Position: <%= @candidate.position.name %></h3>
<% <%
m=0 m=0
f=0 f=0
...@@ -24,30 +27,31 @@ ...@@ -24,30 +27,31 @@
end end
end end
%> %>
<%end%> <%end%>
<hr> <br>
<h3>Slogan: <%= @candidate.slogan%></h3> <h3>Slogan: <%= @candidate.slogan%></h3>
<hr> <br>
<center>
<table width="100%"> <table class="table table-hover">
<h4>Gender of Voters</h4> <h4>Gender of Voters</h4>
<tr> <tr>
<th>Male Voters</th> <th><center>Male Voters</center></th>
<th>Female Voters</th> <th><center>Female Voters</center></th>
<th>LGBT Voters</th> <th><center>LGBT Voters</center></th>
<th>Total Votes</th> <th><center>Total Votes</center></th>
</tr> </tr>
<tr> <tr>
<td><%= m%> <progress value="<%= m%>" max="<%= @candidate.votes.count %>" > </td> <td><center><%= m%> Votes <br> <progress value="<%= m%>" max="<%= @candidate.votes.count %>" ></center></td>
<td><%= f%> <progress value="<%= f%>" max="<%= @candidate.votes.count %>" ></td> <td><center><%= f%> Votes <br> <progress value="<%= f%>" max="<%= @candidate.votes.count %>" ></center></td>
<td><%= l%> <progress value="<%= l%>" max="<%= @candidate.votes.count %>" ></td> <td><center><%= l%> Votes <br> <progress value="<%= l%>" max="<%= @candidate.votes.count %>" ></center></td>
<td><%= @candidate.votes.count %></td> <td><center><%= @candidate.votes.count %></center></td>
</tr> </tr>
</table> </table>
<hr> </center>
<hr>
<h3>Voters who voted for <%= @candidate.full_name%></h3> <h3>Voters who voted for <%= @candidate.full_name%></h3>
<ul> <ul>
<li> <li>
<% @candidate.votes.each do |v|%> <% @candidate.votes.each do |v|%>
<%= "#{v.user.full_name}"%> <%= "#{v.user.full_name}"%>
...@@ -56,7 +60,10 @@ ...@@ -56,7 +60,10 @@
</p> </p>
</li> </li>
<%end%> <%end%>
</ul> </ul>
<hr> <hr>
<%= link_to "Back to Candidates", admin_candidates_path %> <%= link_to "Back to Candidates", admin_candidates_path %>
\ No newline at end of file </div>
</div>
</div>
\ No newline at end of file
<% provide(:position, "active") %> <% provide(:position, "active") %>
<% provide(:title, "Edit Position" ) %> <% 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 %> <%= link_to "Back to Candidates", admin_candidates_path %>
\ No newline at end of file </div>
</div>
</div>
\ No newline at end of file
<% provide(:position, "active") %> <% provide(:position, "active") %>
<% provide(:title, "Positions") %> <% provide(:title, "Positions") %>
<h1>Positions</h1> <div class ="container">
<div class="row">
<%=link_to "Add New Position", new_admin_position_path%> <div class="col-md-12">
<hr> <center>
<h1>Positions</h1>
<% @positions.each do |p| %> <%=link_to "Add New Position", new_admin_position_path%>
<h2><%= link_to p.name, admin_position_path(p.id) %></h2> </center>
<ul> <%@positions.each do |p|%>
<% p.candidates.each do |c|%> <hr>
<li><%=link_to c.full_name, admin_candidate_path(c.id)%></li> <h3><center><%= link_to p.name, admin_position_path(p.id) %></center></h3>
<% end %> <table class="table table-hover">
</ul> <thead>
<% end %> <th><center>Name</center></th>
\ No newline at end of file </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(:position, "active") %>
<% provide(:title, "New Position" ) %> <% 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(:position, "active") %>
<% provide(:title, "#{@position.name}" ) %> <% 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)%> <%=link_to "Edit", edit_admin_position_path(@position.id)%>
<br> <br>
<%=link_to "Delete", admin_position_path(@position.id), method: :delete%> <%=link_to "Delete", admin_position_path(@position.id), method: :delete%>
<br> <br>
<hr> <hr>
<h2>Candidates for <%=@position.name%></h2> <h2>Candidates for <%=@position.name%></h2>
<ul> <ul>
<%@position.candidates.each do |c|%> <%@position.candidates.each do |c|%>
<li><%=link_to c.full_name, admin_candidate_path(c.id)%></li> <li><%=link_to c.full_name, admin_candidate_path(c.id)%></li>
<%end%> <%end%>
</ul> </ul>
<%= link_to "<Back to Positions", admin_positions_path %> <%= link_to "Back to Positions", admin_positions_path %>
\ No newline at end of file </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 %> <%= f.error_notification %>
<div class="form-inputs"> <div class="form-inputs">
...@@ -18,6 +21,9 @@ ...@@ -18,6 +21,9 @@
<div class="form-actions"> <div class="form-actions">
<%= f.button :submit, "Sign up" %> <%= f.button :submit, "Sign up" %>
</div> </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"> <div class="form-inputs">
<%= f.input :email, required: false, autofocus: true %> <%= f.input :email, required: false, autofocus: true %>
<%= f.input :password, required: false %> <%= f.input :password, required: false %>
...@@ -10,6 +13,9 @@ ...@@ -10,6 +13,9 @@
<div class="form-actions"> <div class="form-actions">
<%= f.button :submit, "Log in" %> <%= f.button :submit, "Log in" %>
</div> </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 @@ ...@@ -20,14 +20,15 @@
</ul> </ul>
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<%if user_signed_in?%> <%if user_signed_in?%>
<li class="<%= yield(:vote) %>" ><a href="/voting/votes">Vote now</a></li>
<li class="dropdown"> <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">Hello, <%= current_user.first_name%>!<b class="caret"></b></a>
<ul class="dropdown-menu"> <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> <li><%= link_to "Logout", destroy_user_session_path, method: :delete %></li>
</u1> </u1>
</ul>
</li> </li>
<li class="<%= yield(:vote) %>" ><a href="/voting/votes">Vote now</a></li>
<%else%> <%else%>
<li><%= link_to "Log-in", new_user_session_path %></li> <li><%= link_to "Log-in", new_user_session_path %></li>
<li><%= link_to "Register", new_user_registration_path %></li> <li><%= link_to "Register", new_user_registration_path %></li>
......
...@@ -9,8 +9,11 @@ ...@@ -9,8 +9,11 @@
<body> <body>
<%= render '/layouts/navbar' %> <%= render '/layouts/navbar' %>
<%= yield %> <%= yield %>
</body> </body>
<%= render '/layouts/footer' %>
</html> </html>
...@@ -3,14 +3,12 @@ ...@@ -3,14 +3,12 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-7"> <div class="col-md-12">
<h1 class="heading">About The Developers</h1> <h1 class="heading">About The Developers</h1>
<h3><a href="/about/evilla">Evilla, Galen Solo E.</a></h3> <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/gomez">Gomez, Feliz Marie B.</a></h3>
<h3><a href="/about/guian">Guian, April D.</a></h3> <h3><a href="/about/guian">Guian, April D.</a></h3>
<h3><a href="/about/principe">Principe, Jasmine Nicole G.</a></h3> <h3><a href="/about/principe">Principe, Jasmine Nicole G.</a></h3>
</div>
</div>
</div> </div>
<h2>Hey <%=current_user.first_name%>!</h2> <div class ="container">
<br> <div class="row">
You Voted for: <div class="col-md-12">
<br> <h2>Hey <%=current_user.first_name%>!</h2>
<br>
<ul> You Voted for:
<br>
<ul>
<%current_user.votes.each do |v|%> <%current_user.votes.each do |v|%>
<li> <li>
<%="#{v.candidate.position.name}: #{v.candidate.full_name}"%> <%="#{v.candidate.position.name}: #{v.candidate.full_name}"%>
...@@ -12,4 +14,7 @@ You Voted for: ...@@ -12,4 +14,7 @@ You Voted for:
</p> </p>
</li> </li>
<%end%> <%end%>
</ul> </ul>
\ No newline at end of file </div>
</div>
</div>
\ No newline at end of file
<% provide(:vote, "active") %> <% provide(:vote, "active") %>
<% provide(:title, "Vote now!") %> <% 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>
<h2><center>Hello, <%= current_user.full_name %>!</center></h2>
<hr> <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|%> <%@positions.each do |p|%>
<li><%=p.name%><br> <li><%=p.name%><br>
<%voted_for = false%> <%voted_for = false%>
...@@ -27,8 +28,10 @@ ...@@ -27,8 +28,10 @@
<%end%> <%end%>
</li> </li>
<%end%> <%end%>
</ul> </ul>
<hr> <hr>
<br> <br>
</div>
</div>
</div>
\ No newline at end of file
<% provide(:vote, "active") %> <% provide(:vote, "active") %>
<% provide(:title, "Vote") %> <% 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