Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
candi-date-tayo
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
George Nicole Balmaceda
candi-date-tayo
Commits
5a8f703c
Commit
5a8f703c
authored
Jul 18, 2016
by
royce-matthew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a ton of changes
parent
40a63f06
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
746 additions
and
5 deletions
+746
-5
skeleton.css
app/assets/stylesheets/skeleton.css
+418
-0
style.css
app/assets/stylesheets/style.css
+40
-0
application_controller.rb
app/controllers/application_controller.rb
+10
-1
show.html.erb
app/views/admin/candidates/show.html.erb
+43
-2
new.html.erb
app/views/devise/confirmations/new.html.erb
+16
-0
confirmation_instructions.html.erb
app/views/devise/mailer/confirmation_instructions.html.erb
+5
-0
password_change.html.erb
app/views/devise/mailer/password_change.html.erb
+3
-0
reset_password_instructions.html.erb
app/views/devise/mailer/reset_password_instructions.html.erb
+8
-0
unlock_instructions.html.erb
app/views/devise/mailer/unlock_instructions.html.erb
+7
-0
edit.html.erb
app/views/devise/passwords/edit.html.erb
+19
-0
new.html.erb
app/views/devise/passwords/new.html.erb
+15
-0
edit.html.erb
app/views/devise/registrations/edit.html.erb
+30
-0
new.html.erb
app/views/devise/registrations/new.html.erb
+22
-0
new.html.erb
app/views/devise/sessions/new.html.erb
+15
-0
_links.html.erb
app/views/devise/shared/_links.html.erb
+25
-0
new.html.erb
app/views/devise/unlocks/new.html.erb
+16
-0
application.html.erb
app/views/layouts/application.html.erb
+3
-1
20160718145025_add_columns_to_user.rb
db/migrate/20160718145025_add_columns_to_user.rb
+8
-0
schema.rb
db/schema.rb
+5
-1
q.svg
public/q.svg
+38
-0
No files found.
app/assets/stylesheets/skeleton.css
0 → 100644
View file @
5a8f703c
This diff is collapsed.
Click to expand it.
app/assets/stylesheets/style.css
0 → 100644
View file @
5a8f703c
.nav
{
position
:
fixed
;
top
:
-2px
;
left
:
-2px
;
width
:
calc
(
100vw
+
2px
);
list-style-type
:
none
;
margin
:
0
;
padding
:
0px
;
overflow
:
hidden
;
border
:
1px
solid
#e7e7e7
;
z-index
:
20
;
background-color
:
#f3f3f3
;
}
.nav-item
{
color
:
black
;
text-decoration
:
none
;
margin
:
0px
;
display
:
inline-block
;
padding
:
5px
25px
;
transition
:
ease-out
0.1s
;
font-size
:
18px
;
}
.nav-item
:hover
{
background-color
:
#004e7e
;
color
:
white
;
}
.nohover
:hover
{
background
:
none
;
color
:
black
;
}
.right
{
float
:
right
;
}
\ No newline at end of file
app/controllers/application_controller.rb
View file @
5a8f703c
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :exception
before_action
:configure_permitted_parameters
,
if: :devise_controller?
protected
def
configure_permitted_parameters
devise_parameter_sanitizer
.
permit
(
:sign_up
,
keys:
[
:first_name
,
:last_name
,
:birthday
,
:gender
])
end
end
app/views/admin/candidates/show.html.erb
View file @
5a8f703c
...
...
@@ -6,8 +6,49 @@
<%=
link_to
"OBOSEN"
,
admin_candidate_path
(
@candidate
.
id
),
{
:style
=>
"font-size:18px; text-decoration:none; color:rgba(200,0,0,0.5)"
,
method: :delete
}
%>
</h1>
<h3
style=
"margin-top:3px; color:#004e7e"
>
<%=
@candidate
.
position
.
name
%>
</h3>
<p>
<%=
@candidate
.
slogan
%>
</p>
<%
m
=
0
f
=
0
o
=
0
%>
<%
m
=
0
f
=
0
o
=
0
@candidate
.
votes
.
each
do
|
v
|
if
v
.
user
!=
nil
if
v
.
user
.
gender
==
"Male"
m
=
m
+
1
else
if
v
.
user
.
gender
==
"Female"
f
=
f
+
1
else
o
=
o
+
1
end
end
end
%>
<%
end
%>
<div
class=
"row"
>
<div
class=
"six columns"
style=
"font-size:30px; margin:30px auto; text-align:center"
><br>
“
<%=
@candidate
.
slogan
%>
”
</div>
<table
class=
"five columns"
>
<tr><td>
Male Votes
</td><td>
<%=
m
%>
</td></tr>
<tr><td>
Female Votes
</td><td>
<%=
f
%>
</td></tr>
<tr><td>
Other Votes
</td><td>
<%=
o
%>
</td></tr>
<tr><td>
Total Active Votes
</td><td>
<%=
m
+
f
+
o
%>
</td></tr>
<tr><td>
Total Active and Inactive Casted Votes
</td><td>
<%=
@candidate
.
votes
.
count
%>
</td>
</tr>
</table>
</div>
<hr>
<%=
link_to
"Back to Candidates"
,
admin_candidates_path
%>
app/views/devise/confirmations/new.html.erb
0 → 100644
View file @
5a8f703c
<h2>
Resend confirmation instructions
</h2>
<%=
simple_form_for
(
resource
,
as:
resource_name
,
url:
confirmation_path
(
resource_name
),
html:
{
method: :post
})
do
|
f
|
%>
<%=
f
.
error_notification
%>
<%=
f
.
full_error
:confirmation_token
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:email
,
required:
true
,
autofocus:
true
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Resend confirmation instructions"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
app/views/devise/mailer/confirmation_instructions.html.erb
0 → 100644
View file @
5a8f703c
<p>
Welcome
<%=
@email
%>
!
</p>
<p>
You can confirm your account email through the link below:
</p>
<p>
<%=
link_to
'Confirm my account'
,
confirmation_url
(
@resource
,
confirmation_token:
@token
)
%>
</p>
app/views/devise/mailer/password_change.html.erb
0 → 100644
View file @
5a8f703c
<p>
Hello
<%=
@resource
.
email
%>
!
</p>
<p>
We're contacting you to notify you that your password has been changed.
</p>
app/views/devise/mailer/reset_password_instructions.html.erb
0 → 100644
View file @
5a8f703c
<p>
Hello
<%=
@resource
.
email
%>
!
</p>
<p>
Someone has requested a link to change your password. You can do this through the link below.
</p>
<p>
<%=
link_to
'Change my password'
,
edit_password_url
(
@resource
,
reset_password_token:
@token
)
%>
</p>
<p>
If you didn't request this, please ignore this email.
</p>
<p>
Your password won't change until you access the link above and create a new one.
</p>
app/views/devise/mailer/unlock_instructions.html.erb
0 → 100644
View file @
5a8f703c
<p>
Hello
<%=
@resource
.
email
%>
!
</p>
<p>
Your account has been locked due to an excessive number of unsuccessful sign in attempts.
</p>
<p>
Click the link below to unlock your account:
</p>
<p>
<%=
link_to
'Unlock my account'
,
unlock_url
(
@resource
,
unlock_token:
@token
)
%>
</p>
app/views/devise/passwords/edit.html.erb
0 → 100644
View file @
5a8f703c
<h2>
Change your password
</h2>
<%=
simple_form_for
(
resource
,
as:
resource_name
,
url:
password_path
(
resource_name
),
html:
{
method: :put
})
do
|
f
|
%>
<%=
f
.
error_notification
%>
<%=
f
.
input
:reset_password_token
,
as: :hidden
%>
<%=
f
.
full_error
:reset_password_token
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:password
,
label:
"New password"
,
required:
true
,
autofocus:
true
,
hint:
(
"
#{
@minimum_password_length
}
characters minimum"
if
@minimum_password_length
)
%>
<%=
f
.
input
:password_confirmation
,
label:
"Confirm your new password"
,
required:
true
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Change my password"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
app/views/devise/passwords/new.html.erb
0 → 100644
View file @
5a8f703c
<h2>
Forgot your password?
</h2>
<%=
simple_form_for
(
resource
,
as:
resource_name
,
url:
password_path
(
resource_name
),
html:
{
method: :post
})
do
|
f
|
%>
<%=
f
.
error_notification
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:email
,
required:
true
,
autofocus:
true
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Send me reset password instructions"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
app/views/devise/registrations/edit.html.erb
0 → 100644
View file @
5a8f703c
<h2>
Edit
<%=
resource_name
.
to_s
.
humanize
%>
</h2>
<%=
simple_form_for
(
resource
,
as:
resource_name
,
url:
registration_path
(
resource_name
),
html:
{
method: :put
})
do
|
f
|
%>
<%=
f
.
error_notification
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:email
,
required:
true
,
autofocus:
true
%>
<%=
f
.
input
:first_name
,
required:
true
%>
<%=
f
.
input
:last_name
,
required:
true
%>
<%=
f
.
input
:birthday
,
required:
true
%>
<%=
f
.
input
:gender
,
required
:true
,
collection
:[
"Male"
,
"Female"
,
"Other"
]
%>
<%
if
devise_mapping
.
confirmable?
&&
resource
.
pending_reconfirmation?
%>
<p>
Currently waiting confirmation for:
<%=
resource
.
unconfirmed_email
%>
</p>
<%
end
%>
<%=
f
.
input
:password
,
autocomplete:
"off"
,
hint:
"leave it blank if you don't want to change it"
,
required:
false
%>
<%=
f
.
input
:password_confirmation
,
required:
false
%>
<%=
f
.
input
:current_password
,
hint:
"we need your current password to confirm your changes"
,
required:
true
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Update"
%>
</div>
<%
end
%>
<h3>
Cancel my account
</h3>
<p>
Unhappy?
<%=
link_to
"Cancel my account"
,
registration_path
(
resource_name
),
data:
{
confirm:
"Are you sure?"
},
method: :delete
%>
</p>
<%=
link_to
"Back"
,
:back
%>
app/views/devise/registrations/new.html.erb
0 → 100644
View file @
5a8f703c
<h2>
Registration
</h2>
<%=
simple_form_for
(
resource
,
as:
resource_name
,
url:
registration_path
(
resource_name
))
do
|
f
|
%>
<%=
f
.
error_notification
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:email
,
required:
true
,
autofocus:
true
%>
<%=
f
.
input
:first_name
,
required:
true
%>
<%=
f
.
input
:last_name
,
required:
true
%>
<%=
f
.
input
:birthday
,
required:
true
,
start_year:
Date
.
today
.
year
-
90
,
end_year:
Date
.
today
.
year
-
12
%>
<%=
f
.
input
:gender
,
required
:true
,
collection
:[
"Male"
,
"Female"
,
"Other"
]
%>
<%=
f
.
input
:password
,
required:
true
,
hint:
(
"
#{
@minimum_password_length
}
characters minimum"
if
@minimum_password_length
)
%>
<%=
f
.
input
:password_confirmation
,
required:
true
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Sign up"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
app/views/devise/sessions/new.html.erb
0 → 100644
View file @
5a8f703c
<h2>
Log in
</h2>
<%=
simple_form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
))
do
|
f
|
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:email
,
required:
false
,
autofocus:
true
%>
<%=
f
.
input
:password
,
required:
false
%>
<%=
f
.
input
:remember_me
,
as: :boolean
if
devise_mapping
.
rememberable?
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Log in"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
app/views/devise/shared/_links.html.erb
0 → 100644
View file @
5a8f703c
<%-
if
controller_name
!=
'sessions'
%>
<%=
link_to
"Log in"
,
new_session_path
(
resource_name
)
%>
<br
/>
<%
end
-%>
<%-
if
devise_mapping
.
registerable?
&&
controller_name
!=
'registrations'
%>
<%=
link_to
"Sign up"
,
new_registration_path
(
resource_name
)
%>
<br
/>
<%
end
-%>
<%-
if
devise_mapping
.
recoverable?
&&
controller_name
!=
'passwords'
&&
controller_name
!=
'registrations'
%>
<%=
link_to
"Forgot your password?"
,
new_password_path
(
resource_name
)
%>
<br
/>
<%
end
-%>
<%-
if
devise_mapping
.
confirmable?
&&
controller_name
!=
'confirmations'
%>
<%=
link_to
"Didn't receive confirmation instructions?"
,
new_confirmation_path
(
resource_name
)
%>
<br
/>
<%
end
-%>
<%-
if
devise_mapping
.
lockable?
&&
resource_class
.
unlock_strategy_enabled?
(
:email
)
&&
controller_name
!=
'unlocks'
%>
<%=
link_to
"Didn't receive unlock instructions?"
,
new_unlock_path
(
resource_name
)
%>
<br
/>
<%
end
-%>
<%-
if
devise_mapping
.
omniauthable?
%>
<%-
resource_class
.
omniauth_providers
.
each
do
|
provider
|
%>
<%=
link_to
"Sign in with
#{
OmniAuth
::
Utils
.
camelize
(
provider
)
}
"
,
omniauth_authorize_path
(
resource_name
,
provider
)
%>
<br
/>
<%
end
-%>
<%
end
-%>
app/views/devise/unlocks/new.html.erb
0 → 100644
View file @
5a8f703c
<h2>
Resend unlock instructions
</h2>
<%=
simple_form_for
(
resource
,
as:
resource_name
,
url:
unlock_path
(
resource_name
),
html:
{
method: :post
})
do
|
f
|
%>
<%=
f
.
error_notification
%>
<%=
f
.
full_error
:unlock_token
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:email
,
required:
true
,
autofocus:
true
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Resend unlock instructions"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
app/views/layouts/application.html.erb
View file @
5a8f703c
...
...
@@ -29,7 +29,9 @@
</nav>
<%=
yield
%>
<div
class=
"container"
style=
"margin-top:40px;"
>
<%=
yield
%>
</div>
</body>
</html>
db/migrate/20160718145025_add_columns_to_user.rb
0 → 100644
View file @
5a8f703c
class
AddColumnsToUser
<
ActiveRecord
::
Migration
[
5.0
]
def
change
add_column
:users
,
:first_name
,
:string
add_column
:users
,
:last_name
,
:string
add_column
:users
,
:gender
,
:string
add_column
:users
,
:birthday
,
:date
end
end
db/schema.rb
View file @
5a8f703c
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201607181
35621
)
do
ActiveRecord
::
Schema
.
define
(
version:
201607181
45025
)
do
create_table
"candidates"
,
force: :cascade
do
|
t
|
t
.
string
"first_name"
...
...
@@ -41,6 +41,10 @@ ActiveRecord::Schema.define(version: 20160718135621) do
t
.
string
"last_sign_in_ip"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"first_name"
t
.
string
"last_name"
t
.
string
"gender"
t
.
date
"birthday"
t
.
index
[
"email"
],
name:
"index_users_on_email"
,
unique:
true
t
.
index
[
"reset_password_token"
],
name:
"index_users_on_reset_password_token"
,
unique:
true
end
...
...
public/q.svg
0 → 100644
View file @
5a8f703c
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
version=
"1.1"
id=
"Capa_1"
x=
"0px"
y=
"0px"
width=
"512px"
height=
"512px"
viewBox=
"0 0 349.078 349.078"
style=
"enable-background:new 0 0 349.078 349.078;"
xml:space=
"preserve"
>
<g>
<path
d=
"M150.299,26.634v58.25c0,7.9-6.404,14.301-14.304,14.301c-28.186,0-43.518,28.909-45.643,85.966h45.643 c7.9,0,14.304,6.407,14.304,14.304v122.992c0,7.896-6.404,14.298-14.304,14.298H14.301C6.398,336.745,0,330.338,0,322.447V199.455 c0-27.352,2.754-52.452,8.183-74.611c5.568-22.721,14.115-42.587,25.396-59.048c11.608-16.917,26.128-30.192,43.16-39.44 C93.886,17.052,113.826,12.333,136,12.333C143.895,12.333,150.299,18.734,150.299,26.634z M334.773,99.186 c7.896,0,14.305-6.407,14.305-14.301v-58.25c0-7.9-6.408-14.301-14.305-14.301c-22.165,0-42.108,4.72-59.249,14.023 c-17.035,9.248-31.563,22.523-43.173,39.44c-11.277,16.461-19.824,36.328-25.393,59.054c-5.426,22.166-8.18,47.266-8.18,74.605 v122.992c0,7.896,6.406,14.298,14.304,14.298h121.69c7.896,0,14.299-6.407,14.299-14.298V199.455 c0-7.896-6.402-14.304-14.299-14.304h-44.992C291.873,128.095,306.981,99.186,334.773,99.186z"
fill=
"#254b63"
/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
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