forgejo-federation/options/locale
0ko 1496bb6079 Better logic for showing user feed/public activity elements (#4189)
There are a few changes of template logic which defines when which elements should be shown on profile page. The motivation is to have the elements when needed and don't when they're not relevant.

## Changes

### RSS button

Now displayed if:
* feeds are enabled
AND one or more of:
* the current user is an admin
* the current user is viewing their profile
* the activity is publicly available

So, basically in cases when the .rss feed actually contains any events. Before this change this button was constantly shown and was giving an empty feed if it was unavailable.

### Public activity tab

The tab is displayed if:
* the current user is an admin
* the current user is viewing their profile
* the activity is publicly available
* the current tab is this exact tab, for example, in case it was accessed by adding `?tab=activity` to the URL, so that the UI is not broken w/o a highlighted tab

So, this tab is not displayed when it's not going to contain any information, but still can be accessed.

### Banner "This user has disabled the public visibility of the activity."

For admins:
* always show the big blue banner to warn that sharing a screenshot of this publicly is bad idea

For self:
* always display a little note about the current visibility status with a "Change" link

For others:
* only display a little note to explain why the activity is not shown

### Heatmap and activity feed

Elements are only displayed when relevant, instead of keeping empty leftovers, for easier testing. This template change is also covered by test. **Everything in this Changes section is covered by test unless I forgot something.**

## Preview

There's obviously too many states to screenshot, here are highlights:

![](https://codeberg.org/attachments/47559531-9bcd-46c0-90d4-8b51512da752)
_Warning admin for why they're seeing the information_

![](https://codeberg.org/attachments/3107bf62-955b-4fe5-bce3-6305a928afe1)
_Viewing self - private_

![](https://codeberg.org/attachments/afb63ead-fb0b-4fc7-9d8b-c6c09e9ae62b)
_Viewing self - public_

![](https://codeberg.org/attachments/df3c090a-7490-4827-b33b-771fd4fa0a9f)
_Don't have access to the information_

![](https://codeberg.org/attachments/2dd2b0ac-2fe0-4453-aa4b-e91fd08f4411)
_The tab is not shown when the activity can't be accessed_

![](https://codeberg.org/attachments/ed4c61de-b3b7-4523-b92b-bc76e1d8b7c5)
_Can't access the RSS feed_

![](https://codeberg.org/attachments/5a27f2be-d79c-4fb4-85a5-758348398f1b)
_Can access the RSS feed_

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4189
Reviewed-by: Otto <otto@codeberg.org>
2024-06-24 08:19:11 +00:00
..
locale_ar.ini [I18N] Translations update from Weblate (#3992) 2024-06-10 18:41:20 +00:00
locale_be.ini [I18N] Translations update from Weblate (#2521) 2024-03-04 01:58:49 +00:00
locale_bg.ini [I18N] Translations update from Weblate (#3851) 2024-05-25 18:32:20 +00:00
locale_bn.ini [I18N] Translations update from Weblate (#2350) 2024-02-17 22:18:04 +00:00
locale_bs.ini s/return_to_gitea/return_to_forgejo (#3822) 2024-05-20 18:44:33 +00:00
locale_ca.ini s/return_to_gitea/return_to_forgejo (#3822) 2024-05-20 18:44:33 +00:00
locale_cs-CZ.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_de-DE.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_el-GR.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_en-US.ini Better logic for showing user feed/public activity elements (#4189) 2024-06-24 08:19:11 +00:00
locale_eo.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_es-ES.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_fa-IR.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_fi-FI.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_fil.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_fr-FR.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_gl.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_hi.ini [I18N] Translations update from Weblate (#3508) 2024-05-04 18:36:49 +00:00
locale_hu-HU.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_id-ID.ini [I18N] Injected updated time in translation string (#3837) 2024-05-20 18:47:35 +00:00
locale_is-IS.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_it-IT.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_ja-JP.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_ko-KR.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_lv-LV.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_nl-NL.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_pl-PL.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_pt-BR.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_pt-PT.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_ru-RU.ini [I18N] Translations update from Weblate (#4098) 2024-06-18 05:27:03 +00:00
locale_si-LK.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_sk-SK.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_sl.ini [I18N] Translations update from Weblate (#3992) 2024-06-10 18:41:20 +00:00
locale_sv-SE.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_tr-TR.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_uk-UA.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_zh-CN.ini [I18N] Translations update from Weblate (#3992) 2024-06-10 18:41:20 +00:00
locale_zh-HK.ini Refactor install page hints (#3961) 2024-06-02 13:06:56 +00:00
locale_zh-TW.ini [I18N] Translations update from Weblate (#3992) 2024-06-10 18:41:20 +00:00
TRANSLATORS Fix missing left and right carets in TRANSLATORS (#21397) 2022-10-10 10:36:37 -04:00