{extends "base.tpl.html"}
{block "title"}#{$issue_id} - Self Assign{/block}

{block "content"}
{if $self_assign_result|default:'' != ''}
  <br />
  <center>
  <span>
  {if $self_assign_result == -1}
    <b>{t}An error occurred while trying to run your query{/t}</b>
  {elseif $self_assign_result == 1}
    <b>{t}Thank you, you are now assigned to the issue{/t} #{$issue_id}.</b>
  {/if}
  </span>
  </center>
  <script type="text/javascript">
  <!--
  {if $core.current_user_prefs.close_popup_windows}
  setTimeout('Eventum.close_and_refresh()', 2000);
  {/if}
  //-->
  </script>
  <br />
  {if not $core.current_user_prefs.close_popup_windows}
  <center>
    <span><a href="javascript:void(null);" onClick="Eventum.close_and_refresh();">{t}Continue{/t}</a></span>
  </center>
  {/if}
{else}
<form name="assign_form" method="post" action="self_assign.php">
<input type="hidden" name="iss_id" value="{$issue_id}">
  <table class="bordered">
    <tr>
      <td colspan="2" style="font-weight: bold; color: red;" align="center">
        <span style="font-size: 140%">{t}WARNING{/t}</span><br />
        {t count=$assigned_users|@count plural="The following users are already assigned to this issue"}The following user is already assigned to this issue{/t}.<br />{","|join:$assigned_users}
      </td>
    </tr>
    <tr>
      <td align="right">
        <input id="target_replace" type="radio" name="target" value="replace" checked>
      </td>
      <td>
        <label for="target_replace">
        {t count=$assigned_users|@count plural="Replace current assignees with Myself."}Replace current assignee with Myself.{/t}
        </label>
      </td>
    </tr>
    <tr>
      <td align="right" valign="top">
        <input id="target_add" type="radio" name="target" value="add">
      </td>
      <td>
        <label for="target_add">
            {t}Add Myself to list of assignees.{/t}
        </label>
      </td>
    </tr>
    <tr class="buttons">
      <td colspan="2">
        <input type="submit" value="{t}Continue{/t} &gt;&gt;">
      </td>
    </tr>
  </table>
</form>
{/if}
{/block}
