Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_nth
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
3
Merge Requests
3
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
Ngô Trung Hưng
venjob_nth
Commits
5931eb90
Commit
5931eb90
authored
Aug 07, 2020
by
Ngô Trung Hưng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use decorator pattern
parent
297950ef
Pipeline
#846
failed with stages
in 0 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
8 deletions
+17
-8
app/controllers/job_controller.rb
+1
-1
app/decorators/job_decorator.rb
+12
-0
app/models/job.rb
+1
-0
app/views/job/detail.html.erb
+3
-7
app/views/job/result_data.html.erb
+0
-0
No files found.
app/controllers/job_controller.rb
View file @
5931eb90
...
...
@@ -16,7 +16,7 @@ class JobController < ApplicationController
industries
=
@job
.
industries
.
first
add_breadcrumb
'Trang chủ'
,
root_path
add_breadcrumb
cities
.
name
,
jobs_path
(
model:
'city'
,
slug:
cities
.
slug
)
add_breadcrumb
industries
.
name
,
jobs_path
(
model:
'
cit
y'
,
slug:
industries
.
slug
)
add_breadcrumb
industries
.
name
,
jobs_path
(
model:
'
industr
y'
,
slug:
industries
.
slug
)
add_breadcrumb
@job
.
name
end
...
...
app/decorators/job_decorator.rb
0 → 100644
View file @
5931eb90
# frozen_string_literal: true
# pattern job decorator
module
JobDecorator
def
posted_at
created_at
.
strftime
(
'%d - %m - %Y'
)
end
def
expired_at
expiration_date
.
strftime
(
'%d - %m - %Y'
)
end
end
app/models/job.rb
View file @
5931eb90
...
...
@@ -2,6 +2,7 @@
# Description/Explanation of Person class
class
Job
<
ApplicationRecord
include
JobDecorator
NUMBER_LASTED_JOB
=
5
belongs_to
:company
...
...
app/views/job/detail.html.erb
View file @
5931eb90
...
...
@@ -22,7 +22,7 @@
<span><i
class=
"far fa-building"
></i>
<%=
link_to
@job
.
company
.
name
,
jobs_path
(
model:
'company'
,
slug:
@job
.
company
.
slug
),
class:
'link_ct apply_job'
%>
</span>
</div>
</div>
<div
class=
"col-lg-3
"
>
<div
class=
"col-lg-3"
>
<div
class=
"btn_apply_job"
>
<%=
link_to
'Nộp CV ngay'
,
'#'
,
class:
'btn btn-apply_job'
%>
</div>
...
...
@@ -45,16 +45,12 @@
</div>
<div
class=
"col-lg-4 col-md-6"
>
<div
class=
"detail_info"
>
<span><i
class=
"fab fa-linode"
></i>
Ngày đăng tin:
<%=
@job
.
created_at
.
strftime
(
'%d - %m - %Y'
)
%>
</span>
<span><i
class=
"fab fa-linode"
></i>
Ngày đăng tin:
<%=
@job
.
posted_at
%>
</span>
</div>
</div>
<div
class=
"col-lg-4 col-md-6"
>
<div
class=
"detail_info"
>
<%
if
@job
.
expiration_date
.
present?
%>
<span><i
class=
"fab fa-linode"
></i>
Ngày hết hạn:
<%=
@job
.
expiration_date
.
strftime
(
'%d - %m - %Y'
)
%>
</span>
<%
else
%>
<span><i
class=
"fab fa-linode"
></i>
Ngày hết hạn: đang cập nhật
</span>
<%
end
%>
<span><i
class=
"fab fa-linode"
></i>
Ngày hết hạn:
<%=
@job
.
expiration_date
.
present?
?
@job
.
expired_at
:
'đang cập nhật'
%>
</span>
</div>
</div>
<div
class=
"col-lg-4 col-md-6"
>
...
...
app/views/job/result_data.html.erb
View file @
5931eb90
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