added internship and some changes

This commit is contained in:
Harry Bomrah 2018-01-15 20:26:18 +08:00
parent 5be0e54280
commit a2ca1c9aeb
16 changed files with 482 additions and 78 deletions

View File

@ -28,6 +28,12 @@
.logout { .logout {
font-size: 16px; font-size: 16px;
} }
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
} }
ul.nav { ul.nav {

View File

@ -8,7 +8,11 @@ class RecruitmentsController < PseudoSessionController
def index def index
params = OrbitHelper.params params = OrbitHelper.params
if params[:page_id] == "jobs" if params[:page_id] == "jobs"
load_jobs(params) load_jobs(params, "type1")
elsif params[:page_id] == "internships"
load_jobs(params, "type2")
elsif params[:page_id] == "exchanges"
load_jobs(params, "type3")
elsif params[:page_id] == "candidates" elsif params[:page_id] == "candidates"
load_candidates(params) load_candidates(params)
end end
@ -65,17 +69,17 @@ class RecruitmentsController < PseudoSessionController
} }
end end
def load_jobs(params) def load_jobs(params, type)
jobs = [] jobs = []
if params[:type].present? && params[:type] == "aq" if params[:type].present? && params[:type] == "aq"
rjobs = advanced_filter_jobs(params) rjobs = advanced_filter_jobs(params,type)
criteria = "<span class='criteria'><i>-</i></span> <span class='reset-search'><a href='#{params[:url].gsub("/","")}'><i class='fa fa-refresh' aria-hidden='true'></i></a></span>" criteria = "<span class='criteria'><i>-</i></span> <span class='reset-search'><a href='#{params[:url].gsub("/","")}'><i class='fa fa-refresh' aria-hidden='true'></i></a></span>"
elsif params[:q].present? elsif params[:q].present?
rjobs = filter_jobs(params) rjobs = filter_jobs(params, type)
criteria = "<span class='criteria'><i>- " + params[:q] + "</i></span> <span class='reset-search'><a href='#{params[:url].gsub("/","")}'><i class='fa fa-refresh' aria-hidden='true'></i></a></span>" criteria = "<span class='criteria'><i>- " + params[:q] + "</i></span> <span class='reset-search'><a href='#{params[:url].gsub("/","")}'><i class='fa fa-refresh' aria-hidden='true'></i></a></span>"
else else
criteria = "" criteria = ""
rjobs = RecruitmentJob.not_filled rjobs = RecruitmentJob.where(:post_type => type).not_filled
end end
if !rjobs.nil? && !rjobs.is_a?(Array) if !rjobs.nil? && !rjobs.is_a?(Array)
rjobs = rjobs.desc(:created_at).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count) rjobs = rjobs.desc(:created_at).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count)
@ -105,6 +109,7 @@ class RecruitmentsController < PseudoSessionController
"work_experience_years" => wey, "work_experience_years" => wey,
"work_experience_months" => wem, "work_experience_months" => wem,
"category" => rj.category, "category" => rj.category,
"post-type" => rj.get_post_type_label,
"skills" => rj.skills.collect{|skill| {"skill-tag" => skill}} "skills" => rj.skills.collect{|skill| {"skill-tag" => skill}}
} }
end end
@ -119,7 +124,7 @@ class RecruitmentsController < PseudoSessionController
def show def show
params = OrbitHelper.params params = OrbitHelper.params
if params[:page_id] == "jobs" if params[:page_id] == "jobs" || params[:page_id] == "internships" || params[:page_id] == "exchanges"
show_job(params) show_job(params)
elsif params[:page_id] == "candidates" elsif params[:page_id] == "candidates"
show_candidate(params) show_candidate(params)
@ -243,7 +248,7 @@ class RecruitmentsController < PseudoSessionController
end end
end end
if !job.skills.empty? if !job.skills.empty?
skills = job.skills.collect{|skill| "<span class='label label-info'>#{skill}</span>"} skills = job.skills.collect{|skill| "<span class='label label-default'>#{skill}</span>"}
skills = skills.join(" ") skills = skills.join(" ")
else else
skills = t("recruitment.not_available") skills = t("recruitment.not_available")
@ -283,9 +288,21 @@ class RecruitmentsController < PseudoSessionController
elsif job.max_salary < job.min_salary elsif job.max_salary < job.min_salary
range = (job.min_salary * 1000).to_s + " ~ #{t('recruitment.salary.type1')} / Month" range = (job.min_salary * 1000).to_s + " ~ #{t('recruitment.salary.type1')} / Month"
end end
if job.internship_duration > 0
duration = job.internship_duration.to_s + " #{t("recruitment.months")}"
end
if job.part_time?
parttime = "<span class='label label-primary'>#{t("recruitment.internship_part_time")}<span>"
end
{ {
"infos" => infos, "infos" => infos,
"data" => { "data" => {
"post-type" => job.get_post_type_label,
"part-time" => parttime,
"internship-duration-title" => t("recruitment.internship_duration"),
"internship-duration" => duration,
"perks-title" => t("recruitment.perks_title"),
"perks" => (job.perks.nil? || job.perks != "" ? t("recruitment.perks.#{job.perks}") : t("recruitment.not_available")),
"job-title" => job.job_title, "job-title" => job.job_title,
"job-category" => job.get_category, "job-category" => job.get_category,
"avatar" => profile.get_avatar, "avatar" => profile.get_avatar,
@ -559,15 +576,23 @@ class RecruitmentsController < PseudoSessionController
redirect_to mydashboard_path redirect_to mydashboard_path
end end
# ------ ------ internship ------ ------- #
def addinternship
@job = RecruitmentJob.new
@academic_types = ["type1","type2","type3"].collect{|t| [t("recruitment.academic_type.#{t}"), t]}
end
private private
def filter_jobs(params) def filter_jobs(params, type)
rjobs = [] rjobs = []
keywords = params[:q].split(",").collect{|s| /#{s.strip}/i} keywords = params[:q].split(",").collect{|s| /#{s.strip}/i}
companies = EmployerProfile.where(:company_name.in => keywords).pluck(:id) companies = EmployerProfile.where(:company_name.in => keywords).pluck(:id)
skills = RecruitmentJob.where(:skills.in => keywords) skills = RecruitmentJob.where(:post_type => type).where(:skills.in => keywords)
designations = RecruitmentJob.where(:job_title.in => keywords) designations = RecruitmentJob.where(:post_type => type).where(:job_title.in => keywords)
query = [] query = []
if companies.count > 0 if companies.count > 0
query << {:employer_profile_id.in => companies} query << {:employer_profile_id.in => companies}
@ -579,14 +604,14 @@ class RecruitmentsController < PseudoSessionController
query << {:job_title.in => keywords} query << {:job_title.in => keywords}
end end
if !query.empty? if !query.empty?
rjobs = RecruitmentJob.any_of(query).not_filled rjobs = RecruitmentJob.where(:post_type => type).any_of(query).not_filled
end end
rjobs rjobs
end end
def advanced_filter_jobs(params) def advanced_filter_jobs(params, type)
if params[:q].present? if params[:q].present?
rjobs = filter_jobs(params) rjobs = filter_jobs(params, type)
else else
rjobs = [] rjobs = []
end end
@ -614,7 +639,7 @@ class RecruitmentsController < PseudoSessionController
if !rjobs.empty? if !rjobs.empty?
rjobs = rjobs.where(query.reduce({}, :merge)) rjobs = rjobs.where(query.reduce({}, :merge))
else else
rjobs = RecruitmentJob.where(query.reduce({}, :merge)) rjobs = RecruitmentJob.where(:post_type => type).where(query.reduce({}, :merge))
end end
end end
rjobs rjobs

View File

@ -28,6 +28,12 @@ class RecruitmentJob
field :min_salary, type: Integer, :default => 0 field :min_salary, type: Integer, :default => 0
field :max_salary, type: Integer, :default => 0 field :max_salary, type: Integer, :default => 0
# internship
field :part_time, type: Boolean, :default => false
field :internship_duration, type: Integer, :default => 0
field :perks #type1 => certificate, type2 => placement offer, type3 => informal dress code
field :filled, type: Boolean, :default => false field :filled, type: Boolean, :default => false
@ -35,6 +41,8 @@ class RecruitmentJob
belongs_to :employer_profile belongs_to :employer_profile
scope :not_filled, ->{where(:filled => false)} scope :not_filled, ->{where(:filled => false)}
scope :jobs, ->{where(:post_type => "type1")}
scope :internships, ->{where(:post_type => "type2")}
def get_category def get_category
RecruitmentCategory.find(self.category).job_category rescue "" RecruitmentCategory.find(self.category).job_category rescue ""
@ -44,4 +52,15 @@ class RecruitmentJob
EmployeeJobApplication.where(:job => self.id.to_s).not_archived.count EmployeeJobApplication.where(:job => self.id.to_s).not_archived.count
end end
def get_post_type_label
case self.post_type
when "type1"
"<span class='label label-primary'>#{I18n.t("recruitment.post_t.type1")}</span>"
when "type2"
"<span class='label label-info'>#{I18n.t("recruitment.post_t.type2")}</span>"
when "type3"
"<span class='label label-warning'>#{I18n.t("recruitment.post_t.type3")}</span>"
end
end
end end

View File

@ -4,7 +4,7 @@
</h3> </h3>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<% if @profile.is_employer? %> <% if @profile.is_employer? %>
<li role="presentation" class="<%= params[:action] == "recruitment_dashboard" ? "active" : "" %>"><a href="<%= mydashboard_path %>"><%= t("recruitment.jobs") %></a></li> <li role="presentation" class="<%= params[:action] == "recruitment_dashboard" ? "active" : "" %>"><a href="<%= mydashboard_path %>"><%= t("recruitment.dashboard") %></a></li>
<li role="presentation" class="<%= params[:action] == "editprofile" ? "active" : "" %>"><a href="<%= editprofile_path %>"><%= t("recruitment.profile") %></a></li> <li role="presentation" class="<%= params[:action] == "editprofile" ? "active" : "" %>"><a href="<%= editprofile_path %>"><%= t("recruitment.profile") %></a></li>
<% elsif @profile.is_employee? %> <% elsif @profile.is_employee? %>
<li role="presentation" class="<%= params[:action] == "recruitment_dashboard" ? "active" : "" %>"><a href="<%= mydashboard_path %>"><%= t("recruitment.dashboard") %></a></li> <li role="presentation" class="<%= params[:action] == "recruitment_dashboard" ? "active" : "" %>"><a href="<%= mydashboard_path %>"><%= t("recruitment.dashboard") %></a></li>
@ -16,7 +16,8 @@
<% end %> <% end %>
</ul> </ul>
<% if params[:action] == "recruitment_dashboard" && @profile.is_employer? %> <% if params[:action] == "recruitment_dashboard" && @profile.is_employer? %>
<div class="add-job"> <div class="add-job pull-right">
<a href="<%= addjob_path %>" class="pull-right btn btn-primary"><%= t("recruitment.add_job") %></a> <a href="<%= addjob_path %>" class="btn btn-primary"><%= t("recruitment.add_job") %></a>
<a href="<%= addinternship_path %>" class="btn btn-info"><%= t("recruitment.add_internship") %></a>
</div> </div>
<% end %> <% end %>

View File

@ -1,7 +1,8 @@
<table class="table table-striped jobs-table"> <table class="table table-striped jobs-table">
<thead> <thead>
<tr> <tr>
<th><%= t("recruitment.job_title") %></th> <th><%= t("recruitment.post_type") %></th>
<th><%= t("recruitment.title") %></th>
<th><%= t("recruitment.company_name") %></th> <th><%= t("recruitment.company_name") %></th>
<th><%= t("recruitment.applied_date") %></th> <th><%= t("recruitment.applied_date") %></th>
</tr> </tr>
@ -13,6 +14,7 @@
<% @applications.each do |app| %> <% @applications.each do |app| %>
<% job = app.get_job %> <% job = app.get_job %>
<tr> <tr>
<td><%= job.get_post_type_label.html_safe %></td>
<td><a href="<%= @page + "/" + job.to_param %>" target="_blank"><%= job.job_title %></a></td> <td><a href="<%= @page + "/" + job.to_param %>" target="_blank"><%= job.job_title %></a></td>
<td><%= job.employer_profile.company_name %></td> <td><%= job.employer_profile.company_name %></td>
<td><%= app.created_at.strftime("%d %B %Y") %></td> <td><%= app.created_at.strftime("%d %B %Y") %></td>

View File

@ -10,12 +10,7 @@
<%= javascript_include_tag "lib/file-type" %> <%= javascript_include_tag "lib/file-type" %>
<%# end %> <%# end %>
<style type="text/css"> <style type="text/css">
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
.bootstrap-datetimepicker-widget ul{ .bootstrap-datetimepicker-widget ul{
list-style: none; list-style: none;
padding: 10px 25px; padding: 10px 25px;

View File

@ -1,8 +1,9 @@
<table class="table table-striped jobs-table"> <table class="table table-striped jobs-table">
<thead> <thead>
<tr> <tr>
<th><%= t("recruitment.job_title") %></th> <th><%= t("recruitment.post_type") %></th>
<th><%= t("recruitment.job_posted") %></th> <th><%= t("recruitment.title") %></th>
<th><%= t("recruitment.posted_on") %></th>
<th><%= t("recruitment.position_filled") %></th> <th><%= t("recruitment.position_filled") %></th>
<th><%= t("recruitment.applications") %></th> <th><%= t("recruitment.applications") %></th>
<th><%= t("recruitment.actions") %></th> <th><%= t("recruitment.actions") %></th>
@ -14,6 +15,7 @@
<% else %> <% else %>
<% @jobsposted.each do |job| %> <% @jobsposted.each do |job| %>
<tr> <tr>
<td><%= job.get_post_type_label.html_safe %></td>
<td><a href="<%= @page + "/" + job.to_param %>" target="_blank"><%= job.job_title %></a></td> <td><a href="<%= @page + "/" + job.to_param %>" target="_blank"><%= job.job_title %></a></td>
<td><%= job.created_at.strftime("%Y-%m-%d") %></td> <td><%= job.created_at.strftime("%Y-%m-%d") %></td>
<td><%= job.filled ? "Yes" : "No" %></td> <td><%= job.filled ? "Yes" : "No" %></td>
@ -38,6 +40,7 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<div class="add-job"> <div class="add-job pull-right">
<a href="<%= addjob_path %>" class="pull-right btn btn-primary"><%= t("recruitment.add_job") %></a> <a href="<%= addjob_path %>" class="btn btn-primary"><%= t("recruitment.add_job") %></a>
<a href="<%= addinternship_path %>" class="btn btn-info"><%= t("recruitment.add_internship") %></a>
</div> </div>

View File

@ -0,0 +1,292 @@
<%# content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<%# end %>
<%# content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%# end %>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">
<a data-toggle="tab" href=".<%= locale %>"><%= t(locale) %></a>
</li>
<% end %>
</ul>
<!-- Language -->
<div class="tab-content language-area">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="<%= locale %> tab-pane fade <%= ( i == 0 ) ? "in active" : '' %>">
<!-- Job Title -->
<%= f.fields_for :job_title_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, t("recruitment.internship_title"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field locale, :class => "form-control", :value => @job.job_title_translations[locale] %>
</div>
</div>
<% end %>
<!-- Job Description -->
<%= f.fields_for :job_description_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, t("recruitment.internship_description"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area locale, :rows=>5, :class => "form-control", :value => @job.job_description_translations[locale] %>
</div>
</div>
<% end %>
<!-- Other Conditions -->
<%= f.fields_for :other_conditions_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, t("recruitment.internship_conditions"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area locale, :rows=>5, :class => "form-control", :value => @job.other_conditions_translations[locale] %>
</div>
</div>
<% end %>
</div>
<% end %>
<hr>
<!-- internship partime -->
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label for="recruitment_job_part_time">
<%= f.check_box :part_time %> <%= t("recruitment.internship_part_time") %>
</label>
</div>
</div>
</div>
<!-- internship duration -->
<div class="form-group">
<%= f.label :internship_duration, t("recruitment.internship_duration"), :class => "col-sm-2 control-label" %>
<div class="col-sm-1">
<label for="recruitment_job_internship_duration">
<%= f.number_field :internship_duration, :class => "form-control", :max => 36, :min => 1, :value => 1 %>
<%= t("recruitment.months") %>
</label>
</div>
</div>
<!-- perks -->
<div class="form-group">
<label class="col-sm-2 control-label"><%= t("recruitment.perks_title") %></label>
<div class="col-sm-8">
<label for="recruitment_job_perks_type1" class="control-label radio-label">
<%= f.radio_button :perks, "type1" %> <%= t("recruitment.perks.type1") %>
</label>
<label for="recruitment_job_perks_type2" class="control-label radio-label">
<%= f.radio_button :perks, "type2" %> <%= t("recruitment.perks.type2") %>
</label>
<label for="recruitment_job_perks_type3" class="control-label radio-label">
<%= f.radio_button :perks, "type3" %> <%= t("recruitment.perks.type3") %>
</label>
</div>
</div>
<!-- Job Category -->
<div class="form-group">
<%= f.label :category, t("recruitment.category"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.select :category, RecruitmentCategory.all.asc(:job_category).collect{|rc| [rc.job_category,rc.id.to_s]}, {:include_blank => "Select Category"},{:class => "form-control"} %>
</div>
</div>
<!-- salary type -->
<div class="form-group">
<label class="col-sm-2 control-label"><%= t("recruitment.stipend-title") %></label>
<div class="col-sm-8">
<label for="recruitment_job_salary_type1" class="control-label radio-label">
<%= f.radio_button :salary, "type1" %> <%= t("recruitment.salary.type1") %>
</label>
<label for="recruitment_job_salary_type2" class="control-label radio-label">
<%= f.radio_button :salary, "type2" %> <%= t("recruitment.salary.type2") %>
</label>
</div>
</div>
<!-- salary range -->
<div class="form-group">
<label class="col-sm-2 control-label"><%= t("recruitment.stipend_range") %></label>
<div class="col-sm-8">
<label for="recruitment_job_min_salary" class="control-label radio-label">
<%= t("recruitment.min_salary") %> <%= f.number_field :min_salary %> <%= t("recruitment.thousands") + " / " + t("recruitment.month") %>
</label>
<label for="recruitment_job_max_salary" class="control-label radio-label">
<%= t("recruitment.max_salary") %> <%= f.number_field :max_salary %> <%= t("recruitment.thousands") + " / " + t("recruitment.month") %>
</label>
</div>
</div>
<!-- location of work -->
<div class="form-group">
<%= f.label :location_of_work, t("recruitment.location"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.text_field :location_of_work, :class => "form-control"%>
</div>
</div>
<!-- Industrial area -->
<div class="form-group">
<%= f.label :industrial_area, t("recruitment.industrial_area"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.text_field :industrial_area, :class => "form-control"%>
</div>
</div>
<!-- travel assignment type -->
<div class="form-group">
<label class="col-sm-2 control-label"><%= t("recruitment.travel") %></label>
<div class="col-sm-8">
<label for="recruitment_job_travel_assignment_type1" class="control-label radio-label">
<%= f.radio_button :travel_assignment, "type1" %> <%= t("recruitment.travel_assignment.type1") %>
</label>
<label for="recruitment_job_travel_assignment_type2" class="control-label radio-label">
<%= f.radio_button :travel_assignment, "type2" %> <%= t("recruitment.travel_assignment.type2") %>
</label>
<label for="recruitment_job_travel_assignment_type3" class="control-label radio-label">
<%= f.radio_button :travel_assignment, "type3" %> <%= t("recruitment.travel_assignment.type3") %>
</label>
</div>
</div>
<!-- Working Hours -->
<div class="form-group">
<label class="col-sm-2 control-label"><%= t("recruitment.workingtime_title") %></label>
<div class="col-sm-8">
<label for="recruitment_job_working_time_type1" class="control-label radio-label">
<%= f.radio_button :working_time, "type1" %> <%= t("recruitment.working_time.type1") %>
</label>
<label for="recruitment_job_working_time_type2" class="control-label radio-label">
<%= f.radio_button :working_time, "type2" %> <%= t("recruitment.working_time.type2") %>
</label>
</div>
</div>
<!-- Holidays -->
<div class="form-group">
<label class="col-sm-2 control-label"><%= t("recruitment.holiday_title") %></label>
<div class="col-sm-8">
<label for="recruitment_job_holiday_system_type1" class="control-label radio-label">
<%= f.radio_button :holiday_system, "type1" %> <%= t("recruitment.holiday_system.type1") %>
</label>
<label for="recruitment_job_holiday_system_type2" class="control-label radio-label">
<%= f.radio_button :holiday_system, "type2" %> <%= t("recruitment.holiday_system.type2") %>
<%= f.text_field :holiday_system_other, :disabled => true %>
</label>
</div>
</div>
<!-- Joining Day -->
<div class="form-group">
<label class="col-sm-2 control-label"><%= t("recruitment.joining") %></label>
<div class="col-sm-8">
<label for="recruitment_job_joining_time_type1" class="control-label radio-label">
<%= f.radio_button :joining_time, "type1" %> <%= t("recruitment.joining_time.type1") %>
</label>
<label for="recruitment_job_joining_time_type2" class="control-label radio-label">
<%= f.radio_button :joining_time, "type2" %> <%= t("recruitment.joining_time.type2") %>
</label>
</div>
</div>
<hr>
<!-- Work Type -->
<!-- <div class="form-group">
<label class="col-sm-2 control-label"><%#= t("recruitment.worktype_title") %></label>
<div class="col-sm-8">
<label for="recruitment_job_work_type_type1" class="control-label radio-label">
<%#= f.radio_button :work_type, "type1" %> <%#= t("recruitment.work_type.type1") %>
</label>
<label for="recruitment_job_work_type_type2" class="control-label radio-label">
<%#= f.radio_button :work_type, "type2" %> <%#= t("recruitment.work_type.type2") %>
</label>
<label for="recruitment_job_work_type_type3" class="control-label radio-label">
<%#= f.radio_button :work_type, "type3" %> <%#= t("recruitment.work_type.type3") %>
</label>
<label for="recruitment_job_work_type_type4" class="control-label radio-label">
<%#= f.radio_button :work_type, "type4" %> <%#= t("recruitment.work_type.type4") %>
</label>
<label for="recruitment_job_work_type_type5" class="control-label radio-label">
<%#= f.radio_button :work_type, "type5" %> <%#= t("recruitment.work_type.type5") %>
</label>
</div>
</div> -->
<!-- Work Experience -->
<div class="form-group">
<%= f.label :work_experience_years, t("recruitment.work_experience"), :class => "col-sm-2 control-label" %>
<div class="col-sm-1">
<%= f.number_field :work_experience_years, :class => "form-control", :max => 50, :min => 0, :value => 0 %>
<label for="recruitment_job_work_experience_years"><%= t("recruitment.years") %></label>
</div>
<div class="col-sm-1">
<%= f.number_field :work_experience_months, :class => "form-control", :max => 11, :min => 0, :value => 0 %>
<label for="recruitment_job_work_experience_months"><%= t("recruitment.months") %></label>
</div>
</div>
<!-- Academic Type -->
<div class="form-group">
<%= f.label :academic_type, t("recruitment.academic_type"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.select :academic_type, @academic_types, {:include_blank => "Select Degree"},{:class => "form-control"} %>
</div>
</div>
<!-- Academic Req -->
<div class="form-group">
<%= f.label :academic_requirement, t("recruitment.academic_requirement"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.text_area :academic_requirement, :class => "form-control"%>
</div>
</div>
<!-- Language Req -->
<div class="form-group">
<%= f.label :language_requirement, t("recruitment.language"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.text_field :language_requirement, :class => "form-control", :placeholder => t("recruitment.seperate_with_eng") %>
</div>
</div>
<!-- Tools Req -->
<div class="form-group">
<%= f.label :tools_requirement, t("recruitment.skills"), :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.text_field :skills, :class => "form-control", :placeholder => t("recruitment.seperate_with_word"), :value => @job.skills.join(", ") %>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<%= f.hidden_field :post_type, :value => "type2" %>
<%= f.hidden_field :employer_profile_id, :value => @profile.profile.id %>
<%= f.submit "Submit", :class =>"btn btn-primary" %>
<a href="<%= mydashboard_path %>" class="btn btn-default"><%= t("recruitment.cancel") %></a>
</div>
</div>
<script type="text/javascript">
$("#recruitment_job_holiday_system_type2").on("click",function(){
if($(this).is(":checked")){
$("#recruitment_job_holiday_system_other").prop("disabled",false);
$("#recruitment_job_holiday_system_other").focus();
}
})
$("#recruitment_job_holiday_system_type1").on("click",function(){
$("#recruitment_job_holiday_system_other").prop("disabled",true).val("");
})
</script>

View File

@ -230,6 +230,7 @@
<div class="form-group"> <div class="form-group">
<div class="col-sm-offset-2 col-sm-10"> <div class="col-sm-offset-2 col-sm-10">
<%= f.hidden_field :post_type, :value => "type1" %>
<%= f.hidden_field :employer_profile_id, :value => @profile.profile.id %> <%= f.hidden_field :employer_profile_id, :value => @profile.profile.id %>
<%= f.submit "Submit", :class =>"btn btn-primary" %> <%= f.submit "Submit", :class =>"btn btn-primary" %>
<a href="<%= mydashboard_path %>" class="btn btn-default"><%= t("recruitment.cancel") %></a> <a href="<%= mydashboard_path %>" class="btn btn-default"><%= t("recruitment.cancel") %></a>

View File

@ -0,0 +1,8 @@
<div id="dashboard-wrapper">
<%= render :partial => "dashboard_header" %>
<h3 class="header-title"><%= t("recruitment.add_internship") %></h3>
<hr>
<%= form_for @job, url: {:action => "createjob"}, html: {:class => "form-horizontal main-forms"} do |f| %>
<%= render :partial => "internship_form", locals: {f: f} %>
<% end %>
</div>

View File

@ -1,5 +1,7 @@
<div id="dashboard-wrapper"> <div id="dashboard-wrapper">
<%= render :partial => "dashboard_header" %> <%= render :partial => "dashboard_header" %>
<h3 class="header-title"><%= t("recruitment.add_job") %></h3>
<hr>
<%= form_for @job, url: {:action => "createjob"}, html: {:class => "form-horizontal main-forms"} do |f| %> <%= form_for @job, url: {:action => "createjob"}, html: {:class => "form-horizontal main-forms"} do |f| %>
<%= render :partial => "job_form", locals: {f: f} %> <%= render :partial => "job_form", locals: {f: f} %>
<% end %> <% end %>

View File

@ -1,4 +1,6 @@
<div id="dashboard-wrapper"> <div id="dashboard-wrapper">
<h3 class="header-title"><%= t("recruitment.edit_job") %></h3>
<hr>
<%= render :partial => "dashboard_header" %> <%= render :partial => "dashboard_header" %>
<%= form_for @job, url: "/recruit/#{@job.id.to_s}/updatejob", html: {:class => "form-horizontal main-forms"} do |f| %> <%= form_for @job, url: "/recruit/#{@job.id.to_s}/updatejob", html: {:class => "form-horizontal main-forms"} do |f| %>
<%= render :partial => "job_form", locals: {f: f} %> <%= render :partial => "job_form", locals: {f: f} %>

View File

@ -2,59 +2,63 @@
<% if data["session"] == "true" %> <% if data["session"] == "true" %>
<% if data["type"] == "jobs" %> <% if data["type"] == "jobs" %>
<%= render_view %> <%= render_view %>
<style type="text/css"> <% elsif data["type"] == "internships" %>
#applyForm .modal-dialog{ <%= render_view("internships") %>
z-index: 1100;
}
#applicationform{
padding: 10px;
}
</style>
<!-- Modal -->
<div class="modal fade" id="applyForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{job-title}}</h4>
</div>
<div class="modal-body">
<form id="applicationform" action="/recruit/applyjob" method="post" class="form-horizontal">
<div class="form-group adv-search-bar">
<label for="cover-letter">Please write a cover letter</label>
<textarea id="cover-letter" placeholder="Cover Letter" name="cover_letter" rows="5" class="form-control"></textarea>
<div class="alert alert-warning">Your CV and Rest of your profile will be sent along with it.</div>
</div>
<input type="hidden" name="job_id" id="jobid" value="">
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="applyBtn">Apply</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var formModal = $("#applyForm");
$("#jobApplicationBtn").on("click",function(){
var jobid = $(this).parent().data("jobid"),
title = $(this).parent().data("jobtitle")
formModal.find("#jobid").val(jobid);
formModal.find(".modal-title").text(title);
formModal.modal("show");
return false;
})
$("#applyBtn").on("click",function(){
formModal.find("form").submit();
})
</script>
<% elsif data["type"] == "candidates" %> <% elsif data["type"] == "candidates" %>
<%= render_view("candidate_show") %> <%= render_view("candidate_show") %>
<% end %> <% end %>
<% case data["type"]
when "jobs", "internships" %>
<style type="text/css">
#applyForm .modal-dialog{
z-index: 1100;
}
#applicationform{
padding: 10px;
}
</style>
<!-- Modal -->
<div class="modal fade" id="applyForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{job-title}}</h4>
</div>
<div class="modal-body">
<form id="applicationform" action="/recruit/applyjob" method="post" class="form-horizontal">
<div class="form-group adv-search-bar">
<label for="cover-letter">Please write a cover letter</label>
<textarea id="cover-letter" placeholder="Cover Letter" name="cover_letter" rows="5" class="form-control"></textarea>
<div class="alert alert-warning">Your CV and Rest of your profile will be sent along with it.</div>
</div>
<input type="hidden" name="job_id" id="jobid" value="">
<input type="hidden" name="authenticity_token" value="<%= form_authenticity_token %>">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="applyBtn">Apply</button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var formModal = $("#applyForm");
$("#jobApplicationBtn").on("click",function(){
var jobid = $(this).parent().data("jobid"),
title = $(this).parent().data("jobtitle")
formModal.find("#jobid").val(jobid);
formModal.find(".modal-title").text(title);
formModal.modal("show");
return false;
})
$("#applyBtn").on("click",function(){
formModal.find("form").submit();
})
</script>
<% end %>
<% else %> <% else %>
<div>Please login to view this page. <a href="<%= data["url"] %>">Login</a></div> <div>Please login to view this page. <a href="<%= data["url"] %>">Login</a></div>
<script type="text/javascript"> <script type="text/javascript">

View File

@ -2,6 +2,27 @@ en:
module_name: module_name:
recruitment: Recruitment recruitment: Recruitment
recruitment: recruitment:
post_type: Type
post_t:
type1: Job
type2: Internship
type3: Exchange
title: Title
posted_on: Posted On
edit_job: Edit Job
internship_part_time: Part Time
internship_duration: Internship Duration
perks_title: Perks
perks:
type1: Certificate
type2: Placement Offer
type3: Informal Dress Code
add_internship: Add Internship
internship_title: Internship Title
internship_description: Internship Description
internship_conditions: Internship Conditions
stipend-title: Stipend Title
stipend_range: Stipend Range
in: in in: in
min_qualification: Min Qualification min_qualification: Min Qualification
referral_already_recommended: Sorry! You already have written a recommendation for this user. referral_already_recommended: Sorry! You already have written a recommendation for this user.

View File

@ -2,6 +2,27 @@ zh_tw:
module_name: module_name:
recruitment: 招募 recruitment: 招募
recruitment: recruitment:
post_type: Type
post_t:
type1: Job
type2: Internship
type3: Exchange
title: Title
posted_on: Posted On
edit_job: Edit Job
internship_part_time: Part Time
internship_duration: Internship Duration
perks_title: Perks
perks:
type1: Certificate
type2: Placement Offer
type3: Informal Dress Code
add_internship: Add Internship
internship_title: Internship Title
internship_description: Internship Description
internship_conditions: Internship Conditions
stipend-title: Stipend Title
stipend_range: Stipend Range
in: in in: in
min_qualification: Min Qualification min_qualification: Min Qualification
referral_already_recommended: Sorry! You already have written a recommendation for this user. referral_already_recommended: Sorry! You already have written a recommendation for this user.

View File

@ -57,6 +57,8 @@ Rails.application.routes.draw do
get "/:id/write_recommendation", to: "recruitments#write_recommendation" get "/:id/write_recommendation", to: "recruitments#write_recommendation"
post "create_recommendation", to: "recruitments#create_recommendation" post "create_recommendation", to: "recruitments#create_recommendation"
delete "/:id/delete_employee_recommendation", to: "recruitments#delete_employee_recommendation" delete "/:id/delete_employee_recommendation", to: "recruitments#delete_employee_recommendation"
get "/addinternship", to: "recruitments#addinternship"
end end
end end
end end