From 05a7c8ee069d81821fe6ab7c1d8acdbab1f989d4 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 18 Jan 2018 02:22:24 +0800 Subject: [PATCH] backedn with graphs and applications --- .../admin/recruitments_controller.rb | 113 ++++++++++++ app/controllers/recruitments_controller.rb | 1 + app/models/recruit_profile.rb | 17 ++ app/models/recruitment_job.rb | 13 ++ .../admin/recruitments/_member_index.html.erb | 46 +++++ .../recruitments/_posting_index.html.erb | 35 ++++ .../admin/recruitments/applications.html.erb | 19 ++ .../recruitments/company_postings.html.erb | 6 + app/views/admin/recruitments/index.html.erb | 172 +++++++++++++++++- .../admin/recruitments/load_chart.html.erb | 19 ++ .../recruitments/member_applications.html.erb | 33 ++++ .../recruitments/member_management.html.erb | 5 + .../admin/recruitments/postings.html.erb | 5 + .../admin/recruitments/show_member.html.erb | 53 ++++++ .../recruitments/_employee_dashboard.html.erb | 25 ++- .../recruitments/_exchange_form.html.erb | 2 +- .../recruitments/_internship_form.html.erb | 2 +- app/views/recruitments/_job_form.html.erb | 2 +- .../recruitments/employee_portfolio.html.erb | 8 +- config/locales/en.yml | 18 +- config/locales/zh_tw.yml | 44 +++-- config/routes.rb | 10 +- lib/recruitment/engine.rb | 14 +- 23 files changed, 628 insertions(+), 34 deletions(-) create mode 100644 app/views/admin/recruitments/_member_index.html.erb create mode 100644 app/views/admin/recruitments/_posting_index.html.erb create mode 100644 app/views/admin/recruitments/applications.html.erb create mode 100644 app/views/admin/recruitments/company_postings.html.erb create mode 100644 app/views/admin/recruitments/load_chart.html.erb create mode 100644 app/views/admin/recruitments/member_applications.html.erb create mode 100644 app/views/admin/recruitments/member_management.html.erb create mode 100644 app/views/admin/recruitments/postings.html.erb create mode 100644 app/views/admin/recruitments/show_member.html.erb diff --git a/app/controllers/admin/recruitments_controller.rb b/app/controllers/admin/recruitments_controller.rb index 1a8216a..5d1851a 100644 --- a/app/controllers/admin/recruitments_controller.rb +++ b/app/controllers/admin/recruitments_controller.rb @@ -1,5 +1,118 @@ class Admin::RecruitmentsController < OrbitAdminController + def index + @job_postings = RecruitmentJob.jobs.count + @internship_postings = RecruitmentJob.internships.count + @exchange_postings = RecruitmentJob.exchanges.count + @total_employees = EmployeeProfile.count + @total_employers = EmployerProfile.count + @total_position_filled = RecruitmentJob.filled.count + end + + def load_chart + month = params[:month].present? ? params[:month] : Time.now.month + year = params[:year].present? ? params[:year] : Time.now.year + case params[:type] + when "posting" + @startdt = DateTime.parse("#{year}/#{month}") + enddt = DateTime.parse("#{year}/#{month.to_i + 1}") + @data = {} + @data[t("recruitment.post_t.type1")] = RecruitmentJob.jobs.where(:created_at.gte => @startdt, :created_at.lt => enddt).count + @data[t("recruitment.post_t.type2")] = RecruitmentJob.internships.where(:created_at.gte => @startdt, :created_at.lt => enddt).count + @data[t("recruitment.post_t.type3")] = RecruitmentJob.exchanges.where(:created_at.gte => @startdt, :created_at.lt => enddt).count + when "registration" + @startdt = DateTime.parse("#{year}/#{month}") + enddt = DateTime.parse("#{year}/#{month.to_i + 1}") + @data = {} + @data[t("recruitment.user_type.type1")] = RecruitProfile.employees.where(:created_at.gte => @startdt, :created_at.lt => enddt).count + @data[t("recruitment.user_type.type2")] = RecruitProfile.employers.where(:created_at.gte => @startdt, :created_at.lt => enddt).count + when "filled" + @startdt = DateTime.parse("#{year}/#{month}") + enddt = DateTime.parse("#{year}/#{month.to_i + 1}") + @data = {} + @data[t("recruitment.post_t.type1")] = RecruitmentJob.jobs.filled.where(:created_at.gte => @startdt, :created_at.lt => enddt).count + @data[t("recruitment.post_t.type2")] = RecruitmentJob.internships.filled.where(:created_at.gte => @startdt, :created_at.lt => enddt).count + @data[t("recruitment.post_t.type3")] = RecruitmentJob.exchanges.filled.where(:created_at.gte => @startdt, :created_at.lt => enddt).count + end + render :layout => false + end + + def member_management + @filter_fields = {:user_type => [{:title => t("recruitment.user_type.type1"), :id => "1"},{:title => t("recruitment.user_type.type2"), :id => "2"}]} + @table_fields = ["recruitment.name", "recruitment.user_type_title", "recruitment.actions"] + if params[:filters].present? && params[:filters]["user_type"].present? + numbers = params[:filters]["user_type"].collect{|ut| ut.to_i} + @users = RecruitProfile.where(:user_type.in => numbers).order_by(sort) + else + @users = RecruitProfile.all.order_by(sort) + end + @users = search_data(@users,[:pseudo_member_id, :email, :first_name, :last_name]).page(params[:page]).per(10) + if request.xhr? + render :partial => "member_index" + end + end + + def postings + @filter_fields = {:application_type => [{:title => "recruitment.post_t.type1", :id => "type1"},{:title => "recruitment.post_t.type2", :id => "type2"},{:title => "recruitment.post_t.type3", :id => "type3"}]} + @table_fields = ["recruitment.job_title", "recruitment.company_name", "recruitment.position_filled", "recruitment.number_of_applicants", "recruitment.post_type", "recruitment.actions"] + if params[:filters].present? && params[:filters]["application_type"].present? + @jobs = RecruitmentJob.where(:post_type.in => params[:filters]["application_type"]) + else + @jobs = RecruitmentJob.all + end + @jobs = search_data(@jobs,[:job_title]).page(params[:page]).per(10) + if request.xhr? + render :partial => "posting_index" + end + end + + def show_member + @user = RecruitProfile.find(params[:id]) + @profile = @user.profile + end + + def applications + @job = RecruitmentJob.find(params[:id]) + @applications = EmployeeJobApplication.where(:job => @job.id.to_s).not_archived + @table_fields = ["recruitment.name", "recruitment.applied_date"] + end + + def member_applications + @user = RecruitProfile.find(params[:id]) + profile = @user.profile + @applications = profile.employee_job_applications.not_archived + @table_fields = ["recruitment.job_title", "recruitment.company_name", "recruitment.applied_date", "recruitment.post_type"] + end + + def company_postings + @user = RecruitProfile.find(params[:id]) + profile = @user.profile + @jobs = profile.recruitment_jobs + @filter_fields = {:application_type => [{:title => "recruitment.post_t.type1", :id => "type1"},{:title => "recruitment.post_t.type2", :id => "type2"},{:title => "recruitment.post_t.type3", :id => "type3"}]} + @table_fields = ["recruitment.job_title", "recruitment.company_name", "recruitment.position_filled", "recruitment.number_of_applicants", "recruitment.post_type", "recruitment.actions"] + if params[:filters].present? && params[:filters]["application_type"].present? + @jobs = @jobs.where(:post_type.in => params[:filters]["application_type"]) + end + @jobs = search_data(@jobs,[:job_title]).page(params[:page]).per(10) + if request.xhr? + render :partial => "posting_index" + end + end + + def delete_user + user = RecruitProfile.find(params[:id]) + if params[:status].present? + if params[:status] == "disable" + user.disable_user + elsif params[:status] == "enable" + user.enable_user + end + else + pu = PseudoUser.where(:user_name => user.pseudo_member_id).first + user.destroy + pu.destroy + end + redirect_to member_management_admin_recruitments_path(:page => params[:page]) end def industries diff --git a/app/controllers/recruitments_controller.rb b/app/controllers/recruitments_controller.rb index 9fc7753..f2328eb 100644 --- a/app/controllers/recruitments_controller.rb +++ b/app/controllers/recruitments_controller.rb @@ -692,6 +692,7 @@ class RecruitmentsController < PseudoSessionController par[:employee_profile_attributes][:skills] = par[:employee_profile_attributes][:skills].split(",") par[:employee_profile_attributes][:skills].collect!{|sk| sk.strip} end + # debugger par end diff --git a/app/models/recruit_profile.rb b/app/models/recruit_profile.rb index 2f881a0..42a559d 100644 --- a/app/models/recruit_profile.rb +++ b/app/models/recruit_profile.rb @@ -11,6 +11,7 @@ class RecruitProfile field :first_name, as: :slug_title field :last_name field :user_type, type: Integer, default: 1 + field :enabled, type: Boolean, :default => true scope :employers, ->{ where(user_type: self::EMPLOYER) } scope :employees, ->{ where(user_type: self::EMPLOYEE) } @@ -22,6 +23,22 @@ class RecruitProfile accepts_nested_attributes_for :employer_profile, :allow_destroy => true + def disable_user + pu = PseudoUser.where(:user_name => self.pseudo_member_id).first + pu.enabled = false + self.enabled = false + pu.save + self.save + end + + def enable_user + pu = PseudoUser.where(:user_name => self.pseudo_member_id).first + pu.enabled = true + self.enabled = true + pu.save + self.save + end + def name self.first_name + " " + self.last_name rescue self.email end diff --git a/app/models/recruitment_job.rb b/app/models/recruitment_job.rb index 10d0416..4d83ec0 100644 --- a/app/models/recruitment_job.rb +++ b/app/models/recruitment_job.rb @@ -45,8 +45,10 @@ class RecruitmentJob belongs_to :employer_profile scope :not_filled, ->{where(:filled => false)} + scope :filled, ->{where(:filled => true)} scope :jobs, ->{where(:post_type => "type1")} scope :internships, ->{where(:post_type => "type2")} + scope :exchanges, ->{where(:post_type => "type3")} def get_category RecruitmentCategory.find(self.category).job_category rescue "" @@ -67,4 +69,15 @@ class RecruitmentJob end end + def get_job_page + case self.post_type + when "type1" + "jobs" + when "type2" + "internships" + when "type3" + "exchanges" + end + end + end \ No newline at end of file diff --git a/app/views/admin/recruitments/_member_index.html.erb b/app/views/admin/recruitments/_member_index.html.erb new file mode 100644 index 0000000..37b8c6b --- /dev/null +++ b/app/views/admin/recruitments/_member_index.html.erb @@ -0,0 +1,46 @@ + + + + + + <% @table_fields.each do |f| %> + <%= thead(f) %> + <% end %> + + + + <% @users.each do |user| %> + + + + + + <% end %> + +
+ <% if user.is_employee? %> + " target="_blank" ><%= user.name %> + <% elsif user.is_employer? %> + <%= user.profile.company_name %> + <% end %> + <%= t("recruitment.user_type.type#{user.user_type.to_s}") %> + <% if user.enabled %> + params[:page]) %>" data-method="delete" class="btn btn-warning"><%= t("recruitment.disable_user") %> + <% else %> + params[:page]) %>" data-method="delete" class="btn btn-success"><%= t("recruitment.enable_user") %> + <% end %> + <%= t(:_delete) %> + <% if user.is_employee? %> + <%= t("recruitment.show_applications") %> + <% elsif user.is_employer? %> + <%= t("recruitment.show_jobs") %> + <% end %> +
+ +<%= + content_tag :div, class: "bottomnav clearfix" do + content_tag :div, paginate(@users), class: "pagination pagination-centered" + end +%> \ No newline at end of file diff --git a/app/views/admin/recruitments/_posting_index.html.erb b/app/views/admin/recruitments/_posting_index.html.erb new file mode 100644 index 0000000..87b3d14 --- /dev/null +++ b/app/views/admin/recruitments/_posting_index.html.erb @@ -0,0 +1,35 @@ + + + + + + <% @table_fields.each do |f| %> + <%= thead(f) %> + <% end %> + + + + <% @jobs.each do |job| %> + + + + + <% jobcount = job.get_application_count %> + + + + + <% end %> + +
<%= job.job_title %><%= job.employer_profile.company_name %>"><%= (job.filled ? "Yes" : "No" ) %><%= jobcount %><%= job.get_post_type_label.html_safe %> + <% if jobcount > 0 %> + <%= t("recruitment.show_application") %> + <% end %> +
+<%= + content_tag :div, class: "bottomnav clearfix" do + content_tag :div, paginate(@jobs), class: "pagination pagination-centered" + end +%> \ No newline at end of file diff --git a/app/views/admin/recruitments/applications.html.erb b/app/views/admin/recruitments/applications.html.erb new file mode 100644 index 0000000..f92c1c9 --- /dev/null +++ b/app/views/admin/recruitments/applications.html.erb @@ -0,0 +1,19 @@ +

