aboutsummaryrefslogtreecommitdiffstats
path: root/jm2l/templates/Profil/Profil.mako
blob: 4a2028260069c36477ec24df50db42a9cc7c780c (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
<%namespace name="Modals" file="jm2l:templates/modals.mako"/>
<%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
<%def name="profil_wrapper(uprofil, profil_form)">
    <div class="profile-icon" style="float:right;height:250px;width:250px;">
        <% photos = uprofil.PhotosLinks %>
        <div id="MyPictureCarousel" class="carousel slide">
            <div style="text-align: center;line-height:20px;">
                <a data-target="#AjaxModal" Myhref="/2015/modal/Password/1" role="button" handle="modal">Changer mon mot de passe</a>
            </div>
            % if len(photos)>1:
            <!-- Carousel nav -->
            <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
            <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
            % endif
            <div style="text-align: center;line-height:20px;">
                <a data-target="#AjaxModal" Myhref="/2015/modal/UserPicture/${uprofil.uid}" handle="modal">Changer ma photo</a>
            </div>
            <!-- Carousel items -->
            <div class="carousel-inner" style="height: 220px;">
            % if len(photos):
                % for num, link in enumerate(photos):
                <div class="${['','active '][num==0]}item" id="UserPic${num}">
                    <div style="margin:auto;">
                        <img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${uprofil.slug}" />
                    </div>
                </div>
                % endfor
            % else:
                <div class="active item" id="UserPic0">
                    <div style="margin:auto;width:170px;">
                        <img src="/img/default-user.png" class="img-polaroid" alt="Photo ${uprofil.slug}" style="max-height:205px;"  />
                    </div>
                </div>
            % endif
            </div>
        </div>
    </div>
<a href="/sign/jm2l/${uprofil.my_hash}">Mon lien</a>    
    <h3>${profil_form.prenom.data} ${profil_form.nom.data}</h3>

##<form id="ProfilForm" action="javascript:DoPost('/2015/modal/Place/${form.place_id.data}');">
% if uprofil!=request.user and request.user.uid==1:
    <form id="ProfilForm" action="/MesJM2L?user=${uprofil.uid}" method="POST">
% else:
    <form id="ProfilForm" action="/MesJM2L" method="POST">
% endif

<%
DicForm = {
    'nom':     {'PlaceHolder':u"Mon Nom",               "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;"},
    'prenom':  {'PlaceHolder':u"Mon Prénom",            "FieldStyle":"width:16em;"},
    'pseudo':  {'PlaceHolder':u"Mon Pseudo",            "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;"},
    'mail':    {'PlaceHolder':u"mon.mail@fqdn.tld",     "FieldStyle":"width:16em;"},
    'phone':   {'PlaceHolder':u"0612345678",            "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;"},
    'website': {'PlaceHolder':u"http://ma-page-web.moi","FieldStyle":"width:16em;"},    
    'gpg_key': {'PlaceHolder':u"Ma clé gpg",            "FieldStyle":"width:90%;"},
    'soc_link':{'PlaceHolder':u"#jm2l sur irc.freenode.org","FieldStyle":"width:90%;"},    
    'bio':     {'PlaceHolder':u"Ma Bilibiographie",     "FieldStyle":"width:95%;min-height:150px;", "fieldset":True, "ckeditor":1 },
    'tiersship':  {'Ignore':True}    
    }
%>
    ${helpers.DisplayForm(profil_form, DicForm)}

<fieldset>
    <legend>Activité</legend>
    Si vous ne trouvez pas l'entité que vous souhaitez promouvoir (Association, GULL, Entreprise, Logiciel, ...).
    Vous pouvez <a href="/entity"> en ajouter une. </a>

    <div class="repeat">
        <table class="wrapper table table-striped table-bordered" width="100%">
            <thead>
              <tr class="row">
                <th style="width:4em;text-align:center;">Année</th>
                <th style="width:19em;">Entité</th>
                <th>Rôle</th>
                <th style="width:6em;">Action</th>            
              </tr>            
            </thead>
            <tbody class="container">
            <tr class="row template" style="line-height:2.2em;">
                <td style="text-align:center;">
                    <input type="hidden" style="width:20em;" class="form-control" name="tiersship-{{row-count-placeholder}}-year_uid" 
                        value="2015" /> 2015
                </td>
                <td style="text-align: center;">
                    <input type="hidden" class="form-control" name="tiersship-{{row-count-placeholder}}-user_uid" 
                        value="${uprofil.uid}" style="width:4em;" />                
                    <input type="hidden" class="form-control" style="width:20em;" name="tiersship-{{row-count-placeholder}}-tiers_uid"
                        id="tiersship-{{row-count-placeholder}}-tiers_uid" />
                </td>
                <td style="text-align:center;">
                    <input style="width:100%;margin:-7px;" type="text" class="form-control" name="tiersship-{{row-count-placeholder}}-role" 
                        value="" />
                </td>                
                <td>
                    <span class="remove btn btn-mini btn-danger">
                        <i class="icon-remove-sign icon-white"></i> Suppr.
                    </span>
                </td>            
            </tr>
            % for num, dicdata in enumerate(profil_form._fields.get("tiersship").data):
            <tr class="row" style="padding:5px;line-height:2.2em;">
                <td style="text-align:center;">
                    <input type="hidden" class="form-control" name="tiersship-${num}-year_uid" 
                        value="${dicdata.get('year_uid')}" style="width:4em;" />
                    ${dicdata.get('year_uid')}
                </td>
                <td style="text-align:center;">
                    <input type="hidden" class="form-control" name="tiersship-${num}-user_uid" 
                        value="${dicdata.get('user_uid')}" style="width:4em;" />
                    <input type="hidden" class="form-control" name="tiersship-${num}-tiers_uid" 
                        value="${dicdata.get('tiers_uid')}" style="width:4em;" />
                    <% 
                    entity = DBTiers.by_id(dicdata.get('tiers_uid'))
                    %>
                    % if entity:
                    <small>${entity.get_entity_type.entity_subtype}</small>
                    <a href="/entity/${entity.get_entity_type.entity_type}/${entity.slug}">${entity.name}</a>
                    % endif
                </td>
                <td style="text-align:center;">
                    <input style="width:100%;margin:-7px;" type="text" class="form-control" name="tiersship-${num}-role" 
                        value="${dicdata.get('role')}" />
                </td>
                <td>
                    <span class="remove btn btn-mini btn-danger">
                        <i class="icon-remove-sign icon-white"></i> Suppr.
                    </span>
                </td>
            </tr>
            % endfor
            </tbody>
            <tfoot>
              <tr>
                <td colspan="5" style="text-align:center;line-height: 3em;">
                    <span class="add btn btn-mini btn-primary"><i class="icon-plus-sign icon-white"></i> Ajouter</span>
                </td>
              </tr>            
            </tfoot>
        </table>
    </div>
    </fieldset>

    <input class="btn" type="submit" value="Enregistrer !" />
    
    </form>

</%def>