-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set default for seo settings * Don't use tree yet
- Loading branch information
1 parent
b3a2da9
commit 6308cc1
Showing
13 changed files
with
115 additions
and
36 deletions.
There are no files selected for viewing
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
8 changes: 8 additions & 0 deletions
8
src/SeoToolkit.Umbraco.Common.Core/Models/Config/GlobalAppSettingsModel.cs
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,8 @@ | ||
namespace SeoToolkit.Umbraco.Common.Core.Models.Config | ||
{ | ||
public class GlobalAppSettingsModel | ||
{ | ||
public bool AutomaticSitemapsInRobotsTxt { get; set; } = true; | ||
public bool EnableSeoSettingsByDefault { get; set; } = false; // TODO: Change this in a major version to true; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/SeoToolkit.Umbraco.Common.Core/Models/Config/GlobalConfig.cs
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,8 @@ | ||
namespace SeoToolkit.Umbraco.Common.Core.Models.Config | ||
{ | ||
public class GlobalConfig | ||
{ | ||
public bool AutomaticSitemapsInRobotsTxt { get; set; } | ||
public bool EnableSeoSettingsByDefault { get; set; } | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
src/SeoToolkit.Umbraco.Common.Core/Services/SettingsService/GlobalConfigService.cs
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,26 @@ | ||
using Microsoft.Extensions.Options; | ||
using SeoToolkit.Umbraco.Common.Core.Models.Config; | ||
using System; | ||
|
||
namespace SeoToolkit.Umbraco.Common.Core.Services.SettingsService | ||
{ | ||
public class GlobalConfigService : DefaultAppSettingsService<GlobalConfig> | ||
{ | ||
private readonly IOptionsMonitor<GlobalAppSettingsModel> _config; | ||
|
||
public GlobalConfigService(IOptionsMonitor<GlobalAppSettingsModel> config) | ||
{ | ||
_config = config; | ||
} | ||
|
||
public override GlobalConfig GetSettings() | ||
{ | ||
var settings = _config.CurrentValue; | ||
return new GlobalConfig | ||
{ | ||
AutomaticSitemapsInRobotsTxt = settings.AutomaticSitemapsInRobotsTxt, | ||
EnableSeoSettingsByDefault = settings.EnableSeoSettingsByDefault | ||
}; | ||
} | ||
} | ||
} |
This file was deleted.
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
42 changes: 42 additions & 0 deletions
42
src/SeoToolkit.Umbraco.MetaFields.Core/Controllers/MetaFieldsTreeController.cs
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,42 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Umbraco.Cms.Core; | ||
using Umbraco.Cms.Core.Events; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Trees; | ||
using Umbraco.Cms.Web.BackOffice.Trees; | ||
using Umbraco.Cms.Web.Common.Attributes; | ||
|
||
namespace SeoToolkit.Umbraco.MetaFields.Core.Controllers | ||
{ | ||
/*[Tree("SeoToolkit", "MetaFields", TreeTitle = "MetaFields", TreeGroup = "SeoToolkit", SortOrder = 5)] | ||
[PluginController("SeoToolkit")] | ||
public class MetaFieldsTreeController : TreeController | ||
{ | ||
public MetaFieldsTreeController(ILocalizedTextService localizedTextService, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, IEventAggregator eventAggregator) : base(localizedTextService, umbracoApiControllerTypeCollection, eventAggregator) | ||
{ | ||
} | ||
protected override ActionResult<TreeNode> CreateRootNode(FormCollection queryStrings) | ||
{ | ||
var root = base.CreateRootNode(queryStrings); | ||
root.Value.Icon = "icon-trafic"; | ||
root.Value.HasChildren = false; | ||
root.Value.RoutePath = $"{SectionAlias}/{TreeAlias}/settings"; | ||
root.Value.MenuUrl = null; | ||
return root.Value; | ||
} | ||
protected override ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings) | ||
{ | ||
return null; | ||
} | ||
protected override ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings) | ||
{ | ||
return null; | ||
} | ||
}*/ | ||
} |
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
8 changes: 8 additions & 0 deletions
8
src/SeoToolkit.Umbraco.MetaFields/wwwroot/backoffice/MetaFields/settings.controller.js
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,8 @@ | ||
(function () { | ||
|
||
function globalSettingsController() { | ||
var vm = this; | ||
} | ||
|
||
angular.module("umbraco").controller("SeoToolkit.MetaFields.GlobalSettingsController", globalSettingsController); | ||
})(); |
3 changes: 3 additions & 0 deletions
3
src/SeoToolkit.Umbraco.MetaFields/wwwroot/backoffice/MetaFields/settings.html
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 @@ | ||
<div ng-controller="SeoToolkit.MetaFields.GlobalSettingsController as vm"> | ||
Hello | ||
</div> |