Skip to content

Commit 07f9a61

Browse files
committed
mvc ui style and script referencing simplified
1 parent a6f3129 commit 07f9a61

File tree

6 files changed

+231
-162
lines changed

6 files changed

+231
-162
lines changed
Lines changed: 4 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
@using System.Globalization
2-
@using Abp.Configuration.Startup
1+
@using Abp.Configuration.Startup
32
@using Abp.Web.Security.AntiForgery
43
@using AbpCompanyName.AbpProjectName
54
@using AbpCompanyName.AbpProjectName.Web.Resources
6-
@inject AbpCompanyName.AbpProjectName.Timing.AppTimes AppTimes
75
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
86
@inject IWebResourceManager WebResourceManager
97
@inject ILanguageManager LanguageManager
@@ -24,24 +22,7 @@
2422

2523
<title>@pageTitle</title>
2624

27-
<link rel="shortcut icon" href="~/img/favicon.ico">
28-
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
29-
30-
<environment names="Development">
31-
<link href="~/libs/font-awesome/css/all.css" rel="stylesheet" asp-append-version="true" />
32-
<link href="~/libs-ext/famfamfam-flags/dist/sprite/famfamfam-flags.min.css" rel="stylesheet" asp-append-version="true" />
33-
<link href="~/libs/icheck-bootstrap/icheck-bootstrap.css" rel="stylesheet" asp-append-version="true" />
34-
<link href="~/libs/toastr/toastr.css" rel="stylesheet" asp-append-version="true" />
35-
<link href="~/libs/animate.css/animate.css" rel="stylesheet" asp-append-version="true" />
36-
<link href="~/libs/admin-lte/dist/css/adminlte.css" rel="stylesheet" asp-append-version="true" />
37-
<link href="~/css/style.css" rel="stylesheet" asp-append-version="true" />
38-
<link href="~/view-resources/Views/Account/_Layout.css" rel="stylesheet" asp-append-version="true" />
39-
</environment>
40-
41-
<environment names="Staging,Production">
42-
<link rel="stylesheet" href="~/view-resources/Views/_Bundles/account-layout.min.css" asp-append-version="true" />
43-
</environment>
44-
25+
@await Html.PartialAsync("_Styles.cshtml")
4526
@RenderSection("styles", required: false)
4627
</head>
4728
<body class="hold-transition login-page">
@@ -69,52 +50,8 @@
6950
</div>
7051
</div>
7152
</div>
72-
<script type="text/javascript">
73-
// This is used to get the application's root path from javascript.
74-
// It's useful if you're running application in a virtual directory under IIS.
75-
var abp = abp || {};
76-
abp.appPath = '@ApplicationPath';
77-
</script>
78-
<environment names="Development">
79-
<script src="~/libs/jquery/jquery.js" asp-append-version="true"></script>
80-
<script src="~/libs/bootstrap/dist/js/bootstrap.bundle.js" asp-append-version="true"></script>
81-
<script src="~/libs/admin-lte/dist/js/adminlte.js" asp-append-version="true"></script>
82-
<script src="~/libs/jquery-validate/jquery.validate.js" asp-append-version="true"></script>
83-
<script src="~/libs/jquery-validate/jquery.validate.unobtrusive.js" asp-append-version="true"></script>
84-
<script src="~/libs/toastr/toastr.min.js" asp-append-version="true"></script>
85-
<script src="~/libs/block-ui/jquery.blockUI.js" asp-append-version="true"></script>
86-
<script src="~/libs/spin/spin.js" asp-append-version="true"></script>
87-
<script src="~/libs-ext/spin/jquery.spin.js" asp-append-version="true"></script>
88-
<script src="~/libs/sweetalert/sweetalert.min.js" asp-append-version="true"></script>
89-
<script src="~/libs/moment/moment-with-locales.js" asp-append-version="true"></script>
90-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/abp.js" asp-append-version="true"></script>
91-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js" asp-append-version="true"></script>
92-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js" asp-append-version="true"></script>
93-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js" asp-append-version="true"></script>
94-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js" asp-append-version="true"></script>
95-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js" asp-append-version="true"></script>
96-
<script src="~/js/main.js" asp-append-version="true"></script>
97-
</environment>
98-
99-
<environment names="Staging,Production">
100-
<script src="~/view-resources/Views/_Bundles/account-layout.min.js" asp-append-version="true"></script>
101-
</environment>
102-
103-
@if (CultureInfo.CurrentUICulture.Name != "en")
104-
{
105-
<script src="~/libs/jquery-validate/localization/[email protected](CultureInfo.CurrentUICulture.Name.Replace("-", "_") + ".js")" asp-append-version="true"></script>
106-
}
107-
108-
<script type="text/javascript">
109-
// Localizing momentjs
110-
moment.locale('@CultureInfo.CurrentUICulture.Name');
111-
</script>
112-
113-
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
114-
<script src="~/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
115-
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
116-
117-
@WebResourceManager.RenderScripts()
53+
@await Html.PartialAsync("_Scripts.cshtml")
11854
@RenderSection("scripts", required: false)
55+
@WebResourceManager.RenderScripts()
11956
</body>
12057
</html>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
@using System.Globalization
2+
@inject AbpCompanyName.AbpProjectName.Timing.AppTimes AppTimes
3+
4+
<script type="text/javascript">
5+
// This is used to get the application's root path from javascript.
6+
// It's useful if you're running application in a virtual directory under IIS.
7+
var abp = abp || {};
8+
abp.appPath = '@ApplicationPath';
9+
</script>
10+
11+
<environment names="Development">
12+
@*core scripts start*@
13+
<script src="~/libs/jquery/jquery.js" asp-append-version="true"></script>
14+
@*core scripts end*@
15+
16+
@*admin-lte scripts start*@
17+
<script src="~/libs/bootstrap/dist/js/bootstrap.bundle.js" asp-append-version="true"></script>
18+
<script src="~/libs/admin-lte/dist/js/adminlte.js" asp-append-version="true"></script>
19+
@*admin-lte scripts end*@
20+
21+
@*abp scripts start*@
22+
<script src="~/libs/block-ui/jquery.blockUI.js" asp-append-version="true"></script>
23+
<script src="~/libs/spin/spin.js" asp-append-version="true"></script>
24+
<script src="~/libs-ext/spin/jquery.spin.js" asp-append-version="true"></script>
25+
<script src="~/libs/sweetalert/sweetalert.min.js" asp-append-version="true"></script>
26+
<script src="~/libs/toastr/toastr.min.js" asp-append-version="true"></script>
27+
<script src="~/libs/moment/moment-with-locales.js" asp-append-version="true"></script>
28+
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/abp.js" asp-append-version="true"></script>
29+
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js" asp-append-version="true"></script>
30+
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js" asp-append-version="true"></script>
31+
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js" asp-append-version="true"></script>
32+
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js" asp-append-version="true"></script>
33+
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js" asp-append-version="true"></script>
34+
@*abp scripts end*@
35+
36+
@*other scripts start*@
37+
<script src="~/libs/jquery-validate/jquery.validate.js" asp-append-version="true"></script>
38+
<script src="~/libs/jquery-validate/jquery.validate.unobtrusive.js" asp-append-version="true"></script>
39+
@*other scripts end*@
40+
41+
@*custom scripts start*@
42+
<script src="~/js/main.js" asp-append-version="true"></script>
43+
@*custom scripts end*@
44+
</environment>
45+
46+
<environment names="Staging,Production">
47+
<script src="~/view-resources/Views/_Bundles/account-layout.min.js" asp-append-version="true"></script>
48+
</environment>
49+
50+
@if (CultureInfo.CurrentUICulture.Name != "en")
51+
{
52+
var normalizedCurrentUICultureName = CultureInfo.CurrentUICulture.Name.Replace("-", "_");
53+
var localizationFileNameWithExtension = "messages_";
54+
switch (normalizedCurrentUICultureName)
55+
{
56+
case "zh_Hans":
57+
localizationFileNameWithExtension += "zh";
58+
break;
59+
case "es_MX":
60+
localizationFileNameWithExtension += "es";
61+
break;
62+
default:
63+
localizationFileNameWithExtension += normalizedCurrentUICultureName;
64+
break;
65+
}
66+
localizationFileNameWithExtension += ".min.js";
67+
<script src="~/libs/jquery-validate/localization/@localizationFileNameWithExtension" asp-append-version="true"></script>
68+
}
69+
70+
<script type="text/javascript">
71+
// Localizing momentjs
72+
moment.locale('@CultureInfo.CurrentUICulture.Name');
73+
</script>
74+
75+
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
76+
<script src="~/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
77+
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<link rel="shortcut icon" href="~/img/favicon.ico">
2+
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
3+
4+
<environment names="Development">
5+
@*admin-lte styles start*@
6+
<link href="~/libs/font-awesome/css/all.min.css" rel="stylesheet" asp-append-version="true" />
7+
<link href="~/libs/icheck-bootstrap/icheck-bootstrap.css" rel="stylesheet" asp-append-version="true" />
8+
<link href="~/libs/admin-lte/dist/css/adminlte.min.css" rel="stylesheet" asp-append-version="true" />
9+
@*admin-lte styles end*@
10+
11+
@*abp styles start*@
12+
<link href="~/libs/toastr/toastr.css" rel="stylesheet" asp-append-version="true" />
13+
<link href="~/libs-ext/famfamfam-flags/dist/sprite/famfamfam-flags.min.css" rel="stylesheet" asp-append-version="true" />
14+
@*abp styles end*@
15+
16+
@*other styles start*@
17+
<link href="~/libs/animate.css/animate.css" rel="stylesheet" asp-append-version="true" />
18+
@*other styles end*@
19+
20+
@*custom styles start*@
21+
<link href="~/view-resources/Views/Account/_Layout.css" rel="stylesheet" asp-append-version="true" />
22+
<link href="~/css/style.css" rel="stylesheet" asp-append-version="true" />
23+
@*custom styles end*@
24+
</environment>
25+
26+
<environment names="Staging,Production">
27+
<link rel="stylesheet" href="~/view-resources/Views/_Bundles/account-layout.min.css" asp-append-version="true" />
28+
</environment>
Lines changed: 4 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
@using System.Globalization
2-
@using Abp.Configuration.Startup
1+
@using Abp.Configuration.Startup
32
@using Abp.Web.Mvc.Alerts
43
@using Abp.Web.Security.AntiForgery
54
@using AbpCompanyName.AbpProjectName.Web.Resources
6-
@inject AbpCompanyName.AbpProjectName.Timing.AppTimes AppTimes
75
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
86
@inject IMultiTenancyConfig MultiTenancyConfig
97
@inject IWebResourceManager WebResourceManager
@@ -24,27 +22,7 @@
2422

