{{#if key}}
	<form id="form">
		<div>
			<input type="text" name="title" class="fill-width" placeholder="Title"/>
		</div>
		<div>
			<textarea type="text" name="description" class="fill-width" placeholder="Description"/></textarea>
		</div>
		<div>
			<button value="Cancel" class="danger">Cancel</button>
			<button value="Create" onclick="$(this).parent().submit();">Create</button>
		</div>
	</form>
	<script>
		$(document).ready(function(){
			$('form#form').submit(function(){
				var data = $(this).serializeObject(),
					State = History.getState();
				for(var i in State.data){
					data[i] = State.data;
				}
				data.type = 'action';
				data.id = 'issue';
				apiCall(data,function(d){
					if(!d.error){
						back();
					}else{
						$('#loading').hide();
					}
					return false;
				});
				return false;
			}).find('.danger').click(function(){
				back();
				return false;
			});
		});
	</script>
{{else}}
	<script>
		$(document).ready(function(){
			back();
		});
	</script>
{{/if}}