Skip to content

Commit

Permalink
Merge pull request #132 from DNNCommunity/develop
Browse files Browse the repository at this point in the history
Merge `develop` into `main` for `1.3.0` release
  • Loading branch information
david-poindexter authored May 27, 2023
2 parents fa77a1c + 88a9923 commit 762ae47
Show file tree
Hide file tree
Showing 15 changed files with 409 additions and 339 deletions.
2 changes: 1 addition & 1 deletion manifest.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="9.0">
<packages>
<package name="nvisionative.DNNCommunityTheme" type="Skin" version="1.2.1">
<package name="nvisionative.DNNCommunityTheme" type="Skin" version="1.3.0">
<friendlyName>DNNCommunityTheme</friendlyName>
<description>A DNN Theme by and for the DNN Community</description>
<iconFile>MyIcon.png</iconFile>
Expand Down
39 changes: 39 additions & 0 deletions menus/desktop/RazorMenu.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@using DotNetNuke.Web.DDRMenu;
@using System.Dynamic;
@inherits DotNetNuke.Web.Razor.DotNetNukeWebPage<dynamic>

<ul class="h-100" id="nav-desktop">
@RenderPages(Model.Source.root.Children)
</ul>

@helper RenderPages(IEnumerable<MenuNode> pages)
{
if (!pages.Any())
{
return;
}

foreach (var page in pages)
{
var hasChildren = page.HasChildren();
var attrTarget = !string.IsNullOrEmpty(page.Target) ? ("target=\"" + page.Target + "\"") :string.Empty;

<li class="@(page.Selected ? "selected" : string.Empty)">
@if (page.Enabled)
{
<a href="@page.Url" @attrTarget>@page.Text</a>
}
else
{
<a href="javascript:void(0);" @attrTarget>@page.Text</a>
}

@if (hasChildren)
{
<ul>
@RenderPages(page.Children)
</ul>
}
</li>
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<manifest>
<template>MainMenu.txt</template>
<template>RazorMenu.cshtml</template>
</manifest>
37 changes: 0 additions & 37 deletions menus/main/MainMenu.txt

This file was deleted.

50 changes: 50 additions & 0 deletions menus/mobile/RazorMenu.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@using DotNetNuke.Web.DDRMenu;
@using System.Dynamic;
@inherits DotNetNuke.Web.Razor.DotNetNukeWebPage<dynamic>

<span class="hamburger material-icons" id="nav-mobile"><i class="fa fa-2x fa-bars"></i></span>

<nav class="nav-drill" id="nav-mobile">
<ul class="nav-items">
@RenderPages(Model.Source.root.Children)
</ul>
</nav>

@helper RenderPages(IEnumerable<MenuNode> pages)
{
if (!pages.Any())
{
return;
}

foreach (var page in pages)
{
var hasChildren = page.HasChildren();
var pageDesc = Html.Raw(!string.IsNullOrEmpty(page.Description) ? ("<br/><span class=\"link-description\">" + @page.Description + "</span>") :string.Empty);
var attrTarget = !string.IsNullOrEmpty(page.Target) ? ("target=\"" + page.Target + "\"") :string.Empty;

<li class="nav-item @(hasChildren ? "nav-expand " : string.Empty)@(page.Selected ? "selected" : string.Empty)">
@if (page.Enabled)
{
<a class="nav-link" href="@page.Url" @attrTarget>@page.Text @pageDesc</a>
}
else
{
<a href="javascript:void(0);" @attrTarget>@page.Text @pageDesc</a>
}

@if (hasChildren)
{
<a href="javascript:void(0);" class="nav-link nav-expand-link"><i class="fa fa-chevron-right"></i></a>
<ul class="nav-items nav-expand-content">
<li class="nav-item">
<a class="nav-link nav-back-link" href="javascript:;">
<em class="fa fa-chevron-left mr-1"></em>Back to @page.Text
</a>
</li>
@RenderPages(page.Children)
</ul>
}
</li>
}
}
4 changes: 4 additions & 0 deletions menus/mobile/menudef.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<manifest>
<template>RazorMenu.cshtml</template>
</manifest>
15 changes: 10 additions & 5 deletions partials/_header.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
</div>
<div class="container-fluid">
<div class="container">
<div class="row nav-main">
<dnn:LOGO id="dnnLOGO" runat="server" />
<nav id="nav-items">
<dnn:MENU id="menu" MenuStyle="menus/main" runat="server" NodeSelector="*"></dnn:MENU>
</nav>
<div class="row justify-content-between flex-nowrap">
<div class="col-auto">
<dnn:LOGO id="dnnLOGO" runat="server" />
</div>
<div class="col-auto ms-auto d-none d-xl-block">
<dnn:MENU id="menu_desktop" MenuStyle="menus/desktop" runat="server" NodeSelector="*,0,2"></dnn:MENU>
</div>
<div class="col-auto ms-auto d-flex align-items-center d-xl-none">
<dnn:MENU id="menu_mobile" MenuStyle="menus/mobile" runat="server" NodeSelector="*,0,2"></dnn:MENU>
</div>
</div>
</div>
</div>
Expand Down
27 changes: 27 additions & 0 deletions partials/_header.ascx.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<header class="bg-secondary sticky-top">
<div class="container-fluid user-controls bg-light-grey">
<div class="container">
<div class="row justify-content-end">
<ul>
<li><dnn:Login runat="server" id="dnnLogin" /></li>
<li><dnn:User runat="server" id="dnnUser" /></li>
<li style="display:none;"><dnn:Search runat="server" id="dnnSearch" ShowSite="false" ShowWeb="false" Submit="<i class='fa fa-search'></i>" /></li>
<li style="display:none;"><dnn:Language runat="server" id="dnnLanguage" ShowMenu="false" ShowLinks="false" /></li>
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<div class="container">
<div class="row nav-main">
<dnn:LOGO id="dnnLOGO" runat="server" />
<div class="col-auto ms-auto d-none d-xl-block">
<dnn:MENU id="menu_desktop" MenuStyle="menus/desktop" runat="server" NodeSelector="*,0,2"></dnn:MENU>
</div>
<div class="col-auto ms-auto d-flex align-items-center d-xl-none">
<dnn:MENU id="menu_mobile" MenuStyle="menus/mobile" runat="server" NodeSelector="*,0,2"></dnn:MENU>
</div>
</div>
</div>
</div>
</header>
1 change: 1 addition & 0 deletions partials/_includes.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
<dnn:DnnJsInclude runat="server" FilePath="dist/js/jquery.slimmenu.min.js" ForceProvider="DnnFormBottomProvider" Priority="100" PathNameAlias="SkinPath" />
<dnn:DnnJsInclude runat="server" FilePath="dist/js/bootstrap.bundle.min.js" ForceProvider="DnnFormBottomProvider" Priority="110" PathNameAlias="SkinPath" />
<dnn:DnnJsInclude runat="server" FilePath="dist/js/custom.min.js" ForceProvider="DnnFormBottomProvider" Priority="120" PathNameAlias="SkinPath" />
<dnn:DnnJsInclude runat="server" FilePath="dist/js/customMenu.min.js" ForceProvider="DnnFormBottomProvider" Priority="130" PathNameAlias="SkinPath" />
2 changes: 1 addition & 1 deletion project-details.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"project": "DNNCommunityTheme",
"version": "1.2.1",
"version": "1.3.0",
"author": "David Poindexter",
"company": "nvisionative",
"url": "www.nvisionative.com",
Expand Down
13 changes: 0 additions & 13 deletions src/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
jQuery( document ).ready(function($) {
/* SlimMenu Prep */
$('#navigation').slimmenu({
resizeWidth: '800',
collapserTitle: '',
animSpeed: 0,
easingEffect: null,
indentChildren: false,
childrenIndenter: '&nbsp;',
expandIcon: '',
collapseIcon: ''
});
});
31 changes: 31 additions & 0 deletions src/js/customMenu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*jshint esversion: 6 */

// add event listeners to expands
const navExpand = [].slice.call(document.querySelectorAll('.nav-expand'));

navExpand.forEach(item => {
item.querySelector('.nav-expand-link').addEventListener('click', () => item.classList.add('active'));
item.querySelector('.nav-back-link').addEventListener('click', () => item.classList.remove('active'));
});

// setup and add overlay
let overlay = document.createElement('div');
overlay.setAttribute('id', 'body-overlay');
document.body.appendChild(overlay).classList.add('d-none');

// target hamburger menu
const responsiveMenu = document.getElementById('nav-mobile');
const bodyOverlay = document.getElementById('body-overlay');

responsiveMenu.addEventListener('click', function() {
// toggle menu
document.body.classList.toggle('nav-is-toggled');
bodyOverlay.classList.toggle('d-none');
});

// if overlay is clicked
bodyOverlay.addEventListener('click', function(e) {
// toggle menu and overlay
document.body.classList.toggle('nav-is-toggled');
bodyOverlay.classList.toggle('d-none');
});
2 changes: 1 addition & 1 deletion src/scss/components/_dnn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ a.pinHelp {
}

.dnnRadiobutton img {
background: transparent url(../../../../../../images/radiobutton.png) no-repeat;
background: transparent url(/images/radiobutton.png) no-repeat;
}

.dnnRadiobutton img {
Expand Down
Loading

0 comments on commit 762ae47

Please sign in to comment.