[% IF action != "editor" %]
  <div class="card overflow-hidden w-full">
    <div class="head">
      <h3>Actions</h3>
    </div>
    <div class="actionbox">
      [% IF type != "apply" %]
        <div class="flex flex-nowrap">
          <a href="conf.cgi?sub=objects&amp;action=new&amp;type=[% type | uri %]">
            <i class="fa-solid fa-plus"></i>
            Create a new [% type | html %]
          </a>
          [% IF type == "host" || type == "service" || type == "contact" %]
            <a href="conf.cgi?sub=objects&amp;action=new&amp;type=[% type | uri %]&amp;template=1" class="ml-1.5">
              (new template)
            </a>
          [% END %]
        </div>
      [% END %]
      [% IF show_object && object.get_id() != "new" %]
        <hr class="mt-0.5 pt-0.5">
        <div>
          <a href="status.cgi?style=[% IF type == "host" %]host[% END %]detail&dfl_s0_type=[% type | uri %]&dfl_s0_op=%3D&dfl_s0_value=[% object.get_name() | uri %]">
            <i class="fa-solid fa-magnifying-glass-arrow-right"></i>
            Show live objects
          </a>
        </div>
        [% IF type == 'host' && !object.is_template() %]
        <div>
          <a href="conf.cgi?sub=objects&amp;action=listservices&amp;data.id=[% object.get_id() %]">
            <i class="fa-solid fa-bars"></i>
            Show services for this host
          </a>
        </div>
        [% END %]
        <div>
          <a href="conf.cgi?sub=objects&amp;action=listref&amp;data.id=[% object.get_id() %]">
            <i class="fa-solid fa-arrows-turn-to-dots"></i>
            Show references
          </a>
        </div>
        [% IF has_history %]
        <div>
          <a href='conf.cgi?sub=objects&amp;action=history&data.id=[% object.get_id() %]'>
            <i class="fa-solid fa-code-commit"></i>
            Git Blame
          </a>
        </div>
      [% END %]
        <hr class="mt-0.5 pt-0.5">
        <div>
          <form action='conf.cgi' method='POST'>
            <input type='hidden' name='sub' value='objects'>
            <input type='hidden' name='action' value='clone'>
            <input type='hidden' name='data.id' value="[% object.get_id() %]">
            <input type="hidden" name="CSRFtoken" value="[% get_user_token(c) %]">
            <a href="conf.cgi?sub=objects&amp;data.id=[% object.get_id() %]" onClick="jQuery(this).closest('FORM').submit(); return false;">
              <i class="fa-solid fa-clone"></i>
              Clone this [% type | html %]
            </a>
          </form>
        </div>
        [% IF object.disabled %]
        <div>
          <form action='conf.cgi' method='POST'>
            <input type='hidden' name='sub' value='objects'>
            <input type='hidden' name='action' value='enable'>
            <input type='hidden' name='data.id' value="[% object.get_id() %]">
            <input type="hidden" name="CSRFtoken" value="[% get_user_token(c) %]">
            <a href="conf.cgi?sub=objects&amp;data.id=[% object.get_id() %]" onClick="jQuery(this).closest('FORM').submit(); return false;">
              <i class="fa-solid fa-circle-play"></i>
              Enable this [% type | html %]
            </a>
          </form>
        </div>
        [% ELSE %]
        <div>
          <form action='conf.cgi' method='POST'>
            <input type='hidden' name='sub' value='objects'>
            <input type='hidden' name='action' value='disable'>
            <input type='hidden' name='data.id' value="[% object.get_id() %]">
            <input type="hidden" name="CSRFtoken" value="[% get_user_token(c) %]">
            <a href="conf.cgi?sub=objects&amp;data.id=[% object.get_id() %]" onClick="jQuery(this).closest('FORM').submit(); return false;">
              <i class="fa-solid fa-circle-pause"></i>
              Disable this [% type | html %] temporarily
            </a>
          </form>
        </div>
        [% END %]
        <div class="hover-red-text">
          <form action='conf.cgi' method='POST'>
            <input type='hidden' name='sub' value='objects'>
            <input type='hidden' name='action' value='delete'>
            <input type='hidden' name='data.id' value="[% object.get_id() %]">
            <input type="hidden" name="CSRFtoken" value="[% get_user_token(c) %]">
            <a href="conf.cgi?sub=objects&amp;data.id=[% object.get_id() %]" onClick="jQuery(this).closest('FORM').submit(); return false;">
              <i class="fa-solid fa-trash"></i>
              Delete this [% type | html %]
            </a>
          </form>
        </div>
        <div>
          <form action='conf.cgi' method='POST'>
            <input type='hidden' name='sub' value='objects'>
            <input type='hidden' name='action' value='revert'>
            <input type='hidden' name='data.id' value="[% object.get_id() %]">
            <input type="hidden" name="CSRFtoken" value="[% get_user_token(c) %]">
            <a href="conf.cgi?sub=objects&amp;data.id=[% object.get_id() %]" onClick="jQuery(this).closest('FORM').submit(); return false;">
              <i class="fa-solid fa-reply-all"></i>
              Revert this [% type | html %]
            </a>
          </form>
        </div>
        <div>
          <a href="conf.cgi?sub=objects&amp;action=move&amp;data.id=[% object.get_id() %]">
            <i class="fa-solid fa-truck-fast"></i>
            Move [% type | html %] to file
          </a>
        </div>
        [% IF type == 'contact' %]
        <div>
          <a href="conf.cgi?sub=users&amp;action=change&amp;data.username=[% object.get_name() | uri %]">
            <i class="fa-solid fa-user-pen"></i>
            Edit CGI Permissions
          </a>
        </div>
        [% END %]
      [% END %]
        [% IF type != "apply"|| show_object %]
        <hr class="mt-0.5 pt-0.5">
        [% END %]
        [% IF c.config.exists("has_feature_agents") && c.config.has_feature_agents %]
          [% IF type == "host" && show_object && object.conf.exists("_AGENT") %]
          <div>
            <a href="agents.cgi?action=edit&hostname=[% object.get_name() | uri %]&backend=[% param_backend | uri %]">
              <i class="fa-solid fa-cube"></i>
              Agent Configuration
            </a>
          </div>
          [% END %]
          [% IF type == "service" && show_object && object.conf.exists("_AGENT_AUTO_CHECK") %]
          <div>
            <a href="agents.cgi?action=edit&hostname=[% object.conf.host_name.0 | uri %]&backend=[% param_backend | uri %]">
              <i class="fa-solid fa-cube"></i>
              Agent Configuration
            </a>
          </div>
          [% END %]

        [% END %]
        <div>
          <a href="conf.cgi?sub=objects&amp;action=browser[% IF file_link %]#[% file_link | uri %][% END %]">
            <i class="fa-solid fa-folder-open"></i>
            Browse filesystem
          </a>
        </div>
        <div>
          <a href="conf.cgi?sub=objects&amp;action=tree">
            <i class="fa-solid fa-folder-tree"></i>
            Objects Tree
          </a>
        </div>
        [% IF has_history %]
        <div>
          <a href="conf.cgi?sub=objects&amp;action=history">
            <i class="fa-solid fa-clock-rotate-left"></i>
            History
          </a>
        </div>
        [% END %]
    </div>
  </div>
[% END %]
