Skip to content
Draft
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
70 changes: 59 additions & 11 deletions app/views/home/_history.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,74 @@
<div class="collapse-content px-0">
<%= render "shared/card/property_grid", columns: 2 do %>
<%= render partial: "shared/card/item",
locals: { property: "User", value: history.activity_user } %>
locals: {
property: History.human_attribute_name(:activity_user),
value: history.activity_user
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Type", value: history.activity_type } %>
locals: {
property: History.human_attribute_name(:activity_type),
value: history.activity_type
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Label", value: history.activity_label } %>
locals: {
property: History.human_attribute_name(:activity_label),
value: history.activity_label
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Created at", value: local_time(history.activity_created_at) } %>
locals: {
property: History.human_attribute_name(:activity_created_at),
value: local_time(history.activity_created_at)
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Config Type", value: history.activity_data_config_type } %>
locals: {
property: History.human_attribute_name(:activity_data_config_type),
value: history.activity_data_config_type
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Record Type", value: history.activity_data_config_record_type || "N/A" } %>
locals: {
property: History.human_attribute_name(:activity_data_config_record_type),
value: history.activity_data_config_record_type || t("ui.no_value")
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Task type", value: history.task_type } %>
locals: {
property: History.human_attribute_name(:task_type),
value: history.task_type
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Task status", value: history.task_status } %>
locals: {
property: History.human_attribute_name(:task_status),
value: history.task_status
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Task started", value: local_time(history.task_started_at) } %>
locals: {
property: History.human_attribute_name(:task_started_at),
value: local_time(history.task_started_at)
}
%>

<%= render partial: "shared/card/item",
locals: { property: "Task completed",
value: history.task_completed_at ? local_time(history.task_completed_at) : "N/A" } %>
locals: {
property: History.human_attribute_name(:task_completed_at),
value: history.task_completed_at ? local_time(history.task_completed_at) : ("ui.no_value")
}
%>
<% end %>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<%= render "shared/card/base", card_class: "bg-base-300 shadow-lg" do %>
<h2 class="card-title mb-4">Dashboard</h2>
<p class="mb-6">Welcome to your activities dashboard.</p>
<h2 class="card-title mb-4"><%= t("dashboard.title") %></h2>
<p class="mb-6"><%= t("dashboard.subtitle") %></p>
<div id="activities">
<%= turbo_frame_tag :activities_page, @pagy.page, target: :_top do %>
<% if @activities.empty? %>
<div class="alert alert-info">
<%= icon "information-circle", class: "stroke-current shrink-0 w-6 h-6" %>
<span>No activities found.</span>
<span><%= t("dashboard.no_activities") %></span>
</div>
<% else %>
<% if @activities.first.is_a?(Activity) %>
Expand All @@ -18,9 +18,9 @@

<% if @pagy.next %>
<%= turbo_frame_tag :activities_page, @pagy.next, src: url_for(page: @pagy.next), loading: :lazy, target: :_top do %>
<%= tag.div "Loading...", class: "text-center p-4" %>
<%= tag.div t("ui.loading"), class: "text-center p-4" %>
<% end %>
<% end %>
<% end %>
</div>
<% end %>
<% end %>
16 changes: 8 additions & 8 deletions app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="container mx-auto flex justify-center items-center mt-8">
<div class="w-full max-w-md">
<%= render "shared/card/base", card_class: "bg-base-300 shadow-xl border border-base-400" do %>
<h2 class="card-title text-center mb-6 font-bold text-2xl">Data Toolkit</h2>
<h2 class="card-title text-center mb-6 font-bold text-2xl"><%= t("signin.title") %></h2>

<%= form_with url: session_path, class: "form" do |form| %>
<div class="form-control mb-4">
<label class="label">
<span class="label-text mb-1">CollectionSpace URL</span>
<span class="label-text mb-1"><%= User.human_attribute_name(:cspace_url) %></span>
</label>
<%= form.text_field :cspace_url,
required: true,
Expand All @@ -16,13 +16,13 @@
value: params[:cspace_url],
class: "input input-bordered w-full" %>
<label class="label">
<span class="label-text-alt text-base-content/60 mt-1">Example: https://core.collectionspace.org</span>
<span class="label-text-alt text-base-content/60 mt-1"><%= t("signin.cspace_url_example") %></span>
</label>
</div>

<div class="form-control mb-4">
<label class="label">
<span class="label-text mb-1">Email Address</span>
<span class="label-text mb-1"><%= User.human_attribute_name(:email_address) %></span>
</label>
<%= form.email_field :email_address,
required: true,
Expand All @@ -34,7 +34,7 @@

<div class="form-control mb-4">
<label class="label">
<span class="label-text mb-1">Password</span>
<span class="label-text mb-1"><%= User.human_attribute_name(:password) %></span>
</label>
<%= form.password_field :password,
required: true,
Expand All @@ -46,13 +46,13 @@

<div class="alert alert-warning mb-4">
<%= icon "exclamation-triangle", class: "stroke-current shrink-0 h-6 w-6" %>
<span>You must not enforce single sign on to login with CollectionSpace.</span>
<span><%= t("signin.notice") %></span>
</div>

<div class="form-control">
<%= form.submit "Sign in", class: "btn btn-primary w-full" %>
<%= form.submit t("signin.submit"), class: "btn btn-primary w-full" %>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
18 changes: 9 additions & 9 deletions app/views/shared/_menu.html.erb
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<%= render "shared/card/base", card_class: "bg-base-300 shadow-lg" do %>
<h2 class="card-title mb-4">Activities</h2>
<h2 class="card-title mb-4"><%= t("ui.menu.title") %></h2>
<div class="mb-4">
<%= render partial: "shared/card/subtitle", locals: { title: "View" } %>
<%= render partial: "shared/card/subtitle", locals: { title: t("ui.menu.view.title") } %>
<ul class="menu w-full">
<%= render partial: "shared/menu/item",
locals: {
menu_item_name: "My activities",
menu_item_name: t("ui.menu.view.my"),
menu_item_icon: "user",
menu_item_path: my_activities_path
} %>
<%= render partial: "shared/menu/item",
locals: {
menu_item_name: "Group activities",
menu_item_name: t("ui.menu.view.group"),
menu_item_icon: "list-bullet",
menu_item_path: group_activities_path
} %>
<%= render partial: "shared/menu/item",
locals: {
menu_item_name: "Activity history",
menu_item_name: t("ui.menu.view.history"),
menu_item_icon: "archive-box",
menu_item_path: activity_history_path
} %>
</ul>
</div>

<div class="mb-4">
<%= render partial: "shared/card/subtitle", locals: { title: "Perform" } %>
<%= render partial: "shared/card/subtitle", locals: { title: t("ui.menu.perform.title") } %>
<ul class="menu w-full">
<% Activity.activity_type_display_names.each do |name| %>
<%= render partial: "shared/menu/item",
Expand All @@ -40,17 +40,17 @@

<% if admin? %>
<div>
<%= render partial: "shared/card/subtitle", locals: { title: "Admin" } %>
<%= render partial: "shared/card/subtitle", locals: { title: t("ui.menu.admin.title") } %>
<ul class="menu w-full">
<%= render partial: "shared/menu/item",
locals: {
menu_item_name: "Jobs Dashboard",
menu_item_name: t("ui.menu.admin.jobs"),
menu_item_icon: "chart-bar",
menu_item_path: "/jobs"
} %>
<%= render partial: "shared/menu/item",
locals: {
menu_item_name: "Manifest Registries",
menu_item_name: t("ui.menu.admin.registries"),
menu_item_icon: "document-duplicate",
menu_item_path: manifest_registries_path
} %>
Expand Down
16 changes: 8 additions & 8 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<% end %>
<% end %>
<%= render "shared/card/header",
title: "Profile",
title: t("profile.title"),
actions: actions_content %>

<%= render "shared/card/property_grid" do %>
<%= render partial: "shared/card/info",
locals: {
property: "Email address",
property: User.human_attribute_name(:email_address),
value: @user&.email_address
} %>

<%= render partial: "shared/card/info",
locals: {
property: "CollectionSpace URL",
property: User.human_attribute_name(:cspace_url),
value: link_to(
@user&.cspace_url,
@user&.cspace_url,
Expand All @@ -28,26 +28,26 @@

<%= render partial: "shared/card/info",
locals: {
property: "API version",
property: User.human_attribute_name(:cspace_api_version),
value: @user&.cspace_api_version
} %>

<%= render partial: "shared/card/info",
locals: {
property: "Profile",
property: User.human_attribute_name(:cspace_profile),
value: @user&.cspace_profile
} %>

<%= render partial: "shared/card/info",
locals: {
property: "UI version",
property: User.human_attribute_name(:cspace_ui_version),
value: @user&.cspace_ui_version
} %>

<%= render partial: "shared/card/info",
locals: {
property: "Data Toolkit admin?",
property: t("profile.admin?"),
value: @user&.admin?
} %>
<% end %>
<% end %>
<% end %>
88 changes: 60 additions & 28 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
# Files in the config/locales directory are used for internationalization and
# are automatically loaded by Rails. If you want to use locales other than
# English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
# I18n.t "hello"
#
# In views, this is aliased to just `t`:
#
# <%= t("hello") %>
#
# To use a different locale, set it with `I18n.locale`:
#
# I18n.locale = :es
#
# This would use the information in config/locales/es.yml.
#
# To learn more about the API, please read the Rails Internationalization guide
# at https://guides.rubyonrails.org/i18n.html.
#
# Be aware that YAML interprets the following case-insensitive strings as
# booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
# must be quoted to be interpreted as strings. For example:
#
# en:
# "yes": yup
# enabled: "ON"
# Rails helpers for models/attrs
# User.model_name.human -> User
# User.model_name.human(count: 4) -> Users
# User.human_attribute_name(:email)

en:
activerecord:
models:
history:
one: History
other: Histories
user:
one: User
other: Users
attributes:
history:
activity_user: User
activity_url: Url
activity_type: Type
activity_label: Label
activity_created_at: Created at
activity_data_config_type: Config Type
activity_data_config_record_type: Record Type
task_type: Task type
task_status: Task status
task_started_at: Task started
task_completed_at: Task completed
user:
cspace_api_version: Api Version
cspace_ui_version: UI version
cspace_profile: Profile
cspace_url: CollectionSpace URL
email_address: Email Address
password: Password
dashboard:
title: Dashboard
subtitle: Welcome to your activities dashboard.
no_activities: No activities found.
feedback:
error:
application_error: >-
Expand All @@ -49,6 +57,14 @@ en:
warning:
test_warning: >-
Warning: %{details}
profile:
title: Profile
admin?: Data Toolkit admin?
signin:
title: Data Toolkit
cspace_url_example: "Example: https://core.collectionspace.org"
notice: You must not enforce single sign on to login with CollectionSpace.
submit: Sign in
tasks:
pre_check_ingest_data:
feedback:
Expand Down Expand Up @@ -131,3 +147,19 @@ en:
review: Review
running: Running
succeeded: Succeeded
ui:
loading: Loading ...
menu:
title: Activities
view:
title: View
my: My activities
group: Group activities
history: Activity history
perform:
title: Perform
admin:
title: Admin
jobs: Jobs dashboard
registries: Manifest registries
no_value: N/A