Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Add new theme to Admin pages (part 3) #9891

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

@zhhyu zhhyu Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very sure. Should the line above this change get deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to explain more about this change. var() is not supported by IE, I had a conversation with Joel if this is something we should be worried about but we decided to continue with it and check later if the website is broke for IE (currently there are some CSS that is not supported by IE too).

If line 8 fails, it will try to do line 7, since this is the focus behavior I felt like at least this should be supported always.

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
110 changes: 56 additions & 54 deletions src/NuGetGallery/Areas/Admin/Views/Features/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
@if (!Model.TimeSinceLastRefresh.HasValue)
{
@ViewHelpers.AlertWarning(
@<text>
The feature flags haven't loaded yet. Check the logs for errors.
</text>)
@<text>
martinrrm marked this conversation as resolved.
Show resolved Hide resolved
The feature flags haven't loaded yet. Check the logs for errors.
</text>)
}
else if (Model.IsOutdated)
{
@ViewHelpers.AlertWarning(
@<text>
The feature flags were last cached @Math.Round(Model.TimeSinceLastRefresh.Value.TotalSeconds) seconds ago
but should refresh every @Model.RefreshInterval.TotalSeconds seconds. Check the logs for errors.
</text>)
@<text>
The feature flags were last cached @Math.Round(Model.TimeSinceLastRefresh.Value.TotalSeconds) seconds ago
but should refresh every @Model.RefreshInterval.TotalSeconds seconds. Check the logs for errors.
</text>)
}
else
{
Expand All @@ -33,55 +33,55 @@
@ViewHelpers.Section(
this,
"features-expander",
@<text>Features</text>,
@<text>Features</text>,
@<text><p>View and edit features.</p></text>,
@<text>
<table class="table" aria-label="Features">
<tr>
<th>Name</th>
<th>Current Status</th>
<th>Update Status</th>
<th>Delete</th>
</tr>
<tbody>
@foreach (var feature in Model.Features)
{
@Html.Partial("_EditFeature", new ModifyFeatureFlagsFeatureViewModel(feature, Model.ContentId))
}
</tbody>
</table>

@Html.Partial("_AddFeature", new ModifyFeatureFlagsFeatureViewModel { ContentId = Model.ContentId })
</text>,
expanded: true)
@<text>
<table class="table" aria-label="Features">
<tr>
<th>Name</th>
<th>Current Status</th>
<th>Update Status</th>
<th>Delete</th>
</tr>
<tbody>
@foreach (var feature in Model.Features)
{
@Html.Partial("_EditFeature", new ModifyFeatureFlagsFeatureViewModel(feature, Model.ContentId))
}
</tbody>
</table>

@Html.Partial("_AddFeature", new ModifyFeatureFlagsFeatureViewModel { ContentId = Model.ContentId })
</text>,
expanded: true)

@ViewHelpers.Section(
this,
"flights-expander",
@<text>Flights</text>,
@<text>Flights</text>,
@<text><p>View and edit flights.</p></text>,
@<text>
<table class="table" aria-label="Flights">
<tr>
<th>Name</th>
<th>All</th>
<th>Site Admins</th>
<th>Accounts</th>
<th>Domains</th>
<th>Update</th>
<th>Delete</th>
</tr>
<tbody>
@foreach (var flight in Model.Flights)
{
@Html.Partial("_EditFlight", new ModifyFeatureFlagsFlightViewModel(flight, Model.ContentId))
}
</tbody>
</table>

@Html.Partial("_AddFlight", new ModifyFeatureFlagsFlightViewModel { ContentId = Model.ContentId })
</text>,
expanded: true)
@<text>
<table class="table" aria-label="Flights">
<tr>
<th>Name</th>
<th>All</th>
<th>Site Admins</th>
<th>Accounts</th>
<th>Domains</th>
<th>Update</th>
<th>Delete</th>
</tr>
<tbody>
@foreach (var flight in Model.Flights)
{
@Html.Partial("_EditFlight", new ModifyFeatureFlagsFlightViewModel(flight, Model.ContentId))
}
</tbody>
</table>

@Html.Partial("_AddFlight", new ModifyFeatureFlagsFlightViewModel { ContentId = Model.ContentId })
</text>,
expanded: true)
</div>
</section>

Expand All @@ -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 All @@ -117,7 +119,7 @@
var $notAll = $('#' + notAllId);
var isAll = $notAll.is(':visible');
$notAll.toggle();

var $input = $notAll.find('input');
var $submit = $('#' + submitId);
var offsetClass = 'col-sm-offset-7';
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>
}
Loading