Browse Source

Merge branch 'alper/datetimepicker' into dev

pull/1955/head
Alper Ebicoglu 7 years ago
parent
commit
168440b871
  1. 43
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/BootstrapDatepicker/BootstrapDatepickerScriptContributor.cs
  2. 13
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/BootstrapDatepicker/BootstrapDatepickerStyleContributor.cs
  3. 3
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Bundling/SharedThemeGlobalScriptContributor.cs
  4. 3
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Bundling/SharedThemeGlobalStyleContributor.cs
  5. 3
      npm/packs/aspnetcore.mvc.ui.theme.shared/package.json
  6. 8
      npm/packs/bootstrap-datepicker/abp.resourcemapping.js
  7. 10
      npm/packs/bootstrap-datepicker/package.json

43
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/BootstrapDatepicker/BootstrapDatepickerScriptContributor.cs

@ -0,0 +1,43 @@
using System.Collections.Generic;
using System.Globalization;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Timeago
{
[DependsOn(typeof(JQueryScriptContributor))]
public class BootstrapDatepickerScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/bootstrap-datepicker/bootstrap-datepicker.min.js");
}
public override void ConfigureDynamicResources(BundleConfigurationContext context)
{
var cultureName = CultureInfo.CurrentUICulture.DateTimeFormat.Calendar.AlgorithmType ==
CalendarAlgorithmType.LunarCalendar
? "en"
: CultureInfo.CurrentUICulture.Name;
if (TryAddCultureFile(context, cultureName))
{
return;
}
}
protected virtual bool TryAddCultureFile(BundleConfigurationContext context, string cultureName)
{
var filePath = $"/libs/bootstrap-datepicker/locales/bootstrap-datepicker.{cultureName}.js";
if (!context.FileProvider.GetFileInfo(filePath).Exists)
{
return false;
}
context.Files.AddIfNotContains(filePath);
return true;
}
}
}

13
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/BootstrapDatepicker/BootstrapDatepickerStyleContributor.cs

@ -0,0 +1,13 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Select2
{
public class BootstrapDatepickerStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/bootstrap-datepicker/bootstrap-datepicker.min.css");
}
}
}

3
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Bundling/SharedThemeGlobalScriptContributor.cs

@ -27,7 +27,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling
typeof(ToastrScriptBundleContributor),
typeof(MalihuCustomScrollbarPluginScriptBundleContributor),
typeof(LuxonScriptContributor),
typeof(TimeagoScriptContributor)
typeof(TimeagoScriptContributor),
typeof(BootstrapDatepickerScriptContributor)
)]
public class SharedThemeGlobalScriptContributor : BundleContributor
{

3
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/Bundling/SharedThemeGlobalStyleContributor.cs

@ -17,7 +17,8 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling
typeof(ToastrStyleBundleContributor),
typeof(Select2StyleContributor),
typeof(MalihuCustomScrollbarPluginStyleBundleContributor),
typeof(DatatablesNetBs4StyleContributor)
typeof(DatatablesNetBs4StyleContributor),
typeof(BootstrapDatepickerStyleContributor)
)]
public class SharedThemeGlobalStyleContributor : BundleContributor
{

3
npm/packs/aspnetcore.mvc.ui.theme.shared/package.json

@ -17,7 +17,8 @@
"@abp/select2": "^0.9.0",
"@abp/sweetalert": "^0.9.0",
"@abp/timeago": "^0.9.0",
"@abp/toastr": "^0.9.0"
"@abp/toastr": "^0.9.0",
"@abp/bootstrap-datepicker": "^0.9.0"
},
"gitHead": "4d6791834b7723d8ad78ba4d23ae3425f170fdeb"
}

8
npm/packs/bootstrap-datepicker/abp.resourcemapping.js

@ -0,0 +1,8 @@
module.exports = {
mappings: {
"@node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js": "@libs/bootstrap-datepicker/",
"@node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css": "@libs/bootstrap-datepicker/",
"@node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css.map": "@libs/bootstrap-datepicker/",
"@node_modules/bootstrap-datepicker/dist/locales/*.*": "@libs/bootstrap-datepicker/locales/"
}
}

10
npm/packs/bootstrap-datepicker/package.json

@ -0,0 +1,10 @@
{
"version": "0.9.0",
"name": "@abp/bootstrap-datepicker",
"publishConfig": {
"access": "public"
},
"dependencies": {
"bootstrap-datepicker": "^1.9.0"
}
}
Loading…
Cancel
Save