summaryrefslogtreecommitdiffstats
path: root/client/components/settings/peopleBody.jade
blob: b8a94337d83a33969bcba92fbea68fdea34c437d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
template(name="people")
  .setting-content
    unless currentUser.isAdmin
      | {{_ 'error-notAuthorized'}}
    else
      .content-title.ext-box
        .ext-box-left
          span
            i.fa.fa-users
            | {{_ 'people'}}
          input#searchInput(placeholder="{{_ 'search'}}")
          button#searchButton
            i.fa.fa-search
            | {{_ 'search'}}
        .ext-box-right
          span {{_ 'people-number'}} #{peopleNumber}
      .content-body
        .side-menu
          ul
            li.active
              a.js-setting-menu(data-id="people-setting")
                i.fa.fa-users
                | {{_ 'people'}}
        .main-body
          if loading.get
            +spinner
          else if people.get
            +peopleGeneral

template(name="peopleGeneral")
  table
    tbody
      tr
        th {{_ 'username'}}
        th {{_ 'fullname'}}
        th {{_ 'admin'}}
        th {{_ 'email'}}
        th {{_ 'verified'}}
        th {{_ 'createdAt'}}
        th {{_ 'active'}}
        th {{_ 'authentication-method'}}
        th
      each user in peopleList
        +peopleRow(userId=user._id)

template(name="peopleRow")
  tr
    if userData.loginDisabled
      td.username <s>{{ userData.username }}</s>
    else
      td.username {{ userData.username }}
    if userData.loginDisabled
      td <s>{{ userData.profile.fullname }}</s>
    else
      td {{ userData.profile.fullname }}
    if userData.loginDisabled
      td
        if userData.isAdmin
          | <s>{{_ 'yes'}}</s>
        else
          | <s>{{_ 'no'}}</s>
    else
      td
        if userData.isAdmin
          | {{_ 'yes'}}
        else
          | {{_ 'no'}}
    if userData.loginDisabled
      td <s>{{ userData.emails.[0].address }}</s>
    else
      td {{ userData.emails.[0].address }}
    if userData.loginDisabled
      td
        if userData.emails.[0].verified
          | <s>{{_ 'yes'}}</s>
        else
          | <s>{{_ 'no'}}</s>
    else
      td
        if userData.emails.[0].verified
          | {{_ 'yes'}}
        else
          | {{_ 'no'}}
    if userData.loginDisabled
      td <s>{{ moment userData.createdAt 'LLL' }}</s>
    else
      td {{ moment userData.createdAt 'LLL' }}
    td
      if userData.loginDisabled
        | {{_ 'no'}}
      else
        | {{_ 'yes'}}
    if userData.loginDisabled
      td <s>{{_ userData.authenticationMethod }}</s>
    else
      td {{_ userData.authenticationMethod }}
    td
      a.edit-user
        i.fa.fa-edit
        | {{_ 'edit'}}

template(name="editUserPopup")
  form
    label.hide.userId(type="text" value=user._id)
    label
      | {{_ 'fullname'}}
      input.js-profile-fullname(type="text" value=user.profile.fullname autofocus)
    label
      | {{_ 'username'}}
      span.error.hide.username-taken
        | {{_ 'error-username-taken'}}
      if isLdap
        input.js-profile-username(type="text" value=user.username readonly)
      else
        input.js-profile-username(type="text" value=user.username)
    label
      | {{_ 'email'}}
      span.error.hide.email-taken
        | {{_ 'error-email-taken'}}
      if isLdap
        input.js-profile-email(type="email" value="{{user.emails.[0].address}}" readonly)
      else
        input.js-profile-email(type="email" value="{{user.emails.[0].address}}")
    label
      | {{_ 'admin'}}
      select.select-role.js-profile-isadmin
        option(value="false") {{_ 'no'}}
        option(value="true" selected="{{user.isAdmin}}") {{_ 'yes'}}
    label
      | {{_ 'active'}}
      select.select-active.js-profile-isactive
        option(value="false") {{_ 'yes'}}
        option(value="true" selected="{{user.loginDisabled}}") {{_ 'no'}}
    label
      | {{_ 'authentication-type'}}
      select.select-authenticationMethod.js-authenticationMethod
        each authentications
          if isSelected value
            option(value="{{value}}" selected) {{_ value}}
          else
            option(value="{{value}}") {{_ value}}
    hr
    label
      | {{_ 'password'}}
      input.js-profile-password(type="password")
    div.buttonsContainer
      input.primary.wide(type="submit" value="{{_ 'save'}}")
    //  div
    //  input#deleteButton.primary.wide(type="button" value="{{_ 'delete'}}")