Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
Kape
Commits
0a3f1613
Commit
0a3f1613
authored
Nov 14, 2019
by
Nixi Sendya Putri
Browse files
1606918383 126
parent
4b1db830
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
assets/js/EditProfile.jsx
View file @
0a3f1613
...
...
@@ -55,6 +55,7 @@ export default class ProfilePage extends React.Component {
latest_work_desc
:
''
,
github_url
:
''
,
awards
:
''
,
seminar
:
''
,
},
bagikanTranskrip
:
''
,
acceptedNo
:
0
,
...
...
@@ -70,6 +71,7 @@ export default class ProfilePage extends React.Component {
latest_work_desc
:
''
,
github_url
:
''
,
awards
:
''
,
seminar
:
''
,
};
this
.
getProfile
=
this
.
getProfile
.
bind
(
this
);
this
.
handleChange
=
this
.
handleChange
.
bind
(
this
);
...
...
@@ -120,6 +122,7 @@ export default class ProfilePage extends React.Component {
skills
:
data
.
skills
,
github_url
:
data
.
github_url
,
awards
:
data
.
awards
,
seminar
:
data
.
seminar
,
});
if
(
this
.
props
.
route
.
own
)
{
const
newSession
=
this
.
props
.
user
.
data
;
...
...
@@ -356,6 +359,15 @@ export default class ProfilePage extends React.Component {
name
=
"awards"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"seminar"
>
Seminar dan Training
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
seminar
===
null
?
'
Seminar CompFest
'
:
this
.
state
.
seminar
}
defaultValue
=
{
this
.
state
.
seminar
===
null
?
null
:
this
.
state
.
seminar
}
name
=
"seminar"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"resume"
>
Resume
</
label
>
<
input
onChange
=
{
this
.
handleFile
}
placeholder
=
"Resume"
name
=
"resume"
type
=
"File"
/>
...
...
assets/js/ProfilePage.jsx
View file @
0a3f1613
...
...
@@ -55,6 +55,7 @@ export default class ProfilePage extends React.Component {
latest_work_desc
:
''
,
github_url
:
''
,
awards
:
''
,
seminar
:
''
,
},
bagikanTranskrip
:
''
,
acceptedNo
:
0
,
...
...
@@ -70,6 +71,7 @@ export default class ProfilePage extends React.Component {
latest_work_desc
:
''
,
github_url
:
''
,
awards
:
''
,
semimar
:
''
,
};
this
.
getProfile
=
this
.
getProfile
.
bind
(
this
);
this
.
handleChange
=
this
.
handleChange
.
bind
(
this
);
...
...
@@ -120,6 +122,7 @@ export default class ProfilePage extends React.Component {
skills
:
data
.
skills
,
github_url
:
data
.
github_url
,
awards
:
data
.
awards
,
seminar
:
data
.
seminar
,
});
if
(
this
.
props
.
route
.
own
)
{
const
newSession
=
this
.
props
.
user
.
data
;
...
...
@@ -356,6 +359,15 @@ export default class ProfilePage extends React.Component {
name
=
"awards"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"seminar"
>
Seminar dan Training
</
label
>
<
input
onChange
=
{
this
.
handleChange
}
placeholder
=
{
this
.
state
.
seminar
===
null
?
'
Seminar Compfest
'
:
this
.
state
.
seminar
}
defaultValue
=
{
this
.
state
.
seminar
===
null
?
null
:
this
.
state
.
seminar
}
name
=
"seminar"
/>
</
Form
.
Field
>
<
Form
.
Field
>
<
label
htmlFor
=
"resume"
>
Resume
</
label
>
<
input
onChange
=
{
this
.
handleFile
}
placeholder
=
"Resume"
name
=
"resume"
type
=
"File"
/>
...
...
@@ -641,6 +653,17 @@ export default class ProfilePage extends React.Component {
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
<
Icon
name
=
"slideshare"
size
=
"big"
/>
</
Grid
.
Column
>
<
Grid
.
Column
width
=
{
13
}
>
<
p
>
{
this
.
state
.
seminar
||
'
Seminar dan Training kosong
'
}
</
p
>
</
Grid
.
Column
>
</
Grid
>
</
Segment
>
<
Segment
basic
vertical
>
<
Grid
>
<
Grid
.
Column
width
=
{
2
}
>
...
...
core/migrations/0001_initial.py
View file @
0a3f1613
# -*- coding: utf-8 -*-
# Generated by Django 1.11.17 on 2019-11-14 0
2
:40
# Generated by Django 1.11.17 on 2019-11-14 0
5
:40
from
__future__
import
unicode_literals
import
core.lib.validators
...
...
@@ -37,8 +37,8 @@ class Migration(migrations.Migration):
(
'status'
,
models
.
IntegerField
(
default
=
0
)),
(
'logo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_company_logo_file_path
,
validators
=
[
core
.
lib
.
validators
.
validate_image_file_extension
])),
(
'address'
,
models
.
CharField
(
blank
=
True
,
max_length
=
1000
,
null
=
True
)),
(
'category'
,
models
.
CharField
(
default
=
b
'Belum ada kategori perusahaan'
,
max_length
=
140
)),
(
'website'
,
models
.
CharField
(
default
=
b
'Belum ada link website'
,
max_length
=
100
)),
(
'category'
,
models
.
CharField
(
default
=
'Belum ada kategori perusahaan'
,
max_length
=
140
)),
(
'website'
,
models
.
CharField
(
default
=
'Belum ada link website'
,
max_length
=
100
)),
(
'user'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
options
=
{
...
...
@@ -50,7 +50,7 @@ class Migration(migrations.Migration):
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'title'
,
models
.
CharField
(
blank
=
True
,
default
=
b
''
,
max_length
=
100
)),
(
'title'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
100
)),
(
'content'
,
models
.
TextField
()),
],
options
=
{
...
...
@@ -64,16 +64,16 @@ class Migration(migrations.Migration):
(
'created'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
(
'updated'
,
models
.
DateTimeField
(
auto_now
=
True
)),
(
'npm'
,
models
.
IntegerField
(
unique
=
True
,
validators
=
[
core
.
lib
.
validators
.
validate_npm
])),
(
'resume'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_resume_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
b
'pdf'
])])),
(
'resume'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_resume_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
'pdf'
])])),
(
'sertifikat'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_sertifikat_file_path
,
validators
=
[
core
.
lib
.
validators
.
validate_document_file_extension
])),
(
'phone_number'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
100
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
b
'^0
\\
d{1,11}$'
)])),
(
'phone_number'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
100
,
null
=
True
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
'^0
\\
d{1,11}$'
)])),
(
'gender'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'birth_place'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'birth_date'
,
models
.
DateField
(
blank
=
True
,
null
=
True
)),
(
'major'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'batch'
,
models
.
CharField
(
blank
=
True
,
max_length
=
4
,
null
=
True
)),
(
'show_transcript'
,
models
.
BooleanField
(
default
=
False
)),
(
'photo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_photo_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
b
'jpg'
,
b
'jpeg'
,
b
'png'
])])),
(
'photo'
,
models
.
FileField
(
blank
=
True
,
null
=
True
,
upload_to
=
core
.
models
.
accounts
.
get_student_photo_file_path
,
validators
=
[
django
.
core
.
validators
.
FileExtensionValidator
([
'jpg'
,
'jpeg'
,
'png'
])])),
(
'self_description'
,
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
max_length
=
500
,
null
=
True
)),
(
'portfolio_link'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
(
'linkedin_url'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
...
...
@@ -90,9 +90,10 @@ class Migration(migrations.Migration):
(
'intro'
,
models
.
CharField
(
blank
=
True
,
max_length
=
50
,
null
=
True
)),
(
'expected_salary'
,
models
.
CharField
(
blank
=
True
,
max_length
=
10
,
null
=
True
)),
(
'job_seeking_status'
,
models
.
CharField
(
blank
=
True
,
max_length
=
30
,
null
=
True
)),
(
'student_gpa'
,
models
.
FloatField
(
blank
=
True
,
db_column
=
b
'student_gpa'
,
default
=
1.0
,
null
=
True
)),
(
'student_gpa'
,
models
.
FloatField
(
blank
=
True
,
db_column
=
'student_gpa'
,
default
=
1.0
,
null
=
True
)),
(
'volunteer'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'awards'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
(
'seminar'
,
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
)),
],
options
=
{
'ordering'
:
[
'-updated'
],
...
...
@@ -151,7 +152,7 @@ class Migration(migrations.Migration):
name
=
'ReasonRejected'
,
fields
=
[
(
'application'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
primary_key
=
True
,
serialize
=
False
,
to
=
'core.Application'
)),
(
'reason'
,
models
.
TextField
(
default
=
b
'Tidak memenuhi kualifikasi perusahaan.'
)),
(
'reason'
,
models
.
TextField
(
default
=
'Tidak memenuhi kualifikasi perusahaan.'
)),
],
),
migrations
.
AddField
(
...
...
core/models/accounts.py
View file @
0a3f1613
...
...
@@ -101,6 +101,7 @@ class Student(models.Model):
student_gpa
=
models
.
FloatField
(
db_column
=
'student_gpa'
,
default
=
1.0
,
blank
=
True
,
null
=
True
)
volunteer
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
awards
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
seminar
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
@
property
def
name
(
self
):
...
...
core/serializers/accounts.py
View file @
0a3f1613
...
...
@@ -22,7 +22,7 @@ class StudentSerializer(serializers.ModelSerializer):
fields
=
[
'id'
,
'name'
,
'user'
,
'npm'
,
'resume'
,
'phone_number'
,
'gender'
,
'birth_place'
,
'birth_date'
,
'major'
,
'batch'
,
'show_transcript'
,
'photo'
,
'accepted_no'
,
'linkedin_url'
,
'hackerrank_url'
,
'region'
,
'intro'
,
'portfolio_link'
,
'website_url'
,
'student_gpa'
,
'age'
,
'recommendations'
,
'work_experience'
,
'latest_work'
,
'latest_work_desc'
,
'read_no'
,
'volunteer'
,
'job_seeking_status'
,
'skills'
,
'expected_salary'
,
'self_description'
,
'github_url'
,
'awards'
]
'self_description'
,
'github_url'
,
'awards'
,
'seminar'
]
def
get_accepted_no
(
self
,
obj
):
apps
=
Application
.
objects
.
filter
(
student
=
obj
,
status
=
4
)
...
...
@@ -69,7 +69,8 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'latest_work_desc'
:
instance
.
latest_work_desc
,
'skills'
:
instance
.
skills
,
'github_url'
:
instance
.
github_url
,
'awards'
:
instance
.
awards
'awards'
:
instance
.
awards
,
'seminar'
:
instance
.
seminar
}
def
update
(
self
,
instance
,
validated_data
):
...
...
@@ -114,6 +115,8 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
'github_url'
,
instance
.
github_url
)
instance
.
awards
=
validated_data
.
get
(
'awards'
,
instance
.
awards
)
instance
.
seminar
=
validated_data
.
get
(
'seminar'
,
instance
.
seminar
)
instance
.
save
()
instance
.
user
.
save
()
return
instance
...
...
@@ -122,7 +125,7 @@ class StudentUpdateSerializer(serializers.ModelSerializer):
model
=
Student
fields
=
[
'resume'
,
'email'
,
'phone_number'
,
'gender'
,
'photo'
,
'show_transcript'
,
'linkedin_url'
,
'hackerrank_url'
,
'region'
,
'intro'
,
'portfolio_link'
,
'website_url'
,
'student_gpa'
,
'recommendations'
,
'work_experience'
,
'latest_work'
,
'latest_work_desc'
,
'volunteer'
,
'job_seeking_status'
,
'skills'
,
'expected_salary'
,
'self_description'
,
'github_url'
,
'awards'
]
'self_description'
,
'github_url'
,
'awards'
,
'seminar'
]
class
CompanyUpdateSerializer
(
serializers
.
ModelSerializer
):
...
...
core/tests/test_accounts.py
View file @
0a3f1613
...
...
@@ -213,6 +213,11 @@ class ProfileUpdateTests(APITestCase):
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'awards'
),
'Juara 2 UIUX Gemastik 2019'
)
url
=
'/api/students/'
+
str
(
student_id
)
+
"/profile/"
response
=
self
.
client
.
patch
(
url
,
{
'seminar'
:
'Seminar CompFest'
},
format
=
'multipart'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_202_ACCEPTED
)
self
.
assertEqual
(
response
.
data
.
get
(
'seminar'
),
'Seminar CompFest'
)
@
requests_mock
.
Mocker
()
def
test_student_profile_update_filetype_validation
(
self
,
m
):
mock_csui_oauth_verify
(
m
)
...
...
package-lock.json
View file @
0a3f1613
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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