Skip to content

Commit 2b60cd8

Browse files
committed
Bundling applied for MPA template and added font-awesome.
1 parent ed662da commit 2b60cd8

26 files changed

+2370
-62
lines changed

Templates/All-In-One-Template/MySpaProject/MySpaProject.Application/MySpaProject.Application.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
</ItemGroup>
7070
<ItemGroup>
7171
<Compile Include="MySpaProjectApplicationModule.cs" />
72+
<Compile Include="MySpaProjectApplicationServiceBase.cs" />
7273
<Compile Include="Properties\AssemblyInfo.cs" />
7374
</ItemGroup>
7475
<ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Abp.Application.Services;
2+
3+
namespace MySpaProject
4+
{
5+
/// <summary>
6+
/// Derive your application services from this class.
7+
/// </summary>
8+
public abstract class MySpaProjectApplicationServiceBase : ApplicationService
9+
{
10+
protected MySpaProjectApplicationServiceBase()
11+
{
12+
LocalizationSourceName = MySpaProjectConsts.LocalizationSourceName;
13+
}
14+
}
15+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
using System.Web.Optimization;
2+
3+
namespace MySpaProject.WebMpa
4+
{
5+
public static class BundleConfig
6+
{
7+
public static void RegisterBundles(BundleCollection bundles)
8+
{
9+
bundles.IgnoreList.Clear();
10+
11+
//VENDOR RESOURCES
12+
13+
//~/Bundles/vendor/css
14+
bundles.Add(
15+
new StyleBundle("~/Bundles/vendor/css")
16+
.Include(
17+
"~/Content/themes/base/all.css",
18+
"~/Content/bootstrap-cosmo.min.css",
19+
"~/Content/toastr.min.css",
20+
"~/Content/flags/famfamfam-flags.css",
21+
"~/Content/font-awesome.min.css"
22+
)
23+
);
24+
25+
//~/Bundles/vendor/js/top (These scripts should be included in the head of the page)
26+
bundles.Add(
27+
new ScriptBundle("~/Bundles/vendor/js/top")
28+
.Include(
29+
"~/Abp/Framework/scripts/utils/ie10fix.js",
30+
"~/Scripts/modernizr-2.8.3.js"
31+
)
32+
);
33+
34+
//~/Bundles/vendor/bottom (Included in the bottom for fast page load)
35+
bundles.Add(
36+
new ScriptBundle("~/Bundles/vendor/js/bottom")
37+
.Include(
38+
"~/Scripts/json2.min.js",
39+
40+
"~/Scripts/jquery-2.1.1.min.js",
41+
"~/Scripts/jquery-ui.min-1.11.1.js",
42+
43+
"~/Scripts/bootstrap.min.js",
44+
45+
"~/Scripts/jquery.validate.min.js",
46+
"~/Scripts/jquery.blockUI.min.js",
47+
"~/Scripts/toastr.min.js",
48+
"~/Scripts/others/spinjs/spin.js",
49+
"~/Scripts/others/spinjs/jquery.spin.js",
50+
51+
"~/Abp/Framework/scripts/abp.js",
52+
"~/Abp/Framework/scripts/libs/abp.jquery.js",
53+
"~/Abp/Framework/scripts/libs/abp.toastr.js",
54+
"~/Abp/Framework/scripts/libs/abp.blockUI.js",
55+
"~/Abp/Framework/scripts/libs/abp.spin.js"
56+
)
57+
);
58+
59+
//APPLICATION RESOURCES
60+
61+
//~/Bundles/css
62+
bundles.Add(
63+
new StyleBundle("~/Bundles/css")
64+
.Include("~/css/main.css")
65+
);
66+
67+
//~/Bundles/js
68+
bundles.Add(
69+
new ScriptBundle("~/Bundles/js")
70+
.Include("~/js/main.js")
71+
);
72+
}
73+
}
74+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using Abp.Application.Navigation;
2+
using Abp.Localization;
3+
4+
namespace MySpaProject.WebMpa
5+
{
6+
/// <summary>
7+
/// This class defines menus for the application.
8+
/// It uses ABP's menu system.
9+
/// When you add menu items here, they are automatically appear in angular application.
10+
/// See .cshtml and .js files under App/Main/views/layout/header to know how to render menu.
11+
/// </summary>
12+
public class MySpaProjectNavigationProvider : INavigationProvider
13+
{
14+
public void SetNavigation(INavigationProviderContext context)
15+
{
16+
context.Manager.MainMenu
17+
.AddItem(
18+
new MenuItemDefinition(
19+
"Home",
20+
new LocalizableString("HomePage", MySpaProjectConsts.LocalizationSourceName),
21+
url: "#/",
22+
icon: "fa fa-home"
23+
)
24+
).AddItem(
25+
new MenuItemDefinition(
26+
"About",
27+
new LocalizableString("About", MySpaProjectConsts.LocalizationSourceName),
28+
url: "#/about",
29+
icon: "fa fa-info"
30+
)
31+
);
32+
}
33+
}
34+
}

Templates/All-In-One-Template/MySpaProject/MySpaProject.WebMpa/App_Start/MySpaProjectWebModule.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Reflection;
22
using System.Web;
33
using System.Web.Mvc;
4+
using System.Web.Optimization;
45
using System.Web.Routing;
56
using Abp.Localization;
67
using Abp.Localization.Sources.Xml;
@@ -13,8 +14,12 @@ public class MySpaProjectWebModule : AbpModule
1314
{
1415
public override void PreInitialize()
1516
{
17+
//Add/remove languages for your application
1618
Configuration.Localization.Languages.Add(new LanguageInfo("en", "English", "famfamfam-flag-england", true));
1719
Configuration.Localization.Languages.Add(new LanguageInfo("tr", "Türkçe", "famfamfam-flag-tr"));
20+
21+
//Configure navigation/menu
22+
Configuration.Navigation.Providers.Add<MySpaProjectNavigationProvider>();
1823
}
1924

2025
public override void Initialize()
@@ -23,13 +28,14 @@ public override void Initialize()
2328

2429
Configuration.Localization.Sources.Add(
2530
new XmlLocalizationSource(
26-
"MySpaProject",
31+
MySpaProjectConsts.LocalizationSourceName,
2732
HttpContext.Current.Server.MapPath("~/Localization/MySpaProject")
2833
)
2934
);
3035

3136
AreaRegistration.RegisterAllAreas();
3237
RouteConfig.RegisterRoutes(RouteTable.Routes);
38+
BundleConfig.RegisterBundles(BundleTable.Bundles);
3339
}
3440
}
3541
}

0 commit comments

Comments
 (0)