Merge pull request #2837 from sbwalker/dev
ability to specify if a theme is enabled for a site
This commit is contained in:
@ -16,6 +16,14 @@ namespace Oqtane.Services
|
||||
/// <returns></returns>
|
||||
Task<List<Theme>> GetThemesAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Returns a specific thenme
|
||||
/// </summary>
|
||||
/// <param name="themeId"></param>
|
||||
/// <param name="siteId"></param>
|
||||
/// <returns></returns>
|
||||
Task<Theme> GetThemeAsync(int themeId, int siteId);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of <see cref="ThemeControl"/>s from the given themes
|
||||
/// </summary>
|
||||
@ -39,6 +47,13 @@ namespace Oqtane.Services
|
||||
/// <returns></returns>
|
||||
List<ThemeControl> GetContainerControls(List<Theme> themes, string themeName);
|
||||
|
||||
/// <summary>
|
||||
/// Updates a existing theem
|
||||
/// </summary>
|
||||
/// <param name="theme"></param>
|
||||
/// <returns></returns>
|
||||
Task UpdateThemeAsync(Theme theme);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a theme
|
||||
/// </summary>
|
||||
|
@ -20,6 +20,10 @@ namespace Oqtane.Services
|
||||
List<Theme> themes = await GetJsonAsync<List<Theme>>(ApiUrl);
|
||||
return themes.OrderBy(item => item.Name).ToList();
|
||||
}
|
||||
public async Task<Theme> GetThemeAsync(int themeId, int siteId)
|
||||
{
|
||||
return await GetJsonAsync<Theme>($"{ApiUrl}/{themeId}?siteid={siteId}");
|
||||
}
|
||||
|
||||
public List<ThemeControl> GetThemeControls(List<Theme> themes)
|
||||
{
|
||||
@ -38,6 +42,11 @@ namespace Oqtane.Services
|
||||
.SelectMany(item => item.Containers).ToList();
|
||||
}
|
||||
|
||||
public async Task UpdateThemeAsync(Theme theme)
|
||||
{
|
||||
await PutJsonAsync($"{ApiUrl}/{theme.ThemeId}", theme);
|
||||
}
|
||||
|
||||
public async Task DeleteThemeAsync(string themeName)
|
||||
{
|
||||
await DeleteAsync($"{ApiUrl}/{themeName}");
|
||||
|
Reference in New Issue
Block a user