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