Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
getBlup committed May 10, 2022
1 parent 7274f61 commit c5dadee
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions bs3/_Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
var scrubSvc = GetService<IScrub>();

var parts = CreateInstance("./shared/_Parts.cshtml");
var page = GetService<IPageService>(); // Service to set titles etc. on the page
var pageSvc = GetService<IPageService>(); // Service to set titles etc. on the page
var article = AsList(Data).FirstOrDefault();
var filteredCategory = Request.QueryString["category"];
var categoryParams = Text.Has(filteredCategory)
Expand All @@ -24,8 +24,8 @@
return;
}

page.AddMeta("description", scrubSvc.All(article.Teaser));
page.SetTitle(article.Date.ToString("d") + " - " + article.Title);
pageSvc.AddMeta("description", scrubSvc.All(article.Teaser));
pageSvc.SetTitle(article.Date.ToString("d") + " - " + article.Title);
}

<div class="app-news5 app-news5-detail" @Edit.TagToolbar(article)>
Expand Down
10 changes: 5 additions & 5 deletions bs3/shared/_Assets.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
@{
// 1. Get Services for Css and Page
var pageCss = GetService<Connect.Koi.ICss>(); // Service to get CSS information about the current Theme
var page = GetService<IPageService>(); // Service to set titles etc. on the page
var pageSvc = GetService<IPageService>(); // Service to set titles etc. on the page
// 2. Include Bootstrap4 if the framework isn't known
if (pageCss.IsUnknown) {
page.Activate("Bootstrap4");
pageSvc.Activate("Bootstrap4");
}

// 3. Show warning for admin if koi.json is missing
Expand All @@ -19,13 +19,13 @@
}

// 4. Include styles of the App
<link rel="stylesheet" href="@App.Path/bs3/dist/styles.min.css" @(page.AssetAttributes()) />
<link rel="stylesheet" href="@App.Path/bs3/dist/styles.min.css" @pageSvc.AssetAttributes() />

// 5. If we need scripts (only on the single-album-view) activate these. Note that DynamicModel contains the parameters
if(DynamicModel.scripts == true) {
// Activate turnOn and Fancybox4 - see https://r.2sxc.org/turnon - fancybox4 is a standard WebResources in 2sxc
page.Activate("turnOn", "fancybox4");
<script type="text/javascript" src="@App.Path/bs3/dist/scripts.min.js" @(page.AssetAttributes(position:"bottom"))></script>
pageSvc.Activate("turnOn", "fancybox4");
<script type="text/javascript" src="@App.Path/bs3/dist/scripts.min.js" @pageSvc.AssetAttributes(position:"bottom")></script>
<turnOn turn-on='{"await": ["window.appNews5"], "run": "window.appNews5.activateFancybox()", "data": { "groupId": "@CmsContext.Module.Id" }}'></turnOn>
}
}
10 changes: 5 additions & 5 deletions bs4/_Assets.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
@{
// 1. Get Services for Css and Page
var pageCss = GetService<Connect.Koi.ICss>(); // Service to get CSS information about the current Theme
var page = GetService<IPageService>(); // Service to set titles etc. on the page
var pageSvc = GetService<IPageService>(); // Service to set titles etc. on the page
// 2. Include Bootstrap4 if the framework isn't known
if (pageCss.IsUnknown) {
page.Activate("Bootstrap4");
pageSvc.Activate("Bootstrap4");
}

// 3. Show warning for admin if koi.json is missing
Expand All @@ -19,13 +19,13 @@
}

// 4. Include styles of the App
<link rel="stylesheet" href="@App.Path/bs4/dist/styles.min.css" @(page.AssetAttributes())/>
<link rel="stylesheet" href="@App.Path/bs4/dist/styles.min.css" @pageSvc.AssetAttributes()/>

// 5. If we need scripts (only on the single-album-view) activate these. Note that DynamicModel contains the parameters
if(DynamicModel.scripts == true) {
// Activate turnOn and Fancybox4 - see https://r.2sxc.org/turnon - fancybox4 is a standard WebResources in 2sxc
page.Activate("turnOn", "fancybox4");
<script type="text/javascript" src="@App.Path/bs4/dist/scripts.min.js" @(page.AssetAttributes(position:"bottom"))></script>
pageSvc.Activate("turnOn", "fancybox4");
<script type="text/javascript" src="@App.Path/bs4/dist/scripts.min.js" @pageSvc.AssetAttributes(position:"bottom")></script>
<turnOn turn-on='{"await": ["window.appNews5"], "run": "window.appNews5.activateFancybox()", "data": { "groupId": "@CmsContext.Module.Id" }}'></turnOn>
}
}
8 changes: 4 additions & 4 deletions bs4/_Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var detailsCode = CreateInstance("Details.cs");

