{% extends "polemictweet_base.html" %}
{% load i18n %}
{% load thumbnail %}

	{% block js_import %}
		<script type="text/javascript" src="{{STATIC_URL}}js/jquery.min.js"></script>
		<script type="text/javascript" src="{{STATIC_URL}}js/jquery.qtip.min.js"></script>
		<script type="text/javascript" src="{{STATIC_URL}}js/jquery.formset.js"></script>
		<script type="text/javascript" src="{{STATIC_URL}}js/add_live.js"></script>
	{% endblock %}
	{% block js_declaration %}
		<script type="text/javascript">
		
		// the function stopRKey prevents from the validation of the form if the user tape enter button while entering a field 
		var $j = jQuery.noConflict(); 

		function stopRKey(evt) {
		      var evt = (evt) ? evt : ((event) ? event : null);
		      var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
		      if ((evt.keyCode == 13) && (node.type=="text"))  {return false;}
		    }
	
		document.onkeypress = stopRKey;

	 
		</script>

		
		</script>
	{% endblock %}	
	{% block content %}
	{{ event_form.errors }}
    
	<div id="add_live_event" class="span-18 last">
		<div class="projectseventstitle">{% trans "Create a new partner" %}</div>
    
	<form action="{{ create_partner_action }}" enctype="multipart/form-data" id="my_form" method="POST" enctype="multipart/form-data" >
	        {% csrf_token %}        
	        <div class="createpartnerform">
		        <div id="createpartnerformhidden">
		            <input type="hidden" name="form_status" value="{{form_status}}" id="partner_form_status" />
		            {% for hidden in partner_form.hidden_fields %}
		                {{ hidden }}
		            {% endfor %}
		        </div>
		        <div id="createpartnerformfields" class="span-18 last">
		        <div>{{ partner_form.name.errors }}{{ partner_form.name.label_tag }}{{partner_form.name}}</div>	
		        <div>{{ partner_form.url.errors }}{{ partner_form.url.label_tag }}{{partner_form.url}}</div>	
		        
		        <table id="choosepartnerpicturecontainer" >
	
				    <tr>
				        <td class="leftcolumn">
				            {% trans "Upload a new picture" %}<br/> (JPG, PNG, &lt;&nbsp;1&nbsp;Mo)
				        </td>
				        <td>
				        	<div>{{ partner_form.partner_image.errors }}{{partner_form.partner_image.label_tag}}{{partner_form.partner_image}}</div>
				        </td>
				    </tr>
				</table> 
				 
		        </div>
	        </div>
    	        
        <div id="submitevent" class="span-18 last">
            <div id="submitevent-buttons" class="span-8 last">
                <button type="submit" value="close" name="submit_button" id="submit_button_close">{% trans 'close_cancel' %}</button>
                <button type="submit" value="write" name="submit_button" id="submit_button_write">{% trans "write" %}</button>
            </div>
        </div>
	
	</form>
	</div>
	{% endblock %}