|
|
|
@ -2,7 +2,7 @@ class UserDecorator < ApplicationDecorator
|
|
|
|
|
include AvatarHelper
|
|
|
|
|
|
|
|
|
|
def link
|
|
|
|
|
wrap_with_link(username || temporary_username || 'anonymous')
|
|
|
|
|
wrap_with_link(username || temporary_username || "user:#{id}")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def img_link
|
|
|
|
@ -28,8 +28,9 @@ class UserDecorator < ApplicationDecorator
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def wrap_with_link(html)
|
|
|
|
|
if username
|
|
|
|
|
h.link_to html, h.profile_path(model), title: username
|
|
|
|
|
if id
|
|
|
|
|
title = username || temporary_username || 'anonymous user'
|
|
|
|
|
h.link_to html, h.profile_path(model), title: title
|
|
|
|
|
else
|
|
|
|
|
html
|
|
|
|
|
end
|
|
|
|
|