aboutsummaryrefslogtreecommitdiffstats
path: root/jm2l/templates/trash/old_edit_tiers.mako
blob: 48bd9020704167ed9753a58e76001adf7477d164 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<%inherit file="jm2l:templates/layout.mako"/>
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
<%def name="jsAddOn()">
  <script src="/static/ckeditor/ckeditor.js"></script>
  <script src="/static/select2.js"></script>  
</%def>
<%def name="cssAddOn()">
  <link rel="stylesheet" href="/static/select2.css" type="text/css" media="screen" />
  <link rel="stylesheet" href="/static/css/jquery.fileupload.css">
  <link rel="stylesheet" href="/static/css/jquery.fileupload-ui.css">
  <link rel="stylesheet" href="/static/leaflet.css" />  
  <!-- CSS adjustments for browsers with JavaScript disabled -->
  <noscript><link rel="stylesheet" href="/static/css/jquery.fileupload-noscript.css"></noscript>
  <noscript><link rel="stylesheet" href="/static/css/jquery.fileupload-ui-noscript.css"></noscript>  
</%def>
<% from datetime import datetime %>
<style>
.borderbox {
    border: 1px solid #e1e4e5;
    margin: 1px 0 24px;
    color: #404040;
    line-height: 1.5;
    margin: 0;
    overflow: auto;
    padding: 12px;
    background: none repeat scroll 0 0 #fcfcfc;
    font-family: "Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;
}
.titleborderbox {
    background: none repeat scroll 0 0 #ffffff;
    border: 1px solid #eee;
    display: inline;
    left: 16px;
    padding: 2px 7px;
    position: relative;
    top: 10px;
}
.borderboxtime {
    float:right;
    padding:1px 15px;
    border: 1px solid #eee;
}
</style>

<fieldset>
% if form.name.data:
    <legend>${form.name.data}</legend>
% else:
    <legend>Créer une entité représentative</legend>
% endif
    <form action="" method="POST">
        % if 'uid' in form._fields:
            ${form.uid}
        %endif
<%
TabFields = [
    ( form._fields.get("name"),          u"Nom",         "padding-right:5px;"             , "width:95%;" ),
    ( form._fields.get("description"),   u"Description", "padding-right:5px;"             , "width:90%;height:500px;" ),
    ( form._fields.get("website"),       u"Site web",    "padding-right:15px;",             "width:30em;" ),
    ( form._fields.get("members"),       u"membres",     "padding-right:15px;",             "width:30em;" ),
    ( form._fields.get("csrf_token"), "","",""),
]
%>
% for Field, PlaceHolder, DivClass, FieldClass in TabFields:
    % if Field is None:
        <% continue %>
    % endif    
    % if Field.type=='HiddenField':
        ${Field()}    
        <% continue %>
    % endif
    <div style="padding-right:5px;${DivClass}">
        <label for="${Field.label.field_id}">${Field.label.text}
            % if len(Field.description):
                <a id="${Field.label.field_id}-help" data-toggle="popover"
                    data-original-title="${Field.label.text}"
                    data-content="${Field.description}">
                    <i class="icon-me" style="background-image: url('/static/Help.png');background-position:1px 2px;"></i>
                </a>
            % endif
        </label>
        % for error in Field.errors:
            <div class="alert alert-error">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                <h4>Erreur!</h4>
                ${ error }
            </div>
        % endfor
        ${Field(placeholder=PlaceHolder, style=FieldClass)}        
    </div>
% endfor

    <button type="submit">Proposer</button>
    </form>
    
</fieldset>

% if 'uid' in form._fields:
<fieldset>
    <legend>Ajouter des membres</legend>
    <p>
        Notez que tous les intervenants d'un même évenement ont les droits de modification.
    </p>
    
% if 'uid' in form._fields:
    <div class="borderbox">
        Membres:
        <ul>
        % if tiers.members.count()==0:
            <i><b>Aucun</b></i>
        % else:
            % for num, member in enumerate(tiers.members):
                <li>
                    <strong><a href="/MesJM2L?user=${member.uid}">${member.prenom} ${member.nom}</a></strong>. 
                    % if member.pseudo:
                        (${member.pseudo})
                    %endif
                </li>
            % endfor
        % endif
        </ul>
    </div>
<br clear="both">
%endif    
    
    <form action="link" method="POST">   
${formAdd.tiers_uid}
<%
TabFields = [
    ( formAdd._fields["prenom"],    u"Prénom",            "padding-right:5px;float:left;" ),
    ( formAdd._fields["nom"],       u"Nom",               "padding-right:5px;" ),
    ( formAdd._fields["email"],     u"son.mail@fqdn.tld", "padding-right:5px;" ),
]
%>    
% for Field, PlaceHolder, DivClass in TabFields:
    <div style="padding-right:5px;${DivClass}">
        <label for="${Field.label.field_id}">${Field.label.text}
            % if len(Field.description):
                <a id="${Field.label.field_id}-help" data-toggle="popover"
                    data-original-title="${Field.label.text}"
                    data-content="${Field.description}">
                    <i class="icon-me" style="background-image: url('/static/Help.png');background-position:1px 2px;"></i>
                </a>
            % endif
        </label>
        % for error in Field.errors:
            <div class="alert alert-error">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                <h4>Erreur!</h4>
                ${ error }
            </div>
        % endfor
        ${Field(placeholder=PlaceHolder, style="width:16em;")}        
    </div>
% endfor
        ## Then the submit for this form
        ${formAdd.add}
    </form>
</fieldset>
    % if 'uid' in form._fields:
<fieldset>
    <legend>Support liés</legend>
        <div style="float:right;width:60%">
            <p> En plus de vos support de présentation classique.
            Pensez aussi aux affiches, aux flyers, aux stickers,
            au bulletin d'adhésion à une association, à la documentation technique...
            Tous ce qui peut être utile, de près ou de loin à la promotion de votre évenement.
            </p>
        </div>
        ${helpers.uploader("tiers", request.user.uid, u"fichiers" )}
</fieldset>
    %else:
        <br>NB: Vous devez proposer votre entité avant de pouvoir
        téléverser des fichiers la concernant.
    % endif
<hr/>
    <p style="float:right;">Créé le ${tiers.created.strftime('%d %b %Y')}</p>
%else:
    <p style="float:right;">Créé le ${datetime.now().strftime('%d %b %Y')}</p>
% endif
<br/>
% if 'uid' in form._fields:
    ${helpers.uploader_js()}
% endif
<script type="text/javascript">
## Handle Popover of this form
% for field in form._fields.keys():
    $('#${field}-help').popover();
    % if form._fields[field].type=='SelectField':
    $('#${field}').select2({width:'resolve'});
    % endif
%endfor
% if formAdd:
    % for field in formAdd._fields.keys():
        $('#${field}-help').popover();
    %endfor
% endif
var editor = CKEDITOR.replace('description');
</script>