Skip to content

Commit

Permalink
update newsroom apps
Browse files Browse the repository at this point in the history
  • Loading branch information
rolorogan committed Oct 15, 2024
1 parent 13841e9 commit 59c2a78
Show file tree
Hide file tree
Showing 35 changed files with 2,913 additions and 2,844 deletions.
17 changes: 16 additions & 1 deletion Wmca.Web/Views/ContentPage1.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,19 @@

@* Render the block areas *@
@await Html.GetBlockGridHtmlAsync(Model, "grid")
</main>
</main>

@section customScripts
{
<script>
// reset cookie so cia landing page is shown
document.addEventListener("DOMContentLoaded", function() {
var link = document.getElementById("ds-area-change");
link.addEventListener("click", function(event) {
event.preventDefault();
document.cookie = `cia.selectedAreaUrl=null; expires=Fri, 31 Dec 2027 23:59:59 GMT; path=/`; // set the cookie to null
window.open('/', '_parent'); // redirect to cia landing page
});
});
</script>
}
59 changes: 28 additions & 31 deletions Wmca.Web/Views/HomepageSaferTravel.cshtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Wmca.Models.Content.HomepageSaferTravel>

@{
Layout = "SaferTravel.cshtml";
Layout = "SaferTravel.cshtml";
}

@await Html.PartialAsync("frontend/components/homepagebanner")
Expand All @@ -15,37 +15,34 @@
.OrderByDescending(x => x.Value<DateTime>("date"));
}
<div class="ds-css-grid-3-col ds-m-b-lg">
@foreach (var item in newslist.Take(3))
{
var articleDate = item.Value<DateTime>("date");
var date = articleDate.ToString("dd MMMM yyyy");
<div class="ds-content-card ds-content-card--news">
@if (@item.Value("image") != null)
{
var imgSrc = "/media" + @item.Value("image");
<img src="@imgSrc?anchor=center&mode=crop&width=480&height=357&rnd=132122595620000000" alt="@item.Value("imageAlternativeText")">
}
else if (@item.Value("thumbnail") != null)
{
var image = item.Value<IPublishedContent>("thumbnail");
<img src="@image.Url()?anchor=center&mode=crop&width=480&height=357&rnd=132122595620000000" alt="@image.Value("altText", fallback: Fallback.ToDefaultValue, defaultValue: @image.Name)" />
}
<p>@date</p>
<h3><a href="@item.Url()">@item.Name</a></h3>
</div>
}
@foreach (var item in newslist.Take(3))
{
var articleDate = item.Value<DateTime>("date");
var date = articleDate.ToString("dd MMMM yyyy");
<div class="ds-content-card ds-content-card--news">
@if (@item.Value("image") != null)
{
var imgSrc = "/media" + @item.Value("image");
<img src="@imgSrc?anchor=center&mode=crop&width=480&height=357&rnd=132122595620000000"
alt="@item.Value("imageAlternativeText")">
}
else if (@item.Value("thumbnail") != null)
{
var image = item.Value<IPublishedContent>("thumbnail");
<img src="@image.Url()?anchor=center&mode=crop&width=480&height=357&rnd=132122595620000000"
alt="@image.Value("altText", fallback: Fallback.ToDefaultValue, defaultValue: @image.Name)" />
}
<p>@date</p>
<h3><a href="@item.Url()">@item.Name</a></h3>
</div>
}
</div>
<a href="/news/" title="News"><p>See all news</p></a>
<a href="/news/" title="News">
<p>See all news</p>
</a>

