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

Upgrade TheTheme to use Bootstrap 5.3.2 #14451

Merged
merged 6 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="alert alert-primary">
<h4>@T["Welcome to Orchard Core"]</h4>
<p>@T["Feel free to browse the menu and discover all its possibilities."]</p>
<p class="mb-0">@T["Feel free to browse the menu and discover all its possibilities."]</p>
</div>
322 changes: 161 additions & 161 deletions src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,48 @@
<li class="nav-item">
<div class="dropdown">
<button type="button" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" data-bs-auto-close="outside" aria-expanded="false">
@if (Model.Value.TotalUnread > 0)
{
var notifications = T.Plural(Model.Value.TotalUnread, "notification", "notifications");
LocalizedHtmlString title;
if (Model.Value.TotalUnread > Model.Value.MaxVisibleNotifications)
@if (Model.Value.TotalUnread > 0)
{
title = T["You have more than {0} unread {1}", Model.Value.MaxVisibleNotifications, notifications];
var notifications = T.Plural(Model.Value.TotalUnread, "notification", "notifications");
LocalizedHtmlString title;
if (Model.Value.TotalUnread > Model.Value.MaxVisibleNotifications)
{
title = T["You have more than {0} unread {1}", Model.Value.MaxVisibleNotifications, notifications];
}
else
{
title = T["You have {0} unread {1}", Model.Value.TotalUnread, notifications];
}

<i class="fa-solid fa-bell" aria-hidden="true" data-bs-toggle="tooltip" data-bs-original-title="@title"></i>
}
else
{
title = T["You have {0} unread {1}", Model.Value.TotalUnread, notifications];
<i class="fa-regular fa-bell" aria-hidden="true" data-bs-toggle="tooltip" data-bs-original-title="@T["You have no unread notifications"]"></i>
}

<i class="fa-solid fa-bell" aria-hidden="true" data-bs-toggle="tooltip" data-bs-original-title="@title"></i>
}
else
{
<i class="fa-regular fa-bell" aria-hidden="true" data-bs-toggle="tooltip" data-bs-original-title="@T["You have no unread notifications"]"></i>
}
</button>
</button>
<ul class="dropdown-menu dropdown-menu-end notification-navbar scrollable position-absolute" style="max-width: 20rem;">
@if (Model.Value.Notifications.Count > 0)
{
var maxCount = Math.Min(Model.Value.MaxVisibleNotifications, Model.Value.Notifications.Count);
<li style="max-height: 30rem; overflow-y: auto;">
@for (int i = 0; i < maxCount; i++)
{
var notification = Model.Value.Notifications[i];
@if (Model.Value.Notifications.Count > 0)
{
var maxCount = Math.Min(Model.Value.MaxVisibleNotifications, Model.Value.Notifications.Count);
<li style="max-height: 30rem; overflow-y: auto;">
@for (int i = 0; i < maxCount; i++)
{
var notification = Model.Value.Notifications[i];

<div class="@(i == maxCount - 1 ? string.Empty : "border-bottom")">
@await DisplayAsync(notification)
</div>
}
</li>
<div class="@(i == maxCount - 1 ? string.Empty : "border-bottom")">
@await DisplayAsync(notification)
</div>
}
</li>
<li>
<hr class="dropdown-divider">
</li>
}
<li>
<hr class="dropdown-divider">
<a class="dropdown-item fw-bold" asp-action="List" asp-controller="Admin" asp-area="OrchardCore.Notifications">@T["Notification Center"]</a>
</li>
}
<li>
<a class="dropdown-item fw-bold" asp-action="List" asp-controller="Admin" asp-area="OrchardCore.Notifications">@T["Notification Center"]</a>
</li>
</ul>
</ul>
</div>
</li>

Expand Down
10,442 changes: 5,221 additions & 5,221 deletions src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg-plugins.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -81,76 +81,6 @@
right: 0;
border-right-color: #fff;
}
/**
* Trumbowyg v2.27.3 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link https://alex-d.github.io/Trumbowyg/
* @license MIT
* @author Alexandre Demode (Alex-D)
* Twitter : @AlexandreDemode
* Website : alex-d.fr
*/
.trumbowyg-dropdown-emoji {
width: 265px;
}
[dir=ltr] .trumbowyg-dropdown-emoji {
padding: 7px 0 7px 5px;
}
[dir=rtl] .trumbowyg-dropdown-emoji {
padding: 7px 5px 7px 0;
}

