Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
VeNJOB
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Hoang Mai Phuong
VeNJOB
Commits
2ca39520
Commit
2ca39520
authored
Sep 10, 2021
by
Nguyen Hoang Mai Phuong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
applied-job
parent
8d685ee8
Pipeline
#1440
failed with stages
in 0 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
4 deletions
+56
-4
app/controllers/apply_jobs_controller.rb
+9
-0
app/helpers/application_helper.rb
+1
-1
app/queries/applied_query.rb
+10
-0
app/views/apply_jobs/index.html.slim
+32
-0
app/views/users/show.html.slim
+2
-2
config/application.rb
+1
-1
config/routes.rb
+1
-0
No files found.
app/controllers/apply_jobs_controller.rb
View file @
2ca39520
...
...
@@ -2,6 +2,10 @@ class ApplyJobsController < ApplicationController
include
ApplicationHelper
before_action
:authenticate_user!
def
index
@applied_jobs
=
applied_jobs_query
.
order_applied_jobs
(
current_user
).
page
(
params
[
:page
])
end
def
new
job
=
Job
.
find_by
(
id:
params
[
:job_id
])
or
not_found
...
...
@@ -62,4 +66,8 @@ class ApplyJobsController < ApplicationController
def
apply_params
params
.
require
(
:apply_job
).
permit
(
:name
,
:email
,
:cv
,
:job_id
)
end
def
applied_jobs_query
@applied_jobs_query
||=
AppliedQuery
.
new
end
end
\ No newline at end of file
app/helpers/application_helper.rb
View file @
2ca39520
...
...
@@ -2,7 +2,7 @@ module ApplicationHelper
def
format_datetime
(
input
)
return
if
input
.
nil?
input
.
strftime
(
'%d/%m/%Y'
)
input
.
strftime
(
'%
H:%M : %
d/%m/%Y'
)
end
def
class_active
(
link_path
)
...
...
app/queries/applied_query.rb
0 → 100644
View file @
2ca39520
class
AppliedQuery
def
initialize
(
applied_jobs
=
ApplyJob
)
@applied_jobs
=
applied_jobs
.
includes
(
job:
%i[cities cities_jobs]
)
end
def
order_applied_jobs
(
current_user
)
@applied_jobs
.
where
(
user:
current_user
).
order
(
'apply_jobs.created_at DESC'
)
end
end
\ No newline at end of file
app/views/apply_jobs/index.html.slim
0 → 100644
View file @
2ca39520
-
provide
:title
,
'Applied Job'
h3
.p-3.text-center
|
Applied Jobs
.d-flex.justify-content-center
=
paginate
@applied_jobs
,
window:
1
-
@applied_jobs
.
each
do
|
applied_job
|
.bg-white.card.p-2
.p-3.align-self-center
h5
.mb-1
=
link_to
applied_job
.
job
.
title
,
detail_path
(
applied_job
.
job
.
slug
)
p
.mb-1
i
.fas.fa-dollar-sign.m-1
|
Lương:
=
applied_job
.
job
.
salary
p
.mb-1
i
.fas.fa-map-marker-alt.m-1
=
applied_job
.
job
.
cities
.
map
(
&
:name
).
uniq
.
join
(
' | '
)
p
.mb-1
=
truncate
(
applied_job
.
job
.
overview
,
length:
250
)
p
.mb-1.text-end
|
Applied at:
=
format_datetime
(
applied_job
.
created_at
)
-
if
@applied_jobs
.
any?
.d-flex.justify-content-center.p-2
=
page_entries_info
@applied_jobs
.d-flex.justify-content-center
=
paginate
@applied_jobs
,
window:
1
-
else
h4
.text-center
|
You haven't any applied jobs
\ No newline at end of file
app/views/users/show.html.slim
View file @
2ca39520
...
...
@@ -22,4 +22,4 @@ h2.p-3.text-center
=
link_to
@user
.
cv
.
filename
,
rails_blob_path
(
@user
.
cv
,
disposition:
'attachment'
)
.span.p-2.text-center
=
link_to
"Update"
,
edit_user_registration_path
,
class:
"btn btn-primary btn-space"
=
link_to
"My Jobs"
,
"#"
,
class:
"btn btn-primary btn-space"
\ No newline at end of file
=
link_to
"My Jobs"
,
applied_job_path
,
class:
"btn btn-primary btn-space"
\ No newline at end of file
config/application.rb
View file @
2ca39520
...
...
@@ -16,7 +16,7 @@ module VeNJOB
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
config
.
time_zone
=
'Hanoi'
# config.eager_load_paths << Rails.root.join("extras")
end
end
config/routes.rb
View file @
2ca39520
...
...
@@ -12,6 +12,7 @@ Rails.application.routes.draw do
get
'favorite'
,
to:
'favorite_jobs#index'
,
as:
'favorite'
delete
'unfavorite'
,
to:
'favorite_jobs#destroy'
get
'history'
,
to:
'history_jobs#index'
,
as:
'history'
get
'/my/jobs'
,
to:
'apply_jobs#index'
,
as:
'applied_job'
devise_for
:users
,
skip:
%i[sessions registrations passwords]
,
controllers:
{
confirmations:
'users/confirmations'
}
get
'/my'
,
to:
'users#show'
devise_scope
:user
do
...
...
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