# -*- coding: utf-8 -*- 
<%inherit file="jm2l:templates/layout.mako"/>
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
<%def name="jsAddOn()">
  <script src="/js/jm2l.js"></script>
  <script src="/vendor/ckeditor/ckeditor.js"></script>
  <script src="/vendor/select2/js/select2.js"></script>  
</%def>
<%def name="cssAddOn()">
  <link rel="stylesheet" href="/css/jm2l.css" />
  <link rel="stylesheet" href="/vendor/select2/css/select2.css" type="text/css" media="screen" />
</%def>

<div class="row-fluid">
  <div class="span10 offset1">

<a class="btn" href="${request.route_path('list_salles')}">
    <i class="icon-arrow-left"></i> Retour à la liste
</a>
% if 'salle_id' in form._fields.keys():
<a class="btn btn-danger btn-mini pull-right" onclick="return confirm_click();" href="${request.route_path('action_salle', action='delete', salle_id=form.salle_id.data)}">
    <i class="icon-remove icon-white"></i> Supprimer cette salle
</a>
%endif
% if 'salle_id' in form._fields.keys():
    <h3>Editer une Salle</h3>
% else:
    <h3>Ajouter une Salle</h3>
%endif
<%
DicForm = {
    'year_uid':     {'PlaceHolder':u"Année",           "FieldStyle":"width:7em;",  "ContainerStyle":"float:left;" },
    'phy_salle_id': {'PlaceHolder':u"Salle Physique",  "FieldStyle":"width:20em;", "ContainerStyle":"float:left;" },
    'place_type':   {'PlaceHolder':u"Type d'évènement","FieldStyle":"width:15em;" },
    'name':         {'PlaceHolder':u"Nom de la salle", "FieldStyle":"width:90%;" },
    'description':  {'PlaceHolder':u"Description", "ContainerStyle":"width:95%;min-height:150px;padding-top: 12px;", "ckeditor":"1" },
    }
%>

% if 'salle_id' in form._fields.keys():
    <form action="/Salles/${form.salle_id.data}" method="post">
    ${form.salle_id()}
%else:
    <form action="/Salles" method="post">
%endif
    ${helpers.DisplayForm(form, DicForm)}

<br>
<div class="center">
    <button type="submit" class="btn btn-large btn-primary" />
        <i class="icon-ok icon-white"></i> Enregistrer
    </button>
</div>

</form>

  </div>
</div>
