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
1148912d
Commit
1148912d
authored
Jul 20, 2016
by
Bianca Tarun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited devise views and pages/index.html.erb and added columns to User
parent
8855477e
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
12 deletions
+45
-12
Gemfile
Election/Gemfile
+2
-1
application_controller.rb
Election/app/controllers/application_controller.rb
+2
-0
new.html.erb
Election/app/views/devise/registrations/new.html.erb
+7
-10
index.html.erb
Election/app/views/pages/index.html.erb
+4
-0
20160720051418_add_first_name_to_users.rb
...tion/db/migrate/20160720051418_add_first_name_to_users.rb
+5
-0
20160720051629_add_last_name_to_users.rb
Election/db/migrate/20160720051629_add_last_name_to_users.rb
+5
-0
20160720051906_add_gender_to_users.rb
Election/db/migrate/20160720051906_add_gender_to_users.rb
+5
-0
20160720052533_remove_birthday_from_users.rb
...n/db/migrate/20160720052533_remove_birthday_from_users.rb
+5
-0
20160720053151_add_birthday_to_users.rb
Election/db/migrate/20160720053151_add_birthday_to_users.rb
+5
-0
schema.rb
Election/db/schema.rb
+5
-1
No files found.
Election/Gemfile
View file @
1148912d
...
...
@@ -48,3 +48,4 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem
'simple_form'
gem
'devise'
Election/app/controllers/application_controller.rb
View file @
1148912d
...
...
@@ -2,4 +2,6 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery
with: :exception
end
Election/app/views/devise/registrations/new.html.erb
View file @
1148912d
...
...
@@ -4,21 +4,18 @@
<%=
f
.
error_notification
%>
<div
class=
"form-inputs"
>
<%=
f
.
input
:first_name
,
required
:true
%>
<%=
f
.
input
:last_name
,
required
:true
%>
<%=
f
.
input
:birthday
,
required
:true
%>
<%=
f
.
input
:email
,
required:
true
,
autofocus:
true
%>
<%=
f
.
input
:password
,
required:
true
,
hint:
(
"
#{
@minimum_password_length
}
characters minimum"
if
@minimum_password_length
)
%>
<%=
f
.
input
:password_confirmation
,
required:
true
%>
<%=
f
.
input
:first_name
,
required
:true
%>
<%=
f
.
input
:last_name
,
required
:true
%>
<%=
f
.
input
:birthday
,
:as
=>
:date_picker
,
input_html:
{
data:
{
date_options:
{
defaultDate:
Time
.
now
}}}
%>
<%=
f
.
input
:gender
,
collection:
[
"Male"
,
"Female"
],
include_blank:
false
%>
<%=
f
.
input
:gender
,
as: :select
,
collection:
[
"Male"
,
"Female"
],
required:
true
%>
</div>
<div
class=
"form-actions"
>
<%=
f
.
button
:submit
,
"Sign up"
%>
<%=
f
.
button
:submit
,
"Sign up"
,
:class
=>
"btn btn-success"
%>
</div>
<%
end
%>
<%=
render
"devise/shared/links"
%>
Election/app/views/pages/index.html.erb
View file @
1148912d
...
...
@@ -2,9 +2,13 @@
<%
if
user_signed_in?
%>
<h2>
Please take a look at our candidates!
</h2>
<hr>
<%
if
current_user
.
email
==
"admin_email@yahoo.com"
%>
<%=
link_to
"Manage Candidates"
,
admin_candidates_path
%>
||
<%=
link_to
"Manage Positions"
,
admin_positions_path
%>
||
<%=
link_to
"Vote"
,
votes_path
%>
<%
else
%>
<%=
link_to
"Vote"
,
votes_path
%>
<%
end
%>
<hr>
<%
@positions
.
each
do
|
p
|
%>
<h2>
<%=
p
.
name
%>
</h2>
...
...
Election/db/migrate/20160720051418_add_first_name_to_users.rb
0 → 100644
View file @
1148912d
class
AddFirstNameToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:first_name
,
:string
end
end
Election/db/migrate/20160720051629_add_last_name_to_users.rb
0 → 100644
View file @
1148912d
class
AddLastNameToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:last_name
,
:string
end
end
Election/db/migrate/20160720051906_add_gender_to_users.rb
0 → 100644
View file @
1148912d
class
AddGenderToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:gender
,
:string
end
end
Election/db/migrate/20160720052533_remove_birthday_from_users.rb
0 → 100644
View file @
1148912d
class
RemoveBirthdayFromUsers
<
ActiveRecord
::
Migration
def
change
remove_column
:users
,
:birthday
,
:string
end
end
Election/db/migrate/20160720053151_add_birthday_to_users.rb
0 → 100644
View file @
1148912d
class
AddBirthdayToUsers
<
ActiveRecord
::
Migration
def
change
add_column
:users
,
:birthday
,
:date
end
end
Election/db/schema.rb
View file @
1148912d
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201607200
21955
)
do
ActiveRecord
::
Schema
.
define
(
version:
201607200
53151
)
do
create_table
"candidates"
,
force: :cascade
do
|
t
|
t
.
string
"first_name"
...
...
@@ -45,6 +45,10 @@ ActiveRecord::Schema.define(version: 20160720021955) 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"
end
add_index
"users"
,
[
"email"
],
name:
"index_users_on_email"
,
unique:
true
...
...
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