Commit 5f043334 by Xuan Trung Le

fix bugs

parent f48d0933
......@@ -18,6 +18,7 @@
$(document).ready(function(){
$('.message').delay(5000).fadeOut('slow');
$(document).on('change', 'input[name=job_id]', function(event) {
event.preventDefault();
$('#apply').removeAttr('disabled')
});
});
......@@ -9,11 +9,11 @@ class MyPagesController < ApplicationController
end
def history
@jobs = current_user.viewed_jobs.includes(:apply_jobs).includes(:company).limit(Settings.top.job_per_history_page)
@jobs = current_user.viewed_jobs.includes(:apply_jobs, :company).limit(Settings.top.job_per_history_page)
end
def download_cv
if File.exist?(current_user.cv.path)
if current_user.cv.file.exists?
send_file current_user.cv.path
else
flash[:notice] = 'File not exist!'
......
class PasswordsController < Devise::PasswordsController
def new
super
end
def edit
self.resource = User.with_reset_password_token(params[:reset_password_token])
if self.resource
......
......@@ -5,7 +5,7 @@
<p class="text-info">1. Apply form</p>
</div>
<div class="form-horizontal">
<%= form_for(@application, url: confirm_applies_path, html: {method: :post, multipart: true}) do |f| %>
<%= form_for(@application, url: confirm_applies_path, html: { multipart: true }) do |f| %>
<div class="form-group">
<%= f.label :Email, 'Email:', class: "control-label col-md-2" %>
<div class="col-sm-10">
......
......@@ -3,29 +3,42 @@
<div class="jobs clearfix">
<div class="job col-md-12">
<table class="table">
<tbody>
<%- @jobs.each do |job|-%>
<tr>
<td class="col-md-1 position-relative">
<input type="radio" name="rbn-apply-job" class="mid-heigth">
</td>
<td class="col-md-9">
<h4 class="mr0"><%= link_to job.name, job_path(job) %></h4>
<p><%= "Loacation: #{job.company.location}" %></p>
<p><%= "Salary: #{job.salary}" %></p>
</td>
<td class="col-md-2 position-relative">
<%= button_to "Remove",
unlike_job_favorites_path(job_id: job.id),
data: {confirm: "Are you sure you want to remove this job?"},
class: "btn btn-danger btn-lg mid-heigth" %>
</td>
</tr>
<% end %>
</tbody>
<%= form_tag apply_applies_path, method: :get do %>
<tbody>
<%- @jobs.each do |job|-%>
<tr>
<td class="col-md-1 position-relative">
<%= radio_button_tag "job_id", job.id, false, class: "mid-heigth",
disabled: user_has_applied?(job) ? true : false %>
</td>
<td class="col-md-9">
<h4 class="mr0"><%= link_to job.name + "#{user_has_applied?(job) ? ' (APPLIED)' : ''}", job_path(job) %></h4>
<p><strong>Description:</strong><%= strip_tags(job.description)[0...250] %>...</p>
<p>
<span><%= "<strong>Loacation</strong>: #{job.company.location}".html_safe %></span>
<span class="navbar-right"><%= "<strong>Salary</strong>: #{job.salary}".html_safe %></span>
</p>
</td>
<td class="col-md-2 position-relative">
<%= link_to "Remove",
unlike_job_favorites_path(job_id: job.id),
method: :post,
data: {confirm: "Are you sure you want to remove this job?"},
class: "btn btn-danger btn-lg mid-heigth" %>
</td>
</tr>
<% end %>
<tr>
<td></td>
<td>
<%= submit_tag "Applys", class: "btn btn-primary btn-lg btn-block", id: "apply", disabled: true %>
</td>
<td></td>
</tr>
</tbody>
<% end %>
</table>
</div>
<%= button_to "Apply", nil, class: "btn btn-primary" %>
</div>
</div>
</div>
......@@ -28,7 +28,9 @@
</div>
<div class="col-md-2 favorite">
<%= link_to "FAVORITE", "#", class: "btn btn-default" %>
<%= button_to "Favorite",
job_favorites_path(job_id: job.id),
class: "btn btn-primary btn-lg btn-block" %>
</div>
</div>
<%- end -%>
......
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