Skip to content

Commit e9e2769

Browse files
committed
Refactored durandal template.
1 parent 9e6ccfa commit e9e2769

File tree

5 files changed

+32
-45
lines changed

5 files changed

+32
-45
lines changed

Templates/All-In-One-Template/MySpaProject/MySpaProject.WebSpaDurandal/Views/Home/Index.cshtml renamed to Templates/All-In-One-Template/MySpaProject/MySpaProject.WebSpaDurandal/App/Main/shell.cshtml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717

1818
@Styles.Render("~/Bundles/App/vendor/css")
1919
@Styles.Render("~/Bundles/App/Main/css")
20+
21+
<script type="text/javascript">
22+
//This is used to get the application's root path from javascript. It's useful if you're running application in a virtual directory under IIS.
23+
var abp = abp || {}; abp.appPath = '@ApplicationPath';
24+
</script>
2025

2126
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
2227
<!--[if lt IE 9]>
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<system.webServer>
2929
<handlers>
3030
<remove name="BlockViewHandler"/>
31-
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
3231
</handlers>
3332
</system.webServer>
3433
</configuration>

Templates/All-In-One-Template/MySpaProject/MySpaProject.WebSpaDurandal/Controllers/HomeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class HomeController : MySpaProjectControllerBase
66
{
77
public ActionResult Index()
88
{
9-
return View();
9+
return View("~/App/Main/shell.cshtml"); //Layout of the durandal application.
1010
}
1111
}
1212
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
<Content Include="App\Main\main.less" />
268268
<Content Include="App\Main\views\layout.cshtml" />
269269
<Content Include="App\Main\views\home.cshtml" />
270-
<Content Include="App\Main\views\web.config" />
270+
<Content Include="App\Main\web.config" />
271271
<Content Include="App\Main\main.css.map">
272272
<DependentUpon>main.css</DependentUpon>
273273
</Content>
@@ -321,7 +321,7 @@
321321
<Content Include="Web.config" />
322322
<Content Include="Views\_ViewStart.cshtml" />
323323
<Content Include="Views\Shared\_Layout.cshtml" />
324-
<Content Include="Views\Home\Index.cshtml" />
324+
<Content Include="App\Main\shell.cshtml" />
325325
</ItemGroup>
326326
<ItemGroup>
327327
<Compile Include="App_Start\BundleConfig.cs" />
Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,68 @@
1-
@using MySpaProject.WebSpaDurandal.Views
1+
@*
2+
IMPORTANT NOTES FROM ASP.NET BOILERPLATE:
3+
4+
This _Layout.cshtml is not used actually. It's left here if you want to add some classic style (MPA)
5+
pages to your application.
6+
7+
See App/Main/shell.cshtml for Durandal application's layout page.
8+
*@
9+
210
<!DOCTYPE html>
311
<html lang="en">
412
<head>
5-
6-
<!-- Standard meta tags -->
713
<meta charset="utf-8">
814
<meta http-equiv="X-UA-Compatible" content="IE=edge">
915
<meta name="viewport" content="width=device-width, initial-scale=1">
1016
<meta name="description" content="">
1117
<meta name="author" content="">
1218

13-
<!-- favicon -->
14-
<link rel="shortcut icon" href="~/favicon.ico">
19+
<title>MySpaProject</title>
1520

16-
<!-- Site title -->
17-
<title>My ASP.NET Boilerplate Project!</title>
21+
<link rel="shortcut icon" href="~/favicon.ico">
1822

19-
<!-- Style for jQueryUI -->
2023
<link href="~/Content/themes/base/all.css" rel="stylesheet" />
21-
22-
<!-- Style for Bootstrap -->
2324
<link href="~/Content/bootstrap-cosmo.min.css" rel="stylesheet">
24-
25-
<!-- Style for Durandal -->
26-
<link href="~/Content/durandal.css" rel="stylesheet" />
27-
28-
<!-- Styles for jQuery plug-ins -->
2925
<link href="~/Content/toastr.min.css" rel="stylesheet" />
30-
31-
<!-- Country flags -->
3226
<link href="~/Content/flags/famfamfam-flags.css" rel="stylesheet" />
3327

28+
<script type="text/javascript">
29+
//This is used to get the application's root path from javascript. It's useful if you're running application in a virtual directory under IIS.
30+
var abp = abp || {}; abp.appPath = '@ApplicationPath';
31+
</script>
32+
3433
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
3534
<!--[if lt IE 9]>
3635
<script src="@Url.Content("~/Scripts/others/html5shiv.js")"></script>
3736
<script src="@Url.Content("~/Scripts/others/respond.min.js")"></script>
3837
<![endif]-->
3938

40-
@RenderSection("styles", required: false)
41-
42-
<!-- Windows Phone 8 and Internet Explorer 10 FIX -->
4339
<script src="~/Abp/Framework/scripts/utils/ie10fix.js"></script>
4440

45-
<!-- Modernizr: for feature detection (All other scripts are included at the end of file for faster page load) -->
4641
<script src="~/Scripts/modernizr-2.8.3.js"></script>
4742

48-
</head>
49-
50-
<body>
51-
52-
@RenderBody()
53-
54-
<!-- jQuery and plugins -->
5543
<script src="~/Scripts/json2.min.js"></script>
5644
<script src="~/Scripts/jquery-2.1.1.min.js"></script>
5745
<script src="~/Scripts/jquery-ui.min-1.11.1.js"></script>
58-
<script src="~/Scripts/jquery.validate.min.js"></script>
5946
<script src="~/Scripts/jquery.blockUI.min.js"></script>
6047
<script src="~/Scripts/toastr.min.js"></script>
6148
<script src="~/Scripts/others/spinjs/spin.js"></script>
6249
<script src="~/Scripts/others/spinjs/jquery.spin.js"></script>
6350

64-
<!-- Knockout -->
65-
<script src="~/Scripts/knockout-3.2.0.js"></script>
66-
<script src="~/Scripts/knockout.mapping-latest.js"></script>
67-
68-
<!-- Twitter Bootstrap -->
6951
<script src="~/Scripts/bootstrap.min.js"></script>
7052

71-
<!-- Abp framework scripts -->
7253
<script src="~/Abp/Framework/scripts/abp.js"></script>
7354
<script src="~/Abp/Framework/scripts/libs/abp.jquery.js"></script>
7455
<script src="~/Abp/Framework/scripts/libs/abp.toastr.js"></script>
7556
<script src="~/Abp/Framework/scripts/libs/abp.blockUI.js"></script>
7657
<script src="~/Abp/Framework/scripts/libs/abp.spin.js"></script>
7758

78-
<!-- Dynamic script for client side localization (It's created on runtime) -->
59+
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
60+
<script src="~/api/AbpServiceProxies/GetAll"></script>
7961
<script src="~/AbpLocalization/GetScripts" type="text/javascript"></script>
80-
81-
<!-- Custom scripts for views -->
82-
@RenderSection("scripts", required: false)
83-
62+
<script src="~/AbpAuthorization/GetScripts" type="text/javascript"></script>
63+
<script src="~/AbpNavigation/GetScripts" type="text/javascript"></script>
64+
</head>
65+
<body>
66+
@RenderBody()
8467
</body>
85-
</html>
68+
</html>

0 commit comments

Comments
 (0)