<h2>Partners</h2>
<div class="ds-css-grid-3-col ds-m-b-lg">
<div class="ds-content-card ds-logo-card ds-p-sm">
<img class="ds-content-card__image" src="/media/d2vbaoj4/og-logo-1.png" alt="West Midlands Police logo" />
</div>
<div class="ds-content-card ds-logo-card ds-p-sm">
<img class="ds-content-card__image" src="/media/zhklj4t3/btp-logo-1.png" alt="British Transport Police logo" />
</div>
<div class="ds-content-card ds-logo-card ds-p-sm">
<img class="ds-content-card__image" src="/media/hkzcfc14/tfwm-2021-landscape-1.png" alt="Transport for West Midlands logo" />
</div>
@Html.GetBlockListHtml(Model, "partners")
</div>
</main>
2 changes: 1 addition & 1 deletion Wmca.Web/Views/News.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@await Html.PartialAsync("frontend/components/shared/breadcrumb")
</div>

<script defer="defer" src="~/assets/apps/st-newsroom/static/js/main.097e209a.js"></script>
<script defer="defer" src="~/assets/apps/st-newsroom/static/js/main.a0c1434a.js"></script>
<link href="~/assets/apps/st-newsroom/static/css/main.51a6e80e.css" rel="stylesheet" />

<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
18 changes: 18 additions & 0 deletions Wmca.Web/Views/News1.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@using Umbraco.Cms.Web.Common.PublishedModels;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.NewsMidlandsConnect>
@using ContentModels = Wmca.Models.Content;
@{
Layout = "MidlandsConnect.cshtml";
}

<div class="ds-container">
@await Html.PartialAsync("frontend/components/shared/breadcrumb")
</div>

<script defer="defer" src="~/assets/apps/mc-newsroom/static/js/main.cac0619a.js"></script>
<link href="~/assets/apps/mc-newsroom/static/css/main.51a6e80e.css" rel="stylesheet" />

<noscript>You need to enable JavaScript to run this app.</noscript>
<main id="ds-main-content" class="ds-container">
<div id="root"></div>
</main>
22 changes: 16 additions & 6 deletions Wmca.Web/Views/Partials/blockgrid/Components/contentCard.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
var useImage = Model.Content.Value<String>("useImage");
var useIcon = Model.Content.Value<String>("useIcon");
var useTitle = Model.Content.Value<String>("useTitle");
var useCopy = Model.Content.Value<String>("useCopy");
var useLink = Model.Content.Value<String>("useLink");
var useButton = Model.Content.Value<String>("useButton");
var useSecondButton = Model.Content.Value<String>("useSecondButton");
Expand All @@ -30,7 +31,7 @@
<div class="ds-content-card">
@if (useImage == "Yes" && useIcon == "No Icon" && image != null)
{
<img src="@image.GetCropUrl("Content Card - Rectangle")" alt="@image.Value("altText", fallback: Fallback.ToDefaultValue, defaultValue: @image.Name)" />
<img class="ds-content-card__image" src="@image.GetCropUrl("Content Card - Rectangle")" alt="@image.Value("altText", fallback: Fallback.ToDefaultValue, defaultValue: @image.Name)" />
}
<div class="ds-p-sm">
@if (useIcon == "Design System Icon")
Expand All @@ -45,7 +46,10 @@
{
<h2>@Model.Content.Value("title")</h2>
}
@Model.Content.Value("copy")
@if (@useCopy != "No" && Model.Content.Value("copy") != "")
{
@Model.Content.Value("copy")
}

