<% if @exists_notifications_routes %>

Authentecated User

<% if user_signed_in? %> <%= current_user.name %> · <%= current_user.email %> · <%= link_to 'Logout', destroy_user_session_path, method: :delete %>
<% else %> Not logged in · <%= link_to 'Login', new_user_session_path %>
<% end %> <%= link_to 'Notifications', notifications_path %> / <% if User.subscription_enabled? %> <%= link_to 'Subscriptions', subscriptions_path %> <% end %>

<% end %> <% if @exists_user_notifications_routes %>

Listing Users

<% User.all.each do |user| %>

<%= user.name %> · <%= user.email %>
<%= link_to 'Notifications', user_notifications_path(user) %> / <% if User.subscription_enabled? %> <%= link_to 'Subscriptions', user_subscriptions_path(user) %> <% end %>

<% end %>
<% end %> <% if @exists_admins_notifications_routes %>

Authentecated User as Admin

<% if user_signed_in? %> <%= current_user.name %> · <%= current_user.email %> <%= current_user.admin? ? "(admin)" : "(not admin)" %>
<% else %> Not logged in · <%= link_to 'Login', new_user_session_path %>
<% end %> <%= link_to 'Notifications', admins_notifications_path %> / <% if User.subscription_enabled? %> <%= link_to 'Subscriptions', admins_subscriptions_path %> <% end %>

<% end %> <% if @exists_admin_notifications_routes %>

Listing Admins

<% Admin.all.each do |admin| %>

<%= admin.user.name %> · <%= admin.user.email %>
<%= link_to 'Notifications', admin_notifications_path(admin) %> / <% if Admin.subscription_enabled? %> <%= link_to 'Subscriptions', admin_subscriptions_path(admin) %> <% end %>

<% end %>
<% end %>
<%= link_to 'New Article', new_article_path, class: "create_button green_button" %>

Listing Articles

<% @articles.each do |article| %>

<%= link_to article.title, article %>

<%= article.user.name %> · <%= article.created_at.strftime("%b %d %H:%M") %>
<%= article.body.truncate(60) if article.body.present? %>
<%= link_to 'Read', article %>

<% if user_signed_in? and article.author?(current_user) %> <%= link_to 'Edit Article', edit_article_path(article), class: "gray_button" %> <% end %> <%# if user_signed_in? and (article.author?(current_user) or current_user.admin?) %> <%#= link_to 'Destroy Article', article, method: :delete, data: { confirm: 'Are you sure?' }, class: "gray_button" %> <%# end %>
<% end %>