Skip to content

Commit

Permalink
[UI] Add new theme to Admin pages (part 3) (#9891)
Browse files Browse the repository at this point in the history
* [UI] Admin pages 3
  • Loading branch information
martinrrm committed Apr 30, 2024
1 parent bf2e13a commit 894f2b4
Show file tree
Hide file tree
Showing 19 changed files with 96 additions and 87 deletions.
10 changes: 5 additions & 5 deletions src/Bootstrap/dist/css/bootstrap-theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions src/Bootstrap/dist/css/bootstrap.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/Bootstrap/less/buttons.less
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@
border-radius: var(--Medium, 4px);
border: 2px solid transparent;
box-shadow: none !important;
padding: 5px 12px;

&:hover,
&:focus:hover {
Expand All @@ -250,7 +249,7 @@
// Make a button look and behave like a link
.btn-link {
font-weight: 400;
color: @link-color;
color: var(--brandForegroundLinkRest);
border-radius: 0;

&,
Expand All @@ -269,15 +268,15 @@
}
&:hover,
&:focus {
color: @link-hover-color;
color: var(--brandForegroundLinkHover);
text-decoration: @link-hover-decoration;
background-color: transparent;
}
&[disabled],
fieldset[disabled] & {
&:hover,
&:focus {
color: @btn-link-disabled-color;
color: var(--neutralForegroundDisabledRest);
text-decoration: none;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Bootstrap/less/mixins/tab-focus.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// (Initially tried to also force default via `outline: initial`,
// but that seems to erroneously remove the outline in Firefox altogether.)
outline: 4px solid -webkit-focus-ring-color;
outline: 2px solid var(--neutralStrokeFocus2Rest);
border-radius: 4px;
outline-offset: -2px;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Bootstrap/less/theme/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ h2, h3 {
}

a, a:hover, a:focus, a:active {
color: @text-color;
color: var(--neutralForeground1Rest);
text-decoration: none;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Bootstrap/less/theme/page-admin-popularity-transfers.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
}

.col-group-from-header {
background-color: #f2f2f2;
background-color: transparent;
}

.col-group-to-header {
background-color: #ebebeb;
background-color: var(--neutralBackground1Rest);
}

.col-group-from-data {
background-color: #f2f2f2;
background-color: transparent;
}

.col-group-to-data {
background-color: #ebebeb;
background-color: var(--neutralBackground1Rest);
}
}
8 changes: 4 additions & 4 deletions src/NuGetGallery/Areas/Admin/Views/ApiKeys/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
{"ApiKey":"oy2apikey2","LeakedUrl":"https://leakedUrl2","RevocationSource":"GitHub"}
</p>
<form>
<textarea class="form-control" placeholder="Verify API keys to revoke" autocomplete="off" autofocus rows="5" data-bind="value: verifyQuery"></textarea><br />
<input type="button" value="Verify" data-bind="click: verify" /><br />
<textarea class="form-control textarea-brand" placeholder="Verify API keys to revoke" autocomplete="off" autofocus rows="5" data-bind="value: verifyQuery"></textarea><br />
<input type="button" class="btn btn-brand-secondary" value="Verify" data-bind="click: verify" /><br />
</form>
<div style="display: none" data-bind="visible: Error">
@ViewHelpers.AlertDanger(@<text><span data-bind="html: Error"></span></text>)
Expand All @@ -34,7 +34,7 @@
<tbody data-bind="foreach: verifiedResults">
<tr>
<td class="col-sm-1" style="vertical-align: middle">
<input type="checkbox" name="SelectedApiKeys" data-bind="visible: IsRevocable, checked: Selected, value: ko.toJSON($data)" />
<input type="checkbox" class="brand-checkbox" name="SelectedApiKeys" data-bind="visible: IsRevocable, checked: Selected, value: ko.toJSON($data)" />
</td>
<td class="col-sm-5" style="vertical-align: middle">
<span data-bind="text: ApiKey"></span>
Expand Down Expand Up @@ -84,7 +84,7 @@
This will expire and revoke the selected API keys, and send the emails to notify customers!
</p>
<hr />
<input type="submit" class="btn btn-danger form-control" value="I understand the consequences, revoke the API keys" />
<input type="submit" class="btn btn-brand-danger form-control" value="I understand the consequences, revoke the API keys" />
</div>
}
</section>
Expand Down
6 changes: 4 additions & 2 deletions src/NuGetGallery/Areas/Admin/Views/Features/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@
</li>
</ul>

<input type="text" data-bind="value: toAdd" />
<input type="submit" class="btn btn-primary" data-bind="click: add" value="Add" />
<div class="row-checkbox-label">
<input type="text" class="input-brand" data-bind="value: toAdd" />
<input type="submit" class="btn btn-brand" data-bind="click: add" value="Add" />
</div>
</div>
</script>
<script type="text/javascript">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
<div class="row">
<div class="col-sm-6 form-group @Html.HasErrorFor(m => m.Name)">
@Html.ShowLabelFor(m => m.Name)<br />
@Html.ShowTextBoxFor(m => m.Name)
@Html.ShowTextBoxFor(m => m.Name, customClass: "input-brand")
@Html.ShowValidationMessagesFor(m => m.Name)
</div>

<div class="col-sm-3 form-group @Html.HasErrorFor(m => m.Status)">
@Html.ShowLabelFor(m => m.Status)<br />
@Html.EnumDropDownListFor(m => m.Status)
@Html.EnumDropDownListFor(m => m.Status, new { @class = "select-brand" })
@Html.ShowValidationMessagesFor(m => m.Status)
</div>

<div class="col-sm-3">
<br />
<input id="Add" type="submit" class="btn btn-primary form-control" value="Add" />
<input id="Add" type="submit" class="btn btn-brand form-control" value="Add" />
</div>
</div>
}
8 changes: 4 additions & 4 deletions src/NuGetGallery/Areas/Admin/Views/Features/_AddFlight.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
<div class="row">
<div class="col-sm-3 form-group @Html.HasErrorFor(m => m.Name)">
@Html.ShowLabelFor(m => m.Name)<br />
@Html.ShowTextBoxFor(m => m.Name)
@Html.ShowTextBoxFor(m => m.Name, customClass: "input-brand")
@Html.ShowValidationMessagesFor(m => m.Name)
</div>

<div class="col-sm-1 form-group @Html.HasErrorFor(m => m.All)" onchange="FlightFormToggleAll('@formNotAllId', '@formAddId')">
@Html.ShowLabelFor(m => m.All)<br />
@Html.ShowCheckboxFor(m => m.All)
@Html.ShowCheckboxFor(m => m.All, customClass: "brand-checkbox")
@Html.ShowValidationMessagesFor(m => m.All)
</div>

<div id="@formNotAllId" style="@(Model.All ? "display: none" : "")">
<div class="col-sm-1 form-group @Html.HasErrorFor(m => m.SiteAdmins)">
@Html.ShowLabelFor(m => m.SiteAdmins)<br />
@Html.ShowCheckboxFor(m => m.SiteAdmins)
@Html.ShowCheckboxFor(m => m.SiteAdmins, customClass: "brand-checkbox")
@Html.ShowValidationMessagesFor(m => m.SiteAdmins)
</div>

Expand All @@ -40,7 +40,7 @@

<div class="col-sm-1 @(Model.All ? "col-sm-offset-7" : "")" id="@formAddId">
<br />
<input id="Add" type="submit" class="btn btn-primary form-control" value="Add" />
<input id="Add" type="submit" class="btn btn-brand form-control" value="Add" />
</div>
</div>
}
10 changes: 5 additions & 5 deletions src/NuGetGallery/Areas/Admin/Views/Features/_EditFeature.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
@Html.Hidden("Name", Model.Name)

