Commit 98be312e by Son Do Hong

Merge branch 'feature/city_page' into 'master'

Feature/city page

See merge request !12
parents f853348f ffc5ab70
......@@ -93,3 +93,19 @@ footer {
.flash-message {
padding-top: 15px;
}
/* grid */
.col-show {
border: 1px solid black;
border-radius: 3px;
text-align: center;
margin: 10px;
padding: 10px;
}
/* smooth scroll */
html {
scroll-behavior: smooth;
}
class CitiesController < ApplicationController
def index
@cities = City.all
@vn_cities = City.vn_cities
@inter_cities = City.inter_cities
end
end
class JobsController < ApplicationController
def index
@jobs = Job.all
@jobs = Job.page(params[:page]).per(Settings.job.per_page)
end
end
class StaticPagesController < ApplicationController
def index
@cities = City.all
@vn_cities = City.vn_cities
@industries = Industry.all
@jobs = Job.page(params[:page]).per(Settings.jobs.page.per)
@jobs = Job.page(params[:page]).per(Settings.job.per_page)
end
end
......@@ -14,4 +14,6 @@
#
class City < ApplicationRecord
scope :vn_cities, -> {where region: "Việt Nam"}
scope :inter_cities, -> {where region: "#"}
end
<li class="list-group-item"><%= city.name %></li>
<div class="col-md-3">
<div class="col-show">
<%= city.name %>
</div>
</div>
<%= render partial: "cities/city", collection: @cities %>
<div class="container jumbotron text-center">
<h1>City List</h1>
<div class="row">
<div class="col-sm">
<a href="#vietnam">
<div class="tag">Vietnam</div>
</a>
</div>
<div class="col-sm">
<a href="#interational">
<div class="tag">International</div>
</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="tag text-center" id="vietnam">Vietnam</div>
<div class="row row-cols-4">
<%= render partial: "cities/city", collection: @vn_cities %>
</div>
</div>
<div class="container-fluid">
<div class="tag text-center" id="interational">International</div>
<div class="row row-cols-4">
<%= render partial: "cities/city", collection: @inter_cities %>
</div>
</div>
<tr>
<td><%= job.title %></td>
<td><%= job.short_des %></td>
<td><%= job.salary %></td>
</tr>
<div>
<%= job.title %>
<%= job.short_des %>
<%= job.salary %>
</div>
<%= render partial: "jobs/job", collection: @jobs %>
<div>
<%= render partial: "jobs/job", collection: @jobs %>
</div>
<%= paginate @jobs %>
......@@ -10,22 +10,20 @@
<div class="lastest_jobs">
<h3>Latest jobs</h3>
<table class="table">
<tbody>
<ul class="table">
<div>
<%= render partial: "jobs/job", collection: @jobs %>
</ul>
</tbody>
</table>
</div>
<%= paginate @jobs %>
</div>
<div class="top_cities">
<h3>Top cities</h3>
<ul class="list-group list-group-horizontal">
<%= render partial: "cities/city", collection: @cities %>
</ul>
<div class="container">
<div class="row row-cols-4">
<%= render partial: "cities/city", collection: @vn_cities %>
</div>
</div>
</div>
<div class="top_industries">
......
......@@ -2,12 +2,12 @@
<p>
We received a request to reset the password associated with this e-mail address.
If you made this request, please follow the instructions below.
</p><br>
If you made this request, please follow the instructions below.<br>
</p>
<p>Click the link below to reset your password using our secure server:</p>
<p><%= link_to "Change my password", edit_password_url(@resource, reset_password_token: @token) %></p>
<br>
<p><%= link_to "Change my password", edit_password_url(@resource, reset_password_token: @token) %><br></p>
<p>
If you did not request to have your password reset you can safely ignore this email.
Rest assured your account is safe.
......
......@@ -4,7 +4,7 @@
<h3>Email: <%= current_user.email %></h3>
<h3>Full name: <%= current_user.first_name %> <%= current_user.last_name %></h3>
<h3>My CV: <%= current_user.cv_path %></h3>
<br>
<%= link_to "Edit", edit_user_registration_path, class: "btn btn-lg btn-primary" %>
<%= link_to "My jobs", "#", class: "btn btn-lg btn-primary" %>
</div>
......@@ -25,7 +25,7 @@
<div class="field">
<%= f.label :cv_path %><br/>
<input type="file" class="form-control-file" id="cv_path">
</div><br>
</div>
<div class="form-group">
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br/>
......@@ -50,7 +50,7 @@
<%= f.submit "Update", class: "btn btn-lg btn-primary" %>
</div>
<% end %>
<br>
<%= button_to "Delete my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, class: "btn btn-danger", method: :delete %>
<%= link_to "Back", :back %>
jobs:
page:
per: 5
job:
per_page: 5
This source diff could not be displayed because it is too large. You can view the blob instead.
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