Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MIS21FinalsElection
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
Dean Krisitan Bardeloza
MIS21FinalsElection
Commits
547bd4b2
Commit
547bd4b2
authored
Jul 21, 2016
by
Dean Krisitan Bardeloza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed votes index
parent
68c2d345
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
application.html.erb
Election/app/views/layouts/application.html.erb
+2
-0
_form.html.erb
Election/app/views/votes/_form.html.erb
+1
-1
index.html.erb
Election/app/views/votes/index.html.erb
+2
-5
No files found.
Election/app/views/layouts/application.html.erb
View file @
547bd4b2
...
...
@@ -7,6 +7,8 @@
<%=
csrf_meta_tags
%>
</head>
<body>
<style
type=
"text/css"
>
body
{
background-color
:
rgba
(
245
,
245
,
245
,
0.9
)}
</style>
<%
if
user_signed_in?
%>
<%=
"You are logged in as:
#{
current_user
.
email
}
"
%>
<button
type=
"button"
class=
"btn btn-default"
>
<%=
link_to
'Edit Profile'
,
edit_user_registration_path
%>
</button>
<button
type=
"button"
class=
"btn btn-default"
>
<%=
link_to
"Log Out"
,
destroy_user_session_path
,
method: :delete
%>
</button>
<%
else
%>
...
...
Election/app/views/votes/_form.html.erb
View file @
547bd4b2
...
...
@@ -8,7 +8,7 @@
<div
class=
"col-md-6"
>
<%=
f
.
association
:candidate
,
:collection
=>
Candidate
.
where
(
position_id:
(
p
.
id
)),
include_blank:
false
,
:label_method
=>
lambda
{
|
candidate
|
"
#{
candidate
.
last_name
}
,
#{
candidate
.
first_name
}
"
},
as: :radio_buttons
,
label:
"Candidates: "
%>
<%
Candidate
.
where
(
position_id:
(
p
.
id
)).
each
do
|
candidate
|
%>
<p>
<div
class=
"btn btn-primary btn-xs"
data-toggle=
"popover"
data-content=
"
<%=
candidate
.
slogan
%>
"
style=
"margin-top: 2px; margin-bottom: 1px"
,
data-trigger=
"focus"
,
role=
"button"
,
tabindex=
"0"
,
title=
"
<%=
candidate
.
first_name
%>
<%=
candidate
.
last_name
%>
"
>
View
<%=
candidate
.
last_name
%>
's Slogan
</div
></p>
<p>
Slogan:
<%=
candidate
.
slogan
%
>
</p>
<%
end
-%>
</div>
<div
class=
"col-md-6"
>
...
...
Election/app/views/votes/index.html.erb
View file @
547bd4b2
<h1>
Votes
</h1>
<%=
link_to
"Vote Now!"
,
votes_new_path
%>
<table
width=
"100%"
>
<tr>
<th>
#
</th>
<th>
User ID
</th>
<th>
Vote ID
</th>
<th>
Candidate
</th>
<th>
Position
</th>
<th>
Comments
</th>
...
...
@@ -11,8 +9,7 @@
<%
@votes
.
each
do
|
vote
|
%>
<tr>
<td>
<%=
link_to
"
#{
vote
.
id
}
"
,
vote_path
(
vote
.
id
)
%>
</td>
<td>
<%=
vote
.
user_id
%>
</td>
<td>
<%=
vote
.
id
%>
</td>
<td>
<%=
vote
.
candidate
.
first_name
%>
"
<%=
vote
.
candidate
.
nickname
%>
"
<%=
vote
.
candidate
.
last_name
%>
</td>
...
...
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