Le repo des sources pour le site web des JM2L
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

158 rader
7.6 KiB

  1. <%namespace name="Modals" file="jm2l:templates/modals.mako"/>
  2. <%namespace name="helpers" file="jm2l:templates/helpers.mako"/>
  3. <%def name="profil_wrapper(uprofil, profil_form)">
  4. <div class="profile-icon" style="float:right;height:250px;width:250px;">
  5. <% photos = uprofil.PhotosLinks %>
  6. <div id="MyPictureCarousel" class="carousel slide">
  7. <div style="text-align: center;line-height:20px;">
  8. <a data-target="#AjaxModal" Myhref="/2015/modal/Password/1" role="button" handle="modal">Changer mon mot de passe</a>
  9. </div>
  10. % if len(photos)>1:
  11. <!-- Carousel nav -->
  12. <a class="Ucarousel-control left" href="#MyPictureCarousel" data-slide="prev">&lsaquo;</a>
  13. <a class="Ucarousel-control right" href="#MyPictureCarousel" data-slide="next">&rsaquo;</a>
  14. % endif
  15. <div style="text-align: center;line-height:20px;">
  16. <a data-target="#AjaxModal" Myhref="/2015/modal/UserPicture/${uprofil.uid}" handle="modal">Changer ma photo</a>
  17. </div>
  18. <!-- Carousel items -->
  19. <div class="carousel-inner" style="height: 220px;">
  20. % if len(photos):
  21. % for num, link in enumerate(photos):
  22. <div class="${['','active '][num==0]}item" id="UserPic${num}">
  23. <div style="margin:auto;">
  24. <img src="${link}" class="img-polaroid" style="max-height:205px;max-width:235px;" alt="Photo ${uprofil.slug}" />
  25. </div>
  26. </div>
  27. % endfor
  28. % else:
  29. <div class="active item" id="UserPic0">
  30. <div style="margin:auto;width:170px;">
  31. <img src="/img/default-user.png" class="img-polaroid" alt="Photo ${uprofil.slug}" style="max-height:205px;" />
  32. </div>
  33. </div>
  34. % endif
  35. </div>
  36. </div>
  37. </div>
  38. <a href="/sign/jm2l/${uprofil.my_hash}">Mon lien</a>
  39. <h3>${profil_form.prenom.data} ${profil_form.nom.data}</h3>
  40. ##<form id="ProfilForm" action="javascript:DoPost('/2015/modal/Place/${form.place_id.data}');">
  41. % if uprofil!=request.user and request.user.uid==1:
  42. <form id="ProfilForm" action="/MesJM2L?user=${uprofil.uid}" method="POST">
  43. % else:
  44. <form id="ProfilForm" action="/MesJM2L" method="POST">
  45. % endif
  46. <%
  47. DicForm = {
  48. 'nom': {'PlaceHolder':u"Mon Nom", "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;"},
  49. 'prenom': {'PlaceHolder':u"Mon Prénom", "FieldStyle":"width:16em;"},
  50. 'pseudo': {'PlaceHolder':u"Mon Pseudo", "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;"},
  51. 'mail': {'PlaceHolder':u"mon.mail@fqdn.tld", "FieldStyle":"width:16em;"},
  52. 'phone': {'PlaceHolder':u"0612345678", "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;"},
  53. 'website': {'PlaceHolder':u"http://ma-page-web.moi","FieldStyle":"width:16em;"},
  54. 'gpg_key': {'PlaceHolder':u"Ma clé gpg", "FieldStyle":"width:90%;"},
  55. 'soc_link':{'PlaceHolder':u"#jm2l sur irc.freenode.org","FieldStyle":"width:90%;"},
  56. 'bio': {'PlaceHolder':u"Ma Bilibiographie", "FieldStyle":"width:95%;min-height:150px;", "fieldset":True },
  57. 'tiersship': {'Ignore':True}
  58. }
  59. %>
  60. ${helpers.DisplayForm(profil_form, DicForm)}
  61. <fieldset>
  62. <legend>Activité</legend>
  63. <div class="repeat">
  64. <table class="wrapper table table-striped table-bordered" width="100%">
  65. <thead>
  66. <tr class="row">
  67. ##<th></th>
  68. <th style="width:4em;text-align:center;">Année</th>
  69. <th style="width:19em;">Entitée</th>
  70. <th>Rôle</th>
  71. <th style="width:6em;">Action</th>
  72. </tr>
  73. </thead>
  74. <tbody class="container">
  75. <tr class="row template" style="line-height:2.2em;">
  76. ##<td><span class="move btn btn-mini btn-info">Move</span></td>
  77. <td style="text-align:center;">
  78. <input type="hidden" style="width:20em;" class="form-control" name="tiersship-{{row-count-placeholder}}-year_uid"
  79. value="2015" /> 2015
  80. </td>
  81. <td style="text-align: center;">
  82. <input type="hidden" class="form-control" name="tiersship-{{row-count-placeholder}}-user_uid"
  83. value="${uprofil.uid}" style="width:4em;" />
  84. <input type="hidden" class="form-control" style="width:20em;" name="tiersship-{{row-count-placeholder}}-tiers_uid"
  85. id="tiersship-{{row-count-placeholder}}-tiers_uid" />
  86. </td>
  87. <td style="text-align:center;">
  88. <input style="width:100%;margin:-7px;" type="text" class="form-control" name="tiersship-{{row-count-placeholder}}-role"
  89. value="" />
  90. </td>
  91. <td>
  92. <span class="remove btn btn-mini btn-danger">
  93. <i class="icon-remove-sign icon-white"></i> Suppr.
  94. </span>
  95. </td>
  96. </tr>
  97. % for num, dicdata in enumerate(profil_form._fields.get("tiersship").data):
  98. <tr class="row" style="padding:5px;line-height:2.2em;">
  99. ##<td><span class="move btn btn-mini btn-info">Move</span></td>
  100. <td style="text-align:center;">
  101. <input type="hidden" class="form-control" name="tiersship-${num}-year_uid"
  102. value="${dicdata.get('year_uid')}" style="width:4em;" />
  103. ${dicdata.get('year_uid')}
  104. </td>
  105. <td style="text-align:center;">
  106. <input type="hidden" class="form-control" name="tiersship-${num}-user_uid"
  107. value="${dicdata.get('user_uid')}" style="width:4em;" />
  108. <input type="hidden" class="form-control" name="tiersship-${num}-tiers_uid"
  109. value="${dicdata.get('tiers_uid')}" style="width:4em;" />
  110. <%
  111. entity = DBTiers.by_id(dicdata.get('tiers_uid'))
  112. %>
  113. % if entity:
  114. <small>${entity.get_entity_type.entity_subtype}</small>
  115. <a href="/entity/${entity.get_entity_type.entity_type}/${entity.slug}">${entity.name}</a>
  116. % endif
  117. </td>
  118. <td style="text-align:center;">
  119. <input style="width:100%;margin:-7px;" type="text" class="form-control" name="tiersship-${num}-role"
  120. value="${dicdata.get('role')}" />
  121. </td>
  122. <td>
  123. <span class="remove btn btn-mini btn-danger">
  124. <i class="icon-remove-sign icon-white"></i> Suppr.
  125. </span>
  126. </td>
  127. </tr>
  128. % endfor
  129. </tbody>
  130. <tfoot>
  131. <tr>
  132. <td colspan="5" style="text-align:center;line-height: 3em;">
  133. <span class="add btn btn-mini btn-primary"><i class="icon-plus-sign icon-white"></i> Ajouter</span>
  134. </td>
  135. </tr>
  136. </tfoot>
  137. </table>
  138. </div>
  139. </fieldset>
  140. <input type="submit" value="Enregistrer !" />
  141. </form>
  142. ## Handle Popover of this form
  143. ##<script type="text/javascript">
  144. ## % for field in profil_form._fields.keys():
  145. ## $('#${field}-help').popover();
  146. ## %endfor
  147. ##</script>
  148. </%def>