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
Show 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
...
@@ -42,7 +42,7 @@ class CandidatesController < ApplicationController
end
end
def
destroy
def
destroy
Candidate
.
find
(
params
[
:id
]).
de
lete_all
Candidate
.
find
(
params
[
:id
]).
de
stroy
redirect_to
admin_candidates_path
redirect_to
admin_candidates_path
end
end
...
...
sus_final/app/controllers/candidates_controller.rb
View file @
aa2be4cf
...
@@ -43,7 +43,7 @@ class CandidatesController < ApplicationController
...
@@ -43,7 +43,7 @@ class CandidatesController < ApplicationController
render
"candidates/show.html.erb"
render
"candidates/show.html.erb"
end
end
def
de
stroy
def
de
lete_all
Candidate
.
where
(
params
[
:id
]).
delete_all
Candidate
.
where
(
params
[
:id
]).
delete_all
redirect_to
candidates_path
redirect_to
candidates_path
end
end
...
...
sus_final/app/controllers/pages_controller.rb
View file @
aa2be4cf
...
@@ -18,17 +18,22 @@ class PagesController < ApplicationController
...
@@ -18,17 +18,22 @@ class PagesController < ApplicationController
id
=
params
[
:id
]
id
=
params
[
:id
]
@user
=
User
.
find
(
id
.
to_i
)
@user
=
User
.
find
(
id
.
to_i
)
@votes
=
current_user
.
votes
@votes
=
current_user
.
votes
@votes
.
each
do
|
x
|
@votes
.
each
do
|
x
|
@archive
=
Userarchive
.
new
@archive
=
Userarchive
.
new
@archive
.
name
=
@user
.
email
@archive
.
name
=
@user
.
email
@archive
.
candidate
=
"
#{
x
.
candidate
.
first_name
}
#{
x
.
candidate
.
last_name
}
"
@archive
.
candidate
=
"
#{
x
.
candidate
.
first_name
}
#{
x
.
candidate
.
last_name
}
"
@archive
.
position
=
x
.
candidate
.
position
_id
@archive
.
position
=
x
.
candidate
.
position
.
name
@archive
.
save
@archive
.
save
end
end
@user
.
destroy
!
@user
.
destroy
redirect_to
users_path
redirect_to
users_path
end
end
def
archive
@archive
=
Userarchive
.
all
render
"users/archive.html.erb"
end
end
end
sus_final/app/views/candidates/index.html.erb
View file @
aa2be4cf
sus_final/app/views/layouts/application.html.erb
View file @
aa2be4cf
...
@@ -7,6 +7,20 @@
...
@@ -7,6 +7,20 @@
<%=
csrf_meta_tags
%>
<%=
csrf_meta_tags
%>
</head>
</head>
<body>
<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?
%>
<%
if
user_signed_in?
%>
Welcome,
<%=
current_user
.
email
%>
! Your voter id is
<%=
current_user
.
id
%>
!
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 @@
...
@@ -43,25 +43,25 @@
<%=
image_tag
"designer.png"
,
class
:"pull-right"
%>
<%=
image_tag
"designer.png"
,
class
:"pull-right"
%>
<h1>
John Vincent Agbayani
</h1>
<h1>
John Vincent Agbayani
</h1>
<h2>
Design
er
</h2>
<h2>
Lead Designer/Associate Develop
er
</h2>
</div>
</div>
<div
id=
"section2"
class=
"container-fluid"
>
<div
id=
"section2"
class=
"container-fluid"
>
<%=
image_tag
"developer.png"
,
size
:"336x150"
,
class
:"pull-right"
%>
<%=
image_tag
"developer.png"
,
size
:"336x150"
,
class
:"pull-right"
%>
<h1>
Henry Gonzales
</h1>
<h1>
Henry Gonzales
</h1>
<h2>
Developer
</h2>
<h2>
Lead
Developer
</h2>
</div>
</div>
<div
id=
"section3"
class=
"container-fluid"
>
<div
id=
"section3"
class=
"container-fluid"
>
<%=
image_tag
"designer.png"
,
class
:"pull-right"
%>
<%=
image_tag
"designer.png"
,
class
:"pull-right"
%>
<h1>
Jan Paulo Gozum
</h1>
<h1>
Jan Paulo Gozum
</h1>
<h2>
Design
er
</h2>
<h2>
Associate Designer/Associate Develop
er
</h2>
</div>
</div>
<div
id=
"section41"
class=
"container-fluid"
>
<div
id=
"section41"
class=
"container-fluid"
>
<%=
image_tag
"developer.png"
,
size
:"336x150"
,
class
:"pull-right"
%>
<%=
image_tag
"developer.png"
,
size
:"336x150"
,
class
:"pull-right"
%>
<h1>
Juan Paulo Macasaet
</h1>
<h1>
Juan Paulo Macasaet
</h1>
<h2>
Developer
</h2>
<h2>
Lead
Developer
</h2>
</div>
</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>
<br><br><br>
<div
class =
"row"
>
<div
class =
"row"
>
<div
class =
"col-md-2 col-md-offset-2"
>
<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>
<table>
<tr>
<tr>
<th>
USERS
</th>
<th>
USERS
</th>
...
@@ -17,9 +17,5 @@
...
@@ -17,9 +17,5 @@
<%
end
%>
<%
end
%>
</tr>
</tr>
</table>
</table>
<br>
<%
@archive
.
each
do
|
a
|
%>
<a
href =
"/archive"
class =
"btn btn-primary"
>
View Archived Users
</a>
<h1>
<%=
a
.
name
%>
</h1>
\ No newline at end of file
<h1>
<%=
a
.
candidate
%>
</h1>
<h1>
<%=
a
.
position
%>
</h1>
<%
end
%>
\ No newline at end of file
sus_final/config/routes.rb
View file @
aa2be4cf
...
@@ -5,6 +5,7 @@ Rails.application.routes.draw do
...
@@ -5,6 +5,7 @@ Rails.application.routes.draw do
get
"/about"
,
to:
"pages#about"
get
"/about"
,
to:
"pages#about"
get
"/user_profile"
,
to:
"votes#user_profile"
get
"/user_profile"
,
to:
"votes#user_profile"
get
"/delete/:id"
,
to:
"pages#archive_user"
get
"/delete/:id"
,
to:
"pages#archive_user"
get
"/archive"
,
to:
"pages#archive"
get
"/users"
,
to:
"pages#users_summary"
get
"/users"
,
to:
"pages#users_summary"
get
"/users_summary"
,
to:
"users#users_summary"
get
"/users_summary"
,
to:
"users#users_summary"
resources
:candidates
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