summaryrefslogtreecommitdiffstats
path: root/polygerrit-ui/app/elements/admin/gr-group/gr-group_html.ts
blob: 6bc5d2a471fc49708fba07ab6167a24bb8274fbe (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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/**
 * @license
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import {html} from '@polymer/polymer/lib/utils/html-tag';

export const htmlTemplate = html`
  <style include="gr-font-styles">
    /* Workaround for empty style block - see https://github.com/Polymer/tools/issues/408 */
  </style>
  <style include="shared-styles">
    /* Workaround for empty style block - see https://github.com/Polymer/tools/issues/408 */
  </style>
  <style include="gr-subpage-styles">
    h3.edited:after {
      color: var(--deemphasized-text-color);
      content: ' *';
    }
  </style>
  <style include="gr-form-styles">
    /* Workaround for empty style block - see https://github.com/Polymer/tools/issues/408 */
  </style>
  <div class="main gr-form-styles read-only">
    <div id="loading" class$="[[_computeLoadingClass(_loading)]]">
      Loading...
    </div>
    <div id="loadedContent" class$="[[_computeLoadingClass(_loading)]]">
      <h1 id="Title" class="heading-1">[[_groupName]]</h1>
      <h2 id="configurations" class="heading-2">General</h2>
      <div id="form">
        <fieldset>
          <h3 id="groupUUID" class="heading-3">Group UUID</h3>
          <fieldset>
            <gr-copy-clipboard
              id="uuid"
              text="[[_getGroupUUID(_groupConfig.id)]]"
            ></gr-copy-clipboard>
          </fieldset>
          <h3
            id="groupName"
            class$="heading-3 [[_computeHeaderClass(_rename)]]"
          >
            Group Name
          </h3>
          <fieldset>
            <span class="value">
              <gr-autocomplete
                id="groupNameInput"
                text="{{_groupConfig.name}}"
                disabled="[[_computeGroupDisabled(_groupOwner, _isAdmin, _groupIsInternal)]]"
              ></gr-autocomplete>
            </span>
            <span
              class="value"
              disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin, _groupIsInternal)]]"
            >
              <gr-button
                id="inputUpdateNameBtn"
                on-click="_handleSaveName"
                disabled="[[!_rename]]"
              >
                Rename Group</gr-button
              >
            </span>
          </fieldset>
          <h3
            id="groupOwner"
            class$="heading-3 [[_computeHeaderClass(_owner)]]"
          >
            Owners
          </h3>
          <fieldset>
            <span class="value">
              <gr-autocomplete
                id="groupOwnerInput"
                text="{{_groupConfig.owner}}"
                value="{{_groupConfigOwner}}"
                query="[[_query]]"
                disabled="[[_computeGroupDisabled(_groupOwner, _isAdmin, _groupIsInternal)]]"
              >
              </gr-autocomplete>
            </span>
            <span
              class="value"
              disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin, _groupIsInternal)]]"
            >
              <gr-button
                id="inputUpdateOwnerBtn"
                on-click="_handleSaveOwner"
                disabled="[[!_owner]]"
              >
                Change Owners</gr-button
              >
            </span>
          </fieldset>
          <h3 class$="heading-3 [[_computeHeaderClass(_description)]]">
            Description
          </h3>
          <fieldset>
            <div>
              <iron-autogrow-textarea
                class="description"
                autocomplete="on"
                bind-value="{{_groupConfig.description}}"
                disabled="[[_computeGroupDisabled(_groupOwner, _isAdmin, _groupIsInternal)]]"
              ></iron-autogrow-textarea>
            </div>
            <span
              class="value"
              disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin, _groupIsInternal)]]"
            >
              <gr-button
                on-click="_handleSaveDescription"
                disabled="[[!_description]]"
              >
                Save Description
              </gr-button>
            </span>
          </fieldset>
          <h3 id="options" class$="heading-3 [[_computeHeaderClass(_options)]]">
            Group Options
          </h3>
          <fieldset>
            <section>
              <span class="title">
                Make group visible to all registered users
              </span>
              <span class="value">
                <gr-select
                  id="visibleToAll"
                  bind-value="{{_groupConfig.options.visible_to_all}}"
                >
                  <select
                    disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin, _groupIsInternal)]]"
                  >
                    <template is="dom-repeat" items="[[_submitTypes]]">
                      <option value="[[item.value]]">[[item.label]]</option>
                    </template>
                  </select>
                </gr-select>
              </span>
            </section>
            <span
              class="value"
              disabled$="[[_computeGroupDisabled(_groupOwner, _isAdmin, _groupIsInternal)]]"
            >
              <gr-button on-click="_handleSaveOptions" disabled="[[!_options]]">
                Save Group Options
              </gr-button>
            </span>
          </fieldset>
        </fieldset>
      </div>
    </div>
  </div>
`;