employee forms completed

This commit is contained in:
Harry Bomrah 2018-01-01 21:52:15 +08:00
parent 96e759bc85
commit 060102637c
23 changed files with 1268 additions and 50 deletions

View File

@ -1 +1,2 @@
//= require jquery_ujs
//= require jquery_ujs
//= require ckeditor/init

View File

@ -6,8 +6,67 @@ class RecruitmentsController < PseudoSessionController
layout :get_layout
def index
jobs = []
params = OrbitHelper.params
if params[:page_id] == "jobs"
load_jobs(params)
elsif params[:page_id] == "candidates"
load_candidates(params)
end
end
def load_candidates(params)
data = []
if params[:type].present? && params[:type] == "aq"
candidates = advanced_filter_candidates(params)
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?
candidates = filter_candidates(params)
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
criteria = ""
candidates = EmployeeProfile.job_seekers
end
if !candidates.nil? && !candidates.is_a?(Array)
candidates = candidates.desc(:updated_at).page(OrbitHelper.page_number).per(OrbitHelper.page_data_count)
total_pages = candidates.total_pages
else
candidates = []
total_pages = 0
end
candidates.each do |candidate|
company = !candidate.current_company.nil? && candidate.current_company != "" ? candidate.current_company : candidate.get_current_exp
company = "N/A" if company.nil?
if candidate.experience_years == 0 && candidate.experience_months == 0
wey = t("recruitment.fresher")
wem = ""
else
wey = (candidate.experience_years.to_s rescue "0") + " year(s)"
wem = (candidate.experience_months.to_s rescue "0") + " month(s)"
end
data << {
"name" => candidate.recruit_profile.name,
"designation" => candidate.desired_job_title,
"company_name" => company,
"location" => candidate.desired_place,
"url_to_show" => OrbitHelper.url_to_show(candidate.recruit_profile.to_param),
"work_experience_years" => wey,
"work_experience_months" => wem,
"introduction" => candidate.introduction,
"skills" => candidate.skills.collect{|skill| {"skill-tag" => skill}},
"avatar" => candidate.get_avatar
}
end
{
"candidates" => data,
"extras" => {
"criteria" => criteria
},
"total_pages" => total_pages
}
end
def load_jobs(params)
jobs = []
if params[:type].present? && params[:type] == "aq"
rjobs = advanced_filter_jobs(params)
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>"
@ -60,6 +119,26 @@ class RecruitmentsController < PseudoSessionController
def show
params = OrbitHelper.params
if params[:page_id] == "jobs"
show_job(params)
elsif params[:page_id] == "candidates"
show_candidate(params)
end
end
def get_show_type
{
"type" => OrbitHelper.params[:page_id]
}
end
def show_candidate(params)
{
"data" => {}
}
end
def show_job(params)
job = RecruitmentJob.where(:uid => params[:uid]).first
profile = job.employer_profile
infos = []
@ -161,12 +240,58 @@ class RecruitmentsController < PseudoSessionController
def createprofile
profile = RecruitProfile.create(profile_params)
redirect_to mydashboard_path
if profile.is_employer?
redirect_to mydashboard_path
elsif profile.is_employee?
if params[:commit] == "Next" && params[:step] == "step1"
redirect_to employee_academics_path
elsif params[:commit] == "Save"
redirect_to mydashboard_path
end
end
end
def employee_academics
@academic = EmployeeAcademic.new
@academics = @profile.profile.employee_academics
@academic_types = ["type1","type2","type3","type4"].collect{|t| [t("recruitment.academic_type.#{t}"), t]}
end
def edit_employee_academic
@academic = EmployeeAcademic.find(params[:id])
@academic_types = ["type1","type2","type3","type4"].collect{|t| [t("recruitment.academic_type.#{t}"), t]}
end
def update_academic
academic = EmployeeAcademic.find(params[:id])
academic.update_attributes(employee_academic_params)
redirect_to employee_academics_path
end
def create_academic
if params[:commit] == "Add"
academic = EmployeeAcademic.create(employee_academic_params)
redirect_to employee_academics_path
elsif params[:commit] = "Next"
if params[:employee_academic][:degree_name].present?
academic = EmployeeAcademic.create(employee_academic_params)
end
redirect_to employee_portfolio_path
end
end
def employee_portfolio
end
def recruitment_dashboard
@jobsposted = @profile.profile.recruitment_jobs.desc(:created_at)
@page = "/#{I18n.locale.to_s}" + Page.where(:module => "recruitment").first.url rescue "#"
if @profile.is_employer?
@jobsposted = @profile.profile.recruitment_jobs.desc(:created_at)
@page = "/#{I18n.locale.to_s}" + Page.where(:module => "recruitment").first.url rescue "#"
elsif @profile.is_employee?
@applications = @profile.profile.employee_job_applications.desc(:created_at)
@page = "/#{I18n.locale.to_s}" + Page.where(:module => "recruitment").first.url rescue "#"
end
end
def editprofile
@ -174,7 +299,46 @@ class RecruitmentsController < PseudoSessionController
def updateprofile
@profile.update_attributes(profile_params)
redirect_to mydashboard_path
if @profile.is_employer?
redirect_to mydashboard_path
elsif @profile.is_employee?
if params[:commit] == "Next"
if params[:step] == "step3"
redirect_to employee_experience_path
elsif params[:step] == "step1"
redirect_to employee_academics_path
end
elsif params[:commit] == "Save"
redirect_to mydashboard_path
end
end
end
def employee_experience
@exeperiences = @profile.employee_profile.employee_experiences.desc(:created_at)
@experience = EmployeeExperience.new
end
def create_experience
if params[:commit] == "Add"
academic = EmployeeExperience.create(employee_exp_params)
redirect_to employee_experience_path
elsif params[:commit] = "Finish"
if params[:employee_experience][:job_title].present? || params[:employee_experience][:company_name].present?
academic = EmployeeExperience.create(employee_exp_params)
end
redirect_to mydashboard_path
end
end
def edit_employee_experience
@experience = EmployeeExperience.find(params[:id])
end
def update_exmployee_experience
experience = EmployeeExperience.find(params[:id])
experience.update_attributes(employee_exp_params)
redirect_to employee_experience_path
end
def addjob
@ -281,6 +445,12 @@ class RecruitmentsController < PseudoSessionController
rjobs
end
def filter_candidates
end
def advanced_filter_candidates
end
def get_layout
"recruit"
end
@ -290,7 +460,20 @@ class RecruitmentsController < PseudoSessionController
end
def profile_params
params.require(:recruit_profile).permit!
par = params.require(:recruit_profile).permit!
if par[:employee_profile_attributes][:skills].present?
par[:employee_profile_attributes][:skills] = par[:employee_profile_attributes][:skills].split(",")
par[:employee_profile_attributes][:skills].collect!{|sk| sk.strip}
end
par
end
def employee_academic_params
params.require(:employee_academic).permit!
end
def employee_exp_params
params.require(:employee_experience).permit!
end
def recruitment_job_params

