peopleBody.jade 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  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. if loading.get
  9. +spinner
  10. else if orgSetting.get
  11. span
  12. i.fa.fa-sitemap
  13. unless isMiniScreen
  14. | {{_ 'organizations'}}
  15. input#searchOrgInput(placeholder="{{_ 'search'}}")
  16. button#searchOrgButton
  17. i.fa.fa-search
  18. | {{_ 'search'}}
  19. .ext-box-right
  20. span {{#unless isMiniScreen}}{{_ 'org-number'}}{{/unless}} #{orgNumber}
  21. else if teamSetting.get
  22. span
  23. i.fa.fa-users
  24. unless isMiniScreen
  25. | {{_ 'teams'}}
  26. input#searchTeamInput(placeholder="{{_ 'search'}}")
  27. button#searchTeamButton
  28. i.fa.fa-search
  29. | {{_ 'search'}}
  30. .ext-box-right
  31. span {{#unless isMiniScreen}}{{_ 'team-number'}}{{/unless}} #{teamNumber}
  32. else if peopleSetting.get
  33. span
  34. i.fa.fa-user
  35. unless isMiniScreen
  36. | {{_ 'people'}}
  37. input#searchInput(placeholder="{{_ 'search'}}")
  38. button#searchButton
  39. i.fa.fa-search
  40. | {{_ 'search'}}
  41. .ext-box-right
  42. span {{#unless isMiniScreen}}{{_ 'people-number'}}{{/unless}} #{peopleNumber}
  43. .content-body
  44. .side-menu
  45. ul
  46. li.active
  47. a.js-org-menu(data-id="org-setting")
  48. i.fa.fa-sitemap
  49. | {{_ 'organizations'}}
  50. li
  51. a.js-team-menu(data-id="team-setting")
  52. i.fa.fa-users
  53. | {{_ 'teams'}}
  54. li
  55. a.js-people-menu(data-id="people-setting")
  56. i.fa.fa-user
  57. | {{_ 'people'}}
  58. .main-body
  59. if loading.get
  60. +spinner
  61. else if orgSetting.get
  62. +orgGeneral
  63. else if teamSetting.get
  64. +teamGeneral
  65. else if peopleSetting.get
  66. +peopleGeneral
  67. template(name="orgGeneral")
  68. table
  69. tbody
  70. tr
  71. th {{_ 'displayName'}}
  72. th {{_ 'description'}}
  73. th {{_ 'shortName'}}
  74. th {{_ 'website'}}
  75. th {{_ 'createdAt'}}
  76. th {{_ 'active'}}
  77. th
  78. +newOrgRow
  79. each org in orgList
  80. +orgRow(orgId=org._id)
  81. template(name="teamGeneral")
  82. table
  83. tbody
  84. tr
  85. th {{_ 'displayName'}}
  86. th {{_ 'description'}}
  87. th {{_ 'shortName'}}
  88. th {{_ 'website'}}
  89. th {{_ 'createdAt'}}
  90. th {{_ 'active'}}
  91. th
  92. +newTeamRow
  93. each team in teamList
  94. +teamRow(teamId=team._id)
  95. template(name="peopleGeneral")
  96. table
  97. tbody
  98. tr
  99. th {{_ 'username'}}
  100. th {{_ 'fullname'}}
  101. th {{_ 'initials'}}
  102. th {{_ 'admin'}}
  103. th {{_ 'email'}}
  104. th {{_ 'verified'}}
  105. th {{_ 'createdAt'}}
  106. th {{_ 'active'}}
  107. th {{_ 'authentication-method'}}
  108. th {{_ 'import-usernames'}}
  109. th
  110. +newUserRow
  111. each user in peopleList
  112. +peopleRow(userId=user._id)
  113. template(name="newOrgRow")
  114. a.new-org
  115. i.fa.fa-plus-square
  116. | {{_ 'new'}}
  117. template(name="newTeamRow")
  118. a.new-team
  119. i.fa.fa-plus-square
  120. | {{_ 'new'}}
  121. template(name="newUserRow")
  122. a.new-user
  123. i.fa.fa-plus-square
  124. | {{_ 'new'}}
  125. template(name="orgRow")
  126. tr
  127. if orgData.loginDisabled
  128. td <s>{{ orgData.orgDisplayName }}</s>
  129. else
  130. td {{ orgData.orgDisplayName }}
  131. if orgData.loginDisabled
  132. td <s>{{ orgData.orgDesc }}</s>
  133. else
  134. td {{ orgData.orgDesc }}
  135. if orgData.loginDisabled
  136. td <s>{{ orgData.orgName }}</s>
  137. else
  138. td {{ orgData.orgName }}
  139. if orgData.loginDisabled
  140. td <s>{{ orgData.orgWebsite }}</s>
  141. else
  142. td {{ orgData.orgWebsite }}
  143. if orgData.loginDisabled
  144. td <s>{{ moment orgData.createdAt 'LLL' }}</s>
  145. else
  146. td {{ moment orgData.createdAt 'LLL' }}
  147. td
  148. if orgData.loginDisabled
  149. | {{_ 'no'}}
  150. else
  151. | {{_ 'yes'}}
  152. td
  153. a.edit-org
  154. i.fa.fa-edit
  155. | {{_ 'edit'}}
  156. a.more-settings-org
  157. i.fa.fa-ellipsis-h
  158. template(name="teamRow")
  159. tr
  160. if teamData.loginDisabled
  161. td <s>{{ teamData.teamDisplayName }}</s>
  162. else
  163. td {{ teamData.teamDisplayName }}
  164. if teamData.loginDisabled
  165. td <s>{{ teamData.teamDesc }}</s>
  166. else
  167. td {{ teamData.teamDesc }}
  168. if teamData.loginDisabled
  169. td <s>{{ teamData.teamName }}</s>
  170. else
  171. td {{ teamData.teamName }}
  172. if teamData.loginDisabled
  173. td <s>{{ teamData.teamWebsite }}</s>
  174. else
  175. td {{ teamData.teamWebsite }}
  176. if orgData.loginDisabled
  177. td <s>{{ moment teamData.createdAt 'LLL' }}</s>
  178. else
  179. td {{ moment teamData.createdAt 'LLL' }}
  180. td
  181. if teamData.loginDisabled
  182. | {{_ 'no'}}
  183. else
  184. | {{_ 'yes'}}
  185. td
  186. a.edit-team
  187. i.fa.fa-edit
  188. | {{_ 'edit'}}
  189. a.more-settings-team
  190. i.fa.fa-ellipsis-h
  191. template(name="peopleRow")
  192. tr
  193. if userData.loginDisabled
  194. td.username <s>{{ userData.username }}</s>
  195. else
  196. td.username {{ userData.username }}
  197. if userData.loginDisabled
  198. td <s>{{ userData.profile.fullname }}</s>
  199. else
  200. td {{ userData.profile.fullname }}
  201. if userData.loginDisabled
  202. td <s>{{ userData.profile.initials }}</s>
  203. else
  204. td {{ userData.profile.initials }}
  205. if userData.loginDisabled
  206. td
  207. if userData.isAdmin
  208. | <s>{{_ 'yes'}}</s>
  209. else
  210. | <s>{{_ 'no'}}</s>
  211. else
  212. td
  213. if userData.isAdmin
  214. | {{_ 'yes'}}
  215. else
  216. | {{_ 'no'}}
  217. if userData.loginDisabled
  218. td <s>{{ userData.emails.[0].address }}</s>
  219. else
  220. td {{ userData.emails.[0].address }}
  221. if userData.loginDisabled
  222. td
  223. if userData.emails.[0].verified
  224. | <s>{{_ 'yes'}}</s>
  225. else
  226. | <s>{{_ 'no'}}</s>
  227. else
  228. td
  229. if userData.emails.[0].verified
  230. | {{_ 'yes'}}
  231. else
  232. | {{_ 'no'}}
  233. if userData.loginDisabled
  234. td <s>{{ moment userData.createdAt 'LLL' }}</s>
  235. else
  236. td {{ moment userData.createdAt 'LLL' }}
  237. td
  238. if userData.loginDisabled
  239. | {{_ 'no'}}
  240. else
  241. | {{_ 'yes'}}
  242. if userData.loginDisabled
  243. td <s>{{_ userData.authenticationMethod }}</s>
  244. else
  245. td {{_ userData.authenticationMethod }}
  246. if userData.loginDisabled
  247. td <s>{{ userData.importUsernamesString }}</s>
  248. else
  249. td {{ userData.importUsernamesString }}
  250. td
  251. a.edit-user
  252. i.fa.fa-edit
  253. | {{_ 'edit'}}
  254. a.more-settings-user
  255. i.fa.fa-ellipsis-h
  256. template(name="editOrgPopup")
  257. form
  258. label.hide.orgId(type="text" value=org._id)
  259. label
  260. | {{_ 'displayName'}}
  261. input.js-orgDisplayName(type="text" value=org.displayName required)
  262. span.error.hide.orgname-taken
  263. | {{_ 'error-orgname-taken'}}
  264. label
  265. | {{_ 'description'}}
  266. input.js-orgDesc(type="text" value=org.orgDesc required)
  267. label
  268. | {{_ 'shortName'}}
  269. input.js-orgShortName(type="text" value=org.orgShortName required)
  270. label
  271. | {{_ 'website'}}
  272. input.js-orgWebsite(type="text" value=org.orgWebsite required)
  273. label
  274. | {{_ 'active'}}
  275. select.select-active.js-org-isactive
  276. option(value="false") {{_ 'yes'}}
  277. option(value="true" selected="{{org.loginDisabled}}") {{_ 'no'}}
  278. hr
  279. div.buttonsContainer
  280. input.primary.wide(type="submit" value="{{_ 'save'}}")
  281. template(name="editTeamPopup")
  282. form
  283. label.hide.teamId(type="text" value=team._id)
  284. label
  285. | {{_ 'displayName'}}
  286. input.js-teamDisplayName(type="text" value=team.teamDisplayName required)
  287. span.error.hide.teamname-taken
  288. | {{_ 'error-teamname-taken'}}
  289. label
  290. | {{_ 'description'}}
  291. input.js-teamDesc(type="text" value=team.teamDesc required)
  292. label
  293. | {{_ 'shortName'}}
  294. input.js-teamShortName(type="text" value=team.teamShortName required)
  295. label
  296. | {{_ 'website'}}
  297. input.js-teamWebsite(type="text" value=team.teamWebsite required)
  298. label
  299. | {{_ 'active'}}
  300. select.select-active.js-team-isactive
  301. option(value="false") {{_ 'yes'}}
  302. option(value="true" selected="{{team.loginDisabled}}") {{_ 'no'}}
  303. hr
  304. div.buttonsContainer
  305. input.primary.wide(type="submit" value="{{_ 'save'}}")
  306. template(name="editUserPopup")
  307. form
  308. label.hide.userId(type="text" value=user._id)
  309. label
  310. | {{_ 'username'}}
  311. span.error.hide.username-taken
  312. | {{_ 'error-username-taken'}}
  313. if isLdap
  314. input.js-profile-username(type="text" value=user.username readonly)
  315. else
  316. input.js-profile-username(type="text" value=user.username required)
  317. label
  318. | {{_ 'fullname'}}
  319. input.js-profile-fullname(type="text" value=user.profile.fullname required)
  320. label
  321. | {{_ 'initials'}}
  322. input.js-profile-initials(type="text" value=user.profile.initials required)
  323. label
  324. | {{_ 'admin'}}
  325. select.select-role.js-profile-isadmin
  326. option(value="false") {{_ 'no'}}
  327. option(value="true" selected="{{user.isAdmin}}") {{_ 'yes'}}
  328. label
  329. | {{_ 'email'}}
  330. span.error.hide.email-taken
  331. | {{_ 'error-email-taken'}}
  332. if isLdap
  333. input.js-profile-email(type="email" value="{{user.emails.[0].address}}" readonly)
  334. else
  335. input.js-profile-email(type="email" value="{{user.emails.[0].address}}" required)
  336. label
  337. | {{_ 'import-usernames'}}
  338. input.js-import-usernames(type="text" value=user.importUsernames)
  339. label
  340. | {{_ 'verified'}}
  341. select.select-verified.js-profile-email-verified
  342. option(value="false") {{_ 'no'}}
  343. option(value="true" selected="{{userData.emails.[0].verified}}") {{_ 'yes'}}
  344. label
  345. | {{_ 'active'}}
  346. select.select-active.js-profile-isactive
  347. option(value="false") {{_ 'yes'}}
  348. option(value="true" selected="{{user.loginDisabled}}") {{_ 'no'}}
  349. label
  350. | {{_ 'authentication-type'}}
  351. select.select-authenticationMethod.js-authenticationMethod
  352. each authentications
  353. if isSelected value
  354. option(value="{{value}}" selected) {{_ value}}
  355. else
  356. option(value="{{value}}") {{_ value}}
  357. hr
  358. label
  359. | {{_ 'password'}}
  360. input.js-profile-password(type="password")
  361. div.buttonsContainer
  362. input.primary.wide(type="submit" value="{{_ 'save'}}")
  363. template(name="newOrgPopup")
  364. form
  365. //label.hide.userId(type="text" value=user._id)
  366. label
  367. | {{_ 'displayName'}}
  368. input.js-orgDisplayName(type="text" value="" required)
  369. label
  370. | {{_ 'description'}}
  371. input.js-orgDesc(type="text" value="" required)
  372. label
  373. | {{_ 'shortName'}}
  374. input.js-orgName(type="text" value="" required)
  375. label
  376. | {{_ 'website'}}
  377. input.js-orgWebsite(type="text" value="" required)
  378. label
  379. | {{_ 'active'}}
  380. select.select-active.js-org-isactive
  381. option(value="false" selected="selected") {{_ 'yes'}}
  382. option(value="true") {{_ 'no'}}
  383. hr
  384. div.buttonsContainer
  385. input.primary.wide(type="submit" value="{{_ 'save'}}")
  386. template(name="newTeamPopup")
  387. form
  388. //label.hide.teamId(type="text" value=team._id)
  389. label
  390. | {{_ 'displayName'}}
  391. input.js-teamDisplayName(type="text" value="" required)
  392. label
  393. | {{_ 'description'}}
  394. input.js-teamDesc(type="text" value="" required)
  395. label
  396. | {{_ 'shortName'}}
  397. input.js-teamName(type="text" value="" required)
  398. label
  399. | {{_ 'website'}}
  400. input.js-teamWebsite(type="text" value="" required)
  401. label
  402. | {{_ 'active'}}
  403. select.select-active.js-team-isactive
  404. option(value="false" selected="selected") {{_ 'yes'}}
  405. option(value="true") {{_ 'no'}}
  406. hr
  407. div.buttonsContainer
  408. input.primary.wide(type="submit" value="{{_ 'save'}}")
  409. template(name="newUserPopup")
  410. form
  411. //label.hide.userId(type="text" value=user._id)
  412. label
  413. | {{_ 'fullname'}}
  414. input.js-profile-fullname(type="text" value="" required)
  415. label
  416. | {{_ 'username'}}
  417. span.error.hide.username-taken
  418. | {{_ 'error-username-taken'}}
  419. //if isLdap
  420. // input.js-profile-username(type="text" value=user.username readonly)
  421. //else
  422. input.js-profile-username(type="text" value="" required)
  423. label
  424. | {{_ 'initials'}}
  425. input.js-profile-initials(type="text" value="" required)
  426. label
  427. | {{_ 'email'}}
  428. span.error.hide.email-taken
  429. | {{_ 'error-email-taken'}}
  430. //if isLdap
  431. // input.js-profile-email(type="email" value="{{user.emails.[0].address}}" readonly)
  432. //else
  433. input.js-profile-email(type="email" value="" required)
  434. label
  435. | {{_ 'import-usernames'}}
  436. input.js-import-usernames(type="text" value="")
  437. label
  438. | {{_ 'admin'}}
  439. select.select-role.js-profile-isadmin
  440. option(value="false" selected="selected") {{_ 'no'}}
  441. option(value="true") {{_ 'yes'}}
  442. label
  443. | {{_ 'active'}}
  444. select.select-active.js-profile-isactive
  445. option(value="false" selected="selected") {{_ 'yes'}}
  446. option(value="true") {{_ 'no'}}
  447. label
  448. | {{_ 'authentication-type'}}
  449. select.select-authenticationMethod.js-authenticationMethod
  450. each authentications
  451. if isSelected value
  452. option(value="{{value}}" selected) {{_ value}}
  453. else
  454. option(value="{{value}}") {{_ value}}
  455. hr
  456. label
  457. | {{_ 'password'}}
  458. input.js-profile-password(type="password" required)
  459. div.buttonsContainer
  460. input.primary.wide(type="submit" value="{{_ 'save'}}")
  461. template(name="settingsOrgPopup")
  462. ul.pop-over-list
  463. li
  464. a.impersonate-org
  465. i.fa.fa-user
  466. | {{_ 'impersonate-org'}}
  467. // Delete is not enabled yet, because it does leave empty user avatars
  468. // to boards: boards members, card members and assignees have
  469. // empty users. See:
  470. // - wekan/client/components/settings/peopleBody.jade deleteButton
  471. // - wekan/client/components/settings/peopleBody.js deleteButton
  472. // - wekan/client/components/sidebar/sidebar.js Popup.afterConfirm('removeMember'
  473. // that does now remove member from board, card members and assignees correctly,
  474. // but that should be used to remove user from all boards similarly
  475. // - wekan/models/users.js Delete is not enabled
  476. //li
  477. // br
  478. // br
  479. // hr
  480. //li
  481. // form
  482. // label.hide.userId(type="text" value=user._id)
  483. // div.buttonsContainer
  484. // input#deleteButton.card-details-red.right.wide(type="button" value="{{_ 'delete'}}")
  485. template(name="settingsUserPopup")
  486. ul.pop-over-list
  487. li
  488. a.impersonate-user
  489. i.fa.fa-user
  490. | {{_ 'impersonate-user'}}
  491. // Delete is not enabled yet, because it does leave empty user avatars
  492. // to boards: boards members, card members and assignees have
  493. // empty users. See:
  494. // - wekan/client/components/settings/peopleBody.jade deleteButton
  495. // - wekan/client/components/settings/peopleBody.js deleteButton
  496. // - wekan/client/components/sidebar/sidebar.js Popup.afterConfirm('removeMember'
  497. // that does now remove member from board, card members and assignees correctly,
  498. // but that should be used to remove user from all boards similarly
  499. // - wekan/models/users.js Delete is not enabled
  500. //li
  501. // br
  502. // br
  503. // hr
  504. //li
  505. // form
  506. // label.hide.userId(type="text" value=user._id)
  507. // div.buttonsContainer
  508. // input#deleteButton.card-details-red.right.wide(type="button" value="{{_ 'delete'}}")