Applications for <%= @job.job_title %> ~ <%= @job.employer_profile.company_name %>

+ + + + <% @table_fields.each do |f| %> + <%= thead(f) %> + <% end %> + + + + <% @applications.each do |app| %> + + + + + <% end %> + +
<%= app.employee_profile.recruit_profile.name %><%= app.created_at.strftime("%Y/%m/%d") %>
+<%= t(:back) %> \ No newline at end of file diff --git a/app/views/admin/recruitments/company_postings.html.erb b/app/views/admin/recruitments/company_postings.html.erb new file mode 100644 index 0000000..6ea72b4 --- /dev/null +++ b/app/views/admin/recruitments/company_postings.html.erb @@ -0,0 +1,6 @@ +<%= csrf_meta_tag %> +<%= render_filter @filter_fields, "index_table" %> + + <%= render 'posting_index'%> + +<%= t(:back) %> diff --git a/app/views/admin/recruitments/index.html.erb b/app/views/admin/recruitments/index.html.erb index 447b721..717d0e9 100644 --- a/app/views/admin/recruitments/index.html.erb +++ b/app/views/admin/recruitments/index.html.erb @@ -1 +1,171 @@ -backend index \ No newline at end of file +<%= javascript_include_tag "//www.google.com/jsapi", "chartkick"%> + +
+

