Skip to content

Commit d169f6e

Browse files
committed
Include a Mastodon link besides the user name below post titles
We show the Mastodon URL alongside the website URL and XMPP address. This crowds the user box even more and I think LinuxFR should switch to using a proper profile page instead. This was requested by Adrien Dorsaz.
1 parent c22059b commit d169f6e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/helpers/node_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def posted_by(content, user_link='Anonyme')
111111
user_infos = []
112112
user_infos << homesite_link(user)
113113
user_infos << jabber_link(user)
114+
user_infos << mastodon_link(user)
114115
user_infos.compact!
115116
user_link += (" (" + user_infos.join(', ') + ")").html_safe if user_infos.any?
116117
end

app/helpers/users_helper.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ def homesite_link(user)
3535
end
3636

3737
def jabber_link(user)
38-
return unless current_account
3938
return if user.jabber_id.blank?
4039
link_to("adresse XMPP", "xmpp:" + user.jabber_id)
4140
end
4241

42+
def mastodon_link(user)
43+
return if user.mastodon_url.blank?
44+
link_to("Mastodon", user.mastodon_url)
45+
end
4346
end

0 commit comments

Comments
 (0)