Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Hide sensitive things if not authed

  • Loading branch information...
commit 71abf5b0d768730b700fc1ff43d79f543f9cb4f7 1 parent 141e21c
@nmanzi authored
Showing with 28 additions and 22 deletions.
  1. +28 −22 app/views/links/index.html.erb
View
50 app/views/links/index.html.erb
@@ -4,36 +4,42 @@
<tr>
<th>Subdomain</th>
<th>URL</th>
- <th>Visits</th>
- <th>Actions</th>
+ <% if is_authed? %>
+ <th>Visits</th>
+ <th>Actions</th>
+ <% end %>
</tr>
<% @links.each do |link| %>
<tr>
<td><%= link.subdomain %><span class="sublabel">.hadric.us</span></td>
<td><a href="<%= link.url %>"><%= link.url %></a></td>
- <td><%= link.visits %>
- <td>
- <%= link_to 'Edit', edit_link_path(link), :class => "label" %>
- <a href="#" data-controls-modal="modal-<%= link.id %>" data-keyboard="true" class="label important">Destroy</a>
- <div id="modal-<%= link.id %>" class="modal hide fade">
- <div class="modal-header">
- <a href="#" class="close">&times;</a>
- <h3>Are you sure?</h3>
- </div>
- <div class="modal-body">
- <p>Really destroy subdomain <strong><%= link.subdomain %>.hadric.us</strong>?</p>
- </div>
- <div class="modal-footer">
- <%= link_to 'Destroy', link, method: :delete, :class => "btn danger" %>
- <a href="#" class="btn secondary" data-controls-modal="modal-<%= link.id %>">Cancel</a>
- </div>
- </div>
- </td>
+ <% if is_authed? %>
+ <td><%= link.visits %></td>
+ <td>
+ <%= link_to 'Edit', edit_link_path(link), :class => "label" %>
+ <a href="#" data-controls-modal="modal-<%= link.id %>" data-keyboard="true" class="label important">Destroy</a>
+ <div id="modal-<%= link.id %>" class="modal hide fade">
+ <div class="modal-header">
+ <a href="#" class="close">&times;</a>
+ <h3>Are you sure?</h3>
+ </div>
+ <div class="modal-body">
+ <p>Really destroy subdomain <strong><%= link.subdomain %>.hadric.us</strong>?</p>
+ </div>
+ <div class="modal-footer">
+ <%= link_to 'Destroy', link, method: :delete, :class => "btn danger" %>
+ <a href="#" class="btn secondary" data-controls-modal="modal-<%= link.id %>">Cancel</a>
+ </div>
+ </div>
+ </td>
+ <% end %>
</tr>
<% end %>
</table>
-<div style="text-align: right;">
+<% if is_authed? %>
+ <div style="text-align: right;">
<%= link_to 'New Link', new_link_path, :class => "btn primary" %>
-</div>
+ </div>
+<% end %>
Please sign in to comment.
Something went wrong with that request. Please try again.