{# 	
	Keosu is an open source CMS for mobile app
	Copyright (C) 2014  Vincent Le Borgne, Pockeit

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    #}
{% extends 'KeosuCoreBundle:MainViews:configuration.html.twig' %}


{% block content %}
{% if error != null %}
<div class="alert alert-danger">
	{{error}}
</div>
{% endif %}
<script type="text/javascript">
	$(document).ready(function() {
		
		function openInput($el){
			$el.parent().parent().find('input[type="file"]')[ 0 ].click();
		}
		 
		$(document).on("click",'.uploader',function() {
			 	openInput($(this));
			    return false;
		 });

		$(document).on("change",'input[type="file"]',function() {
			$nameFile = $( this ).val().split('\\');
			$('#name-file').html('	' + $nameFile[$nameFile.length - 1]);
		});
	});
	</script>
	<div class="picture-edit">
		{{ form_start(form) }}
		    {{ form_errors(form) }}
			    <div class="upload image-collection-entry col-lg-12">
			    	{{ form_row(form.file) }}
			    	<button type="button" class="btn btn-info uploader">Upload new Theme</button><span id="name-file"></span>	
			    </div>
		    <br class="clear"/>
 <br class="clear"/>
			    <br class="clear"/>
				<div class="col-md-3"></div>
	    		<input type="submit" class="btn btn-success" /><span>&nbsp;</span><a class="confirmModal" href="javascript:history.go(-1);" ><button type="button" class="btn btn-danger">Cancel</button></a>
						 {{ form_end(form) }}	    
	</div>
{% endblock %}

