<!-- $Id: manage_template.tt2 5269 2008-08-22 15:52:19Z peter.hart $ -->

<h2>[%|loc%]Modify or delete existing rejection messages[%END%]</h2>
<p>

[% IF available_files %]

<table border="1">
<table summary="[%|loc%]Listing rejection messages[%END%]" class="listOfItems">
	<tr><th colspan="4">[%|loc%]Listing rejection messages[%END%]</th></tr>
	<tr><th>[%|loc%]Use as default[%END%]</th><th>[%|loc%]Message name[%END%]</th><th colspan="2">[%|loc%]Operation[%END%]</th></tr>

        <form action="[% path_cgi %]" method="post" name="manage_templates">
        <fieldset>
        <input type="hidden" name="action" value="manage_template">
        <input type="hidden" name="list" value="[% list %]">
        <input type="hidden" name="new_default" value="[% default_reject_template %]">

	[% SET dark = 1 %]
	[% FOREACH file = available_files %]
		[% IF dark == '1' %]
			  [% dark = '0' %]
			  <tr>
		[% ELSE %]
			  [% dark = '1' %]
        		  <tr class="color0">
		[% END %]
                <td align="center">
                <input type="radio" name="subaction_setdefault" value="[% file %]" [% IF file == default_reject_template %] checked="checked" [% ELSE %]  onchange="this.form.new_default.value = '[%file%]' ; this.form.submit();" [% END %]>
	        </td> 
       		<td>
		[% file %]
		</td>
                <td  align="center">
		<a href="[% path_cgi %]/manage_template/modify/[% list %]/[% file %]" class="MainMenuLinks">[%|loc%]Edit[%END%]</a>
		</td>
		<td align="center">
		<a href="[% path_cgi %]/manage_template/delete/[% list %]/[% file %]" class="MainMenuLinks" onclick="return request_confirm('[% FILTER escape_quote %][%|loc(file)%]Do you really want to delete message %1?[%END%][%END%]')">[%|loc%]Delete[%END%]</a>
		</td>
		</tr>
	[% END %]
</fieldset>
</form>

[% ELSE %]
<tr><td colspan="4">[%|loc%]There are currently no Rejection Messages available[%END%]<td>
[% END %]

</table>
</table>

[%IF content %] 

<form action="[% path_cgi %]" method="post" name="edit_templates">
<p>
<h2>[%|loc%]Edit[%END%] [% message_template %]</h2>
</p>
<p>
<!-- [%|loc()%]Message Name:[%END%]<input type="text" name="message_template" value="[% message_template %]"> -->
<!-- <input class="MainMenuLinks" type="submit" name="subaction_default" value="[%|loc%]Default Message[%END%]" /> -->

<textarea NAME="template_content" COLS="50" ROWS="10" WRAP=SOFT>
[% content %] 
</TEXTAREA>
</p>
<p>
<input class="MainMenuLinks" type="submit" name="subaction_save" value="[%|loc%]Save Message[%END%]" />
<input class="MainMenuLinks" type="submit" name="action_manage_template" value="[%|loc%]Cancel[%END%]" />
<input type="hidden" name="message_template" value="[% message_template %]"/>
<input type="hidden" name="list" value="[% list %]"/>
<input type="hidden" name="action" value="manage_template"/>
</p>
</fieldset>
</form>

[% ELSE %]

<h2>[%|loc%]Create new rejection messages[%END%]</h2>

<form action="[% path_cgi %]" method="post" name="edit_templates">
<fieldset>
<input type="hidden" name="list" value="[%list%]">
<input type="hidden" name="action" value="manage_template">

[%|loc%]New message name:[%END%] <input type="text" name="new_template_name"> <input type="submit" name="subaction_create_new" value="[%|loc%]create[%END%]" class="MainMenuLinks">

</fieldset>
</form>

[% END %]

<!-- end manage_template.tt2 -->