Summary

+ +
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/app/views/admin/recruitments/load_chart.html.erb b/app/views/admin/recruitments/load_chart.html.erb new file mode 100644 index 0000000..e5a85dd --- /dev/null +++ b/app/views/admin/recruitments/load_chart.html.erb @@ -0,0 +1,19 @@ +<% if params[:type] == "posting" %> +

+ Posting statistics for the month + <%= @startdt.strftime("%B %Y") %> +

+ <%= column_chart @data, ytitle: t("recruitment.number_of_posts"), label: t("recruitment.number_of_posts"), id: "posting_chart" %> +<% elsif params[:type] == "registration" %> +

+ Registration statistics for the month + <%= @startdt.strftime("%B %Y") %> +

+ <%= column_chart @data, ytitle: t("recruitment.number_of_registered_users"), label: t("recruitment.number_of_registered_users"), id: "registration_chart", colors: ["#f2096e"] %> +<% elsif params[:type] == "filled" %> +

+ Positions filled statistics for the month + <%= @startdt.strftime("%B %Y") %> +

+ <%= column_chart @data, ytitle: t("recruitment.number_of_positions_filled"), label: t("recruitment.number_of_positions_filled"), id: "filled_chart", colors: ["#aff109"] %> +<% end %> \ No newline at end of file diff --git a/app/views/admin/recruitments/member_applications.html.erb b/app/views/admin/recruitments/member_applications.html.erb new file mode 100644 index 0000000..804b56c --- /dev/null +++ b/app/views/admin/recruitments/member_applications.html.erb @@ -0,0 +1,33 @@ +