View File

@ -0,0 +1,12 @@
class EmployeeAcademic
include Mongoid::Document
include Mongoid::Timestamps
field :academic_type #type1 -> bachelors, type2 -> masters, type3 -> phd, type4 -> course
field :degree_name, localize: true
field :start_date, type: DateTime
field :end_date, type: DateTime
field :note, localize: true
belongs_to :employee_profile
end

View File

@ -0,0 +1,14 @@
class EmployeeExperience
include Mongoid::Document
include Mongoid::Timestamps
field :company_name, localize: true
field :job_title, localize: true
field :responsibilities, localize: true
field :start_date, type: DateTime
field :end_date, type: DateTime
belongs_to :employee_profile
end

View File

@ -0,0 +1,12 @@
class EmployeeJobApplication
include Mongoid::Document
include Mongoid::Timestamps
field :job
belongs_to :employee_profile
def get_job
RecruitmentJob.find(self.job) rescue nil
end
end

View File

@ -2,5 +2,55 @@ class EmployeeProfile
include Mongoid::Document
include Mongoid::Timestamps
# personal info
mount_uploader :avatar, ImageUploader
field :gender #type1 -> male, type2 -> female, type3 -> other
field :dob, type: DateTime
field :marital_status #type1 -> unmarried, type2 -> married
field :phone_number
field :country_code
field :website
field :address, localize: true
field :autobiography, localize: true
field :employment_status #type1 -> employed, type2 -> unemployed
field :active, type: Boolean, :default => true
# job info
field :desired_job_title, localize: true
field :current_company, localize: true
field :resume_content, localize: true
field :desired_place
field :working_time #type1 -> day shift type2 -> night shift
field :skills, type: Array, :default => []
field :languages
field :recommendation1_info
field :recommendation2_info
field :experience_years, type: Integer, :default => 0
field :experience_months, type: Integer, :default => 0
field :introduction, localize: true
mount_uploader :resume, AssetUploader
belongs_to :recruit_profile
has_many :employee_academics
has_many :employee_experiences
has_many :employee_job_applications
scope :job_seekers, ->{where(:active => true)}
def get_avatar
if self.avatar.url.nil?
return "/assets/person.png"
else
return self.avatar.url
end
end
def get_current_exp
self.employee_experiences.where(:end_date => nil).first rescue nil
end
end

