2024-07-25 15:23:28 +09:00
@using BTCPayServer.Abstractions.Contracts
2024-06-26 10:39:22 +02:00
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model UsersViewModel.UserViewModel
@inject IFileService FileService
2018-03-22 19:55:14 +09:00
@{
2021-12-16 11:17:02 +01:00
ViewData.SetActivePage(ServerNavPages.Users, Model.Email);
2024-06-26 10:39:22 +02:00
var canUpload = await FileService.IsAvailable();
2018-03-22 19:55:14 +09:00
}
2024-06-26 10:39:22 +02:00
<form method="post" enctype="multipart/form-data">
2024-06-19 15:23:10 +02:00
<div class="sticky-header">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
2024-10-17 15:51:40 +02:00
<a asp-action="ListUsers" text-translate="true">Users</a>
2024-06-19 15:23:10 +02:00
</li>
2024-10-17 15:51:40 +02:00
<li class="breadcrumb-item active" aria-current="page" text-translate="true">User</li>
2024-06-19 15:23:10 +02:00
</ol>
2024-07-25 22:46:02 +09:00
<h2 text-translate="true">@ViewData["Title"]</h2>
2024-07-25 15:23:28 +09:00
</nav>
2024-10-17 15:51:40 +02:00
<button id="page-primary" name="command" type="submit" class="btn btn-primary" value="Save" text-translate="true">Save</button>
2024-06-19 15:23:10 +02:00
</div>
<partial name="_StatusMessage" />
2024-09-12 05:31:57 +02:00
@if (!string.IsNullOrEmpty(Model.InvitationUrl))
{
2024-10-03 14:35:01 +02:00
<div class="payment-box mx-0 mb-4">
2024-09-12 05:31:57 +02:00
<div class="qr-container">
<vc:qr-code data="@Model.InvitationUrl" />
</div>
<div class="input-group mt-3">
<div class="form-floating">
<vc:truncate-center text="@Model.InvitationUrl" padding="15" elastic="true" classes="form-control-plaintext" id="InvitationUrl"/>
2024-10-17 15:51:40 +02:00
<label for="InvitationUrl" text-translate="true">Invitation URL</label>
2024-09-12 05:31:57 +02:00
</div>
</div>
</div>
}
2024-06-26 10:39:22 +02:00
<div class="form-group">
<label asp-for="Name" class="form-label"></label>
<input asp-for="Name" class="form-control" />
<span asp-validation-for="Name" class="text-danger"></span>
</div>
<div class="form-group">
<div class="d-flex align-items-center justify-content-between gap-2">
<label asp-for="ImageFile" class="form-label"></label>
@if (!string.IsNullOrEmpty(Model.ImageUrl))
{
<button type="submit" class="btn btn-link p-0 text-danger" name="RemoveImageFile" value="true">
2024-10-17 15:51:40 +02:00
<vc:icon symbol="cross" />
<span text-translate="true">Remove</span>
2024-06-26 10:39:22 +02:00
</button>
}
</div>
@if (canUpload)
{
<div class="d-flex align-items-center gap-3">
<input asp-for="ImageFile" type="file" class="form-control flex-grow">
@if (!string.IsNullOrEmpty(Model.ImageUrl))
{
2024-10-17 15:51:40 +02:00
<img src="@Model.ImageUrl" alt="Profile picture" class="profile-picture" />
2024-06-26 10:39:22 +02:00
}
</div>
<span asp-validation-for="ImageFile" class="text-danger"></span>
}
else
{
<input asp-for="ImageFile" type="file" class="form-control" disabled>
2024-10-25 15:48:53 +02:00
<div class="form-text">@ViewLocalizer["In order to upload, a {0} must be configured.", Html.ActionLink(StringLocalizer["file storage"], "Files", "UIServer")]</div>
2024-06-26 10:39:22 +02:00
}
</div>
<div class="form-check my-3">
2024-01-31 06:45:54 +01:00
<input asp-for="IsAdmin" type="checkbox" class="form-check-input" />
2024-10-17 15:51:40 +02:00
<label asp-for="IsAdmin" class="form-check-label" text-translate="true">User is admin</label>
2018-03-22 19:55:14 +09:00
</div>
2024-01-31 06:45:54 +01:00
@if (Model.Approved.HasValue)
{
2024-06-26 10:39:22 +02:00
<div class="form-check my-3">
2024-01-31 06:45:54 +01:00
<input id="Approved" name="Approved" type="checkbox" value="true" class="form-check-input" @(Model.Approved.Value ? "checked" : "") />
2024-10-17 15:51:40 +02:00
<label for="Approved" class="form-check-label" text-translate="true">User is approved</label>
2024-01-31 06:45:54 +01:00
</div>
<input name="Approved" type="hidden" value="false">
}
@if (Model.EmailConfirmed.HasValue)
{
2024-06-26 10:39:22 +02:00
<div class="form-check my-3">
2024-01-31 06:45:54 +01:00
<input id="EmailConfirmed" name="EmailConfirmed" value="true" type="checkbox" class="form-check-input" @(Model.EmailConfirmed.Value ? "checked" : "") />
2024-10-17 15:51:40 +02:00
<label for="EmailConfirmed" class="form-check-label" text-translate="true">Email address is confirmed</label>
2024-01-31 06:45:54 +01:00
</div>
<input name="EmailConfirmed" type="hidden" value="false">
}
</form>