Skip to content

Commit 4149a7b

Browse files
Gargronhiyuki2578
authored andcommitted
Add information about how to opt-in to the directory on the directory (mastodon#9834)
Fix mastodon#9833
1 parent e90cb29 commit 4149a7b

3 files changed

Lines changed: 46 additions & 2 deletions

File tree

app/javascript/styles/mastodon/widgets.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,3 +480,30 @@ $fluid-breakpoint: $maximum-width + 20px;
480480
}
481481
}
482482
}
483+
484+
.notice-widget {
485+
margin-bottom: 10px;
486+
color: $darker-text-color;
487+
488+
p {
489+
margin-bottom: 10px;
490+
491+
&:last-child {
492+
margin-bottom: 0;
493+
}
494+
}
495+
496+
a {
497+
font-size: 14px;
498+
line-height: 20px;
499+
text-decoration: none;
500+
font-weight: 500;
501+
color: $ui-highlight-color;
502+
503+
&:hover,
504+
&:focus,
505+
&:active {
506+
text-decoration: underline;
507+
}
508+
}
509+
}

app/views/directories/index.html.haml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,22 @@
4141
= paginate @accounts
4242

4343
.column-1
44-
- if @tags.empty?
45-
.nothing-here.nothing-here--flexible
44+
- if user_signed_in?
45+
.box-widget.notice-widget
46+
- if current_account.discoverable?
47+
- if current_account.followers_count < Account::MIN_FOLLOWERS_DISCOVERY
48+
%p= t('directories.enabled_but_waiting', min_followers: Account::MIN_FOLLOWERS_DISCOVERY)
49+
- else
50+
%p= t('directories.enabled')
51+
- else
52+
%p= t('directories.how_to_enable')
53+
54+
= link_to settings_profile_path do
55+
= t('settings.edit_profile')
56+
= fa_icon 'chevron-right fw'
57+
58+
- if @tags.empty? && !user_signed_in?
59+
.nothing-here
4660
- else
4761
- @tags.each do |tag|
4862
.directory__tag{ class: tag.id == @tag&.id ? 'active' : nil }

config/locales/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,11 @@ en:
553553
warning_title: Disseminated content availability
554554
directories:
555555
directory: Profile directory
556+
enabled: You are currently listed in the directory.
557+
enabled_but_waiting: You have opted-in to be listed in the directory, but you do not have the minimum number of followers (%{min_followers}) to be listed yet.
556558
explanation: Discover users based on their interests
557559
explore_mastodon: Explore %{title}
560+
how_to_enable: You are not currently opted-in to the directory. You can opt-in below. Use hashtags in your bio text to be listed under specific hashtags!
558561
people:
559562
one: "%{count} person"
560563
other: "%{count} people"

0 commit comments

Comments
 (0)