From c9816c6344b894551046fece95c7a55f7cd6db97 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 19 Jan 2018 21:31:41 +0800 Subject: [PATCH] account settings, hint and languages --- app/controllers/recruitments_controller.rb | 23 ++++++-- .../recruitments/_dashboard_header.html.erb | 4 +- app/views/recruitments/_example_box.html.erb | 31 +++++++++++ .../recruitments/_exchange_form.html.erb | 18 ++++++- .../recruitments/_internship_form.html.erb | 45 +++++++++++----- app/views/recruitments/_job_form.html.erb | 54 +++++++++++++------ .../recruitments/account_settings.html.erb | 28 ++++++++++ app/views/recruitments/advancedform.html.erb | 8 +-- app/views/recruitments/index.html.erb | 2 +- app/views/recruitments/show.html.erb | 22 ++++---- config/locales/en.yml | 46 +++++++++++++++- config/locales/zh_tw.yml | 53 +++++++++++++++--- config/routes.rb | 3 ++ 13 files changed, 277 insertions(+), 60 deletions(-) create mode 100644 app/views/recruitments/_example_box.html.erb create mode 100644 app/views/recruitments/account_settings.html.erb diff --git a/app/controllers/recruitments_controller.rb b/app/controllers/recruitments_controller.rb index 765a4d1..97a6d56 100644 --- a/app/controllers/recruitments_controller.rb +++ b/app/controllers/recruitments_controller.rb @@ -63,7 +63,8 @@ class RecruitmentsController < PseudoSessionController { "candidates" => data, "extras" => { - "criteria" => criteria + "criteria" => criteria, + "advanced-search" => t("recruitment.advanced_search") }, "total_pages" => total_pages } @@ -116,7 +117,8 @@ class RecruitmentsController < PseudoSessionController { "jobs" => jobs, "extras" => { - "criteria" => criteria + "criteria" => criteria, + "advanced-search" => t("recruitment.advanced_search") }, "total_pages" => total_pages } @@ -279,9 +281,9 @@ class RecruitmentsController < PseudoSessionController current_loggedin_user = RecruitProfile.where(:pseudo_member_id => pu.user_name).first rescue nil if !current_loggedin_user.nil? && current_loggedin_user.is_employee? if !current_loggedin_user.profile.is_job_applied?(job.id.to_s) - applybtn = "Apply" + applybtn = "#{"recruitment.apply"}" else - applybtn = "Already Applied" + applybtn = "#{"recruitment.already_applied"}" end end end @@ -611,6 +613,19 @@ class RecruitmentsController < PseudoSessionController @academic_types = ["type1","type2","type3"].collect{|t| [t("recruitment.academic_type.#{t}"), t]} end + # ------ ------ account settings ------ ------- # + def account_settings + end + + def update_settings + pu = PseudoUser.where(:user_name => @profile.pseudo_member_id).first + if pu.update_password(params[:password],params[:password_confirmation]) + redirect_to mydashboard_path + else + redirect_to account_settings_path(:err => "1") + end + end + private def filter_jobs(params, type) diff --git a/app/views/recruitments/_dashboard_header.html.erb b/app/views/recruitments/_dashboard_header.html.erb index 855d5e3..3269e9d 100644 --- a/app/views/recruitments/_dashboard_header.html.erb +++ b/app/views/recruitments/_dashboard_header.html.erb @@ -1,11 +1,12 @@

<%= t("recruitment.welcome") %> <%= @profile.name %>! - +

<% if params[:action] == "recruitment_dashboard" && @profile.is_employer? %> diff --git a/app/views/recruitments/_example_box.html.erb b/app/views/recruitments/_example_box.html.erb new file mode 100644 index 0000000..bcc268a --- /dev/null +++ b/app/views/recruitments/_example_box.html.erb @@ -0,0 +1,31 @@ + + + \ No newline at end of file diff --git a/app/views/recruitments/_exchange_form.html.erb b/app/views/recruitments/_exchange_form.html.erb index 145267f..739ce75 100644 --- a/app/views/recruitments/_exchange_form.html.erb +++ b/app/views/recruitments/_exchange_form.html.erb @@ -77,6 +77,10 @@ <%= fe.label locale, t("recruitment.exchange_description"), :class => "col-sm-2 control-label" %>
<%= fe.text_area locale, :rows=>5, :class => "form-control", :value => @job.job_description_translations[locale] %> +
+ + <%= t("recruitment.example") %> +
<% end %> @@ -87,6 +91,10 @@ <%= fe.label locale, t("recruitment.exchange_conditions"), :class => "col-sm-2 control-label" %>
<%= fe.text_area locale, :rows=>5, :class => "form-control", :value => @job.other_conditions_translations[locale] %> +
+ + <%= t("recruitment.example") %> +
<% end %> @@ -111,6 +119,10 @@ <%= f.number_field :internship_duration, :class => "form-control", :max => 36, :min => 1 %> <%= t("recruitment.months") %> +
+ + <%= t("recruitment.example") %> +
@@ -154,6 +166,10 @@ <%= f.label :location_of_work, t("recruitment.location"), :class => "col-sm-2 control-label" %>
<%= f.text_field :location_of_work, :class => "form-control"%> +
+ + <%= t("recruitment.example") %> +
@@ -227,7 +243,7 @@ - +<%= render :partial => "example_box" %>