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
1
Merge Requests
1
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
Tô Ngọc Ánh
VeNJob
Commits
4be6e76a
Commit
4be6e76a
authored
Sep 07, 2020
by
Tô Ngọc Ánh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show all applied_jobs list for admin
parent
127448dd
Pipeline
#1074
failed with stages
in 0 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
4 deletions
+61
-4
app/controllers/applied_jobs_controller.rb
+4
-0
app/controllers/users_controller.rb
+10
-2
app/views/users/_applied_job.html.erb
+18
-0
app/views/users/applied_jobs.html.erb
+28
-2
config/routes.rb
+1
-0
No files found.
app/controllers/applied_jobs_controller.rb
View file @
4be6e76a
...
...
@@ -33,6 +33,10 @@ class AppliedJobsController < ApplicationController
end
end
def
search
return
unless
current_user
.
admin
end
private
def
applied_job_params
...
...
app/controllers/users_controller.rb
View file @
4be6e76a
class
UsersController
<
ApplicationController
before_action
:authenticate_user!
,
only:
%i[my_page applied_job]
before_action
:authenticate_user!
,
only:
%i[my_page applied_job
s
]
def
show
@user
=
User
.
find_by
(
id:
params
[
:id
])
...
...
@@ -10,6 +10,14 @@ class UsersController < ApplicationController
def
applied_jobs
return
unless
current_user
.
admin
@applied_jobs
=
AppliedJob
.
includes
(
:jobs
).
order
(
created_at: :desc
).
page
(
params
[
:page
])
get_data_search_bar
@applied_jobs
=
AppliedJob
.
includes
(
:job
).
order
(
created_at: :desc
).
page
(
params
[
:page
])
end
private
def
get_data_search_bar
@locations
=
Location
.
select
(
:id
,
:city
)
@industries
=
Industry
.
select
(
:id
,
:name
)
end
end
app/views/users/_applied_job.html.erb
0 → 100644
View file @
4be6e76a
<div
class=
"card my-2"
>
<div
class=
"row"
>
<div
class =
"col-lg-10"
>
<div
class=
'card-body'
>
<%=
link_to
applied_job
.
job
.
title
,
job_path
(
applied_job
.
job
),
class:
'card-title font-weight-bold text-decoration-none'
%>
<p><strong>
Candidate Name:
</strong>
<%=
link_to
applied_job
.
full_name
,
user_path
(
applied_job
.
user
)
%>
</p>
<p><strong>
Candidate's CV:
</strong>
<%=
link_to
applied_job
.
curriculum_vitae
.
identifier
,
applied_job
.
curriculum_vitae
.
url
%>
</p>
<p><strong>
Candidate's Email:
</strong>
<%=
applied_job
.
email
%>
</p>
</div>
</div>
<div
class =
"col-lg-2"
>
<div
class=
"card-body"
>
<p><strong>
Applied at:
</strong></p>
<span>
<%=
applied_job
.
created_at
.
localtime
.
strftime
(
'%d/%m/%y - %H:%M'
)
%>
</span>
</div>
</div>
</div>
</div>
app/views/users/applied_jobs.html.erb
View file @
4be6e76a
day la admin applied job
\ No newline at end of file
<h4
class=
"text-center py-3"
>
Applied Jobs
</h4>
<div
class=
'search-form text-center'
>
<%=
form_tag
search_applied_jobs_path
,
class:
"mt-4 form-group"
,
enforce_utf8:
false
do
%>
<%=
search_field_tag
:email
,
params
[
:email
],
placeholder:
'Email'
,
class:
'form-control my-2'
%>
<%=
select_tag
:industry
,
options_from_collection_for_select
(
@industries
,
:id
,
:name
,
params
[
:industry
]),
prompt:
'All Industries'
,
class:
'form-control my-2'
%>
<%=
select_tag
:location
,
options_from_collection_for_select
(
@locations
,
:id
,
:city
,
params
[
:location
]),
prompt:
'All Locations'
,
class:
'form-control my-2'
%>
<div
class=
"d-flex justify-content-around my-2"
>
<%=
date_select
:applied_at
,
:from
,
{
order:
[
:year
,
:month
,
:day
],
use_month_numbers:
true
,
use_two_digit_numbers:
true
},
{
class:
'form-control mx-1'
}
%>
<strong
class=
"mx-3"
>
~
</strong>
<%=
date_select
:applied_at
,
:to
,
{
order:
[
:year
,
:month
,
:day
],
use_month_numbers:
true
,
use_two_digit_numbers:
true
},
{
class:
'form-control mx-1'
}
%>
</div>
<%=
submit_tag
'Search'
,
name:
nil
,
class:
'btn btn-outline-success m-2'
%>
<%=
button_tag
'CSV Download'
,
class:
'btn btn-outline-success m-2'
%>
<%
end
%>
</div>
<div
class=
'content'
>
<%
if
@applied_jobs
.
any?
%>
<%=
paginate
@applied_jobs
%>
<%=
render
partial:
'users/applied_job'
,
collection:
@applied_jobs
%>
<%=
paginate
@applied_jobs
%>
<%
else
%>
<h4
class=
"text-center"
>
Sorry! We can't found any applied jobs!
</h4>
<%
end
%>
</div>
config/routes.rb
View file @
4be6e76a
...
...
@@ -6,6 +6,7 @@ Rails.application.routes.draw do
end
get
'admin/applies'
,
to:
'users#applied_jobs'
,
as: :admin_applied_jobs
post
'admin/applies'
,
to:
'applied_jobs#search'
,
as: :search_applied_jobs
get
'cities'
,
to:
'locations#index'
get
'industries'
,
to:
'industries#index'
...
...
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