<div class="row">
<div class="col-sm-6 form-group">
@Html.EnumDropDownListFor(m => m.Status)
<div class="col-md-6 form-group">
@Html.EnumDropDownListFor(m => m.Status, new { @class = "select-brand"})
</div>
<div class="col-sm-6 form-group">
<input id="Update" type="submit" class="btn btn-primary" value="Update" />
<div class="col-md-6 form-group">
<input id="Update" type="submit" class="btn btn-brand" value="Update" />
</div>
</div>
}
Expand All @@ -28,7 +28,7 @@
@Html.Hidden("ContentId", Model.ContentId)
@Html.Hidden("Name", Model.Name)

<input id="Delete" type="submit" class="btn btn-danger" value="Delete" onclick="return FormDeleteConfirmation(event, '@Model.Name', 'feature')" />
<input id="Delete" type="submit" class="btn btn-brand-danger" value="Delete" onclick="return FormDeleteConfirmation(event, '@Model.Name', 'feature')" />
}
</td>
</tr>
27 changes: 13 additions & 14 deletions src/NuGetGallery/Areas/Admin/Views/Features/_EditFlight.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,38 @@
</ul>
</td>
<td class="@rowClass">
<button class="btn btn-primary" onclick="$('.@rowClass').hide(); $('#@rowFormId').show()">Update</button>
<button class="btn btn-brand" onclick="$('.@rowClass').hide(); $('#@rowFormId').show()">Update</button>
</td>
<td colspan="5" id="@rowFormId" style="display: none">
@using (Html.BeginForm("EditFlight", "Features", FormMethod.Post))
{
@Html.AntiForgeryToken()
@Html.Hidden("ContentId", Model.ContentId)
@Html.Hidden("Name", Model.Name)

<div class="row">
<div class="col-sm-2 form-group @Html.HasErrorFor(m => m.All)" onchange="FlightFormToggleAll('@rowFormNotAllId', '@rowFormSubmitId')">
<div class="row-checkbox-label">
<div class="form-group @Html.HasErrorFor(m => m.All)" onchange="FlightFormToggleAll('@rowFormNotAllId', '@rowFormSubmitId')">
@Html.ShowLabelFor(m => m.All)
@Html.ShowCheckboxFor(m => m.All)
@Html.ShowCheckboxFor(m => m.All, customClass: "brand-checkbox")
@Html.ShowValidationMessagesFor(m => m.All)
</div>

<div id="@rowFormNotAllId" style="@(Model.All ? "display: none" : "")">
<div class="col-sm-2 form-group @Html.HasErrorFor(m => m.SiteAdmins)">
<div id="@rowFormNotAllId" style="@(Model.All ? "display: none" : "flex-grow: 1")">
<div class="form-group @Html.HasErrorFor(m => m.SiteAdmins)">
@Html.ShowLabelFor(m => m.SiteAdmins)
@Html.ShowCheckboxFor(m => m.SiteAdmins)
@Html.ShowCheckboxFor(m => m.SiteAdmins, customClass: "brand-checkbox")
@Html.ShowValidationMessagesFor(m => m.SiteAdmins)
</div>

<div class="flight-array col-sm-3" name="Accounts" data-items="@string.Join(";", Model.Accounts ?? new string[0])" data-bind="template: { name: 'flight-array', data: $data }"></div>
<div class="flight-array col-sm-3" name="Domains" data-items="@string.Join(";", Model.Domains ?? new string[0])" data-bind="template: { name: 'flight-array', data: $data }"></div>
<div class="flight-array" name="Accounts" data-items="@string.Join(";", Model.Accounts ?? new string[0])" data-bind="template: { name: 'flight-array', data: $data }"></div>
<div class="flight-array" name="Domains" data-items="@string.Join(";", Model.Domains ?? new string[0])" data-bind="template: { name: 'flight-array', data: $data }"></div>
</div>

<div class="col-sm-2 @(Model.All ? "col-sm-offset-7" : "")" id="@rowFormSubmitId">
<div style="margin-left: auto" id="@rowFormSubmitId">
<div class="form-group">
<input id="Update" type="submit" class="btn btn-primary form-control" value="Update" />
<input id="Update" type="submit" class="btn btn-brand form-control" value="Update" />
</div>
<div class="form-group">
<button type="button" class="btn btn-default form-control" onclick="$('.@rowClass').show(); $('#@rowFormId').hide()">Cancel</button>
<button type="button" class="btn btn-brand-secondary form-control" onclick="$('.@rowClass').show(); $('#@rowFormId').hide()">Cancel</button>
</div>
</div>
</div>
Expand All @@ -74,7 +73,7 @@
@Html.Hidden("Name", Model.Name)

<div class="form-group">
<input id="Delete" type="submit" class="btn btn-danger form-control" value="Delete" onclick="return FormDeleteConfirmation(event, '@Model.Name', 'flight')" />
<input id="Delete" type="submit" class="btn btn-brand-danger form-control" value="Delete" onclick="return FormDeleteConfirmation(event, '@Model.Name', 'flight')" />
</div>
}
</td>
Expand Down
2 changes: 1 addition & 1 deletion src/NuGetGallery/Areas/Admin/Views/Lucene/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{
@Html.AntiForgeryToken()
<fieldset class="form">
<input type="submit" value="Rebuild Now" />
<input type="submit" class="btn-brand" value="Rebuild Now" />
<p>NOTE: This will only affect the current instance!</p>
</fieldset>
}
Expand Down
Loading

0 comments on commit 894f2b4

Please sign in to comment.