Applications for <%= @user.name %>

+ + + + <% @table_fields.each do |f| %> + <%= thead(f) %> + <% end %> + + + + <% @applications.each do |app| %> + + <% + job = app.get_job + company_profile = job.employer_profile + %> + + + + + + <% end %> + +
+ " target="_blank"><%= job.job_title %> + + <%= company_profile.company_name %> + + <%= app.created_at.strftime("%y/%m/%d") %> + + <%= job.get_post_type_label.html_safe %> +
+Back \ No newline at end of file diff --git a/app/views/admin/recruitments/member_management.html.erb b/app/views/admin/recruitments/member_management.html.erb new file mode 100644 index 0000000..3b8e61c --- /dev/null +++ b/app/views/admin/recruitments/member_management.html.erb @@ -0,0 +1,5 @@ +<%= csrf_meta_tag %> +<%= render_filter @filter_fields, "index_table" %> + + <%= render 'member_index'%> + \ No newline at end of file diff --git a/app/views/admin/recruitments/postings.html.erb b/app/views/admin/recruitments/postings.html.erb new file mode 100644 index 0000000..23c6e29 --- /dev/null +++ b/app/views/admin/recruitments/postings.html.erb @@ -0,0 +1,5 @@ +<%= csrf_meta_tag %> +<%= render_filter @filter_fields, "index_table" %> + + <%= render 'posting_index'%> + \ No newline at end of file diff --git a/app/views/admin/recruitments/show_member.html.erb b/app/views/admin/recruitments/show_member.html.erb new file mode 100644 index 0000000..fdf9542 --- /dev/null +++ b/app/views/admin/recruitments/show_member.html.erb @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<%= t("recruitment.name") %><%= @user.name %>
<%= t("recruitment.company_name") %><%= @profile.company_name %>
<%= t("recruitment.office_address") %><%= @profile.office_address %>
<%= t("recruitment.company_profile") %><%= @profile.company_profile %>
<%= t("recruitment.website") %><%= @profile.website %>
<%= t("recruitment.country") %><%= MiscList::COUNTRIES[@profile.country] %>
<%= t("recruitment.state") %><%= @profile.state %>
<%= t("recruitment.zipcode") %><%= @profile.zipcode %>
<%= t("recruitment.country_code") %><%= @profile.country_code %>
<%= t("recruitment.phone_number") %><%= @profile.phone_number %>
<%= t("recruitment.mobile_number") %><%= @profile.mobile_number %>
<%= t("recruitment.industry") %><%= @profile.get_industry %>
+Back \ No newline at end of file diff --git a/app/views/recruitments/_employee_dashboard.html.erb b/app/views/recruitments/_employee_dashboard.html.erb index d368f99..836b8b3 100644 --- a/app/views/recruitments/_employee_dashboard.html.erb +++ b/app/views/recruitments/_employee_dashboard.html.erb @@ -14,17 +14,26 @@ <% @applications.each do |app| %> <% job = app.get_job %> - <%= job.get_post_type_label.html_safe %> - <% if job.post_type == "type1" %> - " target="_blank"><%= job.job_title %> - <% elsif job.post_type == "type2" %> - " target="_blank"><%= job.job_title %> - <% elsif job.post_type == "type3" %> - " target="_blank"><%= job.job_title %> + <% if !job.nil? %> + <%= job.get_post_type_label.html_safe %> + <% else %> + <%= t("recruitment.not_available") %> + <% end %> + + <% if !job.nil? %> + <% if job.post_type == "type1" %> + " target="_blank"><%= job.job_title %> + <% elsif job.post_type == "type2" %> + " target="_blank"><%= job.job_title %> + <% elsif job.post_type == "type3" %> + " target="_blank"><%= job.job_title %> + <% end %> + <% else %> + <%= t("recruitment.not_available") %> <% end %> - <%= job.employer_profile.company_name %> + <%= job.employer_profile.company_name rescue t("recruitment.not_available") %> <%= app.created_at.strftime("%d %B %Y") %> <% end %> diff --git a/app/views/recruitments/_exchange_form.html.erb b/app/views/recruitments/_exchange_form.html.erb index 0791dd3..dd526d5 100644 --- a/app/views/recruitments/_exchange_form.html.erb +++ b/app/views/recruitments/_exchange_form.html.erb @@ -196,7 +196,7 @@
- <%= f.label :academic_type, t("recruitment.academic_type"), :class => "col-sm-2 control-label" %> + <%= f.label :academic_type, t("recruitment.academic_type_title"), :class => "col-sm-2 control-label" %>
<%= f.select :academic_type, @academic_types, {:include_blank => "Select Degree"},{:class => "form-control"} %>
diff --git a/app/views/recruitments/_internship_form.html.erb b/app/views/recruitments/_internship_form.html.erb index 1d2769e..618f4d4 100644 --- a/app/views/recruitments/_internship_form.html.erb +++ b/app/views/recruitments/_internship_form.html.erb @@ -237,7 +237,7 @@
- <%= f.label :academic_type, t("recruitment.academic_type"), :class => "col-sm-2 control-label" %> + <%= f.label :academic_type, t("recruitment.academic_type_title"), :class => "col-sm-2 control-label" %>
<%= f.select :academic_type, @academic_types, {:include_blank => "Select Degree"},{:class => "form-control"} %>
diff --git a/app/views/recruitments/_job_form.html.erb b/app/views/recruitments/_job_form.html.erb index d6ea2e4..d687109 100644 --- a/app/views/recruitments/_job_form.html.erb +++ b/app/views/recruitments/_job_form.html.erb @@ -198,7 +198,7 @@
- <%= f.label :academic_type, t("recruitment.academic_type"), :class => "col-sm-2 control-label" %> + <%= f.label :academic_type, t("recruitment.academic_type_title"), :class => "col-sm-2 control-label" %>
<%= f.select :academic_type, @academic_types, {:include_blank => "Select Degree"},{:class => "form-control"} %>
diff --git a/app/views/recruitments/employee_portfolio.html.erb b/app/views/recruitments/employee_portfolio.html.erb index a6a186e..66190e2 100644 --- a/app/views/recruitments/employee_portfolio.html.erb +++ b/app/views/recruitments/employee_portfolio.html.erb @@ -180,9 +180,9 @@
\ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 89cddca..b6b2f6a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2,6 +2,22 @@ en: module_name: recruitment: Recruitment recruitment: + show_jobs: Show Jobs + number_of_positions_filled: Number of position filled + number_of_registered_users: Number of registered users + select_year: Year + select_month: Month + postings: Postings + number_of_posts: Number of Posts + number_of_applicants: Number of Applications + applications: Applications + disable_user: Disable User + enable_user: Enable User + user_type_title: User Type + user_type: + type1: Employee + type2: Employer + stats: Statistics file: File download_file: Download File add_exchange: Add Exchange @@ -53,7 +69,7 @@ en: request_letter: Request Letter request: Request recommendation: Recommendations - academic_type: Academic Type + academic_type_title: Academic Type salary_range: Salary Range min_salary: Min Salary max_salary: Max Salary diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index a559e63..79b0256 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -2,16 +2,32 @@ zh_tw: module_name: recruitment: 招募 recruitment: - file: File - download_file: Download File - add_exchange: Add Exchange - edit_internship: Edit Internship - min_credit_score: Min Credit Score - exchange_title: Exchange Title - exchange_description: Exchange Description - exchange_conditions: Exchange Information - exchange_duration: Exchange Duration - exchange_start_date: Exchange Start Date + show_jobs: Show Jobs + number_of_positions_filled: Number of position filled + number_of_registered_users: Number of registered users + select_year: Year + select_month: Month + postings: Postings + number_of_posts: Number of Posts + number_of_applicants: Number of Applications + applications: 應用 + disable_user: 停止用戶 + enable_user: 啟動用戶 + user_type_title: 使用者類型 + user_type: + type1: 僱員 + type2: 雇主 + stats: 數據 + file: 檔案 + download_file: 下載資料 + add_exchange: 新增交換學生 + edit_internship: 編輯 實習生 + min_credit_score: 最低需求信用點 + exchange_title: 交換學生名義 + exchange_description: 交換描述 + exchange_conditions: 交換資訊 + exchange_duration: 交換期間 + exchange_start_date: 交換日期 post_type: 公告類型 post_t: type1: 正職 @@ -33,7 +49,7 @@ zh_tw: internship_conditions: 實習工作條件 stipend-title: 實習薪資 stipend_range: 實習薪資範圍 - in: in + in: 專精於 min_qualification: 最低需求 referral_already_recommended: 報歉,您已經撰寫此使用者的推薦函. name: 名字 @@ -53,7 +69,7 @@ zh_tw: request_letter: 需求信件 request: 需求 recommendation: 建議 - academic_type: 學術類型 + academic_type_title: 學術類型 salary_range: 工資範圍 min_salary: 最低薪資 max_salary: 最高薪資 @@ -87,13 +103,13 @@ zh_tw: type1: 待業中 type2: 就業中 website: 網址 - avatar: Avatar + avatar: 上傳圖片 address: 地址 next: 下一個 job_posted: 公開職缺 position_filled: 值缺已滿 applications: 申請 - actions: Actions + actions: 動作 no_jobs_posted: 未有相關工作需求 show_application: 展示 應用 edit: 編輯 diff --git a/config/routes.rb b/config/routes.rb index ad1cbda..566a9b7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,18 +9,24 @@ Rails.application.routes.draw do get "categories" get "addindustry" post "createindustry" - + get "member_management" get "addcategory" post "createcategory" + get "postings" + get "load_chart" end member do delete "deleteindustry" get "editindustry" patch "updateindustry" - + delete "delete_user" delete "deletecategory" get "editcategory" patch "updatecategory" + get "applications" + get "show_member" + get "member_applications" + get "company_postings" end end end diff --git a/lib/recruitment/engine.rb b/lib/recruitment/engine.rb index 7ad646b..59daca1 100644 --- a/lib/recruitment/engine.rb +++ b/lib/recruitment/engine.rb @@ -13,12 +13,24 @@ module Recruitment active_for_controllers (['admin/recruitments']) head_link_path "admin_recruitments_path" - context_link 'recruitment.members', + context_link 'recruitment.stats', :link_path=>"admin_recruitments_path" , :priority=>1, :active_for_action=>{'admin/recruitments'=>"index"}, :available_for => 'managers' + context_link 'recruitment.members', + :link_path=>"member_management_admin_recruitments_path" , + :priority=>1, + :active_for_action=>{'admin/recruitments'=>"member_management"}, + :available_for => 'managers' + + context_link 'recruitment.postings', + :link_path=>"postings_admin_recruitments_path" , + :priority=>1, + :active_for_action=>{'admin/recruitments'=>"postings"}, + :available_for => 'managers' + context_link 'recruitment.industries', :link_path=>"industries_admin_recruitments_path" , :priority=>1,