summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/settings/people_page/user_list.html
blob: dbc871abac2ecbd80dfc3e9dc4dd0cc961564c13 (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
<link rel="import" href="chrome://resources/html/polymer.html">

<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/cr_elements/cr_scrollable_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">

<dom-module id="settings-user-list">
  <template>
    <style include="settings-shared iron-flex">
      .user-list {
        /* 4 users (the extra 1px is to account for the border-bottom) */
        max-height: calc(4 * (var(--settings-row-two-line-min-height) + 1px));
        overflow-y: auto;
      }

      .user {
        border-bottom: var(--cr-separator-line);
      }

      .user-icon {
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
        border-radius: 20px;
        flex-shrink: 0;
        height: 40px;
        width: 40px;
      }

      .user-info {
        padding-inline-start: 20px;
      }

      :host([disabled]) .user-list {
        opacity: var(--cr-disabled-opacity);
        overflow: auto;
      }
    </style>
    <div class="user-list" scrollable>
      <template is="dom-repeat" items="[[users_]]">
        <div class="user layout horizontal center two-line">
          <img class="user-icon" src="[[getProfilePictureUrl_(item)]]">
          <div class="flex layout vertical user-info no-min-width">
            <div class="text-elide" title="[[getTooltip_(item)]]">
              [[getUserName_(item)]]
            </div>
            <div class="secondary text-elide" title="[[item.displayEmail]]"
                hidden$="[[!shouldShowEmail_(item)]]">
              [[item.displayEmail]]
            </div>
          </div>
          <cr-icon-button class="icon-clear"
              hidden="[[shouldHideCloseButton_(disabled, item.isOwner)]]"
              title="$i18n{removeUserTooltip}" on-click="removeUser_">
          </cr-icon-button>
        </div>
      </template>
    </div>
  </template>
  <script src="user_list.js"></script>
</dom-module>