<h1>
  <a href="/t/<%= @tag.name %>" style="background:<%= @tag.bg_color_hex %>;color:<%= @tag.text_color_hex %>;">#<%= @tag.name %></a>, tagged <%= @tag.taggings_count %> times.
</h1>
<% if @tag.tag_moderator_ids.any? %>
  <p><strong>Moderators: </strong></p>
<% else %>
  <p>This tag currently has no moderators.</p>
<% end %>
<ul>
  <% @tag.tag_moderator_ids.each do |id| %>
    <%= form_for [:internal, @tag] do |f| %>
      <li>
        <a href="/<%= User.find(id).username %>">@<%= User.find(id).username %></a>
        <%= f.hidden_field :remove_moderator_id, value: id %>
        <%= f.submit "Remove" %>
      </li>
      <br>
    <% end %>
  <% end %>
</ul>
<%= form_for [:internal, @tag] do |f| %>
  <div>
    <%= f.label "Add Moderator (id): " %>
    <%= f.text_field :tag_moderator_id %>
    <%= f.submit "Add Moderator" %>
  </div>
<% end %>
<%= form_for [:internal, @tag] do |f| %>
  <hr>
  <div>
    <%= f.label :supported %>
    <%= f.check_box :supported %>
  </div>
  <div>
    <%= f.label :badge_id %>
    <% badges_array = Badge.pluck(:title, :id) %>
    <%= f.select(:badge_id, options_for_select([["None", nil]] + badges_array, @tag.badge_id)) %>
  </div>
  <div>
    <%= f.label :category %>
    <%= f.select(:category, options_for_select(Tag.valid_categories, @tag.category)) %>
  </div>
  <div>
    <%= f.label :alias_for %>
    <%= f.text_field :alias_for %>
  </div>
  <div>
    <%= f.label :pretty_name %>
    <%= f.text_field :pretty_name %>
  </div>
  <div>
    <%= f.label :short_summary %>
    <%= f.text_field :short_summary %>
  </div>
  <div>
    <%= f.label :rules_markdown %>
    <br>
    <%= f.text_area :rules_markdown %>
  </div>
  <div>
    <%= f.label :wiki_body_markdown %>
    <br>
    <%= f.text_area :wiki_body_markdown %>
  </div>
  <div>
    <%= f.label :bg_color_hex %>
    <%= f.text_field :bg_color_hex, class: "jscolor {hash:true}", required: true %>
  </div>
  <div>
    <%= f.label :text_color_hex %>
    <%= f.text_field :text_color_hex, class: "jscolor {hash:true}", required: true %>
  </div>
  <div>
    <%= f.submit %>
  </div>
<% end %>
