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
2874f419
Commit
2874f419
authored
Dec 18, 2019
by
nnnghia98
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
render partial indsutries
parent
f4629fed
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
12 deletions
+32
-12
app/assets/stylesheets/custom.scss
+8
-0
app/controllers/industries_controller.rb
+1
-1
app/controllers/tops_controller.rb
+1
-1
app/models/industry.rb
+8
-0
app/views/industries/_industry.html.erb
+5
-1
app/views/industries/index.html.erb
+0
-1
app/views/shared/_top_industries.html.erb
+8
-0
app/views/tops/index.html.erb
+1
-8
No files found.
app/assets/stylesheets/custom.scss
View file @
2874f419
...
...
@@ -109,3 +109,11 @@ footer {
html
{
scroll-behavior
:
smooth
;
}
/* banner */
.banner
{
img
{
width
:
75%
;
}
}
app/controllers/industries_controller.rb
View file @
2874f419
class
IndustriesController
<
ApplicationController
def
index
@industries
=
Industry
.
page
(
params
[
:page
]).
per
(
Settings
.
col
.
page
.
per
)
@industries
=
Industry
.
all
end
end
app/controllers/tops_controller.rb
View file @
2874f419
class
TopsController
<
ApplicationController
def
index
@vn_cities
=
City
.
city_order
.
take
(
Settings
.
top
.
city
.
limit
)
@industries
=
Industry
.
all
@industries
=
Industry
.
industry_order
.
take
(
Settings
.
top
.
city
.
limit
)
@jobs
=
Job
.
page
(
params
[
:page
]).
per
(
Settings
.
job
.
per_page
)
end
end
app/models/industry.rb
View file @
2874f419
...
...
@@ -15,4 +15,12 @@
class
Industry
<
ApplicationRecord
has_many
:industry_jobs
has_many
:jobs
,
through: :industry_jobs
def
job_count
@job_count
||=
jobs
.
count
end
def
self
.
industry_order
@industry_order
||=
all
.
sort_by
(
&
:job_count
).
reverse
end
end
app/views/industries/_industry.html.erb
View file @
2874f419
<div
class=
"col-show"
>
<%=
industry
.
name
%>
</div>
<div
class=
"col-md-3"
>
<div
class=
"col-show"
>
<%=
industry
.
name
%>
(
<%=
(
industry
.
job_count
)
%>
)
</div>
</div>
app/views/industries/index.html.erb
View file @
2874f419
...
...
@@ -3,4 +3,3 @@
<%=
render
partial:
"industries/industry"
,
collection:
@industries
%>
</div>
</div>
<%=
paginate
@industries
%>
app/views/shared/_top_industries.html.erb
0 → 100644
View file @
2874f419
<h3>
Top industries
</h3>
<div
class=
"container"
>
<div
class=
"row row-cols-5"
>
<%=
render
partial:
"industries/industry"
,
collection:
@industries
%>
</div>
<%=
link_to
"All industries"
,
industries_path
,
class:
"btn btn-lg btn-primary"
%>
</div>
app/views/tops/index.html.erb
View file @
2874f419
...
...
@@ -23,13 +23,6 @@
</div>
<div
class=
"top_industries"
>
<h3>
Top industries
</h3>
<div
class=
"container"
>
<div
class=
"row row-cols-5"
>
<%=
render
partial:
"industries/industry"
,
collection:
@industries
%>
</div>
</div>
<%=
paginate
@industries
%>
<%=
render
partial:
"shared/top_industries"
%>
</div>
</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