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
AkosiCrux
final_project
Commits
aa2be4cf
Commit
aa2be4cf
authored
Jul 20, 2016
by
Vincent Agbayani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macasaet- comments, gozum-vote record, gonzales- delete, agbayani-userarchive
parent
5d136e98
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
30 deletions
+50
-30
candidates_controller.rb
sus_final/app/controllers/admin/candidates_controller.rb
+1
-1
candidates_controller.rb
sus_final/app/controllers/candidates_controller.rb
+1
-1
pages_controller.rb
sus_final/app/controllers/pages_controller.rb
+8
-3
index.html.erb
sus_final/app/views/candidates/index.html.erb
+1
-1
application.html.erb
sus_final/app/views/layouts/application.html.erb
+14
-0
about.html.erb
sus_final/app/views/pages/about.html.erb
+4
-4
index.html.erb
sus_final/app/views/pages/index.html.erb
+2
-13
archive.html.erb
sus_final/app/views/users/archive.html.erb
+15
-0
users_summary.html.erb
sus_final/app/views/users/users_summary.html.erb
+3
-7
routes.rb
sus_final/config/routes.rb
+1
-0
No files found.
sus_final/app/controllers/admin/candidates_controller.rb
View file @
aa2be4cf
...
...
@@ -42,7 +42,7 @@ class CandidatesController < ApplicationController
end
def
destroy
Candidate
.
find
(
params
[
:id
]).
de
lete_all
Candidate
.
find
(
params
[
:id
]).
de
stroy
redirect_to
admin_candidates_path
end
...
...
sus_final/app/controllers/candidates_controller.rb
View file @
aa2be4cf
...
...
@@ -43,7 +43,7 @@ class CandidatesController < ApplicationController
render
"candidates/show.html.erb"
end
def
de
stroy
def
de
lete_all
Candidate
.
where
(
params
[
:id
]).
delete_all
redirect_to
candidates_path
end
...
...
sus_final/app/controllers/pages_controller.rb
View file @
aa2be4cf
...
...
@@ -18,17 +18,22 @@ class PagesController < ApplicationController
id
=
params
[
:id
]
@user
=
User
.
find
(
id
.
to_i
)
@votes
=
current_user
.
votes
@votes
.
each
do
|
x
|
@archive
=
Userarchive
.
new
@archive
.
name
=
@user
.
email
@archive
.
candidate
=
"
#{
x
.
candidate
.
first_name
}
#{
x
.
candidate
.
last_name
}
"
@archive
.
position
=
x
.
candidate
.
position
_id
@archive
.
position
=
x
.
candidate
.
position
.
name
@archive
.
save
end
@user
.
destroy
!
@user
.
destroy
redirect_to
users_path
end
def
archive
@archive
=
Userarchive
.
all
render
"users/archive.html.erb"
end
end
sus_final/app/views/candidates/index.html.erb
View file @
aa2be4cf
...
...
@@ -38,7 +38,7 @@
<tbody>
<tr>
<%
@candidates
.
each
do
|
a
|
%>
<td>
<%=
a
.
position
.
name
%>
</td>
<td>
<%=
a
.
position
.
name
%>
</td>
<td>
<%=
a
.
first_name
%>
</td>
<td>
<%=
a
.
last_name
%>
</td>
<td>
<%=
a
.
nickname
%>
</td>
...
...
sus_final/app/views/layouts/application.html.erb
View file @
aa2be4cf
...
...
@@ -7,6 +7,20 @@
<%=
csrf_meta_tags
%>
</head>
<body>
<div
class =
"container-fluid"
>
<nav
class=
"navbar navbar-inverse navbar-fixed-top "
>
<ul
class=
"nav navbar-nav navbartxt"
>
<li
class=
"active"
>
<%=
link_to
"HOME"
,
root_path
%>
</li>
<li
>
<%=
link_to
"VOTE TALLY"
,
candidates_list_path
%>
</li>
<li>
<%=
link_to
"CANDITATE LIST"
,
candidates_path
%>
</li>
<li>
<%=
link_to
"VOTES RECORD"
,
vote_history_path
%>
</li>
<li>
<%=
link_to
"ABOUT"
,
about_path
%>
</li>
<li><a
href =
"/users"
>
USERS
</a><li>
</ul>
</nav>
</div>
<%
if
user_signed_in?
%>
Welcome,
<%=
current_user
.
email
%>
! Your voter id is
<%=
current_user
.
id
%>
!
...
...
sus_final/app/views/pages/about.html.erb
View file @
aa2be4cf
...
...
@@ -43,25 +43,25 @@
<%=
image_tag
"designer.png"
,
class
:"pull-right"
%>
<h1>
John Vincent Agbayani
</h1>
<h2>
Design
er
</h2>
<h2>
Lead Designer/Associate Develop
er
</h2>
</div>
<div
id=
"section2"
class=
"container-fluid"
>
<%=
image_tag
"developer.png"
,
size
:"336x150"
,
class
:"pull-right"
%>
<h1>
Henry Gonzales
</h1>
<h2>
Developer
</h2>
<h2>
Lead
Developer
</h2>
</div>
<div
id=
"section3"
class=
"container-fluid"
>
<%=
image_tag
"designer.png"
,
class
:"pull-right"
%>
<h1>
Jan Paulo Gozum
</h1>
<h2>
Design
er
</h2>
<h2>
Associate Designer/Associate Develop
er
</h2>
</div>
<div
id=
"section41"
class=
"container-fluid"
>
<%=
image_tag
"developer.png"
,
size
:"336x150"
,
class
:"pull-right"
%>
<h1>
Juan Paulo Macasaet
</h1>
<h2>
Developer
</h2>
<h2>
Lead
Developer
</h2>
</div>
...
...
sus_final/app/views/pages/index.html.erb
View file @
aa2be4cf
<div
class =
"container-fluid"
>
<nav
class=
"navbar navbar-inverse navbar-fixed-top "
>
<ul
class=
"nav navbar-nav navbartxt"
>
<li
class=
"active"
>
<%=
link_to
"HOME"
,
root_path
%>
</li>
<li
>
<%=
link_to
"VOTE TALLY"
,
candidates_list_path
%>
</li>
<li>
<%=
link_to
"CANDITATE LIST"
,
candidates_path
%>
</li>
<li>
<%=
link_to
"VOTES RECORD"
,
vote_history_path
%>
</li>
<li>
<%=
link_to
"ABOUT"
,
about_path
%>
</li>
<li><a
href =
"/users"
>
USERS
</a><li>
</ul>
</nav>
<br><br><br>
<div
class =
"row"
>
<div
class =
"col-md-2 col-md-offset-2"
>
...
...
sus_final/app/views/users/archive.html.erb
0 → 100644
View file @
aa2be4cf
<br><br>
<table>
<th>
USER
</th>
<th>
CANDIDATE
</th>
<th>
POSITION
</th>
<%
@archive
.
each
do
|
a
|
%>
<tr>
<td>
<%=
a
.
name
%>
</td>
<td>
<%=
a
.
candidate
%>
</td>
<td>
<%=
a
.
position
%>
</td>
<%
end
%>
</tr>
</table>
\ No newline at end of file
sus_final/app/views/users/users_summary.html.erb
View file @
aa2be4cf
<
h1>
test
</h1
>
<
br><br
>
<table>
<tr>
<th>
USERS
</th>
...
...
@@ -17,9 +17,5 @@
<%
end
%>
</tr>
</table>
<%
@archive
.
each
do
|
a
|
%>
<h1>
<%=
a
.
name
%>
</h1>
<h1>
<%=
a
.
candidate
%>
</h1>
<h1>
<%=
a
.
position
%>
</h1>
<%
end
%>
\ No newline at end of file
<br>
<a
href =
"/archive"
class =
"btn btn-primary"
>
View Archived Users
</a>
\ No newline at end of file
sus_final/config/routes.rb
View file @
aa2be4cf
...
...
@@ -5,6 +5,7 @@ Rails.application.routes.draw do
get
"/about"
,
to:
"pages#about"
get
"/user_profile"
,
to:
"votes#user_profile"
get
"/delete/:id"
,
to:
"pages#archive_user"
get
"/archive"
,
to:
"pages#archive"
get
"/users"
,
to:
"pages#users_summary"
get
"/users_summary"
,
to:
"users#users_summary"
resources
:candidates
...
...
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