<commit_before><template>
<div class="site-users">
	<el-card>
		<div slot="header" class="card__header">
			<span class="card__header-text">
				{{ this.siteTitle }} site users
			</span>
		</div>

		<h3>Add new users to {{ this.siteTitle }}</h3>
		<div style="display: flex; padding: 10px; margin-bottom: 40px; background-color: #f7f9fb;">

			<el-select
				v-model="usersToAdd"
				multiple
				filterable
				placeholder="Search for a user" style="width: 70%">
				<el-option
				v-for="user in userList"
				:key="user.user.id"
				:label="`${user.user.name} @ ${user.user.username}`"
				:value="user.user.id">
				</el-option>
			</el-select>

			<el-select v-model="selectedRole" placeholder="Select role" class="u-flex-auto-left">
				<el-option
					label="Site Owner"
					value="Site Owner"
				/>
				<el-option
					label="Editor"
					value="Editor"
				/>
				<el-option
					label="Contributor"
					value="Contributor"
				/>
			</el-select>

			<el-button @click="addUser" type="primary" class="u-flex-auto-left">Add user{{ multipleUsersToAdd ? 's' : ''}}</el-button>
			
		</div>


		<h3>Existing users</h3>
		<div style="display: flex; margin-bottom: 20px;">
			<el-input
				v-model="searchInput"
				placeholder="Find a user"
				icon="search"
				@change="search"
				:on-icon-click="search"
				style="width: 200px;"
			/>
			<el-select v-model="roleFilter" placeholder="Role" class="u-flex-auto-left" style="width: 130px;">
				<el-option
					label="No filter"
					:value="null"
				/>
				<el-option-group label="Filter by role">
					<el-option
						label="Site Owner"
						value="Site Owner"
					/>
					<el-option
						label="Editor"
						value="Editor"
					/>
					<el-option
						label="Contributor"
						value="Contributor"
					/>
				</el-option-group>
			</el-select>
		</div>

		<div v-if="pagedUsers.length" class="el-table w100 el-table--fit el-table--striped el-table--border el-table--enable-row-hover">
			<table cellspacing="0" cellpadding="0" border="0" class="w100">
				<thead>
					<tr>
						<th>
							<div class="cell">
								Name
							</div>
						</th>
						<th>
							<div class="cell">
								Username
							</div>
						</th>
						<th>
							<div class="cell">
								Role
							</div>
						</th>
						<th>
							<div class="cell">
								Email
							</div>
						</th>
						<th>
							<div class="cell">
								Actions
							</div>
						</th>
					</tr>
				</thead>
				<tbody v-loading.body="loading">
					<tr
						v-for="user in pagedUsers"
						:key="user.id"
						class="el-table__row"
					>
						<td>
							<div class="cell">
								{{ user.user.name }}
							</div>
						</td>
						<td>
							<div class="cell">
								{{ user.user.username }}
							</div>
						</td>
						<td>
							<div class="cell">
								<el-select v-model="user.role" size="small" class="u-flex-auto-left">
									<el-option-group label="Change role">
										<el-option
											label="Site Owner"
											value="Site Owner"
										/>
										<el-option
											label="Editor"
											value="Editor"
										/>
										<el-option
											label="Contributor"
											value="Contributor"
										/>
									</el-option-group>
								</el-select>
							</div>
						</td>
						<td>
							<div class="cell">
								{{ user.user.email }}
							</div>
						</td>
						<td>
							<div class="cell">
							<el-button @click="removeUser(user.id)" type="default" size="small">
								<icon name="delete" width="14" height="14" />
							</el-button>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div v-else class="site-users__user--empty">
			No users
		</div>
	</el-card>

	<el-row>
		<el-pagination
			@size-change="handleCountChange"
			@current-change="handlePagination"
			:current-page="currentPage"<commit_msg>swap email & role<commit_after><template>
