Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finalproject
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
AngKo_Catolico_Ilicito_Reyes
finalproject
Commits
c8612200
Commit
c8612200
authored
Jul 20, 2016
by
Norence Ilicito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
admin module
parent
168e4c7b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
0 deletions
+104
-0
_form.html.erb
election_2016/app/views/admin/_form.html.erb
+10
-0
edit.html.erb
election_2016/app/views/admin/edit.html.erb
+8
-0
index.html.erb
election_2016/app/views/admin/index.html.erb
+64
-0
new.html.erb
election_2016/app/views/admin/new.html.erb
+7
-0
show.html.erb
election_2016/app/views/admin/show.html.erb
+14
-0
index.html.erb
election_2016/app/views/pages/index.html.erb
+1
-0
No files found.
election_2016/app/views/admin/_form.html.erb
0 → 100644
View file @
c8612200
<link
rel
"
stylesheet
"
type=
"text/css"
href=
"application.css"
>
<%=
simple_form_for
([
:admin
,
@candidate
])
do
|
f
|
%>
<%=
f
.
association
:position
%>
<%=
f
.
input
:first_name
%>
<%=
f
.
input
:last_name
%>
<%=
f
.
input
:nickname
%>
<%=
f
.
input
:slogan
%>
<%=
f
.
submit
%>
<%
end
%>
election_2016/app/views/admin/edit.html.erb
0 → 100644
View file @
c8612200
<link
rel
"
stylesheet
"
type=
"text/css"
href=
"application.css"
>
<h1>
Edit Candidate
</h1>
<%=
render
partial:
"form"
%>
<%=
link_to
"Back to Candidates"
,
admin_candidates_path
%>
election_2016/app/views/admin/index.html.erb
0 → 100644
View file @
c8612200
<link
rel
"
stylesheet
"
type=
"text/css"
href=
"application.css"
>
<body>
<div
class=
"box fade-in one"
>
<h1
style=
"margin-left:100px;margin-top:100px;font-family:Droid Sans"
>
Election 2016
</h1>
<h3
style=
"color:#0080ff;margin-left:100px"
>
<%=
link_to
"MIS 21 - B DataBAES"
,
"/about"
%>
</h3>
<h4
style=
"color:#0080ff;margin-left:100px"
>
<%
if
user_signed_in?
%>
Hello
<%=
current_user
.
email
%>
!
<br>
<h4
style=
"margin-left:100px"
>
<%=
link_to
"Profile"
,
"/profiles"
%>
<%=
link_to
(
'Log Out'
,
destroy_user_session_path
,
:method
=>
:delete
)
%>
</h4>
<%
else
%>
<h5
style=
"color:#0080ff;margin-left:100px"
>
You're not signed in.
<%=
link_to
"Login"
,
new_user_session_path
%>
<%=
link_to
"Register"
,
new_user_registration_path
%>
<%=
link_to
"Admin"
,
"admin/index.html.erb"
%>
</h5>
<%
end
%>
</h4>
<h2>
List of Candidate
</h2>
<%=
link_to
(
"Add Candidate"
,
new_admin_candidate_path
)
%>
<table
width=
"100%"
style=
"margin:100px;"
>
<tr>
<th>
Candidate ID
</th>
<th>
First Name
</th>
<th>
Last Name
</th>
<th>
Slogan
</th>
<th>
Number of Votes
</th>
</tr>
<%
@candidates
.
each
do
|
candidate
|
%>
<tr>
<td>
<%=
candidate
.
id
%>
</td>
<td>
<%=
candidate
.
first_name
%>
</td>
<td>
<%=
candidate
.
last_name
%>
</td>
<td>
<%=
candidate
.
slogan
%>
</td>
<td>
<%=
candidate
.
votes
.
count
%>
</td>
<td>
<%=
link_to
"Show "
,
candidate_path
(
candidate
.
id
)
%>
<%=
link_to
"Edit"
,
edit_candidate_path
(
candidate
.
id
)
%>
<%=
link_to
"Delete"
,
candidate_path
(
candidate
.
id
),
method: :delete
,
data:
{
confirm:
'Are you sure?'
}
%>
</td>
</tr>
<%
end
%>
</table>
</div>
</body>
election_2016/app/views/admin/new.html.erb
0 → 100644
View file @
c8612200
<link
rel
"
stylesheet
"
type=
"text/css"
href=
"application.css"
>
<h1>
New Candidate
</h1>
<%=
render
partial:
"form"
%>
<%=
link_to
"Back to Candidates"
,
admin_candidates_path
%>
election_2016/app/views/admin/show.html.erb
0 → 100644
View file @
c8612200
<link
rel
"
stylesheet
"
type=
"text/css"
href=
"application.css"
>
<h1>
<%=
@candidate
.
nickname
%>
</h1>
<br>
<ul>
<li>
<%=
@candidate
.
first_name
%>
</li>
<li>
<%=
@candidate
.
last_name
%>
</li>
<li>
<%=
@candidate
.
slogan
%>
</li>
</ul>
<hr>
<%=
link_to
"Back to Candidates"
,
admin_candidates_path
%>
election_2016/app/views/pages/index.html.erb
View file @
c8612200
...
...
@@ -22,6 +22,7 @@
You're not signed in.
<%=
link_to
"Login"
,
new_user_session_path
%>
<%=
link_to
"Register"
,
new_user_registration_path
%>
<%=
link_to
"Admin"
,
"admin/index.html.erb"
%>
</h5>
<%
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