Commit a93fa166 by Thanh Hung Pham

Fix layout

parent 3e6bc17b
......@@ -6,6 +6,7 @@ class JobsController < ApplicationController
def detail
@job = Job.find(params[:id])
History.new(user: current_user, job: @job).save if History.where(user: current_user, job: @job).blank?
end
def apply
......
<%- provide(:title, 'Job Detail') -%>
<div class="well">
<h2><%= @job.name %></h2>
<div class="row">
<div class="col-md-8">
<div class="row form-group">
<div class="col-md-10">
<div class="row">
<%= @job.company.name unless @job.city.nil? %>
</div>
......@@ -16,7 +16,7 @@
<%= @job.description %>
</div>
</div>
<div class="col-md-4">
<div class="col-md-2">
<%= link_to 'Apply', jobs_apply_path, class: 'btn btn-primary' %>
</div>
</div>
......@@ -24,7 +24,12 @@
<div class="col-md-offset-3 ">
<%= link_to 'Apply', jobs_apply_path, class: 'btn btn-primary' %>
<%- if Favorite.where(user: current_user, job: @job).blank? -%>
<%- if user_signed_in? -%>
<%= link_to 'Favorite', '#', class: 'favorite_add btn btn-primary' %>
<%- else -%>
<%= link_to 'Favorite', new_user_session_path, class: 'btn btn-primary' %>
<%- end -%>
<input type="hidden" id="job_id" name="job_id" value="<%= @job.id %>">
<%- else -%>
<%= link_to 'Favorite', '#', class: 'favorite_add btn btn-primary', disabled: true %>
......
<%- provide(:title, 'History Jobs') -%>
<div class="well">
<h2>History Jobs</h2>
<div class="table-responsive">
<table class="table">
<thead>
<th> Job </th>
<th> Description </th>
<th> Location </th>
<th> Salary </th>
</thead>
<tbody>
<%- @history_jobs.each do |history| -%>
<div class="row">
<%= history.job.name %>
</div>
<div class="row">
<%= truncate(history.job.description, length: 250) %>
</div>
<div class="row">
<div class="col-md-4">
<%= history.job.city.name unless history.job.city.nil? %>
</div>
<div class="col-md-4">
<%= history.job.salary %>
</div>
</div>
<tr>
<td> <%= history.job.name %> </td>
<td> <%= truncate(history.job.description, length: 250) %> </td>
<td> <%= history.job.city.name unless history.job.city.nil? %> </td>
<td> <%= history.job.salary %> </td>
</tr>
<%- end -%>
</tbody>
</table>
</div>
</div>
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