<div class="site-users">
	<el-card>
		<div slot="header" class="card__header">
			<span class="card__header-text">
				{{ this.siteTitle }} site users
			</span>
		</div>

		<h3>Add new users to {{ this.siteTitle }}</h3>
		<div style="display: flex; padding: 10px; margin-bottom: 40px; background-color: #f7f9fb;">

			<el-select
				v-model="usersToAdd"
				multiple
				filterable
				placeholder="Search for a user" style="width: 70%">
				<el-option
				v-for="user in userList"
				:key="user.user.id"
				:label="`${user.user.name} @ ${user.user.username}`"
				:value="user.user.id">
				</el-option>
			</el-select>

			<el-select v-model="selectedRole" placeholder="Select role" class="u-flex-auto-left">
				<el-option
					label="Site Owner"
					value="Site Owner"
				/>
				<el-option
					label="Editor"
					value="Editor"
				/>
				<el-option
					label="Contributor"
					value="Contributor"
				/>
			</el-select>

			<el-button @click="addUser" type="primary" class="u-flex-auto-left">Add user{{ multipleUsersToAdd ? 's' : ''}}</el-button>
			
		</div>


		<h3>Existing users</h3>
		<div style="display: flex; margin-bottom: 20px;">
			<el-input
				v-model="searchInput"
				placeholder="Find a user"
				icon="search"
				@change="search"
				:on-icon-click="search"
				style="width: 200px;"
			/>
			<el-select v-model="roleFilter" placeholder="Role" class="u-flex-auto-left" style="width: 130px;">
				<el-option
					label="No filter"
					:value="null"
				/>
				<el-option-group label="Filter by role">
					<el-option
						label="Site Owner"
						value="Site Owner"
					/>
					<el-option
						label="Editor"
						value="Editor"
					/>
					<el-option
						label="Contributor"
						value="Contributor"
					/>
				</el-option-group>
			</el-select>
		</div>

		<div v-if="pagedUsers.length" class="el-table w100 el-table--fit el-table--striped el-table--border el-table--enable-row-hover">
			<table cellspacing="0" cellpadding="0" border="0" class="w100">
				<thead>
					<tr>
						<th>
							<div class="cell">
								Name
							</div>
						</th>
						<th>
							<div class="cell">
								Username
							</div>
						</th>
						<th>
							<div class="cell">
								Email
							</div>
						</th>
						<th>
							<div class="cell">
								Role
							</div>
						</th>
						<th>
							<div class="cell">
								Actions
							</div>
						</th>
					</tr>
				</thead>
				<tbody v-loading.body="loading">
					<tr
						v-for="user in pagedUsers"
						:key="user.id"
						class="el-table__row"
					>
						<td>
							<div class="cell">
								{{ user.user.name }}
							</div>
						</td>
						<td>
							<div class="cell">
								{{ user.user.username }}
							</div>
						</td>
						<td>
							<div class="cell">
								{{ user.user.email }}
							</div>
						</td>
						<td>
							<div class="cell">
								<el-select v-model="user.role" size="small" class="u-flex-auto-left">
									<el-option-group label="Change role">
										<el-option
											label="Site Owner"
											value="Site Owner"
										/>
										<el-option
											label="Editor"
											value="Editor"
										/>
										<el-option
											label="Contributor"
											value="Contributor"
										/>
									</el-option-group>
								</el-select>
							</div>
						</td>
						<td>
							<div class="cell">
							<el-button @click="removeUser(user.id)" type="default" size="small">
								<icon name="delete" width="14" height="14" />
							</el-button>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div v-else class="site-users__user--empty">
			No users
		</div>
	</el-card>

	<el-row>
		<el-pagination
			@size-change="handleCountChange"
			@current-change="handlePagination"
			:current-page="currentPage"
{'fraction_non_alphanumeric': 0.1795037477384337, 'fraction_numerical': 0.008529335745670715, 'mean_word_length': 1.9560733384262796, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 0, '>': 205, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3818292', 'n_tokens_mistral': 4148, 'n_tokens_neox': 2665, 'n_words': 497}