|
42 | 42 | <div class="m15 mw6"> |
43 | 43 | <ul class="point-info"> |
44 | 44 | <li class="point-items"> |
45 | | - <% unless current_user.nil? %> |
46 | | - <% if current_user.id == @point.user_id %> |
47 | | - <div> |
48 | | - <%= link_to 'Edit', edit_point_path(@point), class: 'btn btn-primary' %> |
49 | | - </div> |
50 | | - <% end %> |
51 | | - <% end %> |
52 | | - <div class="pl15"> |
53 | | - <%= link_to 'All', points_path, class: 'btn btn-primary' %> |
54 | | - </div> |
55 | 45 |
|
56 | 46 | <% unless current_user.nil? %> |
57 | | - <% if current_user.curator? %> |
58 | | - <div class="pl15"> |
59 | | - <%= link_to 'Update Status', new_point_reason_path(@point), class: 'btn btn-primary' %> |
60 | | - </div> |
61 | | - <div class="pl15"> |
62 | | - <%= link_to 'Edit Point', edit_point_path(@point), class: 'btn btn-primary' %> |
63 | | - </div> |
64 | | - <div class="pl15"> |
65 | | - <% if @point.status == "approved" %> |
66 | | - <% if !@point.is_featured? %> |
67 | | - <%= link_to 'Feature', featured_point_path(@point), method: :put, class: 'btn btn-primary' %> |
| 47 | + |
| 48 | + <% if current_user.curator? %> |
| 49 | + |
| 50 | + <div class="pl15"> |
| 51 | + <%= link_to 'Update Status', new_point_reason_path(@point), class: 'btn btn-primary' %> |
| 52 | + </div> |
| 53 | + <div class="pl15"> |
| 54 | + <%= link_to 'Edit Point', edit_point_path(@point), class: 'btn btn-primary' %> |
| 55 | + </div> |
| 56 | + <div class="pl15"> |
| 57 | + <% if @point.status == "approved" %> |
| 58 | + <% if !@point.is_featured? %> |
| 59 | + <%= link_to 'Feature', featured_point_path(@point), method: :put, class: 'btn btn-primary' %> |
| 60 | + <% else %> |
| 61 | + <%= link_to 'Un-Feature', featured_point_path(@point), method: :put, class: 'btn btn-warning' %> |
| 62 | + <% end %> |
| 63 | + <% end %> |
| 64 | + </div> |
| 65 | + <div class="pl15"> |
| 66 | + <%= link_to 'Delete', @point, method: :delete, class: 'btn btn-danger' %> |
| 67 | + </div> |
| 68 | + |
| 69 | + <% elsif current_user.id == @point.user_id %> |
| 70 | + |
| 71 | + <div class="pl15"> |
| 72 | + <%= link_to 'All points', points_path, class: 'btn btn-primary' %> |
| 73 | + </div> |
| 74 | + <div class="pl15"> |
| 75 | + <%= link_to 'Edit', edit_point_path(@point), class: 'btn btn-primary' %> |
| 76 | + </div> |
| 77 | + <div class="pl15"> |
| 78 | + <%= link_to 'Back', :back, class: 'btn btn-primary' %> |
| 79 | + </div> |
| 80 | + |
68 | 81 | <% else %> |
69 | | - <%= link_to 'Un-Feature', featured_point_path(@point), method: :put, class: 'btn btn-warning' %> |
70 | | - <% end %> |
71 | | - <% end %> |
72 | | - </div> |
73 | | - <div class="pl15"> |
74 | | - <%= link_to 'Delete', @point, method: :delete, class: 'btn btn-danger' %> |
75 | | - </div> |
76 | | - <% end %> |
77 | | - <% end %> |
78 | | - </li> |
79 | | - </ul> |
80 | | - </div> |
| 82 | + |
| 83 | + <div class="pl15"> |
| 84 | + <%= link_to 'All points', points_path, class: 'btn btn-primary' %> |
| 85 | + </div> |
| 86 | + <div class="pl15"> |
| 87 | + <%= link_to 'Back', :back, class: 'btn btn-primary' %> |
| 88 | + </div> |
| 89 | + <% end %> |
| 90 | + |
| 91 | + <% else %> |
| 92 | + <div class="pl15"> |
| 93 | + <%= link_to 'Back', :back, class:'btn btn-primary' %> |
| 94 | + </div> |
| 95 | + |
| 96 | + <% end %> |
| 97 | + </li> |
| 98 | +</ul> |
| 99 | +</div> |
81 | 100 |
|
82 | 101 | </div> |
83 | 102 |
|
0 commit comments