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 Ngoc Nghia
VeNJOB
Commits
f1077f8b
Commit
f1077f8b
authored
Dec 19, 2019
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix decorator
parent
7a5a4a8d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
13 deletions
+64
-13
app/assets/stylesheets/custom.scss
+6
-7
app/controllers/jobs_controller.rb
+2
-2
app/decorators/application_decorator.rb
+5
-0
app/decorators/job_decorator.rb
+11
-1
app/decorators/paginating_decorator.rb
+3
-0
app/models/job.rb
+1
-1
app/views/jobs/_job.html.erb
+2
-2
app/views/jobs/show.html.erb
+34
-0
No files found.
app/assets/stylesheets/custom.scss
View file @
f1077f8b
...
@@ -38,13 +38,6 @@ h1, h2, h3, h4, h5, h6 {
...
@@ -38,13 +38,6 @@ h1, h2, h3, h4, h5, h6 {
line-height
:
1
;
line-height
:
1
;
}
}
h1
{
font-size
:
3em
;
letter-spacing
:
-2px
;
margin-bottom
:
30px
;
text-align
:
center
;
}
h2
{
h2
{
font-size
:
1
.2em
;
font-size
:
1
.2em
;
letter-spacing
:
-1px
;
letter-spacing
:
-1px
;
...
@@ -157,3 +150,9 @@ dl, dt, dd {
...
@@ -157,3 +150,9 @@ dl, dt, dd {
list-style-type
:
none
;
list-style-type
:
none
;
line-height
:
normal
;
line-height
:
normal
;
}
}
.breadcrump
{
font-weight
:
lighter
;
font-size
:
12px
;
margin-bottom
:
15px
;
}
app/controllers/jobs_controller.rb
View file @
f1077f8b
class
JobsController
<
ApplicationController
class
JobsController
<
ApplicationController
def
index
def
index
@jobs
=
Job
.
page
(
params
[
:page
]).
per
(
Settings
.
job
.
per_page
)
@jobs
=
Job
.
page
(
params
[
:page
]).
per
(
Settings
.
job
.
per_page
)
.
decorate
end
end
def
show
def
show
@job
=
Job
.
find
(
params
[
:id
])
@job
=
Job
.
find
(
params
[
:id
])
.
decorate
end
end
end
end
app/decorators/application_decorator.rb
0 → 100644
View file @
f1077f8b
class
ApplicationDecorator
<
Draper
::
Decorator
def
self
.
collection_decorator_class
PaginatingDecorator
end
end
app/decorators/job_decorator.rb
View file @
f1077f8b
class
JobDecorator
<
Draper
::
Decorator
class
JobDecorator
<
ApplicationDecorator
include
ActionView
::
Helpers
::
TextHelper
delegate_all
delegate_all
decorates_association
:city
decorates_association
:city
...
@@ -6,7 +8,15 @@ class JobDecorator < Draper::Decorator
...
@@ -6,7 +8,15 @@ class JobDecorator < Draper::Decorator
object
.
cities
&
.
first
&
.
name
object
.
cities
&
.
first
&
.
name
end
end
def
company_name
object
.
company
&
.
name
end
def
display_short_des
def
display_short_des
object
.
short_des
&
.
truncate
(
250
)
object
.
short_des
&
.
truncate
(
250
)
end
end
def
display_description
simple_format
object
.
description
end
end
end
app/decorators/paginating_decorator.rb
0 → 100644
View file @
f1077f8b
class
PaginatingDecorator
<
Draper
::
CollectionDecorator
delegate
:current_page
,
:total_pages
,
:limit_value
,
:entry_name
,
:total_count
,
:offset_value
,
:last_page?
end
app/models/job.rb
View file @
f1077f8b
...
@@ -38,6 +38,6 @@ class Job < ApplicationRecord
...
@@ -38,6 +38,6 @@ class Job < ApplicationRecord
has_many
:industries
,
through: :industry_jobs
has_many
:industries
,
through: :industry_jobs
def
self
.
latest_job
def
self
.
latest_job
@latest_job
||=
Job
.
order
(
updated_at: :desc
).
take
(
Settings
.
top
.
job
.
limit
)
@latest_job
||=
order
(
updated_at: :desc
).
take
(
Settings
.
top
.
job
.
limit
)
end
end
end
end
app/views/jobs/_job.html.erb
View file @
f1077f8b
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</dl>
</dl>
<dl
class=
"job_data_row"
>
<dl
class=
"job_data_row"
>
<dt>
Short description
</dt>
<dt>
Short description
</dt>
<dd>
<%=
job
.
d
ecorate
.
d
isplay_short_des
%>
</dd>
<dd>
<%=
job
.
display_short_des
%>
</dd>
</dl>
</dl>
<dl
class=
"job_data_row"
>
<dl
class=
"job_data_row"
>
<dt>
Salary
</dt>
<dt>
Salary
</dt>
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
</dl>
</dl>
<dl
class=
"job_data_row"
>
<dl
class=
"job_data_row"
>
<dt>
Location
</dt>
<dt>
Location
</dt>
<dd>
<%=
job
.
decorate
.
city_name
%>
</dd>
<dd>
<%=
job
.
city_name
%>
</dd>
</dl>
</dl>
</div>
</div>
<button
type=
"button"
class=
"btn btn-outline-secondary"
>
Favorite
</button>
<button
type=
"button"
class=
"btn btn-outline-secondary"
>
Favorite
</button>
...
...
app/views/jobs/show.html.erb
View file @
f1077f8b
<div
class=
"breadcrump"
>
<%=
link_to
"Top"
,
root_path
%>
>
<%=
link_to
"City"
,
cities_path
%>
>
<%=
link_to
"Industry"
,
industries_path
%>
>
<%=
@job
.
title
%>
</div>
<div
class=
"box"
>
<h1>
<%=
@job
.
title
%>
</h1>
<div
class=
"job_data"
>
<dl
class=
"job_data_row"
>
<dt>
Company
</dt>
<dd>
<%=
@job
.
company_name
%>
</dd>
</dl>
<dl
class=
"job_data_row"
>
<dt>
Location
</dt>
<dd>
<%=
@job
.
city_name
%>
</dd>
</dl>
<dl
class=
"job_data_row"
>
<dt>
Salary
</dt>
<dd>
<%=
@job
.
salary
%>
</dd>
</dl>
<dl
class=
"job_data_row"
>
<dt>
Description
</dt>
<dd>
<%=
@job
.
display_description
%>
</dd>
</dl>
</div>
</div>
<div
class=
"job_detail_button"
>
<%=
link_to
"Favorite"
,
"#"
,
class:
"btn btn-primary float-right"
%>
<%=
link_to
"Apply"
,
"#"
,
class:
"btn btn-primary float-right mx-3"
%>
</div>
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