Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/dashboard/app/helpers/batch_connect/sessions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def relaunch(session)

user_context = session.user_context
params = batch_connect_app.attributes.map{|attribute| ["batch_connect_session_context[#{attribute.id}]", user_context.fetch(attribute.id, nil)]}.to_h.compact
title = "#{t('dashboard.batch_connect_sessions_relaunch_title')} #{session.title} #{t('dashboard.batch_connect_sessions_word')}"
title = t('dashboard.batch_connect_sessions_relaunch_full_title', title: session.title)
button_to(
batch_connect_session_contexts_path(token: batch_connect_app.token),
method: :post,
Expand Down Expand Up @@ -139,7 +139,7 @@ def cancel_or_delete(session)
end

def delete(session)
title = "#{t('dashboard.batch_connect_sessions_delete_title')} #{session.title} #{t('dashboard.batch_connect_sessions_word')}"
title = t('dashboard.batch_connect_sessions_delete_full_title', title: session.title)
button_to(
batch_connect_session_path(session.id),
method: :delete,
Expand All @@ -153,7 +153,7 @@ def delete(session)
end

def cancel(session)
title = "#{t('dashboard.batch_connect_sessions_cancel_title')} #{session.title} #{t('dashboard.batch_connect_sessions_word')}"
title = t('dashboard.batch_connect_sessions_cancel_full_title', title: session.title)
button_to(
batch_connect_cancel_session_path(session.id),
method: :post,
Expand Down
12 changes: 6 additions & 6 deletions apps/dashboard/app/helpers/files_helper.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Helper for /files pages.
module FilesHelper
include ApplicationHelper

def files_browse_page_title(path)
prefix = "#{t('dashboard.files_title')} - #{@user_configuration.dashboard_title}"
return prefix if path.blank?

dir_segment = (path.to_s == '/') ? 'Root' : path.basename.to_s
"#{prefix} - #{dir_segment}"
def files_browse_page_title(path)
site = @user_configuration.dashboard_title
page = t('dashboard.files_title')
return t('dashboard.page_title', page: page, site: site) unless path.present?
dir_segment = path.to_s == '/' ? t('dashboard.root') : path.basename.to_s
t('dashboard.page_title_with_dir', page: page, site: site, dir: dir_segment)
end

def path_segment_with_slash(filesystem, segment, counter, total)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :title, "#{t('dashboard.breadcrumbs_my_sessions')} - #{@user_configuration.dashboard_title}" %>
<% content_for :title, t('dashboard.page_title', page: t('dashboard.breadcrumbs_my_sessions'), site: @user_configuration.dashboard_title) %>
<%-
any_apps = (@sys_app_groups + @usr_app_groups + @dev_app_groups).any?
-%>
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/views/module_browser/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% content_for :title, "#{t('dashboard.module_browser_title')} - #{@user_configuration.dashboard_title}" %>
<% content_for :title, t('dashboard.page_title', page: t('dashboard.module_browser_title'), site: @user_configuration.dashboard_title) %>

<h1 class="mb-4 d-flex justify-content-between">
<%= t('dashboard.module_browser_title') %>
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/app/views/projects/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</div>
<div class="col-12 col-lg-7 jobs-files-item">
<div id="directory_browser" class="border border-2 px-1 py-3 mt-3 mb-5 bg-white rounded">
<h2 class="lead fw-bolder d-flex justify-content-center"><%= "#{t('dashboard.project')} #{t('dashboard.directory')}" %>: &nbsp<i><%= @project.id %></i></h2>
<h2 class="lead fw-bolder d-flex justify-content-center"><%= t('dashboard.project_directory') %>: &nbsp<i><%= @project.id %></i></h2>
<hr>
<%= turbo_frame_tag 'project_directory',
src: directory_frame_path(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
<ul class="list-unstyled mb-2">
<li>
<%= quota.to_s %><%= ". #{t('dashboard.quota_additional_message')}" %>
<%= t('dashboard.quota_message', quota: quota.to_s, additional_message: t('dashboard.quota_additional_message')) %>
</li>
<li>
<%=
Expand Down
10 changes: 9 additions & 1 deletion apps/dashboard/config/locales/en.yml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only update this file. Weekly automation will bring the other locale files up to date

Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ en:
batch_connect_no_sessions: You have no active sessions.
batch_connect_sandbox: " [Sandbox]"
batch_connect_sessions_cancel_confirm: Are you sure?
batch_connect_sessions_cancel_full_title: "Cancel %{title} Session"
batch_connect_sessions_cancel_title: Cancel
batch_connect_sessions_data_html: |
The %{title} session data for this session can be accessed
under the %{data_link_tag}.
batch_connect_sessions_delete_confirm: Are you sure?
batch_connect_sessions_delete_full_title: "Delete %{title} Session"
batch_connect_sessions_delete_hover: Delete Session
batch_connect_sessions_delete_title: Delete
batch_connect_sessions_edit_title: Edit new %{title} with this session parameters
Expand All @@ -86,6 +88,7 @@ en:
batch_connect_sessions_novnc_launch: Launch %{app_title}
batch_connect_sessions_novnc_view_only: View Only (Share-able Link)
batch_connect_sessions_path_selector_forbidden_error: You do not have permission to select that directory or file.
batch_connect_sessions_relaunch_full_title: "Relaunch %{title} Session"
batch_connect_sessions_relaunch_title: Relaunch
batch_connect_sessions_staged_root: staged root directory
batch_connect_sessions_stats_created_at: 'Created at:'
Expand Down Expand Up @@ -160,6 +163,7 @@ en:
files_send_to_target_title_default: Send selected files metadata to the external application
files_shell: Open in Terminal
files_shell_dropdown: Select Cluster to Open in Terminal
files_title: File browsing
files_doesnt_exist: "%{path} does not exist."
files_not_readable: "You do not have sufficient permissions to read '%{path}'."
home_directory: Home Directory
Expand Down Expand Up @@ -250,7 +254,6 @@ en:
mode: Mode
module_browser_last_updated: 'Last updated: %{last_updated}'
module_browser_title: Module Browser
files_title: File browsing
motd_erb_render_error: 'MOTD was not parsed or rendered correctly: %{error_message}'
motd_title: Message of the Day
name: Name
Expand All @@ -275,6 +278,8 @@ en:
nsf_access_events: NSF ACCESS Events
ok: OK
owner: Owner
page_title: "%{page} - %{site}"
page_title_with_dir: "%{page} - %{site} - %{dir}"
path_selector_default_popup_title: Select Your Working Directory
path_selector_home: home
path_selector_parent_directory: parent directory
Expand All @@ -283,13 +288,15 @@ en:
pinned_apps_title: Pinned Apps
project: Project
project_balances: Project Balances
project_directory: Project Directory
project_zip_error_message: 'Error creating ZIP file: %{error}'
project_zip_success_message: 'Success: project.zip has been created in your project directory.'
quota_additional_message: Consider deleting or archiving files to free up disk space.
quota_block: Using %{used} of quota %{available}
quota_block_shared: "(%{used_exclusive} are yours)"
quota_file: Using %{used} files of quota %{available} files
quota_file_shared: "(%{used_exclusive} files are yours)"
quota_message: "%{quota}. %{additional_message}"
quota_reload_message: Reload page to see updated quota. Quotas are updated every 5 minutes.
quota_warning_prefix_html: Quota limit warning for
recently_used_apps_title: Recently Used Apps
Expand All @@ -299,6 +306,7 @@ en:
restart_msg_html: |
Your group membership has changed, which affects your access to apps. Your dashboard should restart automatically.
If it doesn't please, click: <a href="%{restart_url}">restart web server</a>.
root: Root
save: Save
saved_settings_title: Saved Settings
select_path: Select Path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class BatchConnect::SessionsHelperTest < ActionView::TestCase
assert_equal true, form['class'].include?('relaunch')

button = html.at_css('button')
assert_equal 'Relaunch AppName Session', button['title']
assert_equal I18n.t('dashboard.batch_connect_sessions_relaunch_full_title', title: 'AppName'), button['title']
assert_equal true, button['class'].include?('relaunch')
end

Expand All @@ -80,10 +80,10 @@ def create_session(state = :running, valid: true)
end

def cancel_session_title
"#{I18n.t('dashboard.batch_connect_sessions_cancel_title')} AppName #{I18n.t('dashboard.batch_connect_sessions_word')}"
I18n.t('dashboard.batch_connect_sessions_cancel_full_title', title: 'AppName')
end

def delete_session_title
"#{I18n.t('dashboard.batch_connect_sessions_delete_title')} AppName #{I18n.t('dashboard.batch_connect_sessions_word')}"
I18n.t('dashboard.batch_connect_sessions_delete_full_title', title: 'AppName')
end
end
Loading