From bf903dc51070f952ab64e43918e803fdaaa15e4d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 19 Apr 2021 14:45:15 +0200 Subject: Change onboarding by replacing tutorial with follow recommendations in web UI (#16060) --- app/javascript/styles/mastodon/components.scss | 66 ++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'app/javascript/styles') diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 49432b864..f151224ae 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1307,6 +1307,29 @@ overflow: hidden; text-decoration: none; font-size: 14px; + + &--with-note { + strong { + display: inline; + } + } + } + + &__note { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: $ui-secondary-color; + } +} + +.follow-recommendations-account { + .icon-button { + color: $ui-primary-color; + + &.active { + color: $valid-value-color; + } } } @@ -2459,6 +2482,49 @@ a.account__display-name { border-color: darken($ui-base-color, 8%); } +.column-title { + text-align: center; + padding: 40px; + + .logo { + fill: $primary-text-color; + width: 50px; + margin: 0 auto; + margin-bottom: 40px; + } + + h3 { + font-size: 24px; + line-height: 1.5; + font-weight: 700; + margin-bottom: 10px; + } + + p { + font-size: 16px; + line-height: 24px; + font-weight: 400; + color: $darker-text-color; + } +} + +.column-actions { + display: flex; + align-items: center; + justify-content: center; + padding: 40px; + padding-top: 40px; + padding-bottom: 200px; + + &__background { + position: absolute; + left: 0; + bottom: 0; + height: 220px; + width: auto; + } +} + .compose-panel { width: 285px; margin-top: 10px; -- cgit From 8d75bd002da5011237b537b522a5b6248e99b9d5 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 5 May 2021 23:57:29 +0200 Subject: Add empty state message for follow recommendations in web UI (#16161) --- .../mastodon/features/follow_recommendations/index.js | 10 +++++++--- app/javascript/styles/mastodon/components.scss | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'app/javascript/styles') diff --git a/app/javascript/mastodon/features/follow_recommendations/index.js b/app/javascript/mastodon/features/follow_recommendations/index.js index 1231a27ea..5b30a206e 100644 --- a/app/javascript/mastodon/features/follow_recommendations/index.js +++ b/app/javascript/mastodon/features/follow_recommendations/index.js @@ -75,10 +75,14 @@ class FollowRecommendations extends ImmutablePureComponent { {!isLoading && ( -
- {suggestions.map(suggestion => ( +
+ {suggestions.size > 0 ? suggestions.map(suggestion => ( - ))} + )) : ( +
+ +
+ )}
diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index f151224ae..74a181603 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -2525,6 +2525,22 @@ a.account__display-name { } } +.column-list { + margin: 0 20px; + border: 1px solid lighten($ui-base-color, 8%); + background: darken($ui-base-color, 2%); + border-radius: 4px; + + &__empty-message { + padding: 40px; + text-align: center; + font-size: 16px; + line-height: 24px; + font-weight: 400; + color: $darker-text-color; + } +} + .compose-panel { width: 285px; margin-top: 10px; -- cgit From 2c77d97e0d59e045a9b04fccc83f0f24d190d8d8 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 7 May 2021 14:33:19 +0200 Subject: Add joined date to profiles in web UI (#16169) --- .../mastodon/features/account/components/header.js | 2 ++ app/javascript/mastodon/locales/defaultMessages.json | 14 +++++++++----- app/javascript/styles/mastodon/components.scss | 11 +++++++++++ app/serializers/activitypub/actor_serializer.rb | 6 +++++- app/serializers/rest/account_serializer.rb | 4 ++++ app/services/activitypub/process_account_service.rb | 3 ++- spec/lib/activitypub/activity/update_spec.rb | 2 +- 7 files changed, 34 insertions(+), 8 deletions(-) (limited to 'app/javascript/styles') diff --git a/app/javascript/mastodon/features/account/components/header.js b/app/javascript/mastodon/features/account/components/header.js index 8e49486bd..20641121f 100644 --- a/app/javascript/mastodon/features/account/components/header.js +++ b/app/javascript/mastodon/features/account/components/header.js @@ -326,6 +326,8 @@ class Header extends ImmutablePureComponent { {account.get('id') !== me && !suspended && } {account.get('note').length > 0 && account.get('note') !== '

' &&
} + +
{!suspended && ( diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index 86cf83403..172fae81f 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -909,6 +909,10 @@ { "defaultMessage": "Group", "id": "account.badges.group" + }, + { + "defaultMessage": "Joined {date}", + "id": "account.joined" } ], "path": "app/javascript/mastodon/features/account/components/header.json" @@ -1919,12 +1923,12 @@ "id": "home.hide_announcements" }, { - "defaultMessage": "Your home timeline is empty! Visit {public} or use search to get started and meet other users.", + "defaultMessage": "Your home timeline is empty! Follow more people to fill it up. {suggestions}", "id": "empty_column.home" }, { - "defaultMessage": "the public timeline", - "id": "empty_column.home.public_timeline" + "defaultMessage": "See some suggestions", + "id": "empty_column.home.suggestions" } ], "path": "app/javascript/mastodon/features/home_timeline/index.json" @@ -2417,7 +2421,7 @@ "id": "notifications.mark_as_read" }, { - "defaultMessage": "You don't have any notifications yet. Interact with others to start the conversation.", + "defaultMessage": "You don't have any notifications yet. When other people interact with you, you will see it here.", "id": "empty_column.notifications" } ], @@ -3249,4 +3253,4 @@ ], "path": "app/javascript/mastodon/features/video/index.json" } -] \ No newline at end of file +] diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 74a181603..d3dd1af60 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -6769,6 +6769,17 @@ noscript { } } + .account__header__joined { + font-size: 14px; + padding: 5px 15px; + color: $darker-text-color; + + .columns-area--mobile & { + padding-left: 20px; + padding-right: 20px; + } + } + .account__header__fields { margin: 0; border-top: 1px solid lighten($ui-base-color, 12%); diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb index 759ef30f9..d92aae7b3 100644 --- a/app/serializers/activitypub/actor_serializer.rb +++ b/app/serializers/activitypub/actor_serializer.rb @@ -13,7 +13,7 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer :inbox, :outbox, :featured, :featured_tags, :preferred_username, :name, :summary, :url, :manually_approves_followers, - :discoverable + :discoverable, :published has_one :public_key, serializer: ActivityPub::PublicKeySerializer @@ -158,6 +158,10 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer !object.suspended? && !object.also_known_as.empty? end + def published + object.created_at.midnight.iso8601 + end + class CustomEmojiSerializer < ActivityPub::EmojiSerializer end diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index 189a62d0e..219f8075a 100644 --- a/app/serializers/rest/account_serializer.rb +++ b/app/serializers/rest/account_serializer.rb @@ -55,6 +55,10 @@ class REST::AccountSerializer < ActiveModel::Serializer full_asset_url(object.suspended? ? object.header.default_url : object.header_static_url) end + def created_at + object.created_at.midnight.iso8601 + end + def last_status_at object.last_status_at&.to_date&.iso8601 end diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 6afeb92d6..bb2e8f665 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -87,6 +87,7 @@ class ActivityPub::ProcessAccountService < BaseService @account.url = url || @uri @account.uri = @uri @account.actor_type = actor_type + @account.created_at = @json['published'] if @json['published'].present? end def set_immediate_attributes! @@ -101,7 +102,7 @@ class ActivityPub::ProcessAccountService < BaseService end def set_fetchable_key! - @account.public_key = public_key || '' + @account.public_key = public_key || '' end def set_fetchable_attributes! diff --git a/spec/lib/activitypub/activity/update_spec.rb b/spec/lib/activitypub/activity/update_spec.rb index 42da29860..1c9bcf43b 100644 --- a/spec/lib/activitypub/activity/update_spec.rb +++ b/spec/lib/activitypub/activity/update_spec.rb @@ -13,7 +13,7 @@ RSpec.describe ActivityPub::Activity::Update do end let(:modified_sender) do - sender.dup.tap do |modified_sender| + sender.tap do |modified_sender| modified_sender.display_name = 'Totally modified now' end end -- cgit