From 6b1db5c2b202383bd22d40909a68df8cbcb20b36 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 20 Mar 2017 03:36:29 +0100 Subject: [PATCH] Add landing strip --- app/assets/stylesheets/application.scss | 18 +++++++ app/views/accounts/show.html.haml | 3 ++ app/views/shared/_landing_strip.html.haml | 2 + app/views/stream_entries/show.html.haml | 3 ++ config/locales/de.yml | 2 - config/locales/en.yml | 4 +- config/locales/es.yml | 15 +++--- config/locales/fr.yml | 63 +++++++++++------------ config/locales/hu.yml | 5 +- config/locales/pt.yml | 3 -- config/locales/uk.yml | 5 +- 11 files changed, 65 insertions(+), 58 deletions(-) create mode 100644 app/views/shared/_landing_strip.html.haml diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index c590f7038..ba16d4a21 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -285,6 +285,24 @@ button:focus { } } +.landing-strip { + background: rgba(darken($color1, 7%), 0.8); + color: $color3; + font-weight: 400; + padding: 14px; + border-radius: 4px; + margin-bottom: 20px; + + strong, a { + font-weight: 500; + } + + a { + color: inherit; + text-decoration: underline; + } +} + @import 'forms'; @import 'accounts'; @import 'stream_entries'; diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml index c194ce33d..e1ad2d905 100644 --- a/app/views/accounts/show.html.haml +++ b/app/views/accounts/show.html.haml @@ -14,6 +14,9 @@ %meta{ property: 'og:image:height', content: '120' }/ %meta{ property: 'twitter:card', content: 'summary' }/ +- if !user_signed_in? && !Rails.configuration.x.single_user_mode + = render partial: 'shared/landing_strip', locals: { account: @account } + .h-feed %data.p-name{ value: "#{@account.username} on #{Rails.configuration.x.local_domain}" }/ diff --git a/app/views/shared/_landing_strip.html.haml b/app/views/shared/_landing_strip.html.haml new file mode 100644 index 000000000..bb081e544 --- /dev/null +++ b/app/views/shared/_landing_strip.html.haml @@ -0,0 +1,2 @@ +.landing-strip + = t('landing_strip_html', name: display_name(account), domain: Rails.configuration.x.local_domain, sign_up_path: new_user_registration_path) diff --git a/app/views/stream_entries/show.html.haml b/app/views/stream_entries/show.html.haml index 6bad45705..7a1afdd96 100644 --- a/app/views/stream_entries/show.html.haml +++ b/app/views/stream_entries/show.html.haml @@ -20,5 +20,8 @@ %meta{ property: 'twitter:card', content: 'summary' }/ +- if !user_signed_in? && !Rails.configuration.x.single_user_mode + = render partial: 'shared/landing_strip', locals: { account: @stream_entry.account } + .activity-stream.activity-stream-headless = render partial: @type, locals: { @type.to_sym => @stream_entry.activity, include_threads: true } diff --git a/config/locales/de.yml b/config/locales/de.yml index f36cc64c8..2b91053d9 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -82,8 +82,6 @@ de: preferences: Einstellungen stream_entries: click_to_show: Klicken um zu zeigen - favourited: favorisierte einen Beitrag von - is_now_following: folgt nun reblogged: teilte sensitive_content: Sensible Inhalte time: diff --git a/config/locales/en.yml b/config/locales/en.yml index e35b8d97a..00ae0ad8e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3,7 +3,6 @@ en: about: about_instance: "%{instance} is a Mastodon instance." about_mastodon: Mastodon is a free, open-source social network server. A decentralized alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Anyone can run Mastodon and participate in the social network seamlessly. - apps: Apps business_email: 'Business e-mail:' contact: Contact domain_count_after: other instances @@ -75,6 +74,7 @@ en: validation_errors: one: Something isn't quite right yet! Please review the error below other: Something isn't quite right yet! Please review %{count} errors below + landing_strip_html: %{name} is a user on %{domain}. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here. notification_mailer: digest: body: 'Here is a brief summary of what you missed on %{instance} since your last visit on %{since}:' @@ -125,8 +125,6 @@ en: unlisted: Public, but do not display on the public timeline stream_entries: click_to_show: Click to show - favourited: favourited a post by - is_now_following: is now following reblogged: boosted sensitive_content: Sensitive content time: diff --git a/config/locales/es.yml b/config/locales/es.yml index 2e0adb742..7a5e0639a 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -10,7 +10,7 @@ es: follow: Seguir followers: Seguidores following: Siguiendo - nothing_here: ¡No hay nada aquí! + nothing_here: "¡No hay nada aquí!" people_followed_by: Usuarios a quien %{name} sigue people_who_follow: Usuarios que siguen a %{name} posts: Publicaciones @@ -19,20 +19,20 @@ es: signature: Notificaciones de Mastodon desde %{instance} auth: change_password: Cambiar contraseña - didnt_get_confirmation: ¿No recibió instrucciones de confirmación? - forgot_password: ¿Olvidó su contraseña? + didnt_get_confirmation: "¿No recibió instrucciones de confirmación?" + forgot_password: "¿Olvidó su contraseña?" login: Iniciar sesión register: Registrarse resend_confirmation: Volver a enviar las instrucciones de confirmación reset_password: Restablecer contraseña set_new_password: Establecer nueva contraseña generic: - changes_saved_msg: ¡Cambios guardados con éxito! + changes_saved_msg: "¡Cambios guardados con éxito!" powered_by: powered by %{link} save_changes: Guardar cambios validation_errors: - one: ¡Algo no está todavía bien! Por favor, revise el error más abajo - other: ¡Algo no está todavía bien! Por favor, revise %{count} errores más abajo + one: "¡Algo no está todavía bien! Por favor, revise el error más abajo" + other: "¡Algo no está todavía bien! Por favor, revise %{count} errores más abajo" notification_mailer: favourite: body: 'Su estado fue marcado como favorito por %{name}:' @@ -52,8 +52,5 @@ es: settings: edit_profile: Editar perfil preferences: Preferencias - stream_entries: - favourited: marcado como favorito por - is_now_following: está ahora siguiendo will_paginate: page_gap: "…" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index f78cd0de5..d83952529 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -2,37 +2,37 @@ fr: about: about_instance: "%{instance} est une instance de Mastodon." - about_mastodon: "Mastodon est un serveur libre de réseautage social. Alternative décentralisée aux plateformes commerciales, la monopolisation de vos communications par une entreprise unique est évitée. Tout un chacun peut faire tourner Mastodon et participer au réseau social de manière transparente." - get_started: "Rejoindre le réseau" - source_code: "Code source" - terms: "Conditions d’utilisation" + about_mastodon: Mastodon est un serveur libre de réseautage social. Alternative décentralisée aux plateformes commerciales, la monopolisation de vos communications par une entreprise unique est évitée. Tout un chacun peut faire tourner Mastodon et participer au réseau social de manière transparente. + get_started: Rejoindre le réseau + source_code: Code source + terms: Conditions d’utilisation accounts: - follow: "Suivre" - followers: "Abonnés" - following: "Abonnements" - nothing_here: "Rien à voir ici !" - people_followed_by: "Personnes suivies par %{name}" - people_who_follow: "Personnes qui suivent %{name}" - posts: "Statuts" - unfollow: "Ne plus suivre" + follow: Suivre + followers: Abonnés + following: Abonnements + nothing_here: Rien à voir ici ! + people_followed_by: Personnes suivies par %{name} + people_who_follow: Personnes qui suivent %{name} + posts: Statuts + unfollow: Ne plus suivre application_mailer: - signature: "Notifications de Mastodon depuis %{instance}" + signature: Notifications de Mastodon depuis %{instance} auth: - change_password: "Changer de mot de passe" - didnt_get_confirmation: "Vous n’avez pas reçu les consignes de confirmation ?" - forgot_password: "Mode passe oublié ?" - login: "Se connecter" - register: "S’inscrire" - resend_confirmation: "Envoyer à nouveau les consignes de confirmation" - reset_password: "Réinitialiser le mot de passe" - set_new_password: "Établir le nouveau mot de passe" + change_password: Changer de mot de passe + didnt_get_confirmation: Vous n’avez pas reçu les consignes de confirmation ? + forgot_password: Mode passe oublié ? + login: Se connecter + register: S’inscrire + resend_confirmation: Envoyer à nouveau les consignes de confirmation + reset_password: Réinitialiser le mot de passe + set_new_password: Établir le nouveau mot de passe generic: - changes_saved_msg: "Les modifications ont été enregistrées avec succès !" - powered_by: "propulsé par %{link}" - save_changes: "Enregistrer les modifications" + changes_saved_msg: Les modifications ont été enregistrées avec succès ! + powered_by: propulsé par %{link} + save_changes: Enregistrer les modifications validation_errors: - one: "Quelque chose ne va pas ! Vérifiez l’erreur ci-dessous." - other: "Quelques choses ne vont pas ! Vérifiez les erreurs ci-dessous." + one: Quelque chose ne va pas ! Vérifiez l’erreur ci-dessous. + other: Quelques choses ne vont pas ! Vérifiez les erreurs ci-dessous. notification_mailer: favourite: body: "%{name} a ajouté votre statut à ses favoris :" @@ -47,13 +47,10 @@ fr: body: "%{name} a partagé votre statut :" subject: "%{name} a partagé votre statut" pagination: - next: "Suivant" - prev: "Précédent" + next: Suivant + prev: Précédent settings: - edit_profile: "Modifier le profil" - preferences: "Préférences" - stream_entries: - favourited: "a ajouté à ses favoris un statut de" - is_now_following: "suit désormais" + edit_profile: Modifier le profil + preferences: Préférences will_paginate: page_gap: "…" diff --git a/config/locales/hu.yml b/config/locales/hu.yml index d891b2b28..ee4157a81 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -41,7 +41,7 @@ hu: body: "%{name} mostantól követ téged!" subject: "%{name} mostantól követ téged" mention: - body: '%{name} megemlített téged:' + body: "%{name} megemlített téged:" subject: "%{name} megemlített téged" reblog: body: 'Az állapotod reblogolta %{name}:' @@ -52,8 +52,5 @@ hu: settings: edit_profile: Profil szerkesztése preferences: Beállítások - stream_entries: - favourited: kedvencnek jelölték a bejegyzésedet - is_now_following: mostantól követ will_paginate: page_gap: "…" diff --git a/config/locales/pt.yml b/config/locales/pt.yml index d02c0bdc5..abb9ff0b7 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -52,8 +52,5 @@ pt: settings: edit_profile: Editar perfil preferences: Preferências - stream_entries: - favourited: favoritou um post por - is_now_following: agora segue will_paginate: page_gap: "…" diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 621dfb323..d82567fea 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -36,7 +36,7 @@ uk: notification_mailer: favourite: body: 'Ваш статус подобається %{name}:' - subject: "Користувачу %{name} сподобвся ваш статус" + subject: Користувачу %{name} сподобвся ваш статус follow: body: "%{name} тепер підписаний на вас!" subject: "%{name} тепер підписаний на вас" @@ -52,8 +52,5 @@ uk: settings: edit_profile: Редагувати профіль preferences: Налаштування - stream_entries: - favourited: сподобався допис від - is_now_following: тепер підписаний(-а) на will_paginate: page_gap: "…"