// Get the PageServices HTTP error headers
var page = GetService<IPageService>();
var pageSvc = GetService<IPageService>();

var article = AsList(Data).FirstOrDefault();
var render = GetService<IRenderService>();
Expand All @@ -25,14 +25,14 @@

@* Show "Back to list" button *@
@detailsCode.BackToListButton()
page.SetHttpStatus(404);
pageSvc.SetHttpStatus(404);
return;
}

var displayCategories = App.Settings.ActivateCategories && (article.Categories as Dynlist).Any();
var imageField = Text.Has(article.Image) ? article.Field("Image") : Resources.PlaceholderMissingImage;
page.AddMeta("description", scrubSvc.All(article.Teaser));
page.SetTitle(article.Date.ToString("d") + " - " + article.Title);
pageSvc.AddMeta("description", scrubSvc.All(article.Teaser));
pageSvc.SetTitle(article.Date.ToString("d") + " - " + article.Title);
}

<div class="app-news5 app-news5-detail" @Edit.TagToolbar(article, toolbar: new [] {"-layout", "%delete&show=true"})>
Expand Down
10 changes: 5 additions & 5 deletions bs5/_Assets.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
@{
// 1. Get Services for Css and Page
var pageCss = GetService<Connect.Koi.ICss>(); // Service to get CSS information about the current Theme
var page = GetService<IPageService>(); // Service to set titles etc. on the page
var pageSvc = GetService<IPageService>(); // Service to set titles etc. on the page
// 2. Include Bootstrap4 if the framework isn't known
if (pageCss.IsUnknown) {
page.Activate("Bootstrap4");
pageSvc.Activate("Bootstrap4");
}

// 3. Show warning for admin if koi.json is missing
Expand All @@ -19,13 +19,13 @@
}

// 4. Include styles of the App
<link rel="stylesheet" href="@App.Path/bs5/dist/styles.min.css" @(page.AssetAttributes())/>
<link rel="stylesheet" href="@App.Path/bs5/dist/styles.min.css" @pageSvc.AssetAttributes()/>

// 5. If we need scripts (only on the single-album-view) activate these. Note that DynamicModel contains the parameters
if(DynamicModel.scripts == true) {
// Activate turnOn and Fancybox4 - see https://r.2sxc.org/turnon - fancybox4 is a standard WebResources in 2sxc
page.Activate("turnOn", "fancybox4");
<script type="text/javascript" src="@App.Path/bs5/dist/scripts.min.js" @(page.AssetAttributes(position:"bottom"))></script>
pageSvc.Activate("turnOn", "fancybox4");
<script type="text/javascript" src="@App.Path/bs5/dist/scripts.min.js" @pageSvc.AssetAttributes(position:"bottom")></script>
<turnOn turn-on='{"await": ["window.appNews5"], "run": "window.appNews5.activateFancybox()", "data": { "groupId": "@CmsContext.Module.Id" }}'></turnOn>
}
}
8 changes: 4 additions & 4 deletions bs5/_Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var detailsCode = CreateInstance("Details.cs");

// Get the PageServices HTTP error headers
var page = GetService<IPageService>();
var pageSvc = GetService<IPageService>();

var article = AsList(Data).FirstOrDefault();
var render = GetService<IRenderService>();
Expand All @@ -25,14 +25,14 @@

@* Show "Back to list" button *@
@detailsCode.BackToListButton()
page.SetHttpStatus(404);
pageSvc.SetHttpStatus(404);
return;
}

var displayCategories = App.Settings.ActivateCategories && (article.Categories as Dynlist).Any();
var imageField = Text.Has(article.Image) ? article.Field("Image") : Resources.PlaceholderMissingImage;
page.AddMeta("description", scrubSvc.All(article.Teaser));
page.SetTitle(article.Date.ToString("d") + " - " + article.Title);
pageSvc.AddMeta("description", scrubSvc.All(article.Teaser));
pageSvc.SetTitle(article.Date.ToString("d") + " - " + article.Title);
}

<div class="app-news5 app-news5-detail" @Edit.TagToolbar(article, toolbar: new [] {"-layout", "%delete&show=true"})>
Expand Down

0 comments on commit c5dadee

Please sign in to comment.