.trumbowyg-dropdown-emoji svg {
display: none !important;
}

.trumbowyg-dropdown-emoji button {
display: block;
position: relative;
height: 26px;
width: 26px;
line-height: 24px;
}

[dir] .trumbowyg-dropdown-emoji button {
padding: 0;
margin: 2px;
text-align: center;
}

[dir=ltr] .trumbowyg-dropdown-emoji button {
float: left;
}

[dir=rtl] .trumbowyg-dropdown-emoji button {
float: right;
}
.trumbowyg-dropdown-emoji button:hover::after, .trumbowyg-dropdown-emoji button:focus::after {
display: block;
position: absolute;
top: -5px;
height: 27px;
width: 27px;
z-index: 10;
}
[dir] .trumbowyg-dropdown-emoji button:hover::after, [dir] .trumbowyg-dropdown-emoji button:focus::after {
background: inherit;
box-shadow: #000 0 0 2px;
background-color: transparent;
}
[dir=ltr] .trumbowyg-dropdown-emoji button:hover::after, [dir=ltr] .trumbowyg-dropdown-emoji button:focus::after {
left: -5px;
}
[dir=rtl] .trumbowyg-dropdown-emoji button:hover::after, [dir=rtl] .trumbowyg-dropdown-emoji button:focus::after {
right: -5px;
}

.trumbowyg .emoji {
width: 22px;
height: 22px;
display: inline-block;
}
/**
* Trumbowyg v2.27.3 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
Expand Down Expand Up @@ -301,6 +231,76 @@
.trumbowyg-giphy-modal .img-container img.tbw-loaded {
opacity: 1;
}
/**
* Trumbowyg v2.27.3 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link https://alex-d.github.io/Trumbowyg/
* @license MIT
* @author Alexandre Demode (Alex-D)
* Twitter : @AlexandreDemode
* Website : alex-d.fr
*/
.trumbowyg-dropdown-emoji {
width: 265px;
}
[dir=ltr] .trumbowyg-dropdown-emoji {
padding: 7px 0 7px 5px;
}
[dir=rtl] .trumbowyg-dropdown-emoji {
padding: 7px 5px 7px 0;
}

.trumbowyg-dropdown-emoji svg {
display: none !important;
}

.trumbowyg-dropdown-emoji button {
display: block;
position: relative;
height: 26px;
width: 26px;
line-height: 24px;
}

[dir] .trumbowyg-dropdown-emoji button {
padding: 0;
margin: 2px;
text-align: center;
}

[dir=ltr] .trumbowyg-dropdown-emoji button {
float: left;
}

[dir=rtl] .trumbowyg-dropdown-emoji button {
float: right;
}
.trumbowyg-dropdown-emoji button:hover::after, .trumbowyg-dropdown-emoji button:focus::after {
display: block;
position: absolute;
top: -5px;
height: 27px;
width: 27px;
z-index: 10;
}
[dir] .trumbowyg-dropdown-emoji button:hover::after, [dir] .trumbowyg-dropdown-emoji button:focus::after {
background: inherit;
box-shadow: #000 0 0 2px;
background-color: transparent;
}
[dir=ltr] .trumbowyg-dropdown-emoji button:hover::after, [dir=ltr] .trumbowyg-dropdown-emoji button:focus::after {
left: -5px;
}
[dir=rtl] .trumbowyg-dropdown-emoji button:hover::after, [dir=rtl] .trumbowyg-dropdown-emoji button:focus::after {
right: -5px;
}