<div class="ds-buttons">
<a href="@link.Url" target="@link.Target" class="ds-btn ds-btn--@buttonClass">
Expand Down Expand Up @@ -92,7 +96,7 @@
<a href="@link.Url" target="@link.Target" class="ds-content-card">
@if (useIcon == "" && image != null)
{
<img src="@image.GetCropUrl("Content Card - Rectangle")"
<img class="ds-content-card__image" src="@image.GetCropUrl("Content Card - Rectangle")"
alt="@image.Value("altText", fallback: Fallback.ToDefaultValue, defaultValue: @image.Name)" />
}
<div class="ds-p-sm">
Expand All @@ -108,7 +112,10 @@
{
<h2>@Model.Content.Value("title")</h2>
}
@Model.Content.Value("copy")
@if (@useCopy != "No" && Model.Content.Value("copy") != "")
{
@Model.Content.Value("copy")
}
</div>
</a>
}
Expand All @@ -119,7 +126,7 @@ else
<div class="ds-content-card">
@if (useIcon != null && image != null)
{
<img src="@image.GetCropUrl("Content Card - Rectangle")"
<img class="ds-content-card__image" src="@image.GetCropUrl("Content Card - Rectangle")"
alt="@image.Value("altText", fallback: Fallback.ToDefaultValue, defaultValue: @image.Name)" />
}
<div class="ds-p-sm">
Expand All @@ -135,7 +142,10 @@ else
{
<h2>@Model.Content.Value("title")</h2>
}
@Model.Content.Value("copy")
@if (@useCopy != "No" && Model.Content.Value("copy") != "")
{
@Model.Content.Value("copy")
}
</div>
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
</div>
}
}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<!-- Start submenu (level 2) -->
<li class="ds-mega-menu__sub-menu-item">
@if (content.SubsectionName != "")
{
{
<span class="ds-mega-menu__sub-menu-link">
@if (content.SubsectionIcon != "")
{
Expand All @@ -53,7 +53,7 @@
}
}
</span>
}

@if (links.Any()){
<!-- collapse button for mobile nav level 3 menu items -->
<button class="ds-mega-menu__collapse-toggle" aria-expanded="false" aria-label="Toggle @content.SubsectionName menu" aria-controls="ds-primary-menu-submenu-child-menu-@links.GetHashCode().ToString()">
Expand All @@ -67,15 +67,17 @@
<ul id="ds-primary-menu-submenu-child-menu-@links.GetHashCode().ToString()" class="ds-mega-menu__sub-menu-child-menu">
@if (links.Any())
{
@foreach (var link in links)
@foreach (var linkq in links)
{
<li class="ds-mega-menu__sub-menu-child-item">
<a href="@link.Url" target="@link.Target" class="ds-mega-menu__sub-menu-child-link">
@link.Name
<a href="@linkq.Url" target="@linkq.Target" class="ds-mega-menu__sub-menu-child-link">
@linkq.Name
</a>
</li>
}
}
</ul>

}
<!-- End submenu child (level 3) list -->
</li>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@if (link != null)
{
<a target="@link.Target" href="@link.Url">
<a class="ds-content-card ds-content-card--full-height ds-logo-card ds-p-sm" target="@link.Target" href="@link.Url">
@if (img != null)
{
<img class="ds-m-b-md" src="@img.MediaUrl()"
Expand All @@ -23,9 +23,11 @@
}
else
{
if (img != null)
<div class="ds-content-card ds-content-card--full-height ds-logo-card ds-p-sm">
@if (img != null)
{
<img class="ds-m-b-md" src="@img.MediaUrl()" alt="@img.Value("altText", fallback: Fallback.ToDefaultValue, defaultValue: @img.Name)" />
}
</div>
}
}
46 changes: 28 additions & 18 deletions Wmca.Web/Views/Partials/frontend/template/footer.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,19 @@

var colClass = "ds-col-lg-1-3";

@if (String.IsNullOrEmpty(col1Title)) // make half width if 1st col not available
{
colClass = "ds-col-lg-1-2";
}

@if (String.IsNullOrEmpty(col2Title)) // make half width if 2nd col not available
{
colClass = "ds-col-lg-1-2";
}

