From 031cc9554dfcc89d53e4604156708612c9702f99 Mon Sep 17 00:00:00 2001 From: Aday BA Date: Fri, 1 Mar 2024 21:30:59 +0000 Subject: [PATCH] Improved project directory field text in new/edit flows (#3362) --- apps/dashboard/app/views/projects/_form.html.erb | 14 +++++++++----- apps/dashboard/config/locales/en.yml | 5 ++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/dashboard/app/views/projects/_form.html.erb b/apps/dashboard/app/views/projects/_form.html.erb index b48b13568d..dd6f7f7a4c 100644 --- a/apps/dashboard/app/views/projects/_form.html.erb +++ b/apps/dashboard/app/views/projects/_form.html.erb @@ -1,3 +1,6 @@ +<% + edit_project_action = action_name != "new" && action_name != "create" +%>
Project Details
@@ -5,15 +8,16 @@
- <%= form.text_field :name, placeholder: "Project name", + <%= form.text_field :name, placeholder: I18n.t('dashboard.jobs_project_name_placeholder'), help: I18n.t('dashboard.jobs_project_name_validation') %>
+
- <%= form.text_field :directory, readonly: action_name != "new" && action_name != "create", - help: I18n.t('dashboard.jobs_project_directory_help') %> + <%= 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_area :description, placeholder: "Project description" %> + <%= form.text_area :description, placeholder: I18n.t('dashboard.jobs_project_description_placeholder') %>
<%- unless @templates.to_a.empty? -%> @@ -55,6 +59,6 @@ title: 'Clear form fields' %> <%= link_to 'Back', projects_path, class: 'btn btn-default', title: 'Return to projects page' %> -

+

diff --git a/apps/dashboard/config/locales/en.yml b/apps/dashboard/config/locales/en.yml index 34a64ef8a4..8aab718ebd 100644 --- a/apps/dashboard/config/locales/en.yml +++ b/apps/dashboard/config/locales/en.yml @@ -230,8 +230,11 @@ en: jobs_project_delete_project_confirmation: "Delete all contents of project directory?" jobs_project_not_found: "Cannot find project %{project_id}" jobs_project_manifest_updated: "Project manifest updated!" + jobs_project_name_placeholder: "Project name" jobs_project_name_validation: "Project name may only contain letters, digits, dashes, underscores, and spaces" - jobs_project_directory_help: "Override the default location for this project" + jobs_project_directory_placeholder: "Project directory absolute path" + jobs_project_directory_help_html: "Leave empty and a new directory will be created.
Default location: %{root_directory}" + jobs_project_description_placeholder: "Project description" jobs_create_blank_project: "Create a new project" jobs_create_template_project: "Create a new project from a template"