peopleBody.jade 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. template(name="people")
  2. .setting-content
  3. unless currentUser.isAdmin
  4. | {{_ 'error-notAuthorized'}}
  5. else
  6. .content-title.ext-box
  7. .ext-box-left
  8. span
  9. i.fa.fa-users
  10. | {{_ 'people'}}
  11. input#searchInput(placeholder="{{_ 'search'}}")
  12. button#searchButton
  13. i.fa.fa-search
  14. | {{_ 'search'}}
  15. .ext-box-right
  16. span {{_ 'people-number'}} #{peopleNumber}
  17. .content-body
  18. .side-menu
  19. ul
  20. li.active
  21. a.js-setting-menu(data-id="people-setting")
  22. i.fa.fa-users
  23. | {{_ 'people'}}
  24. .main-body
  25. if loading.get
  26. +spinner
  27. else if people.get
  28. +peopleGeneral
  29. template(name="peopleGeneral")
  30. table
  31. tbody
  32. tr
  33. th {{_ 'username'}}
  34. th {{_ 'fullname'}}
  35. th {{_ 'admin'}}
  36. th {{_ 'email'}}
  37. th {{_ 'verified'}}
  38. th {{_ 'createdAt'}}
  39. th {{_ 'active'}}
  40. th {{_ 'authentication-method'}}
  41. th
  42. +newUserRow
  43. each user in peopleList
  44. +peopleRow(userId=user._id)
  45. template(name="newUserRow")
  46. a.new-user
  47. i.fa.fa-edit
  48. | {{_ 'new'}}
  49. template(name="peopleRow")
  50. tr
  51. if userData.loginDisabled
  52. td.username <s>{{ userData.username }}</s>
  53. else
  54. td.username {{ userData.username }}
  55. if userData.loginDisabled
  56. td <s>{{ userData.profile.fullname }}</s>
  57. else
  58. td {{ userData.profile.fullname }}
  59. if userData.loginDisabled
  60. td
  61. if userData.isAdmin
  62. | <s>{{_ 'yes'}}</s>
  63. else
  64. | <s>{{_ 'no'}}</s>
  65. else
  66. td
  67. if userData.isAdmin
  68. | {{_ 'yes'}}
  69. else
  70. | {{_ 'no'}}
  71. if userData.loginDisabled
  72. td <s>{{ userData.emails.[0].address }}</s>
  73. else
  74. td {{ userData.emails.[0].address }}
  75. if userData.loginDisabled
  76. td
  77. if userData.emails.[0].verified
  78. | <s>{{_ 'yes'}}</s>
  79. else
  80. | <s>{{_ 'no'}}</s>
  81. else
  82. td
  83. if userData.emails.[0].verified
  84. | {{_ 'yes'}}
  85. else
  86. | {{_ 'no'}}
  87. if userData.loginDisabled
  88. td <s>{{ moment userData.createdAt 'LLL' }}</s>
  89. else
  90. td {{ moment userData.createdAt 'LLL' }}
  91. td
  92. if userData.loginDisabled
  93. | {{_ 'no'}}
  94. else
  95. | {{_ 'yes'}}
  96. if userData.loginDisabled
  97. td <s>{{_ userData.authenticationMethod }}</s>
  98. else
  99. td {{_ userData.authenticationMethod }}
  100. td
  101. a.edit-user
  102. i.fa.fa-edit
  103. | {{_ 'edit'}}
  104. template(name="editUserPopup")
  105. form
  106. label.hide.userId(type="text" value=user._id)
  107. label
  108. | {{_ 'fullname'}}
  109. input.js-profile-fullname(type="text" value=user.profile.fullname)
  110. label
  111. | {{_ 'username'}}
  112. span.error.hide.username-taken
  113. | {{_ 'error-username-taken'}}
  114. if isLdap
  115. input.js-profile-username(type="text" value=user.username readonly)
  116. else
  117. input.js-profile-username(type="text" value=user.username)
  118. label
  119. | {{_ 'email'}}
  120. span.error.hide.email-taken
  121. | {{_ 'error-email-taken'}}
  122. if isLdap
  123. input.js-profile-email(type="email" value="{{user.emails.[0].address}}" readonly)
  124. else
  125. input.js-profile-email(type="email" value="{{user.emails.[0].address}}")
  126. label
  127. | {{_ 'admin'}}
  128. select.select-role.js-profile-isadmin
  129. option(value="false") {{_ 'no'}}
  130. option(value="true" selected="{{user.isAdmin}}") {{_ 'yes'}}
  131. label
  132. | {{_ 'active'}}
  133. select.select-active.js-profile-isactive
  134. option(value="false") {{_ 'yes'}}
  135. option(value="true" selected="{{user.loginDisabled}}") {{_ 'no'}}
  136. label
  137. | {{_ 'authentication-type'}}
  138. select.select-authenticationMethod.js-authenticationMethod
  139. each authentications
  140. if isSelected value
  141. option(value="{{value}}" selected) {{_ value}}
  142. else
  143. option(value="{{value}}") {{_ value}}
  144. hr
  145. label
  146. | {{_ 'password'}}
  147. input.js-profile-password(type="password")
  148. div.buttonsContainer
  149. input.primary.wide(type="submit" value="{{_ 'save'}}")
  150. // div
  151. // input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}")
  152. template(name="newUserPopup")
  153. form
  154. //label.hide.userId(type="text" value=user._id)
  155. label
  156. | {{_ 'fullname'}}
  157. input.js-profile-fullname(type="text" value="")
  158. label
  159. | {{_ 'username'}}
  160. span.error.hide.username-taken
  161. | {{_ 'error-username-taken'}}
  162. //if isLdap
  163. // input.js-profile-username(type="text" value=user.username readonly)
  164. //else
  165. input.js-profile-username(type="text" value="")
  166. label
  167. | {{_ 'email'}}
  168. span.error.hide.email-taken
  169. | {{_ 'error-email-taken'}}
  170. //if isLdap
  171. // input.js-profile-email(type="email" value="{{user.emails.[0].address}}" readonly)
  172. //else
  173. input.js-profile-email(type="email" value="")
  174. label
  175. | {{_ 'admin'}}
  176. select.select-role.js-profile-isadmin
  177. option(value="false" selected="selected") {{_ 'no'}}
  178. option(value="true") {{_ 'yes'}}
  179. label
  180. | {{_ 'active'}}
  181. select.select-active.js-profile-isactive
  182. option(value="false" selected="selected") {{_ 'yes'}}
  183. option(value="true") {{_ 'no'}}
  184. label
  185. | {{_ 'authentication-type'}}
  186. select.select-authenticationMethod.js-authenticationMethod
  187. each authentications
  188. if isSelected value
  189. option(value="{{value}}" selected) {{_ value}}
  190. else
  191. option(value="{{value}}") {{_ value}}
  192. hr
  193. label
  194. | {{_ 'password'}}
  195. input.js-profile-password(type="password")
  196. div.buttonsContainer
  197. input.primary.wide(type="submit" value="{{_ 'save'}}")