diff --git a/app/controllers/personal_projects_controller.rb b/app/controllers/personal_projects_controller.rb index 6bf0107..0603a83 100644 --- a/app/controllers/personal_projects_controller.rb +++ b/app/controllers/personal_projects_controller.rb @@ -7,7 +7,7 @@ class PersonalProjectsController < ApplicationController title_is_paper_format = false fields_to_show = page.custom_array_field rescue [] if fields_to_show.blank? - fields_to_show = ["year", "project_title", "project_number", "member_profile", "participants"] + fields_to_show = ["year", "project_title", "project_number", "member_profile", "jobs", "participants"] end if params[:keywords].present? projects = filter_keywords(projects,params[:selectbox],params[:keywords]) @@ -17,7 +17,7 @@ class PersonalProjectsController < ApplicationController {'jps' => fields_to_show.map{|field| {"value"=> get_display_field(project,field, title_is_paper_format)}}} end - extras = {"th-year" => I18n.t("personal_project.year"), "th-project_title" => I18n.t("personal_project.project_title"), "th-project_number" => I18n.t("personal_project.project_number"), "th-member_profile" => I18n.t("personal_project.member_profile"), "th-participants" => I18n.t("personal_project.participants")} + extras = {"th-year" => I18n.t("personal_project.year"), "th-project_title" => I18n.t("personal_project.project_title"), "th-project_number" => I18n.t("personal_project.project_number"), "th-member_profile" => I18n.t("personal_project.member_profile"), "th-jobs" => I18n.t("personal_project.jobs"), "th-participants" => I18n.t("personal_project.participants")} choice_show = [] headers = [] fields_to_show.each do |fs| @@ -62,7 +62,7 @@ class PersonalProjectsController < ApplicationController def show params = OrbitHelper.params plugin = Project.where(:is_hidden=>false).find_by(uid: params[:uid].to_s) - fields_to_show = ["year", "project_title", "project_number", "member_profile", "period_start_date", "period_end_date", "unit", "participants"] + fields_to_show = ["year", "project_title", "project_number", "member_profile", "period_start_date", "period_end_date", "unit", "jobs", "participants"] {"plugin_datas"=>plugin.get_plugin_data(fields_to_show)} end @@ -120,10 +120,10 @@ class PersonalProjectsController < ApplicationController end def get_fields_for_index @page = Page.find(params[:page_id]) rescue nil - @fields_to_show = ["year", "project_title", "project_number", "period_start_date", "period_end_date", "unit", "participants"] + @fields_to_show = ["year", "project_title", "project_number", "period_start_date", "period_end_date", "unit", "jobs", "participants"] @fields_to_show = @fields_to_show.map { |fs| [t("personal_project.#{fs}"), fs] } if @page.present? && @page.custom_string_field == 'table' - @default_fields_to_show = ["year", "project_title", "project_number", "member_profile", "participants"] + @default_fields_to_show = ["year", "project_title", "project_number", "member_profile", "jobs", "participants"] else @default_fields_to_show = ["year", "project_title"] end diff --git a/app/models/project.rb b/app/models/project.rb index 9dfdf96..7cd5e42 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -12,6 +12,7 @@ class Project field :period_start_date, :type => Date, :default => Date.today field :period_end_date, :type => Date, :default => Date.today field :unit, :type => String, :default => "", :localize => true + field :jobs, :type => String, :default => "", :localize => true field :participants, :type => String, :default => "", :localize => true diff --git a/app/views/admin/projects/_form.html.erb b/app/views/admin/projects/_form.html.erb index 23aa5b6..f227604 100644 --- a/app/views/admin/projects/_form.html.erb +++ b/app/views/admin/projects/_form.html.erb @@ -53,6 +53,15 @@