View File

@ -1,13 +1,14 @@
class RecruitProfile
include Mongoid::Document
include Mongoid::Timestamps
include Slug
EMPLOYEE=1
EMPLOYER=2
field :pseudo_member_id
field :email
field :first_name
field :first_name, as: :slug_title
field :last_name
field :user_type, type: Integer, default: 1

View File

@ -1,9 +1,17 @@
<h3>Welcome <strong><%= @profile.name %></strong>!</h3>
<ul class="nav nav-tabs">
<li role="presentation" class="<%= params[:action] == "recruitment_dashboard" ? "active" : "" %>"><a href="<%= mydashboard_path %>">Jobs</a></li>
<li role="presentation" class="<%= params[:action] == "editprofile" ? "active" : "" %>"><a href="<%= editprofile_path %>">Profile</a></li>
<% if @profile.is_employer? %>
<li role="presentation" class="<%= params[:action] == "recruitment_dashboard" ? "active" : "" %>"><a href="<%= mydashboard_path %>">Jobs</a></li>
<li role="presentation" class="<%= params[:action] == "editprofile" ? "active" : "" %>"><a href="<%= editprofile_path %>">Profile</a></li>
<% elsif @profile.is_employee? %>
<li role="presentation" class="<%= params[:action] == "recruitment_dashboard" ? "active" : "" %>"><a href="<%= mydashboard_path %>">Dashboard</a></li>
<li role="presentation" class="<%= params[:action] == "editprofile" ? "active" : "" %>"><a href="<%= editprofile_path %>">Profile</a></li>
<li role="presentation" class="<%= params[:action] == "employee_academics" ? "active" : "" %>"><a href="<%= employee_academics_path %>">Academics</a></li>
<li role="presentation" class="<%= params[:action] == "employee_portfolio" ? "active" : "" %>"><a href="<%= employee_portfolio_path %>">Portfolio</a></li>
<li role="presentation" class="<%= params[:action] == "employee_experience" ? "active" : "" %>"><a href="<%= employee_experience_path %>">Experience</a></li>
<% end %>
</ul>
<% if params[:action] == "recruitment_dashboard" %>
<% if params[:action] == "recruitment_dashboard" && @profile.is_employer? %>
<div class="add-job">
<a href="<%= addjob_path %>" class="pull-right btn btn-primary">Add Job</a>
</div>

View File

@ -0,0 +1,56 @@
<!-- academic type -->
<div class="form-group">
<%= f.label :academic_type, "Academic Type", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.select :academic_type, @academic_types, {}, {:class => "form-control"} %>
</div>
</div>
<!-- start date -->
<div class="form-group">
<%= f.label :start_date, "Start Date", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.datetime_picker :start_date, :no_label => true, :new_record => @academic.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
</div>
</div>
<!-- end date -->
<div class="form-group">
<%= f.label :end_date, "End Date", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.datetime_picker :end_date, :no_label => true, :new_record => @academic.new_record?, :data=>{"picker-type" => "range", "range" => "end"} %>
</div>
</div>
<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" : '' %>">
<!-- degree name -->
<%= f.fields_for :degree_name_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Degree Name", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field locale, :class => "form-control", :value => @academic.degree_name_translations[locale] %>
</div>
</div>
<% end %>
<!-- notes -->
<%= f.fields_for :note_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Note", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area locale, :rows => 10, :class => "form-control", :value => @academic.note_translations[locale] %>
</div>
</div>
<% end %>
</div>
<% end %>
</div>

View File

@ -0,0 +1,23 @@
<table class="table table-striped jobs-table">
<thead>
<tr>
<th>Job Title</th>
<th>Company Name</th>
<th>Applied Date</th>
</tr>
</thead>
<tbody>
<% if @applications.blank? %>
<tr><td class="no-jobs" colspan="3">No jobs applied.</td></tr>
<% else %>
<% @applications.each do |app| %>
<% job = app.get_job %>
<tr>
<td><a href="<%= @page + "/" + job.to_param %>" target="_blank"><%= job.job_title %></a></td>
<td><%= job.employer_profile.company_name %></td>
<td><%= app.created_at.strftime("%d %B %Y") %></td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

View File

