peopleBody.jade 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. each user in peopleList
  43. +peopleRow(userId=user._id)
  44. template(name="peopleRow")
  45. tr
  46. if userData.loginDisabled
  47. td.username <s>{{ userData.username }}</s>
  48. else
  49. td.username {{ userData.username }}
  50. if userData.loginDisabled
  51. td <s>{{ userData.profile.fullname }}</s>
  52. else
  53. td {{ userData.profile.fullname }}
  54. if userData.loginDisabled
  55. td
  56. if userData.isAdmin
  57. | <s>{{_ 'yes'}}</s>
  58. else
  59. | <s>{{_ 'no'}}</s>
  60. else
  61. td
  62. if userData.isAdmin
  63. | {{_ 'yes'}}
  64. else
  65. | {{_ 'no'}}
  66. if userData.loginDisabled
  67. td <s>{{ userData.emails.[0].address }}</s>
  68. else
  69. td {{ userData.emails.[0].address }}
  70. if userData.loginDisabled
  71. td
  72. if userData.emails.[0].verified
  73. | <s>{{_ 'yes'}}</s>
  74. else
  75. | <s>{{_ 'no'}}</s>
  76. else
  77. td
  78. if userData.emails.[0].verified
  79. | {{_ 'yes'}}
  80. else
  81. | {{_ 'no'}}
  82. if userData.loginDisabled
  83. td <s>{{ moment userData.createdAt 'LLL' }}</s>
  84. else
  85. td {{ moment userData.createdAt 'LLL' }}
  86. td
  87. if userData.loginDisabled
  88. | {{_ 'no'}}
  89. else
  90. | {{_ 'yes'}}
  91. if userData.loginDisabled
  92. td <s>{{_ userData.authenticationMethod }}</s>
  93. else
  94. td {{_ userData.authenticationMethod }}
  95. td
  96. a.edit-user
  97. i.fa.fa-edit
  98. | {{_ 'edit'}}
  99. template(name="editUserPopup")
  100. form
  101. label.hide.userId(type="text" value=user._id)
  102. label
  103. | {{_ 'fullname'}}
  104. input.js-profile-fullname(type="text" value=user.profile.fullname autofocus)
  105. label
  106. | {{_ 'username'}}
  107. span.error.hide.username-taken
  108. | {{_ 'error-username-taken'}}
  109. if isLdap
  110. input.js-profile-username(type="text" value=user.username readonly)
  111. else
  112. input.js-profile-username(type="text" value=user.username)
  113. label
  114. | {{_ 'email'}}
  115. span.error.hide.email-taken
  116. | {{_ 'error-email-taken'}}
  117. if isLdap
  118. input.js-profile-email(type="email" value="{{user.emails.[0].address}}" readonly)
  119. else
  120. input.js-profile-email(type="email" value="{{user.emails.[0].address}}")
  121. label
  122. | {{_ 'admin'}}
  123. select.select-role.js-profile-isadmin
  124. option(value="false") {{_ 'no'}}
  125. option(value="true" selected="{{user.isAdmin}}") {{_ 'yes'}}
  126. label
  127. | {{_ 'active'}}
  128. select.select-active.js-profile-isactive
  129. option(value="false") {{_ 'yes'}}
  130. option(value="true" selected="{{user.loginDisabled}}") {{_ 'no'}}
  131. label
  132. | {{_ 'authentication-type'}}
  133. select.select-authenticationMethod.js-authenticationMethod
  134. each authentications
  135. if isSelected value
  136. option(value="{{value}}" selected) {{_ value}}
  137. else
  138. option(value="{{value}}") {{_ value}}
  139. hr
  140. label
  141. | {{_ 'password'}}
  142. input.js-profile-password(type="password")
  143. div.buttonsContainer
  144. input.primary.wide(type="submit" value="{{_ 'save'}}")
  145. // div
  146. // input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}")