/
_comments.html.haml
21 lines (19 loc) · 1.13 KB
/
_comments.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
%h3 What players are saying:
%ul
- comments.each do |comment|
%li
%img{:src => comment.player.avatar_url}
-if comment.player.name.present?
%a.comment_player_name{:href => player_path(comment.player.username)}= comment.player.name
-else
%a.comment_player_name{:href => player_path(comment.player.username)}= comment.player.username
%span.comment_body= raw comment.body
- if @page == 1 && @comments.pages > 1
= link_to raw("more comments ›"), "/shots/#{@shot.id}?page=#{@page +1}", :class => 'big-pink'
- elsif @page > 1 && @page < @comments.pages
= link_to raw("« back to start"), "/shots/#{@shot.id}" , :class => 'big-pink-third'
= link_to raw("‹ previous"), "/shots/#{@shot.id}?page=#{@page - 1}", :class => 'big-pink-third'
= link_to raw("next ›"), "/shots/#{@shot.id}?page=#{@page + 1}", :class => 'big-pink-third'
- elsif @page == @comments.pages && @comments.pages > 1
= link_to raw("« back to start"), "/shots/#{@shot.id}", :class => 'big-pink-half'
= link_to raw("‹ prev comments"), "/shots/#{@shot.id}?page=#{@page - 1}", :class => 'big-pink-half'