-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tab support for admin / content edit (#3626)
- Loading branch information
1 parent
8f0b283
commit 3a4333d
Showing
9 changed files
with
220 additions
and
23 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/OrchardCore.Modules/OrchardCore.Contents/Views/AdminTabs.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@using OrchardCore.Mvc.Utilities; | ||
@{ | ||
var tabs = ((IEnumerable<dynamic>)Model.Tabs).ToArray(); | ||
string contentItemId = Model.ContentItem != null ? (string)Model.ContentItem.ContentItemId : ""; | ||
} | ||
@if (tabs.Any()) | ||
{ | ||
var tabIndex = 0; | ||
<ul class="nav nav-tabs flex-column flex-md-row" role="tablist"> | ||
@foreach (var tab in tabs) | ||
{ | ||
var tabText = tab.ToString(); | ||
var defaultTabId = $"tab-{contentItemId}-{tabText}".HtmlClassify(); | ||
var tabId = tab is string ? defaultTabId : (string)(tab.TabName ?? defaultTabId); | ||
var tabCssClasses = tabIndex == 0 ? "nav-item nav-link active" : "nav-item nav-link"; | ||
var itemCssClasses = tabIndex == tabs.Length -1 ? "nav-item" : "nav-item pr-md-2"; | ||
<li class="@itemCssClasses"> | ||
<a class="@tabCssClasses" href="#@tabId" data-toggle="tab" role="tab" aria-controls="@tabId" aria-selected="false">@tabText</a> | ||
</li> | ||
tabIndex++; | ||
} | ||
</ul> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/OrchardCore.Modules/OrchardCore.Contents/Views/LocalNavigation.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@await DisplayAsync(await New.AdminTabs(ContentItem: Model.ContentItem, Tabs: Model.Tabs)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/OrchardCore.Themes/TheAdmin/wwwroot/Styles/TheAdmin.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters