Profile links with tilde
This commit is contained in:
parent
2e678714d4
commit
6b8a9e8610
@ -12,7 +12,8 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
def avatar_img(user)
|
||||
nickname = "~#{user.nickname}"
|
||||
image_tag user.avatar_url || default_avatar_url,
|
||||
:title => user.nickname, :alt => user.nickname, :class => "avatar"
|
||||
:title => nickname, :alt => nickname, :class => "avatar"
|
||||
end
|
||||
end
|
||||
|
@ -10,10 +10,15 @@ module AsciicastsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def asciicast_author(asciicast)
|
||||
def profile_link(asciicast, options = {})
|
||||
if asciicast.user
|
||||
link_to avatar_img(asciicast.user) + " #{asciicast.user.nickname}",
|
||||
profile_path(asciicast.user)
|
||||
if options[:avatar]
|
||||
img = avatar_img(asciicast.user) + " "
|
||||
else
|
||||
img = ""
|
||||
end
|
||||
|
||||
link_to img + "~#{asciicast.user.nickname}", profile_path(asciicast.user)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user