From 6605a9b82dd00d9eeaeab08c34e6219122f92257 Mon Sep 17 00:00:00 2001 From: Yuriy Volodin Date: Fri, 22 Dec 2023 21:58:37 +0300 Subject: [PATCH] add custom title and description for athlete profile page --- app/views/activities/_result.html.erb | 4 ++-- app/views/athletes/show.html.erb | 6 +++++- config/locales/rs.yml | 3 ++- config/locales/ru.yml | 3 ++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/views/activities/_result.html.erb b/app/views/activities/_result.html.erb index 7a0e05cd..9ca6fd16 100644 --- a/app/views/activities/_result.html.erb +++ b/app/views/activities/_result.html.erb @@ -3,7 +3,7 @@ <% if result.athlete_id %>
- <%= link_to result.athlete.name.presence || t('athletes.show.nobody'), result.athlete, class: 'athlete-link' %> + <%= link_to result.athlete.name.presence || t('common.nobody'), result.athlete, class: 'athlete-link' %>
<%= t '.total_runs_html', count: @results_count[result.athlete_id] %> @@ -13,7 +13,7 @@ <% end %>
<% else %> - <%= t 'athletes.show.nobody' %> + <%= t 'common.nobody' %> <% end %> diff --git a/app/views/athletes/show.html.erb b/app/views/athletes/show.html.erb index 34d0ed4a..333b6185 100644 --- a/app/views/athletes/show.html.erb +++ b/app/views/athletes/show.html.erb @@ -1,5 +1,9 @@ +<% athlete_name = @athlete.name || t('common.nobody') %> +<% head_info :title, athlete_name %> +<% head_info :description, t('.description', athlete_name:) %> +

- <%= @athlete.name || t('.nobody') %> + <%= athlete_name %> diff --git a/config/locales/rs.yml b/config/locales/rs.yml index 6e90f8f0..8aba75fc 100644 --- a/config/locales/rs.yml +++ b/config/locales/rs.yml @@ -473,6 +473,7 @@ rs: common: without_token: WITHOUT TOKEN (create) without_name: WITHOUT NAME + nobody: UNKNOWN open_link: open gender: Pol man: Čovek @@ -559,7 +560,7 @@ rs: women: Žene athletes: show: - nobody: UNKNOWN + description: 'Athlete profile %{athlete_name}: results, statistics and volunteering' activities: index: description: Recent run results on S95 events diff --git a/config/locales/ru.yml b/config/locales/ru.yml index dc168eaf..01317e09 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -474,6 +474,7 @@ ru: common: without_token: БЕЗ ТОКЕНА (создать) without_name: БЕЗ ИМЕНИ + nobody: НЕИЗВЕСТНЫЙ open_link: открыть gender: Пол man: Мужчина @@ -560,7 +561,7 @@ ru: women: Женщины athletes: show: - nobody: НЕИЗВЕСТНЫЙ + description: 'Профиль участника %{athlete_name}: результаты, статистика и волонтёрства' activities: index: description: Недавние результаты забегов S95