Commit 2a0ed731 by Trịnh Hoàng Phúc

Merge branch 'feature/design_template_ven_job' into 'master'

Feature/design template ven job

See merge request !6
parents feea628f cf108ca1
Pipeline #557 canceled with stages
in 0 seconds
...@@ -30,6 +30,9 @@ gem 'devise' ...@@ -30,6 +30,9 @@ gem 'devise'
# Reduces boot times through caching; required in config/boot.rb # Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false gem 'bootsnap', '>= 1.4.2', require: false
# Pagination
gem 'kaminari'
group :development, :test do group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
...@@ -42,6 +45,7 @@ group :development do ...@@ -42,6 +45,7 @@ group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring' gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0' gem 'spring-watcher-listen', '~> 2.0.0'
gem 'pry'
end end
group :test do group :test do
......
...@@ -76,6 +76,7 @@ GEM ...@@ -76,6 +76,7 @@ GEM
regexp_parser (~> 1.5) regexp_parser (~> 1.5)
xpath (~> 3.2) xpath (~> 3.2)
childprocess (3.0.0) childprocess (3.0.0)
coderay (1.1.2)
concurrent-ruby (1.1.6) concurrent-ruby (1.1.6)
crass (1.0.6) crass (1.0.6)
devise (4.7.1) devise (4.7.1)
...@@ -95,6 +96,18 @@ GEM ...@@ -95,6 +96,18 @@ GEM
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
jbuilder (2.10.0) jbuilder (2.10.0)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
kaminari (1.2.0)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.0)
kaminari-activerecord (= 1.2.0)
kaminari-core (= 1.2.0)
kaminari-actionview (1.2.0)
actionview
kaminari-core (= 1.2.0)
kaminari-activerecord (1.2.0)
activerecord
kaminari-core (= 1.2.0)
kaminari-core (1.2.0)
listen (3.1.5) listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
...@@ -128,7 +141,13 @@ GEM ...@@ -128,7 +141,13 @@ GEM
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
nokogiri (1.10.9-x86-mingw32) nokogiri (1.10.9-x86-mingw32)
mini_portile2 (~> 2.4.0) mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0) pry (0.13.0)
coderay (~> 1.1)
method_source (~> 1.0)
pry (0.13.0-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
public_suffix (4.0.3) public_suffix (4.0.3)
puma (4.3.3) puma (4.3.3)
nio4r (~> 2.0) nio4r (~> 2.0)
...@@ -192,6 +211,8 @@ GEM ...@@ -192,6 +211,8 @@ GEM
selenium-webdriver (3.142.7) selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0) childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2) rubyzip (>= 1.2.2)
spoon (0.0.6)
ffi
spring (2.1.0) spring (2.1.0)
spring-watcher-listen (2.0.1) spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0) listen (>= 2.7, < 4.0)
...@@ -252,8 +273,10 @@ DEPENDENCIES ...@@ -252,8 +273,10 @@ DEPENDENCIES
capybara (>= 2.15) capybara (>= 2.15)
devise devise
jbuilder (~> 2.7) jbuilder (~> 2.7)
kaminari
listen (>= 3.0.5, < 3.2) listen (>= 3.0.5, < 3.2)
mysql2 mysql2
pry
puma (~> 4.1) puma (~> 4.1)
rails (~> 6.0.2, >= 6.0.2.2) rails (~> 6.0.2, >= 6.0.2.2)
sass-rails (>= 6) sass-rails (>= 6)
......
...@@ -6041,10 +6041,10 @@ ul.resumes .listing-favorited h3:before { ...@@ -6041,10 +6041,10 @@ ul.resumes .listing-favorited h3:before {
} }
.companies-overview .company-group { .companies-overview .company-group {
padding: 0 10px; padding: 5px 10px;
width: 25%; width: 25%;
float: left; float: left;
display: inline display: inline;
} }
.company-letter { .company-letter {
...@@ -6634,7 +6634,7 @@ noscript~ul.resumes .resume:first-child { ...@@ -6634,7 +6634,7 @@ noscript~ul.resumes .resume:first-child {
.jobify_widget_jobs .job_listing-date, .jobify_widget_jobs .job_listing-date,
.jobify_widget_jobs .resume-date { .jobify_widget_jobs .resume-date {
display: none display: block;
} }
.job-type, .job-type,
......
...@@ -353,6 +353,19 @@ body { ...@@ -353,6 +353,19 @@ body {
visibility: visible; visibility: visible;
} }
nav.pagination span a, nav.pagination span.current{
text-decoration: none;
font: 400 13px/normal Montserrat, sans-serif;
text-align: center;
padding: 8px 13px;
border: 1px solid #ccc;
border-radius: 4px;
margin: 20px 5px;
display: inline-block;
}
nav.pagination span.current{
color: #7dc246;
}
@media screen and (min-width: 1200px) { @media screen and (min-width: 1200px) {
.job_listing-about, .resume-about { .job_listing-about, .resume-about {
width: 90%; width: 90%;
......
class CityController < ApplicationController class CityController < ApplicationController
def index def index
@cities = City.all
end end
end end
class HomeController < ApplicationController class HomeController < ApplicationController
def index def index
@amount_job = Job.count
@latest_10_jobs = Job.last(10)
@latest_8_cities = City.last(8)
@latest_8_industries = Industry.last(8)
end end
end end
class IndustryController < ApplicationController class IndustryController < ApplicationController
def index def index
@industries = Industry.all
end end
end end
class JobController < ApplicationController class JobController < ApplicationController
def index def index
if params[:city]
@jobs = Job.includes(:cities).where("cities.id = #{params[:city]}").references(:cities).page(params[:page])
@amount_job = Job.includes(:cities).where("cities.id = #{params[:city]}").references(:cities).count
elsif params[:industry]
@jobs = Job.includes(:industries).where("industries.id = #{params[:industry]}").references(:industries).page(params[:page])
@amount_job = Job.includes(:industries).where("industries.id = #{params[:industry]}").references(:industries).count
elsif params[:company]
@jobs = Job.where("company_id = #{params[:company]}").page(params[:page])
@amount_job = Job.where("company_id = #{params[:company]}").count
else
@jobs = Job.order("id DESC").page(params[:page])
@amount_job = Job.count
end
end end
def show def show
@title = "Job Detail Page" @job = Job.find(params[:id])
@relate_jobs = Job.where("company_id = #{@job.company_id} and id != #{@job.id}").limit(3).order("id DESC")
end end
end end
...@@ -6,19 +6,11 @@ ...@@ -6,19 +6,11 @@
<article id="post-2064" class="post-2064 page type-page status-publish hentry"> <article id="post-2064" class="post-2064 page type-page status-publish hentry">
<div class="entry-content"> <div class="entry-content">
<ul class="companies-overview"> <ul class="companies-overview">
<li class="company-group"> <% @cities.each do |city| %>
<a href="https://jobify-demos.astoundify.com/classic/company/AdRoll/">AdRoll (1)</a> <li class="company-group">
</li> <a href="/jobs?city=<%= city.id %>"><%= city.title %> (<%= city.jobs.length %>)</a>
<li class="company-group"> </li>
<a href="https://jobify-demos.astoundify.com/classic/company/AdRoll/">AdRoll (1)</a> <% end %>
</li>
<li class="company-group">
<a href="https://jobify-demos.astoundify.com/classic/company/AdRoll/">AdRoll (1)</a>
</li>
<li class="company-group">
<a href="https://jobify-demos.astoundify.com/classic/company/AdRoll/">AdRoll (1)</a>
</li>
</ul> </ul>
</div> </div>
</article> </article>
......
...@@ -6,19 +6,11 @@ ...@@ -6,19 +6,11 @@
<article id="post-2064" class="post-2064 page type-page status-publish hentry"> <article id="post-2064" class="post-2064 page type-page status-publish hentry">
<div class="entry-content"> <div class="entry-content">
<ul class="companies-overview"> <ul class="companies-overview">
<% @industries.each do |industry| %>
<li class="company-group"> <li class="company-group">
<a href="https://jobify-demos.astoundify.com/classic/company/AdRoll/">AdRoll (1)</a> <a href="/jobs?industry=<%= industry.id %>"><%= industry.title %> (<%= industry.jobs.length %>)</a>
</li> </li>
<li class="company-group"> <% end %>
<a href="https://jobify-demos.astoundify.com/classic/company/AdRoll/">AdRoll (1)</a>
</li>
<li class="company-group">
<a href="https://jobify-demos.astoundify.com/classic/company/AdRoll/">AdRoll (1)</a>
</li>
<li class="company-group">
<a href="https://jobify-demos.astoundify.com/classic/company/AdRoll/">AdRoll (1)</a>
</li>
</ul> </ul>
</div> </div>
</article> </article>
......
<%# Link to the "First" page
- available local variables
url: url to the first page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="first">
<%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote %>
</span>
<%# Non-link tag that stands for skipped pages...
- available local variables
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page gap"><%= t('views.pagination.truncate').html_safe %></span>
<%# Link to the "Last" page
- available local variables
url: url to the last page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="last">
<%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, remote: remote %>
</span>
<%# Link to the "Next" page
- available local variables
url: url to the next page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="next">
<%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote %>
</span>
<%# Link showing page number
- available local variables
page: a page object for "this" page
url: url to this page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="page<%= ' current' if page.current? %>">
<%= link_to_unless page.current?, page, url, {remote: remote, rel: page.rel} %>
</span>
<%# The container tag
- available local variables
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<nav class="pagination" role="navigation" aria-label="pager">
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.display_tag? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<% unless current_page.out_of_range? %>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
<% end %>
</nav>
<% end -%>
<%# Link to the "Previous" page
- available local variables
url: url to the previous page
current_page: a page object for the currently displayed page
total_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<span class="prev">
<%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote %>
</span>
...@@ -4,6 +4,7 @@ Rails.application.routes.draw do ...@@ -4,6 +4,7 @@ Rails.application.routes.draw do
root to: 'home#index' root to: 'home#index'
get '/jobs/', to: 'job#index' get '/jobs/', to: 'job#index'
get '/job/:id', to: 'job#show'
get '/cities/', to: 'city#index' get '/cities/', to: 'city#index'
get '/industries/', to: 'industry#index' get '/industries/', to: 'industry#index'
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment