Skip to content

Commit 4ce8766

Browse files
committed
Merge branch 'bsb-theme'
2 parents 563050d + 21db2ae commit 4ce8766

File tree

1,692 files changed

+207852
-88197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,692 files changed

+207852
-88197
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Threading.Tasks;
2+
using Abp.Authorization;
3+
using Abp.Runtime.Session;
4+
using AbpCompanyName.AbpProjectName.Configuration.Dto;
5+
6+
namespace AbpCompanyName.AbpProjectName.Configuration
7+
{
8+
[AbpAuthorize]
9+
public class ConfigurationAppService : AbpProjectNameAppServiceBase, IConfigurationAppService
10+
{
11+
public async Task ChangeUiTheme(ChangeUiThemeInput input)
12+
{
13+
await SettingManager.ChangeSettingForUserAsync(AbpSession.ToUserIdentifier(), AppSettingNames.UiTheme, input.Theme);
14+
}
15+
}
16+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace AbpCompanyName.AbpProjectName.Configuration.Dto
4+
{
5+
public class ChangeUiThemeInput
6+
{
7+
[Required]
8+
[MaxLength(32)]
9+
public string Theme { get; set; }
10+
}
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Threading.Tasks;
2+
using AbpCompanyName.AbpProjectName.Configuration.Dto;
3+
4+
namespace AbpCompanyName.AbpProjectName.Configuration
5+
{
6+
public interface IConfigurationAppService
7+
{
8+
Task ChangeUiTheme(ChangeUiThemeInput input);
9+
}
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace AbpCompanyName.AbpProjectName.Configuration.Ui
2+
{
3+
public class UiThemeInfo
4+
{
5+
public string Name { get; }
6+
public string CssClass { get; }
7+
8+
public UiThemeInfo(string name, string cssClass)
9+
{
10+
Name = name;
11+
CssClass = cssClass;
12+
}
13+
}
14+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Collections.Generic;
2+
3+
namespace AbpCompanyName.AbpProjectName.Configuration.Ui
4+
{
5+
public static class UiThemes
6+
{
7+
public static List<UiThemeInfo> All { get; }
8+
9+
static UiThemes()
10+
{
11+
All = new List<UiThemeInfo>
12+
{
13+
new UiThemeInfo("Red", "red"),
14+
new UiThemeInfo("Pink", "pink"),
15+
new UiThemeInfo("Purple", "purple"),
16+
new UiThemeInfo("Deep Purple", "deep-purple"),
17+
new UiThemeInfo("Indigo", "indigo"),
18+
new UiThemeInfo("Blue", "blue"),
19+
new UiThemeInfo("Light Blue", "light-blue"),
20+
new UiThemeInfo("Cyan", "cyan"),
21+
new UiThemeInfo("Teal", "teal"),
22+
new UiThemeInfo("Green", "green"),
23+
new UiThemeInfo("Light Green", "light-green"),
24+
new UiThemeInfo("Lime", "lime"),
25+
new UiThemeInfo("Yellow", "yellow"),
26+
new UiThemeInfo("Amber", "amber"),
27+
new UiThemeInfo("Orange", "orange"),
28+
new UiThemeInfo("Deep Orange", "deep-orange"),
29+
new UiThemeInfo("Brown", "brown"),
30+
new UiThemeInfo("Grey", "grey"),
31+
new UiThemeInfo("Blue Grey", "blue-grey"),
32+
new UiThemeInfo("Black", "black")
33+
};
34+
}
35+
}
36+
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/AbpProjectNameCoreModule.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using AbpCompanyName.AbpProjectName.MultiTenancy;
88
using AbpCompanyName.AbpProjectName.Authorization.Roles;
99
using AbpCompanyName.AbpProjectName.Authorization.Users;
10+
using AbpCompanyName.AbpProjectName.Configuration;
1011
using AbpCompanyName.AbpProjectName.Timing;
1112

1213
namespace AbpCompanyName.AbpProjectName
@@ -30,6 +31,8 @@ public override void PreInitialize()
3031

3132
//Configure roles
3233
AppRoleConfig.Configure(Configuration.Modules.Zero().RoleManagement);
34+
35+
Configuration.Settings.Providers.Add<AppSettingProvider>();
3336
}
3437

3538
public override void Initialize()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace AbpCompanyName.AbpProjectName.Configuration
2+
{
3+
public static class AppSettingNames
4+
{
5+
public const string UiTheme = "App.UiTheme";
6+
}
7+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Collections.Generic;
2+
using Abp.Configuration;
3+
4+
namespace AbpCompanyName.AbpProjectName.Configuration
5+
{
6+
public class AppSettingProvider : SettingProvider
7+
{
8+
public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
9+
{
10+
return new[]
11+
{
12+
new SettingDefinition(AppSettingNames.UiTheme, "red", scopes: SettingScopes.Application | SettingScopes.Tenant | SettingScopes.User, isVisibleToClients: true),
13+
};
14+
}
15+
}
16+
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Localization/SourceFiles/AbpProjectName-tr.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,11 @@
6161
<text name="NotSelected">Seçilmemiş</text>
6262
<text name="Change">Değiştir</text>
6363
<text name="ChangeTenant">Müşteri değiştir</text>
64+
65+
<text name="MultiLevelMenu" value="Çok Seviyeli Menü" />
66+
<text name="Back" value="Geri" />
67+
<text name="SuccessfullyRegistered" value="Başarıyla kayıt olundu" />
68+
<text name="WaitingForEmailActivation" value="E-posta adresiniz etkinleştirilmeli." />
69+
6470
</texts>
6571
</localizationDictionary>

aspnet-core/src/AbpCompanyName.AbpProjectName.Core/Localization/SourceFiles/AbpProjectName.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,11 @@
6161
<text name="NotSelected">Not selected</text>
6262
<text name="Change">Change</text>
6363
<text name="ChangeTenant">Change tenant</text>
64+
65+
<text name="MultiLevelMenu" value="Multi Level Menu" />
66+
<text name="Back" value="Back" />
67+
<text name="SuccessfullyRegistered" value="Successfully registered" />
68+
<text name="WaitingForEmailActivation" value="Your email address should be activated" />
69+
6470
</texts>
6571
</localizationDictionary>

0 commit comments

Comments
 (0)