Add a page listing people someone follows (#444)

Nothing exceptional, the layout is the same as the followers page.

Fixes #325
This commit is contained in:
Baptiste Gelez 2019-02-26 13:13:00 +01:00 committed by GitHub
parent 7bac70a483
commit e28371bbe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 1122 additions and 610 deletions

View File

@ -568,7 +568,7 @@ impl User {
.map_err(Error::from) .map_err(Error::from)
} }
pub fn get_following(&self, conn: &Connection) -> Result<Vec<User>> { pub fn get_followed(&self, conn: &Connection) -> Result<Vec<User>> {
use schema::follows::dsl::*; use schema::follows::dsl::*;
let f = follows.filter(follower_id.eq(self.id)).select(following_id); let f = follows.filter(follower_id.eq(self.id)).select(following_id);
users::table users::table
@ -577,6 +577,28 @@ impl User {
.map_err(Error::from) .map_err(Error::from)
} }
pub fn count_followed(&self, conn: &Connection) -> Result<i64> {
use schema::follows;
follows::table
.filter(follows::follower_id.eq(self.id))
.count()
.get_result(conn)
.map_err(Error::from)
}
pub fn get_followed_page(&self, conn: &Connection, (min, max): (i32, i32)) -> Result<Vec<User>> {
use schema::follows;
let follows = follows::table
.filter(follows::follower_id.eq(self.id))
.select(follows::following_id)
.limit((max - min).into());
users::table
.filter(users::id.eq_any(follows))
.offset(min.into())
.load::<User>(conn)
.map_err(Error::from)
}
pub fn is_followed_by(&self, conn: &Connection, other_id: i32) -> Result<bool> { pub fn is_followed_by(&self, conn: &Connection, other_id: i32) -> Result<bool> {
use schema::follows; use schema::follows;
follows::table follows::table

View File

@ -19,9 +19,9 @@ msgstr ""
msgid "{0} commented your article." msgid "{0} commented your article."
msgstr "علَّق {0} على مقالك" msgstr "علَّق {0} على مقالك"
#, fuzzy # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "إنّ {0} يتبعك الآن" msgstr ""
#, fuzzy #, fuzzy
msgid "{0} liked your article." msgid "{0} liked your article."
@ -73,7 +73,8 @@ msgstr "يجب عليك تسجيل الدخول قصد الإعجاب بالمن
msgid "You need to be logged in order to access your dashboard" msgid "You need to be logged in order to access your dashboard"
msgstr "يجب عليك أولا تسجيل الدخول للوصول إلى لوح التحكم" msgstr "يجب عليك أولا تسجيل الدخول للوصول إلى لوح التحكم"
msgid "You need to be logged in order to follow someone" #, fuzzy
msgid "You need to be logged in order to subscribe to someone"
msgstr "يجب عليك أولا تسجيل الدخول قصد متابعة شخص آخر" msgstr "يجب عليك أولا تسجيل الدخول قصد متابعة شخص آخر"
msgid "You need to be logged in order to edit your profile" msgid "You need to be logged in order to edit your profile"
@ -162,7 +163,8 @@ msgstr "كافة مقالات الفديفرس"
msgid "Articles from {}" msgid "Articles from {}"
msgstr "مقالات مِن {0}" msgstr "مقالات مِن {0}"
msgid "Nothing to see here yet. Try to follow more people." #, fuzzy
msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "حاليا لا يوجد أي شيء هنا. حاول متابعة أشخاص آخرين." msgstr "حاليا لا يوجد أي شيء هنا. حاول متابعة أشخاص آخرين."
msgid "Name" msgid "Name"
@ -292,8 +294,12 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "المقالات" msgstr "المقالات"
msgid "Followers" msgid "Subscribers"
msgstr "المتابِعون" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "الوصف"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -314,14 +320,19 @@ msgstr "تعديل ملفك الشخصي"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "افتح على {0}" msgstr "افتح على {0}"
msgid "Unfollow" msgid "Unsubscribe"
msgstr "الغاء المتابعة" msgstr ""
msgid "Follow" msgid "Subscribe"
msgstr "اتبع" msgstr ""
msgid "{0}'s followers" #, fuzzy
msgstr "{0} متابِعون" msgid "{0}'s subscriptions'"
msgstr "الوصف"
#, fuzzy
msgid "{0}'s subscribers"
msgstr "الوصف"
msgid "Respond" msgid "Respond"
msgstr "رد" msgstr "رد"
@ -702,6 +713,26 @@ msgstr "قم بنسخه و إلصاقه في محتوى مقالك لعرض ال
msgid "Use as avatar" msgid "Use as avatar"
msgstr "استخدمها كصورة رمزية" msgstr "استخدمها كصورة رمزية"
#~ msgid "{0}'s followers"
#~ msgstr "{0} متابِعون"
#, fuzzy
#~ msgid "{0} is now following you."
#~ msgstr "إنّ {0} يتبعك الآن"
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "{0} متابِعون"
#~ msgid "Followers"
#~ msgstr "المتابِعون"
#~ msgid "Unfollow"
#~ msgstr "الغاء المتابعة"
#~ msgid "Follow"
#~ msgstr "اتبع"
#~ msgid "Comment \"{0}\"" #~ msgid "Comment \"{0}\""
#~ msgstr "تعليق \"{0}\"" #~ msgstr "تعليق \"{0}\""

View File

@ -18,7 +18,7 @@ msgid "{0} commented your article."
msgstr "{0} hat deinen Artikel kommentiert" msgstr "{0} hat deinen Artikel kommentiert"
# src/template_utils.rs:35 # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "" msgstr ""
#, fuzzy #, fuzzy
@ -79,7 +79,7 @@ msgid "You need to be logged in order to access your dashboard"
msgstr "Du musst eingeloggt sein, um dein Dashboard zu sehen" msgstr "Du musst eingeloggt sein, um dein Dashboard zu sehen"
#, fuzzy #, fuzzy
msgid "You need to be logged in order to follow someone" msgid "You need to be logged in order to subscribe to someone"
msgstr "Du musst eingeloggt sein, um jemandem zu folgen" msgstr "Du musst eingeloggt sein, um jemandem zu folgen"
#, fuzzy #, fuzzy
@ -175,7 +175,7 @@ msgid "Articles from {}"
msgstr "Artikel von {0}" msgstr "Artikel von {0}"
#, fuzzy #, fuzzy
msgid "Nothing to see here yet. Try to follow more people." msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "Hier gibts noch nichts. Versuche dich mehr Leuten anzuschließen." msgstr "Hier gibts noch nichts. Versuche dich mehr Leuten anzuschließen."
msgid "Name" msgid "Name"
@ -315,8 +315,11 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "Artikel" msgstr "Artikel"
msgid "Followers" msgid "Subscribers"
msgstr "Follower" msgstr "Abonomenten"
msgid "Subscriptions"
msgstr "Abonoment"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -338,15 +341,19 @@ msgstr "Ändere dein Profil"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
msgid "Unsubscribe"
msgstr "Abbestellen"
msgid "Subscribe"
msgstr "Abonieren"
#, fuzzy #, fuzzy
msgid "Unfollow" msgid "{0}'s subscriptions'"
msgstr "Folgen" msgstr "Abonoment"
msgid "Follow" #, fuzzy
msgstr "Folgen" msgid "{0}'s subscribers"
msgstr "Abonoment"
msgid "{0}'s followers"
msgstr "{0}s Follower"
msgid "Respond" msgid "Respond"
msgstr "Antworten" msgstr "Antworten"
@ -725,6 +732,27 @@ msgstr "Um diese Mediendatei einzufügen, kopiere sie in deine Artikel."
msgid "Use as avatar" msgid "Use as avatar"
msgstr "Als Avatar verwenden" msgstr "Als Avatar verwenden"
#~ msgid "{0}'s followers"
#~ msgstr "{0}s Follower"
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "{0}s Follower"
#~ msgid "Followers"
#~ msgstr "Follower"
#, fuzzy
#~ msgid "Followed"
#~ msgstr "Folgen"
#, fuzzy
#~ msgid "Unfollow"
#~ msgstr "Folgen"
#~ msgid "Follow"
#~ msgstr "Folgen"
#, fuzzy #, fuzzy
#~ msgid "No articles to see here yet." #~ msgid "No articles to see here yet."
#~ msgstr "Bisher keine Artikel vorhanden." #~ msgstr "Bisher keine Artikel vorhanden."

View File

@ -19,7 +19,7 @@ msgid "{0} commented your article."
msgstr "" msgstr ""
# src/template_utils.rs:35 # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "" msgstr ""
# src/template_utils.rs:36 # src/template_utils.rs:36
@ -83,7 +83,7 @@ msgid "You need to be logged in order to access your dashboard"
msgstr "" msgstr ""
# src/routes/user.rs:164 # src/routes/user.rs:164
msgid "You need to be logged in order to follow someone" msgid "You need to be logged in order to subscribe to someone"
msgstr "" msgstr ""
# src/routes/user.rs:227 # src/routes/user.rs:227
@ -171,7 +171,7 @@ msgstr ""
msgid "Articles from {}" msgid "Articles from {}"
msgstr "" msgstr ""
msgid "Nothing to see here yet. Try to follow more people." msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "" msgstr ""
# src/template_utils.rs:144 # src/template_utils.rs:144
@ -299,7 +299,10 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "" msgstr ""
msgid "Followers" msgid "Subscribers"
msgstr ""
msgid "Subscriptions"
msgstr "" msgstr ""
msgid "Atom feed" msgid "Atom feed"
@ -320,13 +323,16 @@ msgstr ""
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
msgid "Unfollow" msgid "Unsubscribe"
msgstr "" msgstr ""
msgid "Follow" msgid "Subscribe"
msgstr "" msgstr ""
msgid "{0}'s followers" msgid "{0}'s subscriptions'"
msgstr ""
msgid "{0}'s subscribers"
msgstr "" msgstr ""
msgid "Respond" msgid "Respond"

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@ msgid "{0} commented your article."
msgstr "{0} a commenté votre article" msgstr "{0} a commenté votre article"
# src/template_utils.rs:35 # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "" msgstr ""
#, fuzzy #, fuzzy
@ -81,7 +81,7 @@ msgid "You need to be logged in order to access your dashboard"
msgstr "Vous devez vous connecter pour accéder à votre tableau de bord" msgstr "Vous devez vous connecter pour accéder à votre tableau de bord"
#, fuzzy #, fuzzy
msgid "You need to be logged in order to follow someone" msgid "You need to be logged in order to subscribe to someone"
msgstr "Vous devez vous connecter pour suivre quelquun" msgstr "Vous devez vous connecter pour suivre quelquun"
#, fuzzy #, fuzzy
@ -173,7 +173,7 @@ msgid "Articles from {}"
msgstr "Articles de {0}" msgstr "Articles de {0}"
#, fuzzy #, fuzzy
msgid "Nothing to see here yet. Try to follow more people." msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "Rien par ici pour le moment. Essayez de suivre plus de monde." msgstr "Rien par ici pour le moment. Essayez de suivre plus de monde."
msgid "Name" msgid "Name"
@ -313,8 +313,12 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "Articles" msgstr "Articles"
msgid "Followers" msgid "Subscribers"
msgstr "Abonné⋅e⋅s" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "Description"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -336,15 +340,19 @@ msgstr "Modifier votre profil"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
msgid "Unsubscribe"
msgstr ""
msgid "Subscribe"
msgstr ""
#, fuzzy #, fuzzy
msgid "Unfollow" msgid "{0}'s subscriptions'"
msgstr "Sabonner" msgstr "Description"
msgid "Follow" #, fuzzy
msgstr "Sabonner" msgid "{0}'s subscribers"
msgstr "Description"
msgid "{0}'s followers"
msgstr "Abonné⋅e⋅s de {0}"
msgid "Respond" msgid "Respond"
msgstr "Répondre" msgstr "Répondre"
@ -718,6 +726,25 @@ msgstr "Copiez-le dans vos articles pour insérer ce média."
msgid "Use as avatar" msgid "Use as avatar"
msgstr "Utiliser comme avatar" msgstr "Utiliser comme avatar"
#~ msgid "{0}'s followers"
#~ msgstr "Abonné⋅e⋅s de {0}"
#~ msgid "People {0} follows"
#~ msgstr "Personnes suivies par {0}"
#~ msgid "Followers"
#~ msgstr "Abonné⋅e⋅s"
#~ msgid "Followed"
#~ msgstr "Suivi⋅e⋅s"
#, fuzzy
#~ msgid "Unfollow"
#~ msgstr "Sabonner"
#~ msgid "Follow"
#~ msgstr "Sabonner"
#, fuzzy #, fuzzy
#~ msgid "No articles to see here yet." #~ msgid "No articles to see here yet."
#~ msgstr "Aucun article pour le moment." #~ msgstr "Aucun article pour le moment."

View File

@ -17,7 +17,7 @@ msgid "{0} commented your article."
msgstr "{0} comentou o seu artigo" msgstr "{0} comentou o seu artigo"
# src/template_utils.rs:35 # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "" msgstr ""
#, fuzzy #, fuzzy
@ -78,7 +78,7 @@ msgid "You need to be logged in order to access your dashboard"
msgstr "Debe estar conectada para acceder ao seu taboleiro" msgstr "Debe estar conectada para acceder ao seu taboleiro"
#, fuzzy #, fuzzy
msgid "You need to be logged in order to follow someone" msgid "You need to be logged in order to subscribe to someone"
msgstr "Debe estar conectada para seguir a alguén" msgstr "Debe estar conectada para seguir a alguén"
#, fuzzy #, fuzzy
@ -174,7 +174,7 @@ msgid "Articles from {}"
msgstr "Artigos desde {0}" msgstr "Artigos desde {0}"
#, fuzzy #, fuzzy
msgid "Nothing to see here yet. Try to follow more people." msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "Nada que ler por aquí. Intente seguir a máis xente." msgstr "Nada que ler por aquí. Intente seguir a máis xente."
msgid "Name" msgid "Name"
@ -309,8 +309,12 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "Artigos" msgstr "Artigos"
msgid "Followers" msgid "Subscribers"
msgstr "Seguidoras" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "Descrición"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -332,16 +336,19 @@ msgstr "Edite o seu perfil"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
#, fuzzy msgid "Unsubscribe"
msgid "Unfollow" msgstr ""
msgstr "Seguir"
msgid "Follow" msgid "Subscribe"
msgstr "Seguir" msgstr ""
#, fuzzy #, fuzzy
msgid "{0}'s followers" msgid "{0}'s subscriptions'"
msgstr "Unha seguidora" msgstr "Descrición"
#, fuzzy
msgid "{0}'s subscribers"
msgstr "Descrición"
msgid "Respond" msgid "Respond"
msgstr "Respostar" msgstr "Respostar"
@ -715,6 +722,28 @@ msgstr "Copie para incrustar este contido nos seus artigos"
msgid "Use as avatar" msgid "Use as avatar"
msgstr "Utilizar como avatar" msgstr "Utilizar como avatar"
#, fuzzy
#~ msgid "{0}'s followers"
#~ msgstr "Unha seguidora"
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "Unha seguidora"
#~ msgid "Followers"
#~ msgstr "Seguidoras"
#, fuzzy
#~ msgid "Followed"
#~ msgstr "Seguir"
#, fuzzy
#~ msgid "Unfollow"
#~ msgstr "Seguir"
#~ msgid "Follow"
#~ msgstr "Seguir"
#, fuzzy #, fuzzy
#~ msgid "No articles to see here yet." #~ msgid "No articles to see here yet."
#~ msgstr "Aínda non hai entradas publicadas" #~ msgstr "Aínda non hai entradas publicadas"

View File

@ -17,7 +17,7 @@ msgid "{0} commented your article."
msgstr "{0} ha commentato il tuo articolo" msgstr "{0} ha commentato il tuo articolo"
# src/template_utils.rs:35 # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "" msgstr ""
#, fuzzy #, fuzzy
@ -78,7 +78,7 @@ msgid "You need to be logged in order to access your dashboard"
msgstr "Devi effettuare l'accesso per accedere al tuo pannello" msgstr "Devi effettuare l'accesso per accedere al tuo pannello"
#, fuzzy #, fuzzy
msgid "You need to be logged in order to follow someone" msgid "You need to be logged in order to subscribe to someone"
msgstr "Devi effettuare l'accesso per seguire qualcuno" msgstr "Devi effettuare l'accesso per seguire qualcuno"
#, fuzzy #, fuzzy
@ -174,7 +174,7 @@ msgid "Articles from {}"
msgstr "Articoli da {0}}" msgstr "Articoli da {0}}"
#, fuzzy #, fuzzy
msgid "Nothing to see here yet. Try to follow more people." msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "Non c'è niente da mostrare qui. Prova a seguire più persone." msgstr "Non c'è niente da mostrare qui. Prova a seguire più persone."
msgid "Name" msgid "Name"
@ -312,8 +312,12 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "Articoli" msgstr "Articoli"
msgid "Followers" msgid "Subscribers"
msgstr "Seguaci" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "Descrizione"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -335,16 +339,19 @@ msgstr "Modifica il tuo profilo"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
#, fuzzy msgid "Unsubscribe"
msgid "Unfollow" msgstr ""
msgstr "Segui"
msgid "Follow" msgid "Subscribe"
msgstr "Segui" msgstr ""
#, fuzzy #, fuzzy
msgid "{0}'s followers" msgid "{0}'s subscriptions'"
msgstr "Uno ti segue" msgstr "Descrizione"
#, fuzzy
msgid "{0}'s subscribers"
msgstr "Descrizione"
msgid "Respond" msgid "Respond"
msgstr "Rispondi" msgstr "Rispondi"
@ -722,6 +729,28 @@ msgstr "Copialo nei tuoi articoli per inserire questo media."
msgid "Use as avatar" msgid "Use as avatar"
msgstr "Usa come avatar" msgstr "Usa come avatar"
#, fuzzy
#~ msgid "{0}'s followers"
#~ msgstr "Uno ti segue"
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "Uno ti segue"
#~ msgid "Followers"
#~ msgstr "Seguaci"
#, fuzzy
#~ msgid "Followed"
#~ msgstr "Segui"
#, fuzzy
#~ msgid "Unfollow"
#~ msgstr "Segui"
#~ msgid "Follow"
#~ msgstr "Segui"
#, fuzzy #, fuzzy
#~ msgid "No articles to see here yet." #~ msgid "No articles to see here yet."
#~ msgstr "Nessun post da mostrare qui." #~ msgstr "Nessun post da mostrare qui."

View File

@ -18,9 +18,9 @@ msgstr ""
msgid "{0} commented your article." msgid "{0} commented your article."
msgstr "{{ data }} があなたの記事にコメントしました" msgstr "{{ data }} があなたの記事にコメントしました"
#, fuzzy # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "{{ user }} はあなたをフォローしています。" msgstr ""
#, fuzzy #, fuzzy
msgid "{0} liked your article." msgid "{0} liked your article."
@ -74,7 +74,8 @@ msgstr "投稿をいいねするにはログインする必要があります"
msgid "You need to be logged in order to access your dashboard" msgid "You need to be logged in order to access your dashboard"
msgstr "ダッシュボードにアクセスするにはログインする必要があります" msgstr "ダッシュボードにアクセスするにはログインする必要があります"
msgid "You need to be logged in order to follow someone" #, fuzzy
msgid "You need to be logged in order to subscribe to someone"
msgstr "他の人をフォローするにはログインする必要があります" msgstr "他の人をフォローするにはログインする必要があります"
msgid "You need to be logged in order to edit your profile" msgid "You need to be logged in order to edit your profile"
@ -163,7 +164,8 @@ msgstr "Fediverse のすべての記事"
msgid "Articles from {}" msgid "Articles from {}"
msgstr "{{ instance.name }} の記事" msgstr "{{ instance.name }} の記事"
msgid "Nothing to see here yet. Try to follow more people." #, fuzzy
msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "" msgstr ""
"ここにはまだ表示できるものがありません。他の人をもっとフォローしてみてくださ" "ここにはまだ表示できるものがありません。他の人をもっとフォローしてみてくださ"
"い。" "い。"
@ -298,8 +300,12 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "記事" msgstr "記事"
msgid "Followers" msgid "Subscribers"
msgstr "フォロワー" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "説明"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -320,15 +326,19 @@ msgstr "自分のプロフィールを編集"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
msgid "Unfollow" msgid "Unsubscribe"
msgstr "フォロー解除" msgstr ""
msgid "Follow" msgid "Subscribe"
msgstr "フォロー" msgstr ""
#, fuzzy #, fuzzy
msgid "{0}'s followers" msgid "{0}'s subscriptions'"
msgstr "{{ count }} フォロワー" msgstr "説明"
#, fuzzy
msgid "{0}'s subscribers"
msgstr "説明"
msgid "Respond" msgid "Respond"
msgstr "返信" msgstr "返信"
@ -693,6 +703,30 @@ msgstr "このメディアを記事に挿入するには、自分の記事にコ
msgid "Use as avatar" msgid "Use as avatar"
msgstr "アバターとして使う" msgstr "アバターとして使う"
#~ msgid "{0}'s followers"
#~ msgstr "{{ count }} フォロワー"
#, fuzzy
#~ msgid "{0} is now following you."
#~ msgstr "{{ user }} はあなたをフォローしています。"
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "{0} さんのフォロワー"
#~ msgid "Followers"
#~ msgstr "フォロワー"
#, fuzzy
#~ msgid "Followed"
#~ msgstr "フォロー"
#~ msgid "Unfollow"
#~ msgstr "フォロー解除"
#~ msgid "Follow"
#~ msgstr "フォロー"
#, fuzzy #, fuzzy
#~ msgid "Comment \"{0}\"" #~ msgid "Comment \"{0}\""
#~ msgstr "\"{{ post }}\" にコメント" #~ msgstr "\"{{ post }}\" にコメント"

View File

@ -18,9 +18,9 @@ msgstr ""
msgid "{0} commented your article." msgid "{0} commented your article."
msgstr "{0} la inn en kommentar til artikkelen din" msgstr "{0} la inn en kommentar til artikkelen din"
#, fuzzy # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "{0} har begynt å følge deg" msgstr ""
#, fuzzy #, fuzzy
msgid "{0} liked your article." msgid "{0} liked your article."
@ -81,7 +81,7 @@ msgid "You need to be logged in order to access your dashboard"
msgstr "Du må være logget inn for å redigere profilen din" msgstr "Du må være logget inn for å redigere profilen din"
#, fuzzy #, fuzzy
msgid "You need to be logged in order to follow someone" msgid "You need to be logged in order to subscribe to someone"
msgstr "Du må være logget inn for å følge noen" msgstr "Du må være logget inn for å følge noen"
#, fuzzy #, fuzzy
@ -177,7 +177,7 @@ msgstr ""
msgid "Articles from {}" msgid "Articles from {}"
msgstr "Om {0}" msgstr "Om {0}"
msgid "Nothing to see here yet. Try to follow more people." msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "" msgstr ""
# src/template_utils.rs:144 # src/template_utils.rs:144
@ -314,8 +314,12 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "artikler" msgstr "artikler"
msgid "Followers" msgid "Subscribers"
msgstr "Følgere" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "Lang beskrivelse"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -338,15 +342,19 @@ msgstr "Din profil"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
msgid "Unfollow" msgid "Unsubscribe"
msgstr "Slutt å følge" msgstr ""
msgid "Follow" msgid "Subscribe"
msgstr "Følg" msgstr ""
#, fuzzy #, fuzzy
msgid "{0}'s followers" msgid "{0}'s subscriptions'"
msgstr "Én følger" msgstr "Lang beskrivelse"
#, fuzzy
msgid "{0}'s subscribers"
msgstr "Lang beskrivelse"
msgid "Respond" msgid "Respond"
msgstr "Svar" msgstr "Svar"
@ -732,6 +740,31 @@ msgstr ""
msgid "Use as avatar" msgid "Use as avatar"
msgstr "" msgstr ""
#, fuzzy
#~ msgid "{0}'s followers"
#~ msgstr "Én følger"
#, fuzzy
#~ msgid "{0} is now following you."
#~ msgstr "{0} har begynt å følge deg"
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "Én følger"
#~ msgid "Followers"
#~ msgstr "Følgere"
#, fuzzy
#~ msgid "Followed"
#~ msgstr "Følg"
#~ msgid "Unfollow"
#~ msgstr "Slutt å følge"
#~ msgid "Follow"
#~ msgstr "Følg"
#, fuzzy #, fuzzy
#~ msgid "No articles to see here yet." #~ msgid "No articles to see here yet."
#~ msgstr "Ingen innlegg å vise enda." #~ msgstr "Ingen innlegg å vise enda."

View File

@ -18,8 +18,8 @@ msgid "{0} commented your article."
msgstr "{0} skomentował(a) Twój artykuł." msgstr "{0} skomentował(a) Twój artykuł."
# src/template_utils.rs:35 # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "{0} zaczął(-eła) Cię obserwować." msgstr ""
msgid "{0} liked your article." msgid "{0} liked your article."
msgstr "{0} polubił(a) Twój artykuł." msgstr "{0} polubił(a) Twój artykuł."
@ -66,7 +66,8 @@ msgstr "Musisz się zalogować, aby udostępnić wpis"
msgid "You need to be logged in order to access your dashboard" msgid "You need to be logged in order to access your dashboard"
msgstr "Musisz się zalogować, aby uzyskać dostęp do panelu" msgstr "Musisz się zalogować, aby uzyskać dostęp do panelu"
msgid "You need to be logged in order to follow someone" #, fuzzy
msgid "You need to be logged in order to subscribe to someone"
msgstr "Musisz się zalogować, aby zacząć obserwować innych" msgstr "Musisz się zalogować, aby zacząć obserwować innych"
msgid "You need to be logged in order to edit your profile" msgid "You need to be logged in order to edit your profile"
@ -153,7 +154,8 @@ msgstr "Wszystkie artykuły w Fediwersum"
msgid "Articles from {}" msgid "Articles from {}"
msgstr "Artykuły z {}" msgstr "Artykuły z {}"
msgid "Nothing to see here yet. Try to follow more people." #, fuzzy
msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "Nie ma tutaj niczego. Spróbuj zacząć śledzić więcej osób." msgstr "Nie ma tutaj niczego. Spróbuj zacząć śledzić więcej osób."
msgid "Name" msgid "Name"
@ -276,9 +278,14 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "Artykuły" msgstr "Artykuły"
msgid "Followers" msgid "Subscribers"
msgstr "Śledzący" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "Opis"
#, fuzzy
msgid "Atom feed" msgid "Atom feed"
msgstr "Strumień Atom" msgstr "Strumień Atom"
@ -297,14 +304,19 @@ msgstr "Edytuj swój profil"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "Otwórz w {0}" msgstr "Otwórz w {0}"
msgid "Unfollow" msgid "Unsubscribe"
msgstr "Przestań obserwować" msgstr ""
msgid "Follow" msgid "Subscribe"
msgstr "Obserwuj" msgstr ""
msgid "{0}'s followers" #, fuzzy
msgstr "Obserwujący {0}" msgid "{0}'s subscriptions'"
msgstr "Opis"
#, fuzzy
msgid "{0}'s subscribers"
msgstr "Opis"
msgid "Respond" msgid "Respond"
msgstr "Odpowiedz" msgstr "Odpowiedz"
@ -658,6 +670,30 @@ msgstr "Skopiuj do swoich artykułów, aby wstawić tę zawartość multimedialn
msgid "Use as avatar" msgid "Use as avatar"
msgstr "Użyj jako awataru" msgstr "Użyj jako awataru"
#~ msgid "{0}'s followers"
#~ msgstr "Obserwujący {0}"
# src/template_utils.rs:35
#~ msgid "{0} is now following you."
#~ msgstr "{0} zaczął(-eła) Cię obserwować."
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "Obserwujący {0}"
#~ msgid "Followers"
#~ msgstr "Śledzący"
#, fuzzy
#~ msgid "Followed"
#~ msgstr "Śledzący"
#~ msgid "Unfollow"
#~ msgstr "Przestań obserwować"
#~ msgid "Follow"
#~ msgstr "Obserwuj"
#, fuzzy #, fuzzy
#~ msgid "No articles to see here yet." #~ msgid "No articles to see here yet."
#~ msgstr "Brak wpisów do wyświetlenia." #~ msgstr "Brak wpisów do wyświetlenia."

View File

@ -17,7 +17,7 @@ msgid "{0} commented your article."
msgstr "" msgstr ""
# src/template_utils.rs:35 # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "" msgstr ""
# src/template_utils.rs:36 # src/template_utils.rs:36
@ -81,10 +81,10 @@ msgid "You need to be logged in order to access your dashboard"
msgstr "" msgstr ""
# src/routes/user.rs:164 # src/routes/user.rs:164
msgid "You need to be logged in order to follow someone" msgid "You need to be logged in order to subscribe to someone"
msgstr "" msgstr ""
# src/routes/user.rs:227 # src/routes/user.rs:245
msgid "You need to be logged in order to edit your profile" msgid "You need to be logged in order to edit your profile"
msgstr "" msgstr ""
@ -169,7 +169,7 @@ msgstr ""
msgid "Articles from {}" msgid "Articles from {}"
msgstr "" msgstr ""
msgid "Nothing to see here yet. Try to follow more people." msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "" msgstr ""
# src/template_utils.rs:144 # src/template_utils.rs:144
@ -295,7 +295,10 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "" msgstr ""
msgid "Followers" msgid "Subscribers"
msgstr ""
msgid "Subscriptions"
msgstr "" msgstr ""
msgid "Atom feed" msgid "Atom feed"
@ -316,13 +319,16 @@ msgstr ""
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
msgid "Unfollow" msgid "Unsubscribe"
msgstr "" msgstr ""
msgid "Follow" msgid "Subscribe"
msgstr "" msgstr ""
msgid "{0}'s followers" msgid "{0}'s subscriptions'"
msgstr ""
msgid "{0}'s subscribers"
msgstr "" msgstr ""
msgid "Respond" msgid "Respond"

View File

@ -18,9 +18,9 @@ msgstr ""
msgid "{0} commented your article." msgid "{0} commented your article."
msgstr "{0} comentou o seu artigo" msgstr "{0} comentou o seu artigo"
#, fuzzy # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "{0} começou a seguir você" msgstr ""
#, fuzzy #, fuzzy
msgid "{0} liked your article." msgid "{0} liked your article."
@ -72,7 +72,8 @@ msgstr "Você precisa estar logado para gostar de um post"
msgid "You need to be logged in order to access your dashboard" msgid "You need to be logged in order to access your dashboard"
msgstr "Você precisa estar autenticado para acessar seu painel de controle" msgstr "Você precisa estar autenticado para acessar seu painel de controle"
msgid "You need to be logged in order to follow someone" #, fuzzy
msgid "You need to be logged in order to subscribe to someone"
msgstr "Você precisa estar autenticado para poder seguir alguém" msgstr "Você precisa estar autenticado para poder seguir alguém"
msgid "You need to be logged in order to edit your profile" msgid "You need to be logged in order to edit your profile"
@ -161,7 +162,8 @@ msgstr "Todos os artigos do Fediverse"
msgid "Articles from {}" msgid "Articles from {}"
msgstr "Artigos de {0}" msgstr "Artigos de {0}"
msgid "Nothing to see here yet. Try to follow more people." #, fuzzy
msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "Ainda não há nada para ver aqui. Tente seguir mais pessoas." msgstr "Ainda não há nada para ver aqui. Tente seguir mais pessoas."
msgid "Name" msgid "Name"
@ -292,8 +294,12 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "Artigos" msgstr "Artigos"
msgid "Followers" msgid "Subscribers"
msgstr "Seguidores" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "Descrição"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -314,14 +320,19 @@ msgstr "Editar o seu perfil"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "Abrir em {0}" msgstr "Abrir em {0}"
msgid "Unfollow" msgid "Unsubscribe"
msgstr "Não Seguir" msgstr ""
msgid "Follow" msgid "Subscribe"
msgstr "Seguir" msgstr ""
msgid "{0}'s followers" #, fuzzy
msgstr "Seguidores de {0}" msgid "{0}'s subscriptions'"
msgstr "Descrição"
#, fuzzy
msgid "{0}'s subscribers"
msgstr "Descrição"
msgid "Respond" msgid "Respond"
msgstr "Responder" msgstr "Responder"
@ -683,6 +694,26 @@ msgstr "Copie-o em seus artigos para inserir esta mídia."
msgid "Use as avatar" msgid "Use as avatar"
msgstr "Utilizar como avatar" msgstr "Utilizar como avatar"
#~ msgid "{0}'s followers"
#~ msgstr "Seguidores de {0}"
#, fuzzy
#~ msgid "{0} is now following you."
#~ msgstr "{0} começou a seguir você"
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "Seguidores de {0}"
#~ msgid "Followers"
#~ msgstr "Seguidores"
#~ msgid "Unfollow"
#~ msgstr "Não Seguir"
#~ msgid "Follow"
#~ msgstr "Seguir"
#~ msgid "Comment \"{0}\"" #~ msgid "Comment \"{0}\""
#~ msgstr "Comentário \"{0}\"" #~ msgstr "Comentário \"{0}\""

View File

@ -19,7 +19,7 @@ msgid "{0} commented your article."
msgstr "{0} прокомментировал(а) вашу статью" msgstr "{0} прокомментировал(а) вашу статью"
# src/template_utils.rs:35 # src/template_utils.rs:35
msgid "{0} is now following you." msgid "{0} is subscribed to you."
msgstr "" msgstr ""
#, fuzzy #, fuzzy
@ -80,7 +80,7 @@ msgid "You need to be logged in order to access your dashboard"
msgstr "Вы должны войти чтобы получить доступ к вашей панели управления" msgstr "Вы должны войти чтобы получить доступ к вашей панели управления"
#, fuzzy #, fuzzy
msgid "You need to be logged in order to follow someone" msgid "You need to be logged in order to subscribe to someone"
msgstr "Вы должны войти чтобы подписаться на кого-либо" msgstr "Вы должны войти чтобы подписаться на кого-либо"
#, fuzzy #, fuzzy
@ -178,7 +178,7 @@ msgid "Articles from {}"
msgstr "Статьи с {0}" msgstr "Статьи с {0}"
#, fuzzy #, fuzzy
msgid "Nothing to see here yet. Try to follow more people." msgid "Nothing to see here yet. Try to subscribe to more people."
msgstr "" msgstr ""
"Пока что здесь ничего нет. Попробуйте подписаться на большее число людей." "Пока что здесь ничего нет. Попробуйте подписаться на большее число людей."
@ -316,8 +316,12 @@ msgstr ""
msgid "Articles" msgid "Articles"
msgstr "Статьи" msgstr "Статьи"
msgid "Followers" msgid "Subscribers"
msgstr "Подписчики" msgstr ""
#, fuzzy
msgid "Subscriptions"
msgstr "Описание"
#, fuzzy #, fuzzy
msgid "Atom feed" msgid "Atom feed"
@ -339,16 +343,19 @@ msgstr "Редактировать ваш профиль"
msgid "Open on {0}" msgid "Open on {0}"
msgstr "" msgstr ""
#, fuzzy msgid "Unsubscribe"
msgid "Unfollow" msgstr ""
msgstr "Подписаться"
msgid "Follow" msgid "Subscribe"
msgstr "Подписаться" msgstr ""
#, fuzzy #, fuzzy
msgid "{0}'s followers" msgid "{0}'s subscriptions'"
msgstr "Один подписчик" msgstr "Описание"
#, fuzzy
msgid "{0}'s subscribers"
msgstr "Описание"
msgid "Respond" msgid "Respond"
msgstr "Ответить" msgstr "Ответить"
@ -727,6 +734,28 @@ msgstr ""
msgid "Use as avatar" msgid "Use as avatar"
msgstr "Использовать как аватар" msgstr "Использовать как аватар"
#, fuzzy
#~ msgid "{0}'s followers"
#~ msgstr "Один подписчик"
#, fuzzy
#~ msgid "People {0} follows"
#~ msgstr "Один подписчик"
#~ msgid "Followers"
#~ msgstr "Подписчики"
#, fuzzy
#~ msgid "Followed"
#~ msgstr "Подписаться"
#, fuzzy
#~ msgid "Unfollow"
#~ msgstr "Подписаться"
#~ msgid "Follow"
#~ msgstr "Подписаться"
#, fuzzy #, fuzzy
#~ msgid "No articles to see here yet." #~ msgid "No articles to see here yet."
#~ msgstr "Здесь пока нет постов." #~ msgstr "Здесь пока нет постов."

View File

@ -54,7 +54,7 @@ use std::process::exit;
use std::sync::Arc; use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
init_i18n!("plume", ar, de, en, fr, gl, it, ja, nb, pl, pt, ru); init_i18n!("plume", ar, de, en, es, fr, gl, it, ja, nb, pl, pt, ru);
mod api; mod api;
mod inbox; mod inbox;
@ -187,6 +187,7 @@ Then try to restart Plume.
routes::user::dashboard, routes::user::dashboard,
routes::user::dashboard_auth, routes::user::dashboard_auth,
routes::user::followers, routes::user::followers,
routes::user::followed,
routes::user::edit, routes::user::edit,
routes::user::edit_auth, routes::user::edit_auth,
routes::user::update, routes::user::update,

View File

@ -28,7 +28,7 @@ pub fn index(conn: DbConn, user: Option<User>, intl: I18n) -> Result<Ructe, Erro
let federated = Post::get_recents_page(&*conn, Page::default().limits())?; let federated = Post::get_recents_page(&*conn, Page::default().limits())?;
let local = Post::get_instance_page(&*conn, inst.id, Page::default().limits())?; let local = Post::get_instance_page(&*conn, inst.id, Page::default().limits())?;
let user_feed = user.clone().and_then(|user| { let user_feed = user.clone().and_then(|user| {
let followed = user.get_following(&*conn).ok()?; let followed = user.get_followed(&*conn).ok()?;
let mut in_feed = followed.into_iter().map(|u| u.id).collect::<Vec<i32>>(); let mut in_feed = followed.into_iter().map(|u| u.id).collect::<Vec<i32>>();
in_feed.push(user.id); in_feed.push(user.id);
Post::user_feed_page(&*conn, in_feed, Page::default().limits()).ok() Post::user_feed_page(&*conn, in_feed, Page::default().limits()).ok()
@ -62,7 +62,7 @@ pub fn local(conn: DbConn, user: Option<User>, page: Option<Page>, intl: I18n) -
#[get("/feed?<page>")] #[get("/feed?<page>")]
pub fn feed(conn: DbConn, user: User, page: Option<Page>, intl: I18n) -> Result<Ructe, ErrorPage> { pub fn feed(conn: DbConn, user: User, page: Option<Page>, intl: I18n) -> Result<Ructe, ErrorPage> {
let page = page.unwrap_or_default(); let page = page.unwrap_or_default();
let followed = user.get_following(&*conn)?; let followed = user.get_followed(&*conn)?;
let mut in_feed = followed.into_iter().map(|u| u.id).collect::<Vec<i32>>(); let mut in_feed = followed.into_iter().map(|u| u.id).collect::<Vec<i32>>();
in_feed.push(user.id); in_feed.push(user.id);
let articles = Post::user_feed_page(&*conn, in_feed, page.limits())?; let articles = Post::user_feed_page(&*conn, in_feed, page.limits())?;

View File

@ -161,7 +161,7 @@ pub fn follow(name: String, conn: DbConn, user: User, worker: Worker) -> Result<
#[post("/@/<name>/follow", rank = 2)] #[post("/@/<name>/follow", rank = 2)]
pub fn follow_auth(name: String, i18n: I18n) -> Flash<Redirect> { pub fn follow_auth(name: String, i18n: I18n) -> Flash<Redirect> {
utils::requires_login( utils::requires_login(
&i18n!(i18n.catalog, "You need to be logged in order to follow someone"), &i18n!(i18n.catalog, "You need to be logged in order to subscribe to someone"),
uri!(follow: name = name), uri!(follow: name = name),
) )
} }
@ -184,6 +184,24 @@ pub fn followers(name: String, conn: DbConn, account: Option<User>, page: Option
))) )))
} }
#[get("/@/<name>/followed?<page>", rank = 2)]
pub fn followed(name: String, conn: DbConn, account: Option<User>, page: Option<Page>, intl: I18n) -> Result<Ructe, ErrorPage> {
let page = page.unwrap_or_default();
let user = User::find_by_fqn(&*conn, &name)?;
let followed_count = user.count_followed(&*conn)?;
Ok(render!(users::followed(
&(&*conn, &intl.catalog, account.clone()),
user.clone(),
account.and_then(|x| x.is_following(&*conn, user.id).ok()).unwrap_or(false),
user.instance_id != Instance::get_local(&*conn)?.id,
user.get_instance(&*conn)?.public_domain,
user.get_followed_page(&*conn, page.limits())?,
page.0,
Page::total(followed_count as i32)
)))
}
#[get("/@/<name>", rank = 1)] #[get("/@/<name>", rank = 1)]
pub fn activity_details( pub fn activity_details(
name: String, name: String,

View File

@ -32,7 +32,7 @@ pub fn translate_notification(ctx: BaseContext, notif: Notification) -> String {
let name = notif.get_actor(ctx.0).unwrap().name(ctx.0); let name = notif.get_actor(ctx.0).unwrap().name(ctx.0);
match notif.kind.as_ref() { match notif.kind.as_ref() {
notification_kind::COMMENT => i18n!(ctx.1, "{0} commented your article."; &name), notification_kind::COMMENT => i18n!(ctx.1, "{0} commented your article."; &name),
notification_kind::FOLLOW => i18n!(ctx.1, "{0} is now following you."; &name), notification_kind::FOLLOW => i18n!(ctx.1, "{0} is subscribed to you."; &name),
notification_kind::LIKE => i18n!(ctx.1, "{0} liked your article."; &name), notification_kind::LIKE => i18n!(ctx.1, "{0} liked your article."; &name),
notification_kind::MENTION => i18n!(ctx.1, "{0} mentioned you."; &name), notification_kind::MENTION => i18n!(ctx.1, "{0} mentioned you."; &name),
notification_kind::RESHARE => i18n!(ctx.1, "{0} boosted your article."; &name), notification_kind::RESHARE => i18n!(ctx.1, "{0} boosted your article."; &name),

View File

@ -22,7 +22,7 @@
} }
</div> </div>
} else { } else {
<p class="center">@i18n!(ctx.1, "Nothing to see here yet. Try to follow more people.")</p> <p class="center">@i18n!(ctx.1, "Nothing to see here yet. Try to subscribe to more people.")</p>
} }
@paginate(ctx.1, page, n_pages) @paginate(ctx.1, page, n_pages)
}) })

