Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
final_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
evilla_gomez_guian_principe
final_project
Commits
20ed913c
Commit
20ed913c
authored
Jul 20, 2016
by
Galen Evilla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic web design! please improve this haha!
parent
8f091499
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
421 additions
and
180 deletions
+421
-180
_form.html.erb
Halalan-trial/app/views/admin/candidates/_form.html.erb
+3
-0
edit.html.erb
Halalan-trial/app/views/admin/candidates/edit.html.erb
+9
-3
index.html.erb
Halalan-trial/app/views/admin/candidates/index.html.erb
+1
-1
new.html.erb
Halalan-trial/app/views/admin/candidates/new.html.erb
+9
-2
show.html.erb
Halalan-trial/app/views/admin/candidates/show.html.erb
+64
-57
edit.html.erb
Halalan-trial/app/views/admin/positions/edit.html.erb
+9
-3
index.html.erb
Halalan-trial/app/views/admin/positions/index.html.erb
+28
-13
new.html.erb
Halalan-trial/app/views/admin/positions/new.html.erb
+10
-2
show.html.erb
Halalan-trial/app/views/admin/positions/show.html.erb
+19
-13
new.html.erb
Halalan-trial/app/views/devise/registrations/new.html.erb
+25
-19
new.html.erb
Halalan-trial/app/views/devise/sessions/new.html.erb
+18
-12
_footer.html.erb
Halalan-trial/app/views/layouts/_footer.html.erb
+6
-0
_navbar.html.erb
Halalan-trial/app/views/layouts/_navbar.html.erb
+6
-5
application.html.erb
Halalan-trial/app/views/layouts/application.html.erb
+3
-0
about.html.erb
Halalan-trial/app/views/pages/about.html.erb
+3
-5
profile.html.erb
Halalan-trial/app/views/pages/profile.html.erb
+20
-15
index.html.erb
Halalan-trial/app/views/voting/votes/index.html.erb
+30
-27
new.html.erb
Halalan-trial/app/views/voting/votes/new.html.erb
+9
-3
simple_form_bootstrap.rb
Halalan-trial/config/initializers/simple_form_bootstrap.rb
+149
-0
No files found.
Halalan-trial/app/views/admin/candidates/_form.html.erb
View file @
20ed913c
<%=
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: '
%>
...
...
Halalan-trial/app/views/admin/candidates/edit.html.erb
View file @
20ed913c
<%
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
Halalan-trial/app/views/admin/candidates/index.html.erb
View file @
20ed913c
...
...
@@ -10,7 +10,7 @@
</center>
<%
@positions
.
each
do
|
p
|
%>
<hr>
<h
1><center>
<%=
p
.
name
%>
</center></h1
>
<h
3><center>
<%=
p
.
name
%>
</center></h3
>
<table
class=
"table table-hover"
>
<thead>
<th><center>
Name
</center></th>
...
...
Halalan-trial/app/views/admin/candidates/new.html.erb
View file @
20ed913c
<%
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>
Halalan-trial/app/views/admin/candidates/show.html.erb
View file @
20ed913c
<%
provide
(
:candidate
,
"active"
)
%>
<%
provide
(
:title
,
"
#{
@candidate
.
full_name
}
"
)
%>
<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>
<%
m
=
0
f
=
0
l
=
0
@candidate
.
votes
.
each
do
|
v
|
if
v
.
user
!=
nil
if
v
.
user
.
gender
==
"Male"
m
=
m
+
1
else
if
v
.
user
.
gender
==
"Female"
f
=
f
+
1
else
l
=
l
+
1
end
end
end
%>
<%
end
%>
<hr>
<h3>
Slogan:
<%=
@candidate
.
slogan
%>
</h3>
<hr>
<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>
<%
m
=
0
f
=
0
l
=
0
@candidate
.
votes
.
each
do
|
v
|
if
v
.
user
!=
nil
if
v
.
user
.
gender
==
"Male"
m
=
m
+
1
else
if
v
.
user
.
gender
==
"Female"
f
=
f
+
1
else
l
=
l
+
1
end
end
end
%>
<%
end
%>
<br>
<h3>
Slogan:
<%=
@candidate
.
slogan
%>
</h3>
<br>
<center>
<table
class=
"table table-hover"
>
<h4>
Gender of Voters
</h4>
<tr>
<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><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>
</center>
<hr>
<table
width=
"100%"
>
<h4>
Gender of Voters
</h4>
<tr>
<th>
Male Voters
</th>
<th>
Female Voters
</th>
<th>
LGBT Voters
</th>
<th>
Total Votes
</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>
</tr>
</table>
<hr>
<h3>
Voters who voted for
<%=
@candidate
.
full_name
%>
</h3>
<ul>
<li>
<%
@candidate
.
votes
.
each
do
|
v
|
%>
<%=
"
#{
v
.
user
.
full_name
}
"
%>
<p>
Comments:
<%=
v
.
comment
%>
</p>
</li>
<%
end
%>
</ul>
<h3>
Voters who voted for
<%=
@candidate
.
full_name
%>
</h3>
<ul>
<li>
<%
@candidate
.
votes
.
each
do
|
v
|
%>
<%=
"
#{
v
.
user
.
full_name
}
"
%>
<p>
Comments:
<%=
v
.
comment
%>
</p>
</li>
<%
end
%>
</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
Halalan-trial/app/views/admin/positions/edit.html.erb
View file @
20ed913c
<%
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
Halalan-trial/app/views/admin/positions/index.html.erb
View file @
20ed913c
<%
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>
Halalan-trial/app/views/admin/positions/new.html.erb
View file @
20ed913c
<%
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>
Halalan-trial/app/views/admin/positions/show.html.erb
View file @
20ed913c
<%
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>
<%
@position
.
candidates
.
each
do
|
c
|
%>
<li>
<%=
link_to
c
.
full_name
,
admin_candidate_path
(
c
.
id
)
%>
</li>
<%
end
%>
</ul>
<ul>
<%
@position
.
candidates
.
each
do
|
c
|
%>
<li>
<%=
link_to
c
.
full_name
,
admin_candidate_path
(
c
.
id
)
%>
</li>
<%
end
%>
</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
Halalan-trial/app/views/devise/registrations/new.html.erb
View file @
20ed913c
<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
|
%>
<%=
f
.
error_notification
%>
<%=
simple_form_for
(
resource
,
as:
resource_name
,
url:
registration_path
(
resource_name
),
:html
=>
{
:role
=>
'form'
})
do
|
f
|
%>
<%=
f
.
error_notification
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:first_name
,
required:
true
,
autofocus:
true
%>
<%=
f
.
input
:last_name
,
required:
true
%>
<%=
f
.
input
:birthday
,
:start_year
=>
Date
.
today
.
year
-
18
,
:end_year
=>
1920
,
:order
=>
[
:day
,
:month
,
:year
],
:required
=>
true
%>
<%=
f
.
input
:gender
,
as: :select
,
collection:
[
"Male"
,
"Female"
,
"LGBT"
],
required:
true
%>
<%=
f
.
input
:email
,
required:
true
%>
<%=
f
.
input
:password
,
required:
true
,
hint:
(
"
#{
@minimum_password_length
}
characters minimum"
if
@minimum_password_length
)
%>
<%=
f
.
input
:password_confirmation
,
required:
true
%>
</div>
<div
class=
"form-inputs"
>
<%=
f
.
input
:first_name
,
required:
true
,
autofocus:
true
%>
<%=
f
.
input
:last_name
,
required:
true
%>
<%=
f
.
input
:birthday
,
:start_year
=>
Date
.
today
.
year
-
18
,
:end_year
=>
1920
,
:order
=>
[
:day
,
:month
,
:year
],
:required
=>
true
%>
<%=
f
.
input
:gender
,
as: :select
,
collection:
[
"Male"
,
"Female"
,
"LGBT"
],
required:
true
%>
<%=
f
.
input
:email
,
required:
true
%>
<%=
f
.
input
:password
,
required:
true
,
hint:
(
"
#{
@minimum_password_length
}
characters minimum"
if
@minimum_password_length
)
%>
<%=
f
.
input
:password_confirmation
,
required:
true
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Sign up"
%>
</div>
<%
end
%>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Sign up"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
<%=
render
"devise/shared/links"
%>
</div>
</div>
</div>
Halalan-trial/app/views/devise/sessions/new.html.erb
View file @
20ed913c
<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
|
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:email
,
required:
false
,
autofocus:
true
%>
<%=
f
.
input
:password
,
required:
false
%>
<%=
f
.
input
:remember_me
,
as: :boolean
if
devise_mapping
.
rememberable?
%>
</div>
<%=
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
%>
<%=
f
.
input
:remember_me
,
as: :boolean
if
devise_mapping
.
rememberable?
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Log in"
%>
</div>
<%
end
%>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Log in"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
<%=
render
"devise/shared/links"
%>
</div>
</div>
</div>
Halalan-trial/app/views/layouts/_footer.html.erb
0 → 100644
View file @
20ed913c
<hr>
<footer
class=
"footer"
>
<div
class=
"container"
>
<p>
©
2016 HalalanPhMIS21, Inc.
</p>
</div>
</footer>
\ No newline at end of file
Halalan-trial/app/views/layouts/_navbar.html.erb
View file @
20ed913c
...
...
@@ -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>
<%=
link_to
"Logout"
,
destroy_user_session_path
,
method: :delete
%>
</li>
</u1>
</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>
...
...
Halalan-trial/app/views/layouts/application.html.erb
View file @
20ed913c
...
...
@@ -9,8 +9,11 @@
<body>
<%=
render
'/layouts/navbar'
%>
<%=
yield
%>
</body>
<%=
render
'/layouts/footer'
%>
</html>
Halalan-trial/app/views/pages/about.html.erb
View file @
20ed913c
...
...
@@ -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>
Halalan-trial/app/views/pages/profile.html.erb
View file @
20ed913c
<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
}
"
%>
<p>
Comments:
<%=
v
.
comment
%>
</p>
</li>
<%
end
%>
</ul>
\ No newline at end of file
<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
}
"
%>
<p>
Comments:
<%=
v
.
comment
%>
</p>
</li>
<%
end
%>
</ul>
</div>
</div>
</div>
\ No newline at end of file
Halalan-trial/app/views/voting/votes/index.html.erb
View file @
20ed913c
<%
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>
<%
@positions
.
each
do
|
p
|
%>
<li>
<%=
p
.
name
%>
<br>
<%
voted_for
=
false
%>
<%
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
%>
<%
voted_for
=
true
%>
<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
%>
<%
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
%>
<%
voted_for
=
true
%>
<%
end
%>
<%
end
%>
<%
end
%>
</ol>
<%
if
!
voted_for
%>
<%=
link_to
"Vote for a
#{
p
.
name
}
"
,
"/voting/new/
#{
p
.
id
}
"
%>
<%
else
%>
<%
end
%>
</li>
<%
end
%>
<%
end
%>
</ol>
<%
if
!
voted_for
%>
<%=
link_to
"Vote for a
#{
p
.
name
}
"
,
"/voting/new/
#{
p
.
id
}
"
%>
<%
else
%>
<%
end
%>
</li>
<%
end
%>
</ul>
<hr>
<br>
</ul>
<hr>
<br>
</div>
</div>
</div>
\ No newline at end of file
Halalan-trial/app/views/voting/votes/new.html.erb
View file @
20ed913c
<%
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>
Halalan-trial/config/initializers/simple_form_bootstrap.rb
0 → 100644
View file @
20ed913c
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment