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
Fasilkom UI Open Source Software
Kape
Commits
2a9de52c
Commit
2a9de52c
authored
Jun 02, 2017
by
Zamil Majdy
Browse files
Make all images responsive with respect to div
parent
4de829c6
Changes
6
Hide whitespace changes
Inline
Side-by-side
assets/css/custom.css
View file @
2a9de52c
...
...
@@ -2,6 +2,11 @@
text-align
:
center
;
}
img
{
max-width
:
100%
;
height
:
auto
;
}
*
{
box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
...
...
assets/js/ProfilePage.jsx
View file @
2a9de52c
...
...
@@ -91,7 +91,7 @@ export default class ProfilePage extends React.Component {
}
});
this
.
setState
({
loading
:
true
});
Server
.
submit
(
`/
profiles/
students/
${
this
.
state
.
id
}
/`
,
submitForm
,
'
PATCH
'
).
then
(()
=>
{
Server
.
submit
(
`/students/
${
this
.
state
.
id
}
/
profile/
`
,
submitForm
,
'
PATCH
'
).
then
(()
=>
{
this
.
setState
({
loading
:
false
});
this
.
modalAlert
.
open
(
'
Profil berhasil diperbaharui
'
,
'
Silakan periksa kembali profil anda
'
,
this
.
getProfile
);
},
error
=>
error
.
then
((
r
)
=>
{
...
...
assets/js/VacancyPage.jsx
View file @
2a9de52c
...
...
@@ -39,7 +39,7 @@ export default class VacancyPage extends React.Component {
if
(
this
.
props
.
user
.
role
===
'
student
'
)
{
return
(
<
Tabs
selected
=
{
0
}
>
<
Pane
label
=
"
Semua
Lowongan"
>
<
Pane
label
=
"Lowongan"
>
<
Pagination
key
=
{
1
}
url
=
"/vacancies/"
...
...
core/views/accounts.py
View file @
2a9de52c
...
...
@@ -2,7 +2,7 @@ import requests
from
django.contrib.auth
import
authenticate
,
login
from
django.contrib.auth.models
import
User
from
rest_framework
import
viewsets
,
status
from
rest_framework.decorators
import
list_route
from
rest_framework.decorators
import
list_route
,
detail_route
from
rest_framework.parsers
import
FormParser
,
MultiPartParser
from
rest_framework.permissions
import
AllowAny
from
rest_framework.permissions
import
IsAdminUser
,
IsAuthenticated
...
...
@@ -51,6 +51,21 @@ class StudentViewSet(viewsets.ModelViewSet):
return
[
IsAuthenticated
(),
IsAdminOrSupervisorOrCompanyOrSelf
()]
return
super
(
StudentViewSet
,
self
).
get_permissions
()
@
detail_route
(
methods
=
[
'patch'
],
permission_classes
=
[
IsAdminOrStudent
],
serializer_class
=
StudentUpdateSerializer
,
parser_classes
=
(
MultiPartParser
,
FormParser
,))
def
profile
(
self
,
request
,
pk
=
None
):
"""
Update student {student_id}'s profile information
---
"""
user
=
self
.
get_object
()
serializer
=
self
.
serializer_class
(
user
,
data
=
request
.
data
,
partial
=
True
)
if
serializer
.
is_valid
():
serializer
.
save
()
return
Response
(
serializer
.
data
,
status
=
status
.
HTTP_202_ACCEPTED
)
else
:
return
Response
(
serializer
.
errors
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
class
CompanyViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Company
.
objects
.
all
()
...
...
@@ -211,19 +226,3 @@ class CompanyRegisterViewSet(viewsets.GenericViewSet):
return
Response
(
serializer
.
data
,
status
=
status
.
HTTP_201_CREATED
)
else
:
return
Response
({
'error'
:
'Company with email '
+
data
[
'email'
]
+
' already exist'
},
status
=
status
.
HTTP_409_CONFLICT
)
class
StudentProfileViewSet
(
viewsets
.
GenericViewSet
):
queryset
=
Student
.
objects
.
all
()
permission_classes
=
[
IsAdminOrStudent
]
serializer_class
=
StudentUpdateSerializer
parser_classes
=
(
MultiPartParser
,
FormParser
,)
def
partial_update
(
self
,
request
,
pk
=
None
):
user
=
self
.
get_object
()
serializer
=
self
.
serializer_class
(
user
,
data
=
request
.
data
,
partial
=
True
)
if
serializer
.
is_valid
():
serializer
.
save
()
return
Response
(
serializer
.
data
,
status
=
status
.
HTTP_202_ACCEPTED
)
else
:
return
Response
(
serializer
.
errors
,
status
=
status
.
HTTP_400_BAD_REQUEST
)
kape/settings.py
View file @
2a9de52c
...
...
@@ -18,7 +18,7 @@ WEBPACK_LOADER = {
SECRET_KEY
=
'gz!k*@!n8h$yny1)zp!e5#w8!s4%*wqnur5$qnr@$*xx_o+aij'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
DEBUG
=
(
len
(
sys
.
argv
)
>
1
and
sys
.
argv
[
1
]
==
'runserver'
)
ALLOWED_HOSTS
=
[
u
'bot.recruit.id'
,
u
'kape.recruit.id'
,
u
'104.236.76.161'
,
u
'localhost'
,
u
'127.0.0.1'
]
...
...
kape/urls.py
View file @
2a9de52c
...
...
@@ -23,7 +23,7 @@ from rest_framework_swagger.views import get_swagger_view
from
core
import
apps
from
core.views.accounts
import
StudentViewSet
,
CompanyViewSet
,
SupervisorViewSet
,
UserViewSet
,
LoginViewSet
,
\
CompanyRegisterViewSet
,
StudentProfileViewSet
CompanyRegisterViewSet
from
core.views.vacancies
import
VacancyViewSet
,
BookmarkedVacancyByStudentViewSet
,
ApplicationViewSet
,
\
CompanyApplicationViewSet
,
CompanyVacanciesViewSet
,
CompanyApplicationStatusViewSet
,
\
SupervisorStudentApplicationViewSet
...
...
@@ -37,9 +37,9 @@ router.register(r'supervisors', SupervisorViewSet)
router
.
register
(
r
'login'
,
LoginViewSet
)
router
.
register
(
r
'register'
,
CompanyRegisterViewSet
)
router
.
register
(
r
'vacancies'
,
VacancyViewSet
)
router
.
register
(
r
'profiles/students'
,
StudentProfileViewSet
)
router
.
register
(
r
'applications'
,
CompanyApplicationStatusViewSet
)
router
.
register
(
r
'student-applications'
,
SupervisorStudentApplicationViewSet
)
# router.register(r'students/(?P<student_id>\d+)/profile', StudentProfileViewSet)
router
.
register
(
r
'students/(?P<student_id>\d+)/bookmarked-vacancies'
,
BookmarkedVacancyByStudentViewSet
,
base_name
=
'bookmarked-vacancy-list'
)
router
.
register
(
r
'students/(?P<student_id>\d+)/applied-vacancies'
,
ApplicationViewSet
,
...
...
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