Commit | Line | Data |
---|---|---|
5d680e84 | 1 | {% extends 'base.html' %} |
37bf2d05 NC |
2 | |
3 | {% block extrahead %} | |
703e5cfb NC |
4 | <script src="{{ MEDIA_URL }}js/jquery-1.5.1.min.js" |
5 | type="text/javascript"></script> | |
6 | <script src="{{ MEDIA_URL }}js/jquery-ui-1.8.11.custom.min.js" | |
7 | type="text/javascript"></script> | |
8 | <link href="{{ MEDIA_URL }}/css/redmond/jquery-ui-1.8.11.custom.css" | |
9 | rel="stylesheet" /> | |
37bf2d05 NC |
10 | {% endblock %} |
11 | ||
5d680e84 NC |
12 | {% block title %} |
13 | Formulaire poste | |
14 | {% endblock %} | |
37bf2d05 NC |
15 | |
16 | {% block main %} | |
3ed49093 NC |
17 | <h2> |
18 | {% if new %} | |
19 | Nouveau poste | |
20 | {% else %} | |
21 | Poste | |
22 | {% endif %} | |
23 | </h2> | |
24 | ||
5d680e84 NC |
25 | <form action="" method="post"> |
26 | <table cellspacing="0"> | |
27 | {{ form.as_table }} | |
28 | </table> | |
3ed49093 | 29 | <input type="submit" name="save" value="Sauvegarder" /> |
5d680e84 | 30 | </form> |
3ed49093 | 31 | |
3ed49093 NC |
32 | <h2>Financement</h2> |
33 | ||
703e5cfb | 34 | <table cellspacing="0" id="financing"> |
3ed49093 NC |
35 | <tr> |
36 | <th>Type</th> | |
37 | <th>Montant</th> | |
38 | <th>Devise</th> | |
39 | <th>Pourcentage</th> | |
40 | <th>Commentaire</th> | |
41 | <th></th> | |
42 | </tr> | |
43 | {% for fin in poste.financements.all %} | |
44 | <tr> | |
45 | <td>{{ fin.type }}</td> | |
46 | <td>{{ fin.montant }}</td> | |
47 | <td>{{ fin.devise }}</td> | |
48 | <td>{{ fin.pourcentage }}</td> | |
49 | <td>{{ fin.commentaire }}</td> | |
50 | <td><a href="{% url financement poste_key fin.id %}">Modifier</a></td> | |
51 | </tr> | |
52 | {% empty %} | |
53 | <tr> | |
54 | <td colspan="5"> | |
55 | {% if new %} | |
56 | Vous devez enregister ce nouveau poste avant de pouvoir spécifier | |
57 | la ou les sources de financement. | |
58 | {% else %} | |
59 | Aucun financement au registre | |
60 | {% endif %} | |
61 | </td> | |
62 | </tr> | |
63 | {% endfor %} | |
64 | </table> | |
65 | {% if not new %} | |
703e5cfb | 66 | <a href="{% url financement poste_key %}" class="new"> |
3ed49093 NC |
67 | Ajouter une source de financement |
68 | </a> | |
69 | {% endif %} | |
703e5cfb NC |
70 | |
71 | <div id="financing-form"></div> | |
72 | ||
73 | <script type="text/javascript"> | |
74 | $('#id_poste').change(function() { | |
75 | window.location = '{% url poste %}/' + $(this).val(); | |
76 | }); | |
77 | $('#financing a, a.new').click(function() { | |
78 | $('#financing-form').load($(this).attr('href') + '?ajax=1') | |
79 | .dialog({ | |
80 | modal: true, | |
81 | height: 460, | |
82 | width: 500 | |
83 | }); | |
84 | return false; | |
85 | }); | |
86 | </script> | |
5d680e84 | 87 | {% endblock %} |