<%
  if content.favorite?
    icon = 'star'
    action = 'Unfavorite'
  else
    icon = 'star_border'
    action = 'Favorite'
  end
%>

<% if content.persisted? && user_signed_in? && content.user == current_user %>
  <i class="material-icons right yellow-text favorite-button tooltipped" 
    data-tooltip="<%= action %> this page"
    data-content-id="<%= content.id %>"
    data-content-class="<%= content.class.name.downcase.pluralize %>">
    <%= icon %>
  </i>
<% end %>
