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
e296d3d4
Commit
e296d3d4
authored
Jul 20, 2016
by
Wills Gomez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed the nav bar and other page changes
parent
37e830e0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
24 deletions
+15
-24
show.html.erb
Halalan/app/views/admin/candidates/show.html.erb
+3
-4
index.html.erb
Halalan/app/views/admin/positions/index.html.erb
+3
-2
_navbar.html.erb
Halalan/app/views/layouts/_navbar.html.erb
+5
-4
index.html.erb
Halalan/app/views/pages/index.html.erb
+3
-13
index.html.erb
Halalan/app/views/voting/votes/index.html.erb
+1
-1
No files found.
Halalan/app/views/admin/candidates/show.html.erb
View file @
e296d3d4
<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
%>
<h1><center>
<%=
@candidate
.
full_name
%>
</center></h1>
<center>
<%=
link_to
"Edit"
,
edit_admin_candidate_path
(
@candidate
.
id
)
%>
<%=
link_to
"Delete"
,
admin_candidate_path
(
@candidate
.
id
),
method: :delete
%>
</center>
<br>
<h3>
Position:
<%=
@candidate
.
position
.
name
%>
</h3>
<%
...
...
Halalan/app/views/admin/positions/index.html.erb
View file @
e296d3d4
<h1>
Positions
</h1>
<h1><center>
POSITIONS
</center></h1>
<center>
<%=
link_to
"Add New Position"
,
new_admin_position_path
%>
</center>
<%=
link_to
"Add New Position"
,
new_admin_position_path
%>
<hr>
<%
@positions
.
each
do
|
c
|
%>
...
...
Halalan/app/views/layouts/_navbar.html.erb
View file @
e296d3d4
...
...
@@ -14,18 +14,19 @@
<div
class=
"collapse navbar-collapse"
id=
"bs-example-navbar-collapse-1"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<li><a
href=
"/profile"
>
Hello,
<%=
current_user
.
first_name
%>
!
</a></li>
<li>
<%=
link_to
"Home"
,
root_path
%>
</li>
<li>
<%=
link_to
"Candidates"
,
admin_candidates_path
%>
</li>
<li>
<%=
link_to
"Positions"
,
admin_positions_path
%>
</li>
<li><a
href=
"/voting/votes"
>
Vote now
</li>
<li>
<a
href=
"/about"
>
About
</a>
</li>
<%
if
user_signed_in?
%>
<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"
><b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
>
<li>
<a
href=
"/profile"
>
My Profile
</a>
</li>
<li>
<a
href=
"/voting/votes"
>
Vote now
</li>
<li>
<%=
link_to
"Logout"
,
destroy_user_session_path
,
method: :delete
%>
</li>
</u1>
</li>
...
...
Halalan/app/views/pages/index.html.erb
View file @
e296d3d4
<div
class =
"index"
>
<h1><center>
Current Vote Tally
</center></h1>
<br>
<br>
<%
if
user_signed_in?
%>
<%
case
current_user
.
role
%>
<%
when
'voter'
%>
<h3>
Welcome, Voter
</h3>
<%
when
'admin'
%>
<h3>
Welcome, Administrator
</h3>
<%
end
%>
<%
else
%>
<h3>
Welcome
</h3>
<%
end
%>
<%
@positions
.
each
do
|
p
|
%>
<div
class =
"section"
>
<div
class =
"box"
>
<h
4><center>
<%=
p
.
name
%>
</center></h4
>
<h
2><center>
<%=
p
.
name
%>
</center></h2
>
<table>
<thead>
<th><center>
</center></th>
<th><center>
Name
</center></th>
<th
colspan=
"2"
><center>
Votes
</center></th>
<th><center>
Votes
</center></th>
<th><center>
</center></th>
</thead>
<%
total
=
0
%>
...
...
@@ -35,7 +26,6 @@
<td></td>
<td><center>
<%=
link_to
c
.
full_name
,
admin_candidate_path
(
c
.
id
)
%>
</center></td>
<td><center>
<%=
c
.
votes
.
count
%>
</center></td>
<td><center><progress
value=
"
<%=
c
.
votes
.
count
%>
"
max=
"
<%=
total
%>
"
>
(
<%=
c
.
votes
.
count
%>
)
</center></td>
</tr>
<%
end
%>
</table>
...
...
Halalan/app/views/voting/votes/index.html.erb
View file @
e296d3d4
...
...
@@ -12,7 +12,7 @@
<%
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
%>
-
<%=
v
.
candidate
.
full_name
%>
<%
voted_for
=
true
%>
<%
end
%>
<%
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