h1
  = @ip
  ' 's IP profile

ul
  li = link "View images this IP has uploaded", to: Routes.search_path(@conn, :index, q: "ip:#{@ip}")
  li = link "View comments this IP has posted", to: Routes.comment_path(@conn, :index, cq: "ip:#{@ip}")
  li = link "View posts this IP has made", to: Routes.post_path(@conn, :index, pq: "ip:#{@ip}")

= render PhilomenaWeb.BanView, "_bans.html", bans: @subnet_bans, conn: @conn

h2 Administration Options
ul
  li = link "View tag changes", to: Routes.ip_profile_tag_change_path(@conn, :index, to_string(@ip))
  li = link "View source URL history", to: Routes.ip_profile_source_change_path(@conn, :index, to_string(@ip))
  li = link "View reports this IP has made", to: Routes.admin_report_path(@conn, :index, rq: "ip:#{@ip}")
  li = link "View IP ban history", to: Routes.admin_subnet_ban_path(@conn, :index, ip: to_string(@ip))
  li = link "Ban this sucker", to: Routes.admin_subnet_ban_path(@conn, :new, specification: to_string(@ip))

h2 Actions
ul
  li = link "Revert all tag changes", to: Routes.tag_change_full_revert_path(@conn, :create, [ip: to_string(@ip)]), data: [confirm: "Are you really, really sure?", method: "create"]

h4 Observed users
table.table
  thead
    tr
      th Username
      th Account Used
      th Last Seen
      th Created At
  tbody
    = for uip <- @user_ips do
      tr
        td
          = link uip.user.name, to: Routes.profile_path(@conn, :show, uip.user)
        td
          => uip.uses
          ' times
        td
          => pretty_time uip.updated_at
        td
          => pretty_time uip.user.created_at