.trumbowyg .emoji {
width: 22px;
height: 22px;
display: inline-block;
}
@charset "UTF-8";
/**
* Trumbowyg v2.27.3 - A lightweight WYSIWYG editor
Expand Down

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions src/OrchardCore.Themes/TheAdmin/Assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,22 @@
"generateSourceMaps": false,
"inputs": [
"Assets/js/header/global/*.js",
"Assets/js/header/*.js"
"Assets/js/header/theme/*.js"
],
"watch": [
"Assets/js/header/**/*.js"
"Assets/js/header/global/*.js",
"Assets/js/header/theme/*.js"
],
"output": "wwwroot/js/TheAdmin-header.js"
},
{
"generateSourceMaps": false,
"inputs": [
"Assets/js/header/main/*.js"
],
"watch": [
"Assets/js/header/main/*.js"
],
"output": "wwwroot/js/TheAdmin-main.js"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ static ResourceManagementOptionsConfiguration()
.SetDependencies("js-cookie")
.SetVersion("1.0.0");

_manifest
.DefineScript("admin-main")
.SetUrl("~/TheAdmin/js/TheAdmin-main.min.js", "~/TheAdmin/js/TheAdmin-main.js")
.SetDependencies("admin-head")
.SetVersion("1.0.0");

_manifest
.DefineStyle("admin")
.SetUrl("~/TheAdmin/css/TheAdmin.min.css", "~/TheAdmin/css/TheAdmin.css")
Expand Down
38 changes: 2 additions & 36 deletions src/OrchardCore.Themes/TheAdmin/Views/Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">

<!-- This script can't wait till the footer -->
<script asp-name="admin-head" version="1" at="Head"></script>
<script asp-name="admin-main" version="1" at="Head"></script>

<!-- TheAdmin && Bootstrap CSS -->
<style media="all" asp-name="admin" version="1"></style>
Expand Down Expand Up @@ -53,41 +53,7 @@
@await RenderSectionAsync("NavbarTop", required: false)
@if (adminSettings.DisplayThemeToggler)
{
<li class="nav-item">
<div class="dropdown">
<button class="btn btn-link nav-link dropdown-toggle d-flex align-items-center" id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="@T["Toggle theme"]">
<span class="theme-icon-active"><i class="fa-solid fa-circle-half-stroke"></i></span>
<span class="d-none" id="bd-theme-text">@T["Toggle theme"]</span>
</button>
<ul class="dropdown-menu dropdown-menu-end position-absolute" aria-labelledby="bd-theme-text">
<li>
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="auto" aria-pressed="false">
<span class="theme-icon">
<i class="fa-solid fa-circle-half-stroke"></i>
</span>
<span class="ps-2">@T["Auto"]</span>
</button>
</li>
<li>
<button type="button" class="dropdown-item d-flex align-items-center active" data-bs-theme-value="light" aria-pressed="true">
<span class="theme-icon">
<i class="fa-solid fa-sun"></i>
</span>
<span class="ps-2">@T["Light"]</span>
</button>
</li>
<li>
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false">
<span class="theme-icon">
<i class="fa-solid fa-moon"></i>
</span>
<span class="ps-2">@T["Dark"]</span>
</button>
</li>
@await RenderSectionAsync("ToggleThemeItems", required: false)
</ul>
</div>
</li>
@await DisplayAsync(await New.ToggleTheme())
}
<li class="nav-item">
<a href="@Url.Content("~/")" class="nav-link" data-bs-toggle="tooltip" data-bs-placement="bottom" title="@T["Visit Site"]" role="button">
Expand Down
35 changes: 35 additions & 0 deletions src/OrchardCore.Themes/TheAdmin/Views/ToggleTheme.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<li class="nav-item">
<div class="dropdown">
<button class="btn btn-link nav-link dropdown-toggle" id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="@T["Toggle theme"]">
<span class="theme-icon-active"><i class="fa-solid fa-circle-half-stroke"></i></span>
<span class="d-none" id="bd-theme-text">@T["Toggle theme"]</span>
</button>
<ul class="dropdown-menu dropdown-menu-end position-absolute" aria-labelledby="bd-theme-text">
<li>
<button type="button" class="dropdown-item" data-bs-theme-value="auto" aria-pressed="false">
<span class="theme-icon">
<i class="fa-solid fa-circle-half-stroke"></i>
</span>
<span class="ps-2">@T["Auto"]</span>
</button>
</li>
<li>
<button type="button" class="dropdown-item active" data-bs-theme-value="light" aria-pressed="true">
<span class="theme-icon">
<i class="fa-solid fa-sun"></i>
</span>
<span class="ps-2">@T["Light"]</span>
</button>
</li>
<li>
<button type="button" class="dropdown-item" data-bs-theme-value="dark" aria-pressed="false">
<span class="theme-icon">
<i class="fa-solid fa-moon"></i>
</span>
<span class="ps-2">@T["Dark"]</span>
</button>
</li>
@await RenderSectionAsync("ToggleThemeItems", required: false)
</ul>
</div>
</li>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading