<%= title @competition.title %>

<%= content_tag_for :div, @competition do %>
  <h1><%= @competition.title %></h1>

  <p>
    Starts: <%= @competition.start_on %>
    Ends: <%= @competition.end_on %>
  </p>

  <p>
    <%# user a presenter for this %>
    Created by: <%= mail_to @competition.owner.email, @competition.owner.username %>
  </p>

  <%= simple_format @competition.description %>

  <p>
    <h2>Categories</h2>
    <ul>
      <%= render @competition.brackets %>
    </ul>
  </p>

  <% if can? :manage, @competition %>
    <%= link_to "Edit", edit_competition_path(@competition), class: "btn" %>
    <%= link_to "Delete", delete_competition_path(@competition), class: "btn" %>
  <% end %>
<% end %>

<%= title @competition.title %>

<%= content_tag_for :div, @competition do %>
  <h1><%= @competition.title %></h1>

  <p>
    Starts: <%= @competition.start_on %>
    Ends: <%= @competition.end_on %>
  </p>

  <p>
    <%# user a presenter for this %>
    Created by: <%= mail_to @competition.owner.email, @competition.owner.username %>
  </p>

  <%= simple_format @competition.description %>

  <% if @competition.brackets.any? %>
  <p>
    <h2>Categories</h2>
    <ul>
      <%= render @competition.brackets %>
    </ul>
  </p>
  <% end %>

  <% if can? :manage, @competition %>
    <%= link_to "Edit", edit_competition_path(@competition), class: "btn" %>
    <%= link_to "Delete", delete_competition_path(@competition), class: "btn" %>
  <% end %>
<% end %>

Hide categories if they don't exist
Hide categories if they don't exist