<footer>
<div class="ds-footer ds-footer--v2">
<div class="ds-container ds-grid">
<div class="ds-container">
@* Column 1 (this section requires a title - it has validation) *@
@if (!String.IsNullOrEmpty(col1Title))
{
Expand Down Expand Up @@ -87,18 +92,21 @@
@if (!String.IsNullOrEmpty(col2Title))
{
<section class="ds-col-1 @colClass">
<h2 class="ds-footer__heading ds-collapse-heading ds-h3"
aria-controls="footer-menu-col2"
aria-expanded="true">
@col2Title
<svg class="ds-collapse-heading__indicator">
<use xlink:href="#ds-general-chevron-right" href="#ds-general-chevron-right"></use>
</svg>
<h2 class="ds-hide-mobile ds-footer__heading ds-h3">@col2Title</h2>
<h2 class="ds-hide-desktop">
<button class="ds-col-1 ds-footer__heading ds-collapse-heading ds-h3" aria-controls="footer-menu-col2" aria-expanded="false">
@col2Title
<span class="ds-footer__collapse-button">
<svg class="ds-collapse-heading__indicator">
<use xlink:href="#ds-general-chevron-right" href="#ds-general-chevron-right"></use>
</svg>
</span>
</button>
</h2>

@if (col2Links.Any())
{
<ul class="ds-footer__menu ds-collapse-panel" id="footer-menu-col2">
<ul class="ds-footer__menu ds-collapse-panel ds-bare-list" id="footer-menu-col2">
@foreach (var col2Link in col2Links)
{
<li>
Expand All @@ -118,13 +126,16 @@
@if (!String.IsNullOrEmpty(col3Title))
{
@if(@dsSlug != "ciads"){
<h2 class="ds-footer__heading ds-collapse-heading ds-h3"
aria-controls="footer-menu-col3"
aria-expanded="true">
@col3Title
<svg class="ds-collapse-heading__indicator">
<use xlink:href="#ds-general-chevron-right" href="#ds-general-chevron-right"></use>
</svg>
<h2 class="ds-hide-mobile ds-footer__heading ds-h3">@col3Title</h2>
<h2 class="ds-hide-desktop">
<button class="ds-col-1 ds-footer__heading ds-collapse-heading ds-h3" aria-controls="footer-menu-col3" aria-expanded="false">
@col3Title
<span class="ds-footer__collapse-button">
<svg class="ds-collapse-heading__indicator">
<use xlink:href="#ds-general-chevron-right" href="#ds-general-chevron-right"></use>
</svg>
</span>
</button>
</h2>
}

Expand All @@ -148,7 +159,7 @@
}
if (col3Links.Any())
{
<ul class="ds-footer__menu ds-collapse-panel" id="footer-menu-col3">
<ul class="ds-footer__menu ds-collapse-panel ds-bare-list" id="footer-menu-col3">
@foreach (var col3Link in col3Links)
{
<li>
Expand Down Expand Up @@ -237,4 +248,3 @@
</div>
</footer>
}
@* this is a test *@
12 changes: 6 additions & 6 deletions Wmca.Web/Views/Partials/frontend/template/head.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@
@{
if (dsSlug == "wmcads")
{
<link rel="stylesheet" href="/css/ds/wmcads.min.css?v=1" />
<link rel="stylesheet" href="/css/ds/wmcads.min.css?v=2" />
}
else if (dsSlug == "stds")
{
<link rel="stylesheet" href="/css/ds/stds.min.css?v=1" />
<link rel="stylesheet" href="/css/custom/stds.custom.css?v=1" />
<link rel="stylesheet" href="/css/ds/stds.min.css?v=2" />
<link rel="stylesheet" href="/css/custom/stds.custom.css?v=2" />
}
else if (dsSlug == "mcds")
{
<link rel="stylesheet" href="/css/ds/mcds.min.css?v=1" />
<link rel="stylesheet" href="/css/custom/mcds.custom.css?v=1" />
<link rel="stylesheet" href="/css/custom/mcds.custom.css?v=2" />
}
else if (dsSlug == "ciads")
{
<link rel="stylesheet" href="/css/ds/ciads.min.css?v=1" />
<link rel="stylesheet" href="/css/custom/ciads.custom.css?v=1" />
<link rel="stylesheet" href="/css/ds/ciads.min.css?v=2" />
<link rel="stylesheet" href="/css/custom/ciads.custom.css?v=2" />
}
}

Expand Down
Loading

0 comments on commit 59c2a78

Please sign in to comment.