@ -0,0 +1,61 @@
<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" : '' %>">
<!-- company name -->
<%= f.fields_for :company_name_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Company Name", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field locale, :class => "form-control", :value => @experience.company_name_translations[locale] %>
</div>
</div>
<% end %>
<!-- job title -->
<%= f.fields_for :job_title_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Job Title", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field locale, :class => "form-control", :value => @experience.job_title_translations[locale] %>
</div>
</div>
<% end %>
<!-- notes -->
<%= f.fields_for :responsibilities_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Job Responsibilities", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area locale, :rows => 10, :class => "form-control", :value => @experience.responsibilities_translations[locale] %>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
<!-- start date -->
<div class="form-group">
<%= f.label :start_date, "Start Date", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.datetime_picker :start_date, :no_label => true, :new_record => @experience.new_record?, :data=>{"picker-type" => "range", "range" => "start"} %>
</div>
</div>
<!-- end date -->
<div class="form-group">
<%= f.label :end_date, "End Date", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= f.datetime_picker :end_date, :no_label => true, :new_record => @experience.new_record?, :data=>{"picker-type" => "range", "range" => "end"} %>
<div class="hint">Leave blank if its your current job</div>
</div>
</div>

View File

@ -0,0 +1,199 @@
<%# 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-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%# end %>
<style type="text/css">
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
.bootstrap-datetimepicker-widget ul{
list-style: none;
padding: 10px 25px;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td,th{
cursor: pointer;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td.old, td.new{
color: #cecece;
}
.bootstrap-datetimepicker-widget ul td:hover,th:hover{
background-color: #5c5c5c;
color: #fff;
}
.bootstrap-datetimepicker-widget span.month{
width: 50px;
}
.default_picker span.add-on{
padding: 3px;
margin-left: 5px;
cursor: pointer;
height: 20px;
width: 20px;
text-align: center;
}
</style>
<h3 class="header-title">Employee / Fresher Personal Profile</h3>
<hr>
<%= f.fields_for :employee_profile do |fe| %>
<!-- Gender -->
<div class="form-group">
<label class="col-sm-2 control-label">Gender</label>
<div class="col-sm-8">
<label for="recruit_profile_employee_profile_attributes_gender_type1" class="control-label radio-label">
<%= fe.radio_button :gender, "type1" %> Male
</label>
<label for="recruit_profile_employee_profile_attributes_gender_type2" class="control-label radio-label">
<%= fe.radio_button :gender, "type2" %> Female
</label>
<label for="recruit_profile_employee_profile_attributes_gender_type3" class="control-label radio-label">
<%= fe.radio_button :gender, "type3" %> Other
</label>
</div>
</div>
<!-- DOB -->
<div class="form-group">
<%= fe.label :dob, "Date of Birth", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.datetime_picker :dob, :no_label => true, :new_record => @profile.new_record? %>
</div>
</div>
<!-- Martial status -->
<div class="form-group">
<label class="col-sm-2 control-label">Martial Status</label>
<div class="col-sm-8">
<label for="recruit_profile_employee_profile_attributes_marital_status_type1" class="control-label radio-label">
<%= fe.radio_button :marital_status, "type1" %> Un-Married
</label>
<label for="recruit_profile_employee_profile_attributes_marital_status_type2" class="control-label radio-label">
<%= fe.radio_button :marital_status, "type2" %> Married
</label>
</div>
</div>
<!-- country code -->
<div class="form-group">
<%= fe.label :country_code, "Country Code", :class => "col-sm-2 control-label" %>
<div class="col-sm-1">
<%= fe.text_field :country_code, :class => "form-control" %>
</div>
</div>
<!-- phone number -->
<div class="form-group">
<%= fe.label :phone_number, "Phone Number", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field :phone_number, :class => "form-control" %>
</div>
</div>
<!-- employment status -->
<div class="form-group">
<label class="col-sm-2 control-label">Employment Status</label>
<div class="col-sm-8">
<label for="recruit_profile_employee_profile_attributes_employment_status_type1" class="control-label radio-label">
<%= fe.radio_button :employment_status, "type1" %> Un-Employed
</label>
<label for="recruit_profile_employee_profile_attributes_employment_status_type2" class="control-label radio-label">
<%= fe.radio_button :employment_status, "type2" %> Employed
</label>
</div>
</div>
<!-- Website -->
<div class="form-group">
<%= fe.label :website, "Website / Link", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field :website, :class => "form-control" %>
</div>
</div>
<div class="form-group">
<%= fe.label :avatar, "Avatar", :class => "col-sm-2 control-label" %>
<div class="controls">
<div class="fileupload fileupload-new clearfix <%= 'fileupload-edit' if !@profile.new_record? && @profile.employee_profile.avatar.file %>" data-provides="fileupload">
<div class="fileupload-new thumbnail pull-left">
<% if !@profile.new_record? && @profile.employee_profile.avatar.file %>
<%= image_tag @profile.employee_profile.avatar %>
<% else %>
<img src="http://www.placehold.it/50x50/EFEFEF/AAAAAA" />
<% end %>
</div>
<div class="fileupload-preview fileupload-exists thumbnail pull-left"></div>
<span class="btn btn-file">
<span class="fileupload-new"><%= t(:select_image) %></span>
<span class="fileupload-exists"><%= t(:change) %></span>
<%= fe.file_field :avatar %>
</span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload"><%= t(:cancel) %></a>
<div class="controls" data-toggle="buttons-checkbox">
<label class="checkbox inline btn btn-danger fileupload-remove">
<%= fe.check_box :remove_avatar %><%= t(:remove) %>
</label>
</div>
</div>
</div>
</div>
<% 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" : '' %>">
<%= f.fields_for :employee_profile do |fe| %>
<!-- address -->
<%= fe.fields_for :address_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Address", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area locale, :class => "form-control", :value => @profile.employee_profile.address_translations[locale] %>
</div>
</div>
<% end %>
<!-- autobiography -->
<%= fe.fields_for :autobiography_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Autobiography", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area locale, :class => "form-control", :value => @profile.employee_profile.autobiography_translations[locale] %>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<%= f.hidden_field :pseudo_member_id, :value => current_pseudo_user.user_name %>
<%= f.hidden_field :email, :value => current_pseudo_user.email %>
<%= f.hidden_field :first_name, :value => current_pseudo_user.first_name %>
<%= f.hidden_field :last_name, :value => current_pseudo_user.last_name %>
<%= f.hidden_field :user_type, :value => "1" %>
<input type="hidden" name="step" value="step1" >
<%= f.submit "Save", :class =>"btn btn-primary" %>
<%= f.submit "Next", :class =>"btn btn-primary" %>
</div>
</div>

View File

@ -0,0 +1,37 @@
<table class="table table-striped jobs-table">
<thead>
<tr>
<th>Job Title</th>
<th>Job Posted</th>
<th>Position Filled</th>
<th>Applied Candidates</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% if @jobsposted.blank? %>
<tr><td class="no-jobs" colspan="5">No jobs posted.</td></tr>
<% else %>
<% @jobsposted.each do |job| %>
<tr>
<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.filled ? "Yes" : "No" %></td>
<td><button class="btn btn-info">Show</button></td>
<td>
<a href="/recruit/<%= job.id.to_s %>/editjob" class="btn btn-warning">Edit</a>
<% if !job.filled %>
<a href="/recruit/<%= job.id.to_s %>/markfilled" class="btn btn-primary">Mark Filled</a>
<% else %>
<a href="/recruit/<%= job.id.to_s %>/unmarkfilled" class="btn btn-success">Not Filled</a>
<% end %>
<a data-method="delete" href="/recruit/<%= job.id.to_s %>/deletejob" data-confirm="Are you sure?" class="btn btn-danger">Delete</a>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<div class="add-job">
<a href="<%= addjob_path %>" class="pull-right btn btn-primary">Add Job</a>
</div>

View File

@ -7,6 +7,18 @@
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%# end %>
<style type="text/css">
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
</style>
<h3 class="header-title">Employer Personal Profile</h3>
<hr>
<ul class="nav nav-pills language-nav">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<li class="<%= 'active' if i == 0 %>">

View File

@ -0,0 +1,65 @@
<%# 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-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%# end %>
<style type="text/css">
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
hr.dotted{
border-top: 1px dotted #5c5c5c;
}
.bootstrap-datetimepicker-widget ul{
list-style: none;
padding: 10px 25px;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td,th{
cursor: pointer;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td.old, td.new{
color: #cecece;
}
.bootstrap-datetimepicker-widget ul td:hover,th:hover{
background-color: #5c5c5c;
color: #fff;
}
.bootstrap-datetimepicker-widget span.month{
width: 50px;
}
.default_picker span.add-on{
padding: 3px;
margin-left: 5px;
cursor: pointer;
height: 20px;
width: 20px;
text-align: center;
}
</style>
<h3 class="header-title"><%= @academic.degree_name %></h3>
<hr>
<%= form_for @academic, :url => "/recruit/#{@academic.id.to_s}/update_academic", :html => {:class => "form-horizontal"} do |f| %>
<%= render :partial => "employee_academic_form", locals: {f: f} %>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<%= f.submit "Save", :class =>"btn btn-primary" %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,65 @@
<%# 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-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%# end %>
<style type="text/css">
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
hr.dotted{
border-top: 1px dotted #5c5c5c;
}
.bootstrap-datetimepicker-widget ul{
list-style: none;
padding: 10px 25px;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td,th{
cursor: pointer;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td.old, td.new{
color: #cecece;
}
.bootstrap-datetimepicker-widget ul td:hover,th:hover{
background-color: #5c5c5c;
color: #fff;
}
.bootstrap-datetimepicker-widget span.month{
width: 50px;
}
.default_picker span.add-on{
padding: 3px;
margin-left: 5px;
cursor: pointer;
height: 20px;
width: 20px;
text-align: center;
}
</style>
<h3 class="header-title"><%= @experience.company_name %> - <%= @experience.job_title %></h3>
<hr>
<%= form_for @experience, :url => "/recruit/#{@experience.id.to_s}/update_exmployee_experience", :html => {:class => "form-horizontal"} do |f| %>
<%= render :partial => "employee_experience_form", locals: {f: f} %>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<%= f.submit "Save", :class =>"btn btn-primary" %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,118 @@
<%# 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-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%# end %>
<style type="text/css">
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
hr.dotted{
border-top: 1px dotted #5c5c5c;
}
.bootstrap-datetimepicker-widget ul{
list-style: none;
padding: 10px 25px;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td,th{
cursor: pointer;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td.old, td.new{
color: #cecece;
}
.bootstrap-datetimepicker-widget ul td:hover,th:hover{
background-color: #5c5c5c;
color: #fff;
}
.bootstrap-datetimepicker-widget span.month{
width: 50px;
}
.default_picker span.add-on{
padding: 3px;
margin-left: 5px;
cursor: pointer;
height: 20px;
width: 20px;
text-align: center;
}
</style>
<div id="dashboard-wrapper">
<%= render :partial => "dashboard_header" %>
<h3 class="header-title">Academics</h3>
<hr>
<% @academics.each do |academic| %>
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">Academic Type</label>
<div class="col-sm-10">
<p class="form-control-static"><%= t("recruitment.academic_type.#{academic.academic_type}") %></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Degree Name</label>
<div class="col-sm-10">
<p class="form-control-static"><%= academic.degree_name %></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Start Date</label>
<div class="col-sm-10">
<p class="form-control-static"><%= academic.start_date.strftime("%d %B %Y") rescue "" %></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">End Date</label>
<div class="col-sm-10">
<p class="form-control-static"><%= academic.end_date.strftime("%d %B %Y") rescue "" %></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Note</label>
<div class="col-sm-10">
<%= simple_format(academic.note) %>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<a href="/recruit/<%= academic.id.to_s %>/edit_employee_academic" class="btn btn-warning">Edit</a>
</div>
</div>
</div>
<hr class="dotted">
<% end %>
<%= form_for @academic, :url => create_academic_path, :html => {:class => "form-horizontal", :id => "new-academics-form"} do |f| %>
<%= render :partial => "employee_academic_form", locals: {f: f} %>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<%= f.hidden_field :employee_profile_id, :value => @profile.profile.id.to_s %>
<%= f.submit "Add", :class =>"btn btn-primary" %>
<%= f.submit "Next", :class =>"btn btn-primary" %>
</div>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function() {
$("#new-academics-form").submit(function() {
$(this).find(":input").filter(function(){ return !this.value; }).attr("disabled", "disabled");
return true; // ensure form still submits
});
});
</script>

View File

@ -0,0 +1,118 @@
<%# 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-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%# end %>
<style type="text/css">
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
hr.dotted{
border-top: 1px dotted #5c5c5c;
}
.bootstrap-datetimepicker-widget ul{
list-style: none;
padding: 10px 25px;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td,th{
cursor: pointer;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td.old, td.new{
color: #cecece;
}
.bootstrap-datetimepicker-widget ul td:hover,th:hover{
background-color: #5c5c5c;
color: #fff;
}
.bootstrap-datetimepicker-widget span.month{
width: 50px;
}
.default_picker span.add-on{
padding: 3px;
margin-left: 5px;
cursor: pointer;
height: 20px;
width: 20px;
text-align: center;
}
</style>
<div id="dashboard-wrapper">
<%= render :partial => "dashboard_header" %>
<h3 class="header-title">Work Experience</h3>
<hr>
<% @exeperiences.each do |exp| %>
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">Company Name</label>
<div class="col-sm-10">
<p class="form-control-static"><%= exp.company_name %></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Job Title</label>
<div class="col-sm-10">
<p class="form-control-static"><%= exp.job_title %></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Start Date</label>
<div class="col-sm-10">
<p class="form-control-static"><%= exp.start_date.strftime("%d %B %Y") rescue "" %></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">End Date</label>
<div class="col-sm-10">
<p class="form-control-static"><%= exp.end_date.strftime("%d %B %Y") rescue "Currently Working" %></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Responsibilities</label>
<div class="col-sm-10">
<%= simple_format(exp.responsibilities) %>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<a href="/recruit/<%= exp.id.to_s %>/edit_employee_experience" class="btn btn-warning">Edit</a>
</div>
</div>
</div>
<hr class="dotted">
<% end %>
<%= form_for @experience, :url => create_experience_path, :html => {:class => "form-horizontal", :id => "new-exp-form"} do |f| %>
<%= render :partial => "employee_experience_form", locals: {f: f} %>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<%= f.hidden_field :employee_profile_id, :value => @profile.profile.id.to_s %>
<%= f.submit "Add", :class =>"btn btn-primary" %>
<%= f.submit "Finish", :class =>"btn btn-primary" %>
</div>
</div>
<% end %>
</div>
<script type="text/javascript">
$(function() {
$("#new-exp-form").submit(function() {
$(this).find(":input").filter(function(){ return !this.value; }).attr("disabled", "disabled");
return true; // ensure form still submits
});
});
</script>

View File

@ -0,0 +1,196 @@
<%= 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-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/file-type" %>
<%# end %>
<style type="text/css">
.header-title{
text-align: center;
}
hr{
border-top: 1px solid #5c5c5c;
}
.bootstrap-datetimepicker-widget ul{
list-style: none;
padding: 10px 25px;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td,th{
cursor: pointer;
text-align: center;
}
.bootstrap-datetimepicker-widget ul td.old, td.new{
color: #cecece;
}
.bootstrap-datetimepicker-widget ul td:hover,th:hover{
background-color: #5c5c5c;
color: #fff;
}
.bootstrap-datetimepicker-widget span.month{
width: 50px;
}
.default_picker span.add-on{
padding: 3px;
margin-left: 5px;
cursor: pointer;
height: 20px;
width: 20px;
text-align: center;
}
</style>
<div id="dashboard-wrapper">
<%= render :partial => "dashboard_header" %>
<h3 class="header-title">Employee Portfolio</h3>
<hr>
<%= form_for @profile, url: {:action => "updateprofile"}, html: {:class => "form-horizontal main-forms"} do |f| %>
<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" : '' %>">
<%= f.fields_for :employee_profile do |fe| %>
<!-- address -->
<%= fe.fields_for :desired_job_title_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Job Title", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field locale, :class => "form-control", :value => @profile.employee_profile.desired_job_title_translations[locale] %>
</div>
</div>
<% end %>
<%= fe.fields_for :current_company_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Current Company", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field locale, :class => "form-control", :value => @profile.employee_profile.current_company_translations[locale] %>
</div>
</div>
<% end %>
<%= fe.fields_for :introduction_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Introduction", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area locale, :rows => 5, :class => "form-control", :value => @profile.employee_profile.introduction_translations[locale], :placeholder => "Example: Professional developer with 6 years of experience with good knowledge of computer languages." %>
<div class="hint">This will be the first thing companies will see on your profile.</div>
</div>
</div>
<% end %>
<%= fe.fields_for :resume_content_translations do |fe| %>
<div class="form-group">
<%= fe.label locale, "Resume Content", :class => "col-sm-2 control-label" %>
<div class="col-sm-10">
<%= fe.cktext_area locale, :class => "ckeditor form-control", :value => @profile.employee_profile.resume_content_translations[locale] %>
</div>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
<%= f.fields_for :employee_profile do |fe| %>
<!-- desired place -->
<div class="form-group">
<%= fe.label :desired_place, "Current Location", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field :desired_place, :class => "form-control" %>
</div>
</div>
<!-- Working Hours -->
<div class="form-group">
<label class="col-sm-2 control-label">Working Shift</label>
<div class="col-sm-8">
<label for="recruit_profile_employee_profile_attributes_working_time_type1" class="control-label radio-label">
<%= fe.radio_button :working_time, "type1" %> Day Shift
</label>
<label for="recruit_profile_employee_profile_attributes_working_time_type2" class="control-label radio-label">
<%= fe.radio_button :working_time, "type2" %> Night Shift
</label>
</div>
</div>
<!-- Skills -->
<div class="form-group">
<%= f.label :skills, "Skills", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field :skills, :class => "form-control", :placeholder => "Seperate with (,) ex; Word, Excel", :value => (@profile.employee_profile.skills.join(", ") rescue "") %>
</div>
</div>
<!-- Language Req -->
<div class="form-group">
<%= fe.label :languages, "Language", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_field :languages, :class => "form-control", :placeholder => "Seperate with (,) ex; English, Chinese" %>
</div>
</div>
<!-- Recommendation 1-->
<div class="form-group">
<%= fe.label :recommendation1_info, "First Recommendation", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area :recommendation1_info, :rows => 5, :class => "form-control", :placeholder => "Recommendation name and contact" %>
</div>
</div>
<!-- Recommendation 2-->
<div class="form-group">
<%= fe.label :recommendation2_info, "Second Recommendation", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.text_area :recommendation2_info, :rows => 5, :class => "form-control", :placeholder => "Recommendation name and contact" %>
</div>
</div>
<!-- Resume -->
<% if !@profile.employee_profile.resume.nil? && !@profile.employee_profile.resume.url.nil? %>
<div class="form-group">
<label class="col-sm-2 control-label">Resume</label>
<div class="col-sm-10">
<p class="form-control-static"><a href="<%= @profile.employee_profile.resume.url %>" target="_blank">Download CV here</a></p>
</div>
</div>
<% end %>
<div class="form-group">
<%= fe.label :resume, "Upload Resume", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<p class="form-control-static"><%= fe.file_field :resume %></p>
</div>
</div>
<!-- Total Exp -->
<div class="form-group">
<%= fe.label :exprience_years, "Total Experience", :class => "col-sm-2 control-label" %>
<div class="col-sm-5">
<%= fe.number_field :experience_years, :class => "form-control", :max => 50, :min => 0 %> Years
</div>
<div class="col-sm-5">
<%= fe.number_field :experience_months, :class => "form-control", :max => 11, :min => 0 %> Months
</div>
</div>
<% end %>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="step" value="step3" >
<%= f.submit "Save", :class =>"btn btn-primary" %>
<%= f.submit "Next", :class =>"btn btn-primary" %>
</div>
</div>
<% end %>
</div>

View File

@ -1,41 +1,9 @@
<%= csrf_meta_tag %>
<div id="dashboard-wrapper">
<%= render :partial => "dashboard_header" %>
<table class="table table-striped jobs-table">
<thead>
<tr>
<th>Job Title</th>
<th>Job Posted</th>
<th>Position Filled</th>
<th>Applied Candidates</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% if @jobsposted.blank? %>
<tr><td class="no-jobs" colspan="5">No jobs posted.</td></tr>
<% else %>
<% @jobsposted.each do |job| %>
<tr>
<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.filled ? "Yes" : "No" %></td>
<td><button class="btn btn-info">Show</button></td>
<td>
<a href="/recruit/<%= job.id.to_s %>/editjob" class="btn btn-warning">Edit</a>
<% if !job.filled %>
<a href="/recruit/<%= job.id.to_s %>/markfilled" class="btn btn-primary">Mark Filled</a>
<% else %>
<a href="/recruit/<%= job.id.to_s %>/unmarkfilled" class="btn btn-success">Not Filled</a>
<% end %>
<a data-method="delete" href="/recruit/<%= job.id.to_s %>/deletejob" data-confirm="Are you sure?" class="btn btn-danger">Delete</a>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<div class="add-job">
<a href="<%= addjob_path %>" class="pull-right btn btn-primary">Add Job</a>
</div>
<% if @profile.is_employer? %>
<%= render :partial => "employer_dashboard" %>
<% elsif @profile.is_employee? %>
<%= render :partial => "employee_dashboard" %>
<% end %>
</div>

View File

@ -1 +1,6 @@
<%= render_view %>
<% data = action_data("get_show_type") %>
<% if data["type"] == "jobs" %>
<%= render_view %>
<% elsif data["type"] == "candidates" %>
<%= render_view("candidate_show") %>
<% end %>

View File

@ -53,4 +53,9 @@ en:
type2: Graduate
type3: Foreigner
type4: Internship
type5: SOHO
type5: SOHO
academic_type:
type1: Bachelors
type2: Masters
type3: PhD
type4: Certificate Course

View File

@ -40,6 +40,15 @@ Rails.application.routes.draw do
get "/:id/unmarkfilled", to: "recruitments#unmarkfilled"
delete "/:id/deletejob", to: "recruitments#deletejob"
get "/advancedform", to: "recruitments#advancedform"
get "/employee_academics", to: "recruitments#employee_academics"
post "/create_academic", to: "recruitments#create_academic"
get "/employee_portfolio", to: "recruitments#employee_portfolio"
get "/:id/edit_employee_academic", to: "recruitments#edit_employee_academic"
patch "/:id/update_academic", to: "recruitments#update_academic"
get "/employee_experience", to: "recruitments#employee_experience"
post "/create_experience", to: "recruitments#create_experience"
patch "/:id/update_exmployee_experience", to: "recruitments#update_exmployee_experience"
get "/:id/edit_employee_experience", to: "recruitments#edit_employee_experience"
end
end
end