diff --git a/apps/dashboard/app/javascript/projects_new.js b/apps/dashboard/app/javascript/projects_new.js index 8aaca8fa37..1c38d680ab 100644 --- a/apps/dashboard/app/javascript/projects_new.js +++ b/apps/dashboard/app/javascript/projects_new.js @@ -1,7 +1,10 @@ 'use strict'; +import { attachPathSelectors } from './path_selector/path_selector'; + jQuery(function() { $("#project_template").on('change', (event) => templateChange(event)); + attachPathSelectors(); }); function templateChange(event) { diff --git a/apps/dashboard/app/views/projects/_form.html.erb b/apps/dashboard/app/views/projects/_form.html.erb index dd6f7f7a4c..5f362d9e63 100644 --- a/apps/dashboard/app/views/projects/_form.html.erb +++ b/apps/dashboard/app/views/projects/_form.html.erb @@ -1,6 +1,21 @@ <% edit_project_action = action_name != "new" && action_name != "create" + + path_selector_id = "project_directory_path_selector" + + path_selector_locals = { + path_selector_id: path_selector_id, + show_files: false, + show_hidden: false, + initial_directory: CurrentUser.home, + table_id: "#{path_selector_id}_table", + breadcrumb_id: "#{path_selector_id}_breadcrumb", + button_id: "#{path_selector_id}_button", + input_field_id: 'project_directory', + favorites: false + } %> +
Project Details
@@ -13,9 +28,18 @@
- <%= form.text_field :directory, placeholder: I18n.t('dashboard.jobs_project_directory_placeholder'), - readonly: edit_project_action, help: edit_project_action ? '' : I18n.t('dashboard.jobs_project_directory_help_html', root_directory: Project.dataroot.to_s).html_safe %> + <%= form.text_field(:directory, placeholder: I18n.t('dashboard.jobs_project_directory_placeholder'), + readonly: edit_project_action, + help: edit_project_action ? '' : I18n.t('dashboard.jobs_project_directory_help_html', root_directory: Project.dataroot.to_s).html_safe, + data: { 'path-selector': true })%> + + + + <%= render(partial: 'shared/path_selector_table', locals: path_selector_locals ) %>
+
<%= form.text_area :description, placeholder: I18n.t('dashboard.jobs_project_description_placeholder') %>