View File

@ -80,7 +80,7 @@
</div> </div>
@if !ctx.2.as_ref().map(|u| u.id == author.id).unwrap_or(false) { @if !ctx.2.as_ref().map(|u| u.id == author.id).unwrap_or(false) {
<form action="@uri!(user::follow: name = author.get_fqn(ctx.0))" method="POST"> <form action="@uri!(user::follow: name = author.get_fqn(ctx.0))" method="POST">
<input type="submit" class="button" value="@if is_following {@i18n!(ctx.1, "Unfollow")} else {@i18n!(ctx.1, "Follow")}"> <input type="submit" class="button" value="@if is_following {@i18n!(ctx.1, "Unsubscribe")} else {@i18n!(ctx.1, "Subscribe")}">
</form> </form>
} }
</div> </div>

View File

@ -11,7 +11,8 @@
@tabs(&[ @tabs(&[
(&uri!(user::details: name= user.get_fqn(ctx.0)).to_string(), i18n!(ctx.1, "Articles"), true), (&uri!(user::details: name= user.get_fqn(ctx.0)).to_string(), i18n!(ctx.1, "Articles"), true),
(&uri!(user::followers: name = user.get_fqn(ctx.0), page = _).to_string(), i18n!(ctx.1, "Followers"), false) (&uri!(user::followers: name = user.get_fqn(ctx.0), page = _).to_string(), i18n!(ctx.1, "Subscribers"), false),
(&uri!(user::followed: name = user.get_fqn(ctx.0), page = _).to_string(), i18n!(ctx.1, "Subscriptions"), false)
]) ])
@if !recents.is_empty() { @if !recents.is_empty() {

View File

@ -0,0 +1,26 @@
@use templates::{base, users::header};
@use template_utils::*;
@use plume_models::users::User;
@use routes::*;
@(ctx: BaseContext, user: User, follows: bool, is_remote: bool, remote_url: String, followed: Vec<User>, page: i32, n_pages: i32)
@:base(ctx, i18n!(ctx.1, "{0}'s subscriptions'"; user.name(ctx.0)), {}, {}, {
@:header(ctx, &user, follows, is_remote, remote_url)
@tabs(&[
(&uri!(user::details: name= user.get_fqn(ctx.0)).to_string(), i18n!(ctx.1, "Articles"), true),
(&uri!(user::followers: name = user.get_fqn(ctx.0), page = _).to_string(), i18n!(ctx.1, "Subscribers"), false),
(&uri!(user::followed: name = user.get_fqn(ctx.0), page = _).to_string(), i18n!(ctx.1, "Subscriptions"), false)
])
<div class="cards">
@for follow in followed {
<div class="card">
<h3><a href="@uri!(user::details: name = follow.get_fqn(ctx.0))">@follow.name(ctx.0)</a> <small>@format!("@{}", follow.get_fqn(ctx.0))</small></h3>
<main><p>@Html(follow.summary)</p></main>
</div>
}
</div>
@paginate(ctx.1, page, n_pages)
})

View File

@ -5,12 +5,13 @@
@(ctx: BaseContext, user: User, follows: bool, is_remote: bool, remote_url: String, followers: Vec<User>, page: i32, n_pages: i32) @(ctx: BaseContext, user: User, follows: bool, is_remote: bool, remote_url: String, followers: Vec<User>, page: i32, n_pages: i32)
@:base(ctx, i18n!(ctx.1, "{0}'s followers"; user.name(ctx.0)), {}, {}, { @:base(ctx, i18n!(ctx.1, "{0}'s subscribers"; user.name(ctx.0)), {}, {}, {
@:header(ctx, &user, follows, is_remote, remote_url) @:header(ctx, &user, follows, is_remote, remote_url)
@tabs(&[ @tabs(&[
(&uri!(user::details: name= user.get_fqn(ctx.0)).to_string(), i18n!(ctx.1, "Articles"), false), (&uri!(user::details: name= user.get_fqn(ctx.0)).to_string(), i18n!(ctx.1, "Articles"), true),
(&uri!(user::followers: name = user.get_fqn(ctx.0), page = _).to_string(), i18n!(ctx.1, "Followers"), true) (&uri!(user::followers: name = user.get_fqn(ctx.0), page = _).to_string(), i18n!(ctx.1, "Subscribers"), false),
(&uri!(user::followed: name = user.get_fqn(ctx.0), page = _).to_string(), i18n!(ctx.1, "Subscriptions"), false)
]) ])
<div class="cards"> <div class="cards">

View File

@ -35,9 +35,9 @@
@if ctx.2.clone().map(|u| u.id != user.id).unwrap_or(false) { @if ctx.2.clone().map(|u| u.id != user.id).unwrap_or(false) {
<form class="inline" method="post" action="@uri!(user::follow: name = user.get_fqn(ctx.0))"> <form class="inline" method="post" action="@uri!(user::follow: name = user.get_fqn(ctx.0))">
@if follows { @if follows {
<input type="submit" value="@i18n!(ctx.1, "Unfollow")"> <input type="submit" value="@i18n!(ctx.1, "Unsubscribe")">
} else { } else {
<input type="submit" value="@i18n!(ctx.1, "Follow")"> <input type="submit" value="@i18n!(ctx.1, "Subscribe")">
} }
</form> </form>
} }