Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
$header(formurl,breadcrumbs,shortcuts)$

$if(error)$<div class="error"><p>$error$</p></div>$endif$

<div class="template_list">

<div>
<form method="post" action="$formurl$/templates">

<h2>Templates</h2>

$if(!first(templates))$
<p>No templates are available. This does not make sense. Contact support.</p>
$endif$

<table>
$templates:{t|
<tr>
	<td>
		$t.name;format="html"$
	</td><td>
		$if(!t.default)$<a href='$formurl$/templates?name=$t.name;format="url"$&amp;a=$auth$&amp;default=' class="default">Make default</a>$endif$
		$if(t.edit)$<a href='$formurl$/template?name=$t.name;format="url"$&amp;a=$auth$' class="edit">Edit</a>$endif$
		$if(t.delete)$<a href='$formurl$/templates?name=$t.name;format="url"$&amp;a=$auth$&amp;delete=' class="delete">Delete</a>$endif$
		<a href='$formurl$/templates?name=$t.name;format="url"$&amp;a=$auth$&amp;export=' class="export">Export</a>
	</td>
</tr>
}$
</table>
</div>

</form>
</div>

<div>
<form method="post" action="$formurl$/templates">
<input type="hidden" name="a" value="$auth$" />

<h3>Create new template</h3>

<p>Create a new template based on an existing template.</p>

<input type="text" name="name" value="" placeholder="New template name">
<select name="new_template_from">
$templates:{t|
<option name='$t.name;format="url"$'>$t.name;format="html"$</option>
}$
</select>

<input type="submit" value="Create" />

</form>
</div>

$footer()$
New to GrepCode? Check out our FAQ X