neocities/views/_news_profile_comment.erb

24 lines
No EOL
1.1 KiB
Text

<% actioning_site = profile_comment.actioning_site_dataset.select(:id, :username).first %>
<% site = profile_comment.site_dataset.select(:id, :username).first %>
<div class="title">
<div class="icon" style="background-image:url(<%= actioning_site.screenshot_url('index.html', '100x100') %>);"></div>
<% if current_site && current_site.id == actioning_site.id && request.path == '/' %>
You
<% else %>
<a href="/site/<%= actioning_site.username %>" class="user"><%= actioning_site.username %></a>
<% end %>
<% if request.path == '/' %>
<% if current_site && current_site.id == profile_comment.site_id %>
left a comment on <a href="/site/<%= current_site.username %>">your profile</a>:
<% else %>
left a comment on <a href="/site/<%= profile_comment.site.username %>" class="user"><%= profile_comment.site.username %></a><%= site.username[site.username.length-1] == 's' ? "'" : "'s" %> site profile:
<% end %>
<% end %>
<span class="date">
<a href="?event_id=<%= profile_comment.event.id %>"><%= profile_comment.created_at.ago %></a>
</span>
<div class="comment"><%= profile_comment.message %></div>
</div>