peopleBody.jade 16 KB

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