2523
<title>@pageTitle</title>
2624

27-
<link rel="shortcut icon" href="~/img/favicon.ico">
28-
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
29-
30-
<environment names="Development">
31-
<link href="~/libs/font-awesome/css/all.min.css" rel="stylesheet" asp-append-version="true" />
32-
<link href="~/libs-ext/famfamfam-flags/dist/sprite/famfamfam-flags.min.css" rel="stylesheet" asp-append-version="true" />
33-
<link href="~/libs/animate.css/animate.css" rel="stylesheet" asp-append-version="true" />
34-
<link href="~/libs/icheck-bootstrap/icheck-bootstrap.css" rel="stylesheet" asp-append-version="true" />
35-
<link href="~/libs/toastr/toastr.css" rel="stylesheet" asp-append-version="true" />
36-
<link href="~/libs/admin-lte/dist/css/adminlte.min.css" rel="stylesheet" asp-append-version="true" />
37-
<link href="~/libs/datatables/css/dataTables.bootstrap4.min.css" rel="stylesheet" asp-append-version="true" />
38-
<link href="~/libs/datatables/css/responsive.bootstrap4.min.css" rel="stylesheet" asp-append-version="true" />
39-
<link href="~/libs/datatables/css/buttons.bootstrap4.min.css" rel="stylesheet" asp-append-version="true" />
40-
<link href="~/css/style.css" rel="stylesheet" asp-append-version="true" />
41-
<link href="~/view-resources/Views/Shared/_Layout.css" rel="stylesheet" asp-append-version="true" />
42-
</environment>
43-
44-
<environment names="Staging,Production">
45-
<link href="~/view-resources/Views/_Bundles/shared-layout.min.css" rel="stylesheet" asp-append-version="true" />
46-
</environment>
47-
25+
@await Html.PartialAsync("_Styles.cshtml")
4826
@RenderSection("styles", required: false)
4927
</head>
5028
<body class="hold-transition sidebar-mini">
@@ -57,78 +35,9 @@
5735
</div>
5836
@await Html.PartialAsync("_Footer.cshtml")
5937
</div>
60-
<script type="text/javascript">
61-
// This is used to get the application's root path from javascript.
62-
// It's useful if you're running application in a virtual directory under IIS.
63-
var abp = abp || {};
64-
abp.appPath = '@ApplicationPath';
65-
</script>
66-
<environment names="Development">
67-
<script src="~/libs/jquery/jquery.js" asp-append-version="true"></script>
68-
<script src="~/libs/bootstrap/dist/js/bootstrap.bundle.js" asp-append-version="true"></script>
69-
<script src="~/libs/admin-lte/dist/js/adminlte.js" asp-append-version="true"></script>
70-
<script src="~/libs/jquery-validate/jquery.validate.js" asp-append-version="true"></script>
71-
<script src="~/libs/jquery-validate/jquery.validate.unobtrusive.js" asp-append-version="true"></script>
72-
<script src="~/libs/block-ui/jquery.blockUI.js" asp-append-version="true"></script>
73-
<script src="~/libs/spin/spin.js" asp-append-version="true"></script>
74-
<script src="~/libs-ext/spin/jquery.spin.js" asp-append-version="true"></script>
75-
<script src="~/libs/sweetalert/sweetalert.min.js" asp-append-version="true"></script>
76-
<script src="~/libs/toastr/toastr.min.js" asp-append-version="true"></script>
77-
<script src="~/libs/push.js/push.js" asp-append-version="true"></script>
78-
<script src="~/libs/moment/moment-with-locales.js" asp-append-version="true"></script>
79-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/abp.js" asp-append-version="true"></script>
80-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js" asp-append-version="true"></script>
81-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js" asp-append-version="true"></script>
82-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js" asp-append-version="true"></script>
83-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js" asp-append-version="true"></script>
84-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js" asp-append-version="true"></script>
85-
<script src="~/libs/datatables/js/jquery.dataTables.min.js" asp-append-version="true"></script>
86-
<script src="~/libs/datatables/js/dataTables.bootstrap4.min.js" asp-append-version="true"></script>
87-
<script src="~/libs/datatables/js/dataTables.responsive.min.js" asp-append-version="true"></script>
88-
<script src="~/libs/datatables/js/responsive.bootstrap4.min.js" asp-append-version="true"></script>
89-
<script src="~/libs/datatables/js/dataTables.buttons.js" asp-append-version="true"></script>
90-
<script src="~/libs/datatables/js/buttons.bootstrap4.js" asp-append-version="true"></script>
91-
<script src="~/js/abp.dataTable.js" asp-append-version="true"></script>
92-
<script src="~/js/main.js" asp-append-version="true"></script>
93-
</environment>
94-
95-
<environment names="Staging,Production">
96-
<script src="~/view-resources/Views/_Bundles/shared-layout.min.js" asp-append-version="true"></script>
97-
</environment>
98-
99-
@if (CultureInfo.CurrentUICulture.Name != "en")
100-
{
101-
var normalizedCurrentUICultureName = CultureInfo.CurrentUICulture.Name.Replace("-", "_");
102-
var localizationFileNameWithExtension = "messages_";
103-
switch (normalizedCurrentUICultureName)
104-
{
105-
case "zh_Hans":
106-
localizationFileNameWithExtension += "zh";
107-
break;
108-
case "es_MX":
109-
localizationFileNameWithExtension += "es";
110-
break;
111-
default:
112-
localizationFileNameWithExtension += normalizedCurrentUICultureName;
113-
break;
114-
}
115-
localizationFileNameWithExtension += ".min.js";
116-
<script src="~/libs/jquery-validate/localization/@localizationFileNameWithExtension" asp-append-version="true"></script>
117-
}
11838

119-
<script type="text/javascript">
120-
// Localizing momentjs
121-
moment.locale('@CultureInfo.CurrentUICulture.Name');
122-
</script>
123-
124-
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
125-
<script src="~/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
126-
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
127-
128-
<script src="~/libs/signalr/dist/browser/signalr.js" asp-append-version="true"></script>
129-
<script src="~/libs/abp-web-resources/Abp/Framework/scripts/libs/abp.signalr-client.js" asp-append-version="true"></script>
130-
131-
@WebResourceManager.RenderScripts()
39+
@await Html.PartialAsync("_Scripts.cshtml")
13240
@RenderSection("scripts", required: false)
41+
@WebResourceManager.RenderScripts()
13342
</body>
13443
</html>

0 commit comments

Comments
 (0)