Skip to content

Commit

Permalink
Theme Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
murst committed Jul 25, 2017
1 parent d5704ef commit a146424
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/Blogifier.Core/Common/AppSettingsLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,28 @@ public void LoadFromConfigFile(IConfiguration config)
if (section["AdminTheme"] != null)
ApplicationSettings.AdminTheme = section.GetValue<string>("AdminTheme");

var adminThemeSettings = section.GetSection("AdminThemeSettings");
if(adminThemeSettings != null)
{
foreach(var child in adminThemeSettings.GetChildren())
{
ApplicationSettings.AdminThemeSettings.Add(child.Key, child.Value);
}
}

if (section["BlogTheme"] != null)
ApplicationSettings.BlogTheme = section.GetValue<string>("BlogTheme");

// applicatin settings
var blogThemeSettings = section.GetSection("BlogThemeSettings");
if(blogThemeSettings != null)
{
foreach(var child in blogThemeSettings.GetChildren())
{
ApplicationSettings.BlogThemeSettings.Add(child.Key, child.Value);
}
}

// applicatin settings
if (section["Title"] != null)
ApplicationSettings.Title = section.GetValue<string>("Title");

Expand Down
2 changes: 2 additions & 0 deletions src/Blogifier.Core/Common/ApplicationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public class ApplicationSettings
public static int ItemsPerPage { get; set; } = 10;

public static string AdminTheme { get; set; } = "Standard";
public static System.Collections.Generic.IDictionary<string, string> AdminThemeSettings { get; set; } = new System.Collections.Generic.Dictionary<string, string>();
public static string BlogTheme { get; set; } = "Standard";
public static System.Collections.Generic.IDictionary<string, string> BlogThemeSettings { get; set; } = new System.Collections.Generic.Dictionary<string, string>();
public static string ProfileAvatar { get; set; } = "/embedded/lib/img/avatar.jpg";
public static string ProfileLogo { get; set; } = "/embedded/lib/img/logo.png";
public static string ProfileImage { get; set; } = "/embedded/lib/img/cover.png";
Expand Down

0 comments on commit a146424

Please sign in to comment.