Explorar o código

Projektdateien hinzufügen.

Arne Diekmann %!s(int64=4) %!d(string=hai) anos
achega
52e80a4c70
Modificáronse 100 ficheiros con 8767 adicións e 0 borrados
  1. 25 0
      .dockerignore
  2. 63 0
      .gitattributes
  3. 340 0
      .gitignore
  4. 11 0
      GreenTree.Maschinenbestellungen.Core/DependencyInjection/ISingletonObject.cs
  5. 39 0
      GreenTree.Maschinenbestellungen.Core/Domain/Rights/Policy.cs
  6. 54 0
      GreenTree.Maschinenbestellungen.Core/Domain/Rights/User.cs
  7. 24 0
      GreenTree.Maschinenbestellungen.Core/Domain/Rights/UserPolicy.cs
  8. 38 0
      GreenTree.Maschinenbestellungen.Core/Domain/Shared/TrackedEntity.cs
  9. 36 0
      GreenTree.Maschinenbestellungen.Core/Extension/DecimalExtension.cs
  10. 20 0
      GreenTree.Maschinenbestellungen.Core/Extension/GuidExtension.cs
  11. 25 0
      GreenTree.Maschinenbestellungen.Core/Extension/StringExtension.cs
  12. 22 0
      GreenTree.Maschinenbestellungen.Core/Extension/TypeExtension.cs
  13. 11 0
      GreenTree.Maschinenbestellungen.Core/GreenTree.Maschinenbestellungen.Core.csproj
  14. 16 0
      GreenTree.Maschinenbestellungen.Core/Helper/IUserHelper.cs
  15. 36 0
      GreenTree.Maschinenbestellungen.Core/Helper/UserHelper.cs
  16. 44 0
      GreenTree.Maschinenbestellungen.Domain/Extension/DbSetExtension.cs
  17. 62 0
      GreenTree.Maschinenbestellungen.Domain/GreenTree.Maschinenbestellungen.Domain.csproj
  18. 79 0
      GreenTree.Maschinenbestellungen.Domain/Model/OrderDbContext.cs
  19. 19 0
      GreenTree.Maschinenbestellungen.Domain/Model/Rights/PolicyMapping.cs
  20. 45 0
      GreenTree.Maschinenbestellungen.Domain/Model/Rights/UserMapping.cs
  21. 22 0
      GreenTree.Maschinenbestellungen.Domain/Model/Rights/UserPolicyMapping.cs
  22. 31 0
      GreenTree.Maschinenbestellungen.Domain/Model/Shared/TrackedEntityMapping.cs
  23. BIN=BIN
      GreenTree.Maschinenbestellungen.Domain/_MySqlWorkbenchModels/Migration_BusinessModel.mwb
  24. 138 0
      GreenTree.Maschinenbestellungen.Services/Authentication/DbContextAuthenticationService.cs
  25. 33 0
      GreenTree.Maschinenbestellungen.Services/Authentication/IAuthenticationService.cs
  26. 22 0
      GreenTree.Maschinenbestellungen.Services/Authorization/AdministrationOptions.cs
  27. 68 0
      GreenTree.Maschinenbestellungen.Services/Authorization/CookieAuthorizationService.cs
  28. 102 0
      GreenTree.Maschinenbestellungen.Services/Authorization/DefaultAuthorizationHandler.cs
  29. 41 0
      GreenTree.Maschinenbestellungen.Services/Authorization/DefaultAuthorizationPolicy.cs
  30. 31 0
      GreenTree.Maschinenbestellungen.Services/Authorization/IAuthorizationService.cs
  31. 110 0
      GreenTree.Maschinenbestellungen.Services/Extension/ConfigurationExtension.cs
  32. 20 0
      GreenTree.Maschinenbestellungen.Services/Extension/GuidExtension.cs
  33. 19 0
      GreenTree.Maschinenbestellungen.Services/Geolocator/GoogleApiOptions.cs
  34. 104 0
      GreenTree.Maschinenbestellungen.Services/Geolocator/GoogleGeocodingService.cs
  35. 22 0
      GreenTree.Maschinenbestellungen.Services/Geolocator/IGeocodingService.cs
  36. 28 0
      GreenTree.Maschinenbestellungen.Services/GreenTree.Maschinenbestellungen.Services.csproj
  37. 21 0
      GreenTree.Maschinenbestellungen.Services/Localization/CultureOptions.cs
  38. 26 0
      GreenTree.Maschinenbestellungen.Services/Notification/INotificationService.cs
  39. 39 0
      GreenTree.Maschinenbestellungen.Services/Notification/MailNotificationOptions.cs
  40. 109 0
      GreenTree.Maschinenbestellungen.Services/Notification/MailNotificationService.cs
  41. 12 0
      GreenTree.Maschinenbestellungen.Web/.config/dotnet-tools.json
  42. 24 0
      GreenTree.Maschinenbestellungen.Web/Configuration/DefaultOptionMonitoringService.cs
  43. 11 0
      GreenTree.Maschinenbestellungen.Web/Configuration/IOptionMonitoringService.cs
  44. 107 0
      GreenTree.Maschinenbestellungen.Web/Controllers/AccountController.cs
  45. 45 0
      GreenTree.Maschinenbestellungen.Web/Controllers/HomeController.cs
  46. 177 0
      GreenTree.Maschinenbestellungen.Web/Controllers/RightsController.cs
  47. 21 0
      GreenTree.Maschinenbestellungen.Web/Dockerfile
  48. 486 0
      GreenTree.Maschinenbestellungen.Web/Extension/HtmlContentExtension.cs
  49. 50 0
      GreenTree.Maschinenbestellungen.Web/Extension/ViewDataExtension.cs
  50. 36 0
      GreenTree.Maschinenbestellungen.Web/GreenTree.Maschinenbestellungen.Web.csproj
  51. 116 0
      GreenTree.Maschinenbestellungen.Web/Helper/ImportHelper.cs
  52. 43 0
      GreenTree.Maschinenbestellungen.Web/ImportMaps/CustomerMap.cs
  53. 33 0
      GreenTree.Maschinenbestellungen.Web/Models/Account/LoginModel.cs
  54. 11 0
      GreenTree.Maschinenbestellungen.Web/Models/ErrorViewModel.cs
  55. 102 0
      GreenTree.Maschinenbestellungen.Web/Models/Rights/User/UserModel.cs
  56. 20 0
      GreenTree.Maschinenbestellungen.Web/Models/Shared/ISearchResult.cs
  57. 43 0
      GreenTree.Maschinenbestellungen.Web/Models/Shared/SearchModel.cs
  58. 65 0
      GreenTree.Maschinenbestellungen.Web/Models/Shared/TrackingModel.cs
  59. 26 0
      GreenTree.Maschinenbestellungen.Web/Program.cs
  60. 34 0
      GreenTree.Maschinenbestellungen.Web/Properties/launchSettings.json
  61. 228 0
      GreenTree.Maschinenbestellungen.Web/Startup.cs
  62. 104 0
      GreenTree.Maschinenbestellungen.Web/Validators/LoginValidator.cs
  63. 63 0
      GreenTree.Maschinenbestellungen.Web/Validators/UserValidator.cs
  64. 30 0
      GreenTree.Maschinenbestellungen.Web/Views/Account/Login.cshtml
  65. 8 0
      GreenTree.Maschinenbestellungen.Web/Views/Home/Index.cshtml
  66. 66 0
      GreenTree.Maschinenbestellungen.Web/Views/Rights/User/Create.cshtml
  67. 66 0
      GreenTree.Maschinenbestellungen.Web/Views/Rights/User/Details.cshtml
  68. 64 0
      GreenTree.Maschinenbestellungen.Web/Views/Rights/User/Edit.cshtml
  69. 164 0
      GreenTree.Maschinenbestellungen.Web/Views/Rights/User/Index.cshtml
  70. 25 0
      GreenTree.Maschinenbestellungen.Web/Views/Shared/Error.cshtml
  71. 76 0
      GreenTree.Maschinenbestellungen.Web/Views/Shared/_Empty.cshtml
  72. 159 0
      GreenTree.Maschinenbestellungen.Web/Views/Shared/_Layout.cshtml
  73. 5 0
      GreenTree.Maschinenbestellungen.Web/Views/Shared/_TokenBoxLibPartial.cshtml
  74. 2 0
      GreenTree.Maschinenbestellungen.Web/Views/Shared/_ValidationScriptsPartial.cshtml
  75. 7 0
      GreenTree.Maschinenbestellungen.Web/Views/_ViewImports.cshtml
  76. 3 0
      GreenTree.Maschinenbestellungen.Web/Views/_ViewStart.cshtml
  77. 9 0
      GreenTree.Maschinenbestellungen.Web/appsettings.Development.json
  78. 37 0
      GreenTree.Maschinenbestellungen.Web/appsettings.json
  79. 48 0
      GreenTree.Maschinenbestellungen.Web/libman.json
  80. 49 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/css/simple-sidebar.css
  81. 183 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/css/site.css
  82. BIN=BIN
      GreenTree.Maschinenbestellungen.Web/wwwroot/favicon.ico
  83. BIN=BIN
      GreenTree.Maschinenbestellungen.Web/wwwroot/img/icon-average-48.png
  84. BIN=BIN
      GreenTree.Maschinenbestellungen.Web/wwwroot/img/icon-sigma-48.png
  85. BIN=BIN
      GreenTree.Maschinenbestellungen.Web/wwwroot/img/strohrmann_logo.png
  86. BIN=BIN
      GreenTree.Maschinenbestellungen.Web/wwwroot/img/user_logo.png
  87. 72 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/js/extension.js
  88. 17 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/js/site.js
  89. 460 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/css/bootstrap-select.css
  90. 0 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/css/bootstrap-select.css.map
  91. 5 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/css/bootstrap-select.min.css
  92. 3248 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/bootstrap-select.js
  93. 0 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/bootstrap-select.js.map
  94. 7 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/bootstrap-select.min.js
  95. 0 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/bootstrap-select.min.js.map
  96. 46 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-am_ET.js
  97. 0 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-am_ET.js.map
  98. 8 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-am_ET.min.js
  99. 51 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-ar_AR.js
  100. 0 0
      GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-ar_AR.js.map

+ 25 - 0
.dockerignore

@@ -0,0 +1,25 @@
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/azds.yaml
+**/bin
+**/charts
+**/docker-compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md

+ 63 - 0
.gitattributes

@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs     diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following 
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln       merge=binary
+#*.csproj    merge=binary
+#*.vbproj    merge=binary
+#*.vcxproj   merge=binary
+#*.vcproj    merge=binary
+#*.dbproj    merge=binary
+#*.fsproj    merge=binary
+#*.lsproj    merge=binary
+#*.wixproj   merge=binary
+#*.modelproj merge=binary
+#*.sqlproj   merge=binary
+#*.wwaproj   merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg   binary
+#*.png   binary
+#*.gif   binary
+
+###############################################################################
+# diff behavior for common document formats
+# 
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the 
+# entries below.
+###############################################################################
+#*.doc   diff=astextplain
+#*.DOC   diff=astextplain
+#*.docx  diff=astextplain
+#*.DOCX  diff=astextplain
+#*.dot   diff=astextplain
+#*.DOT   diff=astextplain
+#*.pdf   diff=astextplain
+#*.PDF   diff=astextplain
+#*.rtf   diff=astextplain
+#*.RTF   diff=astextplain

+ 340 - 0
.gitignore

@@ -0,0 +1,340 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- Backup*.rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb

+ 11 - 0
GreenTree.Maschinenbestellungen.Core/DependencyInjection/ISingletonObject.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.DependencyInjection
+{
+    public interface ISingletonObject
+    {
+
+    }
+}

+ 39 - 0
GreenTree.Maschinenbestellungen.Core/Domain/Rights/Policy.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Domain.Rights
+{
+    public class Policy
+    {
+        #region Properties
+
+        /// <summary>
+        /// The policy name
+        /// </summary>
+        public string Name { get; set; }
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the Policy class
+        /// </summary>
+        public Policy()
+        {
+
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the Policy class
+        /// </summary>
+        /// <param name="name">The policy name.</param>
+        public Policy(string name)
+        {
+            Name = name;
+        }
+
+        #endregion
+    }
+}

+ 54 - 0
GreenTree.Maschinenbestellungen.Core/Domain/Rights/User.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Domain.Rights
+{
+    public class User
+    {
+        /// <summary>
+        /// User Id
+        /// </summary>
+        public int Id { get; set; }
+
+        /// <summary>
+        /// User accountname
+        /// </summary>
+        public string Accountname { get; set; }
+
+        /// <summary>
+        /// User forename
+        /// </summary>
+        public string Forename { get; set; }
+
+        /// <summary>
+        /// User lastname
+        /// </summary>
+        public string Lastname { get; set; }
+
+        /// <summary>
+        /// User mail address
+        /// </summary>
+        public string MailAddress { get; set; }
+
+        /// <summary>
+        /// User password (encrypted)
+        /// </summary>
+        public string Password { get; set; }
+
+        /// <summary>
+        /// User birthdate
+        /// </summary>
+        public DateTime? Birthdate { get; set; }
+
+        /// <summary>
+        /// User activation status
+        /// </summary>
+        public bool? Activated { get; set; }
+
+        /// <summary>
+        /// User policies
+        /// </summary>
+        public virtual ICollection<UserPolicy> Policies { get; set; }
+    }
+}

+ 24 - 0
GreenTree.Maschinenbestellungen.Core/Domain/Rights/UserPolicy.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Domain.Rights
+{
+    public class UserPolicy
+    {
+        /// <summary>
+        /// Policy name
+        /// </summary>
+        public string PolicyName { get; set; }
+
+        /// <summary>
+        /// Role Id
+        /// </summary>
+        public int UserId { get; set; }
+
+        /// <summary>
+        /// Role
+        /// </summary>
+        public virtual User User { get; set; }
+    }
+}

+ 38 - 0
GreenTree.Maschinenbestellungen.Core/Domain/Shared/TrackedEntity.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Domain.Shared
+{
+    public class TrackedEntity
+    {
+        #region Properties
+
+        /// <summary>
+        /// Tracked creation user
+        /// </summary>
+        public string CreatedBy { get; set; }
+
+        /// <summary>
+        /// Tracked creation datetime
+        /// </summary>
+        public DateTime CreatedOn { get; set; }
+
+        /// <summary>
+        /// Tracked changed user
+        /// </summary>
+        public string ChangedBy { get; set; }
+
+        /// <summary>
+        /// Tracked changed datetime
+        /// </summary>
+        public DateTime? ChangedOn { get; set; }
+
+        /// <summary>
+        /// Status of creation mode (created or imported)
+        /// </summary>
+        public string CreationStatus { get; set; }
+
+        #endregion
+    }
+}

+ 36 - 0
GreenTree.Maschinenbestellungen.Core/Extension/DecimalExtension.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Extension
+{
+    public static class DecimalExtension
+    {
+        /// <summary>
+        /// Trims trailing zeros of decimal
+        /// </summary>
+        /// <param name="value">The value.</param>
+        /// <returns>The same number without trailing zero decimal places.</returns>
+        public static decimal TrimEnd(this decimal value)
+        {
+            var decimalSplit = value.ToString(CultureInfo.InvariantCulture.NumberFormat).Split('.');
+
+            if (decimalSplit.Length == 1)
+                return value;
+
+            var onlyZero = true;
+
+            for (int i = 0; i < decimalSplit[1].Length; i++)
+            {
+                if (decimalSplit[1][i] != '0')
+                {
+                    onlyZero = false;
+                    break;
+                }
+            }
+
+            return onlyZero ? Convert.ToDecimal(decimalSplit[0]) : value;
+        }
+    }
+}

+ 20 - 0
GreenTree.Maschinenbestellungen.Core/Extension/GuidExtension.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Core.Extension
+{
+    public static class GuidExtension
+    {
+        /// <summary>
+        /// Converts the GUID to a short version
+        /// </summary>
+        /// <param name="guid">The GUID object.</param>
+        /// <returns>The first part until the first hyphen of the regular GUID.</returns>
+        public static string ToShortString(this Guid guid)
+        {
+            return guid.ToString().Split('-')[0];
+        }
+    }
+}

+ 25 - 0
GreenTree.Maschinenbestellungen.Core/Extension/StringExtension.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Extension
+{
+    public static class StringExtension
+    {
+        /// <summary>
+        /// Évaluates a string between a starting and an endling string part
+        /// </summary>
+        /// <param name="str">Base string.</param>
+        /// <param name="start">Beginning string part.</param>
+        /// <param name="end">Ending string part.</param>
+        public static string Between(this string str, string start, string end)
+        {
+            var startIndex = str.IndexOf(start) + start.Length;
+            var endIndex = str.IndexOf(end, startIndex);
+
+            return end == String.Empty 
+                ? str.Substring(startIndex) 
+                : str[startIndex..endIndex];
+        }
+    }
+}

+ 22 - 0
GreenTree.Maschinenbestellungen.Core/Extension/TypeExtension.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Extension
+{
+    public static class TypeExtension
+    {
+        /// <summary>
+        /// Gets the default value of the given type
+        /// </summary>
+        /// <param name="type">The type.</param>
+        /// <returns>Default value of value type or NULL for reference type.</returns>
+        public static object GetDefaultValue(this Type type)
+        {
+            if (type.IsValueType && Nullable.GetUnderlyingType(type) == null)
+                return Activator.CreateInstance(type);
+
+            return null;
+        }
+    }
+}

+ 11 - 0
GreenTree.Maschinenbestellungen.Core/GreenTree.Maschinenbestellungen.Core.csproj

@@ -0,0 +1,11 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Folder Include="Domain\Business\" />
+  </ItemGroup>
+
+</Project>

+ 16 - 0
GreenTree.Maschinenbestellungen.Core/Helper/IUserHelper.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Helper
+{
+    public interface IUserHelper
+    {
+        /// <summary>
+        /// Generates a MD5 hash from a string
+        /// </summary>
+        /// <param name="str">The string to encrypt.</param>
+        /// <param name="lowerCase">Return hashed string in lower case.</param>
+        public string HashString(string str, bool lowerCase);
+    }
+}

+ 36 - 0
GreenTree.Maschinenbestellungen.Core/Helper/UserHelper.cs

@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Core.Helper
+{
+    public class UserHelper : IUserHelper
+    {
+        /// <summary>
+        /// Generates a MD5 hash from a string
+        /// </summary>
+        /// <param name="str">The string to encrypt.</param>
+        /// <param name="lowerCase">Return hashed string in lower case.</param>
+        public string HashString(string str, bool lowerCase)
+        {
+            if (String.IsNullOrEmpty(str))
+                throw new ArgumentNullException("str", "An empty string cannot be encrypted.");
+
+            // Byte array representation of that string
+            var encodedStr = new UTF8Encoding().GetBytes(str);
+
+            // Need MD5 to calculate the hash
+            var hash = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(encodedStr);
+
+            // String representation (similar to UNIX format)
+            var hashedStr = BitConverter.ToString(hash)
+               .Replace("-", string.Empty)
+               .ToLower();
+
+            return lowerCase
+                ? hashedStr.ToLower()
+                : hashedStr;
+        }
+    }
+}

+ 44 - 0
GreenTree.Maschinenbestellungen.Domain/Extension/DbSetExtension.cs

@@ -0,0 +1,44 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Domain.Extension
+{
+    public static class DbSetExtension
+    {
+        /// <summary>
+        /// Removes a sequence of entities from a specific DbSet filtered by a predicate
+        /// </summary>
+        /// <typeparam name="TEntity">Entity type.</typeparam>
+        /// <param name="dbSet">Database DbSet.</param>
+        /// <param name="expression">Filter expression.</param>
+        public static void RemoveWhere<TEntity>(this DbSet<TEntity> dbSet, Expression<Func<TEntity, bool>> expression)
+            where TEntity : class
+        {
+            var entities = dbSet
+                .Where(expression);
+
+            dbSet.RemoveRange(entities);
+        }
+
+        /// <summary>
+        /// Removes a sequence of entities from a specific DbSet filtered by a predicate and inserts a set of new entities for them
+        /// </summary>
+        /// <typeparam name="TEntity">Entity type.</typeparam>
+        /// <param name="dbSet">Database DbSet.</param>
+        /// <param name="expression">Filter expression.</param>
+        /// <param name="newEntities">New entities.</param>
+        public static void ReplaceWhere<TEntity>(this DbSet<TEntity> dbSet, Expression<Func<TEntity, bool>> expression,
+            IEnumerable<TEntity> newEntities)
+            where TEntity : class
+        {
+            RemoveWhere(dbSet, expression);
+
+            dbSet.AddRange(newEntities);
+        }
+    }
+}

+ 62 - 0
GreenTree.Maschinenbestellungen.Domain/GreenTree.Maschinenbestellungen.Domain.csproj

@@ -0,0 +1,62 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Compile Remove="Migrations\20200614195012_InitialCreate.cs" />
+    <Compile Remove="Migrations\20200614195012_InitialCreate.Designer.cs" />
+    <Compile Remove="Migrations\20200615110555_UserActivation.cs" />
+    <Compile Remove="Migrations\20200615110555_UserActivation.Designer.cs" />
+    <Compile Remove="Migrations\20200721115022_Calculation.cs" />
+    <Compile Remove="Migrations\20200721115022_Calculation.Designer.cs" />
+    <Compile Remove="Migrations\20200721125217_Titles.cs" />
+    <Compile Remove="Migrations\20200721125217_Titles.Designer.cs" />
+    <Compile Remove="Migrations\20200721125659_Titles.cs" />
+    <Compile Remove="Migrations\20200721125659_Titles.Designer.cs" />
+    <Compile Remove="Migrations\20200721130734_Titles.cs" />
+    <Compile Remove="Migrations\20200721130734_Titles.Designer.cs" />
+    <Compile Remove="Migrations\20200721130913_Titles.cs" />
+    <Compile Remove="Migrations\20200721130913_Titles.Designer.cs" />
+    <Compile Remove="Migrations\20200721131229_Titles.cs" />
+    <Compile Remove="Migrations\20200721131229_Titles.Designer.cs" />
+    <Compile Remove="Migrations\20200726163539_CraftMaterial_Hotfix.cs" />
+    <Compile Remove="Migrations\20200726163539_CraftMaterial_Hotfix.Designer.cs" />
+    <Compile Remove="Migrations\20200727144454_CraftEmployee_Hotfix.cs" />
+    <Compile Remove="Migrations\20200727144454_CraftEmployee_Hotfix.Designer.cs" />
+    <Compile Remove="Migrations\20200727144849_CraftEmployee_Hotfix.cs" />
+    <Compile Remove="Migrations\20200727144849_CraftEmployee_Hotfix.Designer.cs" />
+    <Compile Remove="Migrations\20200727153610_CraftEmployee_Hotfix.cs" />
+    <Compile Remove="Migrations\20200727153610_CraftEmployee_Hotfix.Designer.cs" />
+    <Compile Remove="Migrations\20200727154230_CraftEmployee_Hotfix.cs" />
+    <Compile Remove="Migrations\20200727154230_CraftEmployee_Hotfix.Designer.cs" />
+    <Compile Remove="Migrations\20200727155915_CraftEmployee_Hotfix_2.cs" />
+    <Compile Remove="Migrations\20200727155915_CraftEmployee_Hotfix_2.Designer.cs" />
+    <Compile Remove="Migrations\20200728100718_CraftMaterials_Hotfix.cs" />
+    <Compile Remove="Migrations\20200728100718_CraftMaterials_Hotfix.Designer.cs" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\GreenTree.Maschinenbestellungen.Core\GreenTree.Maschinenbestellungen.Core.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.5">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.1.1" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="Migrations\" />
+    <Folder Include="Model\Business\" />
+  </ItemGroup>
+
+</Project>

+ 79 - 0
GreenTree.Maschinenbestellungen.Domain/Model/OrderDbContext.cs

@@ -0,0 +1,79 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using GreenTree.Maschinenbestellungen.Core.Domain.Rights;
+using GreenTree.Maschinenbestellungen.Domain.Model.Rights;
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Text;
+using GreenTree.Maschinenbestellungen.Core.Domain.Business;
+using GreenTree.Maschinenbestellungen.Domain.Model.Business;
+
+namespace GreenTree.Maschinenbestellungen.Domain.Model
+{
+    public class OrderDbContext : DbContext
+    {
+        #region Tables
+
+        /// <summary>
+        /// Users table
+        /// </summary>
+        public DbSet<User> Users { get; set; }
+
+        /// <summary>
+        /// Policies table
+        /// </summary>
+        public DbSet<Policy> Policies { get; set; }
+
+        /// <summary>
+        /// UserPolicies table
+        /// </summary>
+        public DbSet<UserPolicy> UserPolicies { get; set; }
+
+        #endregion
+
+        #region Constructor
+
+        /// <summary>
+        /// Initializes a new instance of the ERPDbContext class
+        /// </summary>
+        /// <param name="options">Database context options.</param>
+        public OrderDbContext(DbContextOptions options) : base(options)
+        {
+
+        }
+
+        #endregion
+
+        #region Overrides
+
+        /// <summary>
+        /// Model creation override method to initialize the necessary model mappings
+        /// </summary>
+        /// <param name="modelBuilder">The model builder.</param>
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            modelBuilder.ApplyConfiguration(new UserMapping());
+            modelBuilder.ApplyConfiguration(new PolicyMapping());
+            modelBuilder.ApplyConfiguration(new UserPolicyMapping());
+        }
+
+        #endregion
+
+        #region Data
+
+        /// <summary>
+        /// Create seed data for the model database
+        /// </summary>
+        /// <typeparam name="T">The entity type gaining the seed data.</typeparam>
+        /// <param name="modelBuilder">The basted model builder.</param>
+        /// <param name="data">The seeded data.</param>
+        private void CreateSeedDate<T>(ModelBuilder modelBuilder, params T[] data)
+        {
+            modelBuilder.Entity(typeof(T))
+                .HasData(data);
+        }
+
+        #endregion
+    }
+}

+ 19 - 0
GreenTree.Maschinenbestellungen.Domain/Model/Rights/PolicyMapping.cs

@@ -0,0 +1,19 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using GreenTree.Maschinenbestellungen.Core.Domain.Rights;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Domain.Model.Rights
+{
+    public class PolicyMapping : IEntityTypeConfiguration<Policy>
+    {
+        public void Configure(EntityTypeBuilder<Policy> builder)
+        {
+            builder.ToTable("Policies");
+
+            builder.HasKey(u => u.Name);
+        }
+    }
+}

+ 45 - 0
GreenTree.Maschinenbestellungen.Domain/Model/Rights/UserMapping.cs

@@ -0,0 +1,45 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using GreenTree.Maschinenbestellungen.Core.Domain.Rights;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+
+namespace GreenTree.Maschinenbestellungen.Domain.Model.Rights
+{
+    public class UserMapping : IEntityTypeConfiguration<User>
+    {
+        public void Configure(EntityTypeBuilder<User> builder)
+        {
+            builder.ToTable("Users");
+
+            builder.HasKey(u => u.Id);
+
+            builder.Property(u => u.Id)
+                .ValueGeneratedOnAdd();
+
+            builder.Property(u => u.Accountname)
+                .IsRequired();
+
+            builder.Property(u => u.Forename)
+                .IsRequired();
+
+            builder.Property(u => u.Lastname)
+                .IsRequired();
+
+            builder.Property(u => u.MailAddress)
+                .IsRequired();
+
+            builder.Property(u => u.Password)
+                .IsRequired();
+
+            builder.Property(u => u.Birthdate)
+                .IsRequired(false);
+
+            builder.Property(u => u.Activated)
+                .IsRequired()
+                .HasDefaultValue(true);
+        }
+    }
+}

+ 22 - 0
GreenTree.Maschinenbestellungen.Domain/Model/Rights/UserPolicyMapping.cs

@@ -0,0 +1,22 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using GreenTree.Maschinenbestellungen.Core.Domain.Rights;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Domain.Model.Rights
+{
+    public class UserPolicyMapping : IEntityTypeConfiguration<UserPolicy>
+    {
+        public void Configure(EntityTypeBuilder<UserPolicy> builder)
+        {
+            builder.ToTable("UserPolicies");
+
+            builder.HasKey(up => new { up.UserId, up.PolicyName });
+
+            builder.HasOne(rp => rp.User)
+                .WithMany(r => r.Policies);
+        }
+    }
+}

+ 31 - 0
GreenTree.Maschinenbestellungen.Domain/Model/Shared/TrackedEntityMapping.cs

@@ -0,0 +1,31 @@
+using GreenTree.Maschinenbestellungen.Core.Domain.Shared;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Domain.Model.Shared
+{
+    public class TrackedEntityMapping<TEntity> : IEntityTypeConfiguration<TEntity>
+        where TEntity : TrackedEntity
+    {
+        public virtual void Configure(EntityTypeBuilder<TEntity> builder)
+        {
+            builder.Property(t => t.CreatedOn)
+                .IsRequired();
+
+            builder.Property(t => t.CreatedBy)
+                .IsRequired();
+
+            builder.Property(t => t.ChangedOn)
+                .IsRequired(false);
+
+            builder.Property(t => t.ChangedBy)
+                .IsRequired(false);
+
+            builder.Property(t => t.CreationStatus)
+                .IsRequired(false);
+        }
+    }
+}

BIN=BIN
GreenTree.Maschinenbestellungen.Domain/_MySqlWorkbenchModels/Migration_BusinessModel.mwb


+ 138 - 0
GreenTree.Maschinenbestellungen.Services/Authentication/DbContextAuthenticationService.cs

@@ -0,0 +1,138 @@
+using GreenTree.Maschinenbestellungen.Domain.Model;
+using GreenTree.Maschinenbestellungen.Services.Authorization;
+using Microsoft.AspNetCore.Authentication;
+using Microsoft.AspNetCore.Authentication.Cookies;
+using Microsoft.AspNetCore.Http;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Claims;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Services.Authentication
+{
+    public class DbContextAuthenticationService : IAuthenticationService
+    {
+        #region DI fields
+
+        // The global DbContext
+        private readonly OrderDbContext _eRPDbContext;
+
+        // The global HttpContext accessor
+        private readonly IHttpContextAccessor _httpContextAccessor;
+
+        // The global administration options
+        private readonly AdministrationOptions _administrationOptions;
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the DbContextAuthenticationService class
+        /// </summary>
+        /// <param name="eRPDbContext">Global DbContext.</param>
+        /// <param name="httpContextAccessor">Global HTTP context accessor.</param>
+        /// <param name="administrationOptions">Global administration options.</param>
+        public DbContextAuthenticationService(
+            OrderDbContext eRPDbContext,
+            IHttpContextAccessor httpContextAccessor,
+            AdministrationOptions administrationOptions)
+        {
+            _eRPDbContext = eRPDbContext;
+            _httpContextAccessor = httpContextAccessor;
+            _administrationOptions = administrationOptions;
+        }
+
+        #endregion
+
+        #region Implementation
+
+        /// <summary>
+        /// Authenticate and sign user in
+        /// </summary>
+        /// <param name="httpContext"></param>
+        /// <param name="username">The username.</param>
+        /// <param name="isPersistent">The login persistence.</param>
+        public async void SignIn(string username, bool isPersistent = false)
+        {
+            var user = _eRPDbContext.Users
+                .FirstOrDefault(u => u.Accountname == username || u.MailAddress == username);
+
+            if (user == null)
+                throw new Exception(
+                    String.Format("Der Benutzer \"{0}\" kann nicht gefunden werden.", username));
+
+            var claims = new List<Claim>
+            {
+                new Claim(ClaimTypes.NameIdentifier, user.Accountname),
+                new Claim(ClaimTypes.Name, String.Format("{0}, {1}", user.Lastname, user.Forename)),
+                new Claim(ClaimTypes.Email, user.MailAddress)
+            };
+
+            if (user.Birthdate.HasValue)
+                claims.Add(new Claim(ClaimTypes.DateOfBirth, user.Birthdate.Value.ToString("dd.MM.yyyy")));
+
+            foreach (var policy in user.Policies)
+            {
+                claims.Add(new Claim("Policy", policy.PolicyName));
+            }
+
+            var identity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
+            var principal = new ClaimsPrincipal(identity);
+
+            var authProperties = new AuthenticationProperties
+            {
+                AllowRefresh = true,
+                IsPersistent = isPersistent,
+                IssuedUtc = DateTimeOffset.UtcNow
+            };
+
+            await _httpContextAccessor.HttpContext.SignInAsync(
+                CookieAuthenticationDefaults.AuthenticationScheme,
+                principal,
+                authProperties);
+        }
+
+        /// <summary>
+        /// Authenticate and sign user in
+        /// </summary>
+        /// <param name="username">The username.</param>
+        /// <param name="isPersistent">The login persistence.</param>
+        public async void SignInAdmin(bool isPersistent = false)
+        {
+            var claims = new List<Claim>
+            {
+                new Claim(ClaimTypes.NameIdentifier, _administrationOptions.Administrator),
+                new Claim(ClaimTypes.Name, _administrationOptions.Administrator)
+            };
+
+            var identity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
+            var principal = new ClaimsPrincipal(identity);
+
+            var authProperties = new AuthenticationProperties
+            {
+                AllowRefresh = true,
+                IsPersistent = isPersistent,
+                IssuedUtc = DateTimeOffset.UtcNow
+            };
+
+            await _httpContextAccessor.HttpContext.SignInAsync(
+                CookieAuthenticationDefaults.AuthenticationScheme,
+                principal,
+                authProperties);
+        }
+
+        /// <summary>
+        /// Sign user out
+        /// </summary>
+        /// <param name="httpContext"></param>
+        public async void SignOut()
+        {
+            await _httpContextAccessor.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
+        }
+
+        #endregion
+    }
+}

+ 33 - 0
GreenTree.Maschinenbestellungen.Services/Authentication/IAuthenticationService.cs

@@ -0,0 +1,33 @@
+using Microsoft.AspNetCore.Http;
+using System;
+using System.Collections.Generic;
+using System.Security.Claims;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Services.Authentication
+{
+    public interface IAuthenticationService
+    {
+        /// <summary>
+        /// Authenticate and sign user in
+        /// </summary>
+        /// <param name="httpContext"></param>
+        /// <param name="username">The username.</param>
+        /// <param name="isPersistent">The login persistence.</param>
+        public void SignIn(string username, bool isPersistent = false);
+
+        /// <summary>
+        /// Authenticate and sign user in
+        /// </summary>
+        /// <param name="httpContext"></param>
+        /// <param name="username">The username.</param>
+        /// <param name="isPersistent">The login persistence.</param>
+        public void SignInAdmin(bool isPersistent = false);
+
+        /// <summary>
+        /// Sign user out
+        /// </summary>
+        /// <param name="httpContext"></param>
+        public void SignOut();
+    }
+}

+ 22 - 0
GreenTree.Maschinenbestellungen.Services/Authorization/AdministrationOptions.cs

@@ -0,0 +1,22 @@
+using Microsoft.Extensions.Configuration;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Porta.Kundenzähler.Services.Extension;
+using GreenTree.Maschinenbestellungen.Core.DependencyInjection;
+
+namespace GreenTree.Maschinenbestellungen.Services.Authorization
+{
+    public class AdministrationOptions : ISingletonObject
+    {
+        /// <summary>
+        /// The username of the administrator
+        /// </summary>
+        public string Administrator { get; set; }
+
+        /// <summary>
+        /// The administrator password
+        /// </summary>
+        public string Password { get; set; }
+    }
+}

+ 68 - 0
GreenTree.Maschinenbestellungen.Services/Authorization/CookieAuthorizationService.cs

@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Security.Principal;
+using System.Text;
+using System.Linq;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.AspNetCore.Authorization;
+using GreenTree.Maschinenbestellungen.Domain.Model;
+using System.Security.Claims;
+
+namespace GreenTree.Maschinenbestellungen.Services.Authorization
+{
+    public class CookieAuthorizationService : IAuthorizationService
+    {
+        #region Implementation
+
+        /// <summary>
+        /// Check wether the user has a specific policy
+        /// </summary>
+        /// <param name="identity">The user identity.</param>
+        /// <param name="policy">The policy to be checked.</param>
+        public bool UserHasPolicy(IIdentity identity, string policy)
+        {
+            var claimsIdentity = identity as ClaimsIdentity;
+
+            if (claimsIdentity == null) return false;
+
+            return claimsIdentity.Claims
+                .Any(c => c.Type == "Policy" && c.Value == policy);
+        }
+
+        /// <summary>
+        /// Check wether the user has any policy regarding base data management
+        /// </summary>
+        /// <param name="identity">The user identity.</param>
+        public bool UserHasBasedataPolicy(IIdentity identity)
+        {
+            var claimsIdentity = identity as ClaimsIdentity;
+
+            if (claimsIdentity == null) return false;
+
+            return claimsIdentity.Claims
+                .Any(c => c.Type == "Policy" &&
+                         (c.Value.StartsWith("Customer") ||
+                          c.Value.StartsWith("Employee") ||
+                          c.Value.StartsWith("Material") ||
+                          c.Value.StartsWith("Supplier")));
+        }
+
+        /// <summary>
+        /// Check wether the user has any policy in a specific category
+        /// </summary>
+        /// <param name="identity">The user identity.</param>
+        /// <param name="category">The category (e.g. 'Customer').</param>
+        public bool UserHasCategoryPolicy(IIdentity identity, string category)
+        {
+            var claimsIdentity = identity as ClaimsIdentity;
+
+            if (claimsIdentity == null) return false;
+
+            return claimsIdentity.Claims
+                .Any(c => c.Type == "Policy" && c.Value.StartsWith(category));
+        }
+
+        #endregion
+    }
+}

+ 102 - 0
GreenTree.Maschinenbestellungen.Services/Authorization/DefaultAuthorizationHandler.cs

@@ -0,0 +1,102 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Claims;
+using System.Security.Principal;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Services.Authorization
+{
+    public class DefaultAuthorizationHandler : AuthorizationHandler<DefaultAuthorizationPolicy>
+    {
+        #region DI fields
+
+        // The current authorization service
+        private readonly IAuthorizationService _authorizationService;
+
+        private readonly IHttpContextAccessor _httpContextAccessor;
+
+        #endregion
+
+        #region Properties
+
+        /// <summary>
+        /// The administration Options
+        /// </summary>
+        public AdministrationOptions Options { get; set; }
+
+        #endregion
+
+        #region DI Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the DefaultAuthorizationHandler class
+        /// </summary>
+        /// <param name="authorizationService">The dependent authorization serivce.</param>
+        /// <param name="administrationOptions">The global administration options.</param>
+        public DefaultAuthorizationHandler(
+            IAuthorizationService authorizationService,
+            IConfiguration configuration,
+            IHttpContextAccessor httpContextAccessor)
+        {
+            _authorizationService = authorizationService;
+
+            var administrationOptions = configuration.GetSection("AdministrationOptions").Get<AdministrationOptions>();
+
+            if (administrationOptions == null)
+                throw new Exception("The appsettings.json does not contain administration options.");
+
+            Options = administrationOptions;
+            _httpContextAccessor = httpContextAccessor;
+        }
+
+        #endregion
+
+        #region Implementation AuthorizationHandler
+
+        /// <summary>
+        /// Handle the current requirement for a specific resource
+        /// </summary>
+        /// <param name="context">The authorization context.</param>
+        /// <param name="requirement">The requirement.</param>
+        /// <returns>Returns a succeeded or failed task if the user is authorized for the required resource.</returns>
+        protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, DefaultAuthorizationPolicy requirement)
+        {
+            // Check if the checked requirement is the default policy and allow access when authenticated
+            if (requirement.Policy == String.Empty && context.User.Identity.IsAuthenticated)
+            {
+                context.Succeed(requirement);
+
+                return Task.CompletedTask;
+            }
+
+            // Check admin state of user
+            var isAdmin = context.User.Identity.Name == Options.Administrator;
+
+            if (isAdmin)
+            {
+                context.Succeed(requirement);
+
+                return Task.CompletedTask;
+            }
+
+            // Process the UserHasPolicy check from the current authorization service
+            var isAuthorized = _authorizationService.UserHasPolicy(context.User.Identity, requirement.Policy);
+
+            if (isAuthorized)
+                context.Succeed(requirement);
+            else
+                context.Fail();
+
+            return Task.CompletedTask;
+        }
+
+        #endregion
+    }
+}

+ 41 - 0
GreenTree.Maschinenbestellungen.Services/Authorization/DefaultAuthorizationPolicy.cs

@@ -0,0 +1,41 @@
+using Microsoft.AspNetCore.Authorization;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Services.Authorization
+{
+    public class DefaultAuthorizationPolicy : IAuthorizationRequirement
+    {
+        #region Properties
+
+        /// <summary>
+        /// The policy name
+        /// </summary>
+        public string Policy { get; set; }
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the DefaultAuthorizationPolicy class
+        /// </summary>
+        public DefaultAuthorizationPolicy()
+        {
+
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the DefaultAuthorizationPolicy class
+        /// </summary>
+        /// <param name="policy">The policy name.</param>
+        public DefaultAuthorizationPolicy(string policy)
+        {
+            Policy = policy;
+        }
+
+        #endregion
+    }
+}

+ 31 - 0
GreenTree.Maschinenbestellungen.Services/Authorization/IAuthorizationService.cs

@@ -0,0 +1,31 @@
+using Microsoft.AspNetCore.Authorization;
+using System;
+using System.Collections.Generic;
+using System.Security.Principal;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Services.Authorization
+{
+    public interface IAuthorizationService
+    {
+        /// <summary>
+        /// Check wether the user has a specific policy
+        /// </summary>
+        /// <param name="identity">The user identity.</param>
+        /// <param name="policy">The policy to be checked.</param>
+        public bool UserHasPolicy(IIdentity identity, string policy);
+
+        /// <summary>
+        /// Check wether the user has any policy regarding base data management
+        /// </summary>
+        /// <param name="identity">The user identity.</param>
+        public bool UserHasBasedataPolicy(IIdentity identity);
+
+        /// <summary>
+        /// Check wether the user has any policy in a specific category
+        /// </summary>
+        /// <param name="identity">The user identity.</param>
+        /// <param name="category">The category (e.g. 'Customer').</param>
+        public bool UserHasCategoryPolicy(IIdentity identity, string category);
+    }
+}

+ 110 - 0
GreenTree.Maschinenbestellungen.Services/Extension/ConfigurationExtension.cs

@@ -0,0 +1,110 @@
+using Microsoft.Extensions.Configuration;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Porta.Kundenzähler.Services.Extension
+{
+    public static class ConfigurationExtension
+    {
+        #region Configuration reading
+
+        /// <summary>
+        /// Read a section of the configuration and bind it to a corresponding object containing the same properties (Names must match)
+        /// </summary>
+        /// <typeparam name="T">The type of the config section object.</typeparam>
+        /// <param name="configuration">The global configuration.</param>
+        /// <param name="key">The key of the section.</param>
+        /// <returns>The config section object.</returns>
+        public static T GetSection<T>(this IConfiguration configuration, string key)
+        {
+            if (String.IsNullOrEmpty(key))
+                throw new ArgumentException("The section key must not be NULL or empty.", key);
+
+            // Create empty instance of config object type
+            var optionsObj = Activator.CreateInstance<T>();
+
+            var section = configuration.GetSection(key);
+
+            if (section == null)
+                throw new ArgumentException("The requested section cannot be found in configuration file.", key);
+
+            // Map the object properties to the section properties
+            MapSectionPropertiesToObject(configuration, optionsObj, section);
+
+            return optionsObj;
+        }
+
+        /// <summary>
+        /// Map the properties of a configuration object to the corresponding properties in the configuration section
+        /// </summary>
+        /// <param name="configuration">The global configuration.</param>
+        /// <param name="optionsObj">The current options object.</param>
+        /// <param name="currentSection">The current processing section.</param>
+        private static void MapSectionPropertiesToObject(IConfiguration configuration, object optionsObj, 
+            IConfigurationSection currentSection)
+        {
+            // Get all options object properties
+            var properties = optionsObj.GetType().GetProperties();
+
+            foreach (var propertyInfo in properties)
+            {
+                // Check non primitive, not value typed, only classed properties
+                if (propertyInfo.PropertyType.IsClass
+                        && !propertyInfo.PropertyType.IsArray
+                        && !propertyInfo.PropertyType.IsValueType
+                        && !propertyInfo.PropertyType.IsPrimitive
+                        && propertyInfo.PropertyType.FullName != "System.String")
+                {
+                    // Get the section configuration value of the current property
+                    var valueObj = currentSection.GetValue<object>(propertyInfo.Name);
+
+                    // Proceed when value object can be created
+                    if (valueObj != null)
+                    {
+                        // If the property is NULL, create an object for the property
+                        if (propertyInfo.GetValue(optionsObj) == null)
+                            propertyInfo.SetValue(optionsObj, Activator.CreateInstance(propertyInfo.PropertyType));
+
+                        // Recursive call
+                        MapSectionPropertiesToObject(configuration, propertyInfo.GetValue(optionsObj),
+                            currentSection.GetSection(propertyInfo.Name));
+                    }
+                }
+                else
+                {
+                    // Read the value from the current section
+                    var valueObj = currentSection.GetValue<object>(propertyInfo.Name);
+
+                    // If the value object is NULL then it might not be set or cannot be evaluated
+                    if (valueObj != null)
+                    {
+                        // Serialize the value as a JSON string
+                        var jsonStr = JsonConvert.SerializeObject(valueObj);
+
+                        // Deserialize from the JSON string to prevent conversion issues
+                        var value = JsonConvert.DeserializeObject(jsonStr, propertyInfo.PropertyType);
+
+                        propertyInfo.SetValue(optionsObj, value);
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// Check wether a configuration section exists in the configuration file
+        /// </summary>
+        /// <param name="configuration">The global configuration.</param>
+        /// <param name="key">The key of the section.</param>
+        public static bool SectionExists(this IConfiguration configuration, string key)
+        {
+            return
+                configuration.GetChildren()
+                    .Any(item => item.Key == key);
+        }
+
+        #endregion
+    }
+}

+ 20 - 0
GreenTree.Maschinenbestellungen.Services/Extension/GuidExtension.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Porta.Kundenzähler.Extension
+{
+    public static class GuidExtension
+    {
+        /// <summary>
+        /// Converts the GUID to a short version
+        /// </summary>
+        /// <param name="guid">The GUID object.</param>
+        /// <returns>The first part until the first hyphen of the regular GUID.</returns>
+        public static string ToShortString(this Guid guid)
+        {
+            return guid.ToString().Split('-')[0];
+        }
+    }
+}

+ 19 - 0
GreenTree.Maschinenbestellungen.Services/Geolocator/GoogleApiOptions.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Services.Geolocator
+{
+    public class GoogleApiOptions
+    {
+        /// <summary>
+        /// The Google provided API key
+        /// </summary>
+        public string ApiKey { get; set; }
+
+        /// <summary>
+        /// <i>True</i> to enable the Geocoding service to validate the address
+        /// </summary>
+        public bool Enabled { get; set; }
+    }
+}

+ 104 - 0
GreenTree.Maschinenbestellungen.Services/Geolocator/GoogleGeocodingService.cs

@@ -0,0 +1,104 @@
+using GuigleApi;
+using GuigleApi.Models.Extension;
+using GuigleApi.Models.Response;
+using Microsoft.EntityFrameworkCore.Internal;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net.Http;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Services.Geolocator
+{
+    public class GoogleGeocodingService : IGeocodingService
+    {
+        #region Contants
+
+        // The default address component types to check for an address validation
+        private readonly string[] _defaultCheckComponents = 
+        {
+            "street_number",
+            "route",
+            "locality",
+            "country",
+            "postal_code"
+        };
+
+        #endregion
+
+        #region DI fields
+
+        // The global Google API settings
+        private readonly GoogleApiOptions _googleApiOptions;
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the GoogleGeocodingService
+        /// </summary>
+        /// <param name="googleApiOptions">Global Google API options.</param>
+        public GoogleGeocodingService(
+            GoogleApiOptions googleApiOptions)
+        {
+            _googleApiOptions = googleApiOptions;
+        }
+
+        #endregion
+
+        #region Implementation
+
+        /// <summary>
+        /// Checks an address search string for valid street address
+        /// </summary>
+        /// <param name="searchString">The address search string.</param>
+        public bool IsValidAddress(string searchString)
+        {
+            return IsValidAddress(searchString, _defaultCheckComponents);
+        }
+
+        /// <summary>
+        /// Checks an address search string for valid street address
+        /// </summary>
+        /// <param name="searchString">The address search string.</param>
+        /// <param name="addressComponents">
+        /// The address components the API result shall be checked for 
+        /// (NULL if validation check shall succeed).
+        /// </param>
+        public bool IsValidAddress(string searchString, string[] addressComponents)
+        {
+            if (!_googleApiOptions.Enabled)
+                return true;
+
+            if (addressComponents == null)
+                return true;
+
+            var client = new HttpClient();
+
+            var googleGeocodingApi = new GoogleGeocodingApi(_googleApiOptions.ApiKey);
+            var addressSearchResult = googleGeocodingApi.SearchAddress(
+                client, searchString);
+
+            var result = addressSearchResult.Result;
+
+            if (result.Status != "OK")
+                return false;
+
+            if (result.Results.Count == 0)
+                return false;
+
+            var addressResult = result.Results[0];
+
+            foreach (var addressComponent in addressComponents)
+            {
+                if (!addressResult.AddressComponents.Exists(a => a.Types.Any(t => t.ToString() == addressComponent)))
+                    return false;
+            }
+
+            return true;
+        }
+
+        #endregion
+    }
+}

+ 22 - 0
GreenTree.Maschinenbestellungen.Services/Geolocator/IGeocodingService.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Services.Geolocator
+{
+    public interface IGeocodingService
+    {
+        /// <summary>
+        /// Checks an address search string for valid street address
+        /// </summary>
+        /// <param name="searchString">The address search string.</param>
+        public bool IsValidAddress(string searchString);
+
+        /// <summary>
+        /// Checks an address search string for valid street address
+        /// </summary>
+        /// <param name="searchString">The address search string.</param>
+        /// <param name="addressComponents">The address components the API result shall be checked for.</param>
+        public bool IsValidAddress(string searchString, string[] addressComponents);
+    }
+}

+ 28 - 0
GreenTree.Maschinenbestellungen.Services/GreenTree.Maschinenbestellungen.Services.csproj

@@ -0,0 +1,28 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="GuigleCore" Version="1.1.7" />
+    <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.1.5" />
+    <PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.5">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.5" />
+    <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\GreenTree.Maschinenbestellungen.Core\GreenTree.Maschinenbestellungen.Core.csproj" />
+    <ProjectReference Include="..\GreenTree.Maschinenbestellungen.Domain\GreenTree.Maschinenbestellungen.Domain.csproj" />
+  </ItemGroup>
+
+</Project>

+ 21 - 0
GreenTree.Maschinenbestellungen.Services/Localization/CultureOptions.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Services.Localization
+{
+    public class CultureOptions
+    {
+        /// <summary>
+        /// Culture to be set as application culture
+        /// </summary>
+        public string DefaultCulture { get; set; }
+
+        ///// <summary>
+        ///// Determines if the culture of the request will be handled in the client culture. <i>True</i> if you want this behaviour, <i>False</i>
+        ///// if you want the request and response handled in the system or <b>DefaultCulture</b>
+        ///// </summary>
+        //public bool UseRequestCulture { get; set; }
+    }
+}

+ 26 - 0
GreenTree.Maschinenbestellungen.Services/Notification/INotificationService.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Services.Notification
+{
+    public interface INotificationService
+    {
+        /// <summary>
+        /// Sends a notification to a specific target
+        /// </summary>
+        /// <param name="target">The single target.</param>
+        /// <param name="subject">The subject.</param>
+        /// <param name="message">The message.</param>
+        public void SendNotification(string target, string subject, string message);
+
+        /// <summary>
+        /// Sends a notification to multiple targets
+        /// </summary>
+        /// <param name="targets">The targets.</param>
+        /// <param name="subject">The subject.</param>
+        /// <param name="message">The message.</param>
+        public void SendNotification(string[] targets, string subject, string message);
+    }
+}

+ 39 - 0
GreenTree.Maschinenbestellungen.Services/Notification/MailNotificationOptions.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Services.Notification
+{
+    public class MailNotificationOptions
+    {
+        #region Properties
+
+        /// <summary>
+        /// The Name from which the mails come from
+        /// </summary>
+        public string From { get; set; }
+
+        /// <summary>
+        /// The address of the SMTP server
+        /// </summary>
+        public string SmtpServerAddress { get; set; }
+
+        /// <summary>
+        /// The authenticated username on the SMTP server
+        /// </summary>
+        public string SmtpServerUsername { get; set; }
+
+        /// <summary>
+        /// The password of the authenticated SMTP server
+        /// </summary>
+        public string SmtpServerPassword { get; set; }
+
+        /// <summary>
+        /// The domain of the authenticated SMTP server
+        /// </summary>
+        public string SmtpServerDomain { get; set; }
+
+        #endregion
+    }
+}

+ 109 - 0
GreenTree.Maschinenbestellungen.Services/Notification/MailNotificationService.cs

@@ -0,0 +1,109 @@
+using Microsoft.Extensions.Options;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Mail;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Services.Notification
+{
+    public class MailNotificationService : INotificationService
+    {
+        #region DI fields
+
+        // The global mail notification options object
+        private MailNotificationOptions _mailNotificationOptions;
+
+        #endregion
+
+        #region Fields
+
+        // The SMTP client to send the mail notification messages
+        private SmtpClient _smtpClient;
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the MailNotificationService class
+        /// </summary>
+        /// <param name="mailNotificationOptions">The dependant mail notification options.</param>
+        public MailNotificationService(
+            IOptionsMonitor<MailNotificationOptions> mailNotificationOptions)
+        {
+            ConfigureService(mailNotificationOptions.CurrentValue);
+
+            mailNotificationOptions.OnChange(config =>
+            {
+                ConfigureService(mailNotificationOptions.CurrentValue);
+            });
+        }
+
+        #endregion
+
+        #region Configuration
+
+        /// <summary>
+        /// Configure current service
+        /// </summary>
+        /// <param name="options">The service options.</param>
+        private void ConfigureService(MailNotificationOptions options)
+        {
+            _mailNotificationOptions = options;
+
+            // Create private SMTP client based to mail notification options
+            _smtpClient = new SmtpClient(_mailNotificationOptions.SmtpServerAddress);
+
+            // Check if Username is configured
+            if (String.IsNullOrEmpty(_mailNotificationOptions.SmtpServerUsername)) return;
+
+            // Use credentials on SMTP client
+            _smtpClient.Credentials = new NetworkCredential(_mailNotificationOptions.SmtpServerUsername,
+                _mailNotificationOptions.SmtpServerPassword, _mailNotificationOptions.SmtpServerDomain);
+        }
+
+        #endregion
+
+        #region Implementation
+
+        /// <summary>
+        /// Sends a notification to a specific target
+        /// </summary>
+        /// <param name="target">The single target.</param>
+        /// <param name="subject">The subject.</param>
+        /// <param name="message">The message.</param>
+        public void SendNotification(string target, string subject, string message)
+        {
+            // Parameter validation check
+            if (String.IsNullOrEmpty(target))
+                throw new ArgumentException("Cannot send notification to empty target.", "target");
+
+            // Send message via SMTP client
+            _smtpClient.Send(new MailMessage(_mailNotificationOptions.From, target, subject, message));
+        }
+
+        /// <summary>
+        /// Sends a notification to multiple targets
+        /// </summary>
+        /// <param name="targets">The targets.</param>
+        /// <param name="subject">The subject.</param>
+        /// <param name="message">The message.</param>
+        public void SendNotification(string[] targets, string subject, string message)
+        {
+            // Paramter validation check
+            if (targets == null)
+                throw new ArgumentException("Cannot send notification to empty targets.", "targets");
+
+            // Loop through targets
+            foreach (var target in targets)
+            {
+                // Use single SendNotification method for multiple targets
+                SendNotification(target, subject, message);
+            }
+        }
+
+        #endregion
+    }
+}

+ 12 - 0
GreenTree.Maschinenbestellungen.Web/.config/dotnet-tools.json

@@ -0,0 +1,12 @@
+{
+  "version": 1,
+  "isRoot": true,
+  "tools": {
+    "dotnet-ef": {
+      "version": "3.1.5",
+      "commands": [
+        "dotnet-ef"
+      ]
+    }
+  }
+}

+ 24 - 0
GreenTree.Maschinenbestellungen.Web/Configuration/DefaultOptionMonitoringService.cs

@@ -0,0 +1,24 @@
+using GreenTree.Maschinenbestellungen.Services.Localization;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Localization;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Web.Configuration
+{
+    public class DefaultOptionMonitoringService : IOptionMonitoringService
+    {
+        #region Ctor
+
+        public DefaultOptionMonitoringService(
+            IServiceProvider serviceProvider)
+        {
+
+        }
+
+        #endregion
+    }
+}

+ 11 - 0
GreenTree.Maschinenbestellungen.Web/Configuration/IOptionMonitoringService.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace GreenTree.Maschinenbestellungen.Web.Configuration
+{
+    public interface IOptionMonitoringService
+    {
+
+    }
+}

+ 107 - 0
GreenTree.Maschinenbestellungen.Web/Controllers/AccountController.cs

@@ -0,0 +1,107 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Claims;
+using System.Threading.Tasks;
+using GreenTree.Maschinenbestellungen.Core.Helper;
+using GreenTree.Maschinenbestellungen.Domain.Model;
+using GreenTree.Maschinenbestellungen.Services.Authentication;
+using GreenTree.Maschinenbestellungen.Services.Authorization;
+using GreenTree.Maschinenbestellungen.Web.Models.Account;
+using Microsoft.AspNetCore.Authentication.Cookies;
+using Microsoft.AspNetCore.Mvc;
+
+namespace GreenTree.Maschinenbestellungen.Web.Controllers
+{
+    public class AccountController : Controller
+    {
+        #region DI fields
+
+        // The global DbContext
+        private readonly OrderDbContext _eRPDbContext;
+
+        // The global authentication service
+        private readonly IAuthenticationService _authenticationService;
+
+        // The global user helper
+        private readonly IUserHelper _userHelper;
+
+        // The global administation options
+        private readonly AdministrationOptions _administrationOptions;
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the AccountController class
+        /// </summary>
+        /// <param name="eRPDbContext">Global DbContext.</param>
+        /// <param name="authenticationService">Global authentication service.</param>
+        /// <param name="userHelper">Global user helper.</param>
+        /// <param name="administrationOptions">Global administration options.</param>
+        public AccountController(
+            OrderDbContext eRPDbContext,
+            IAuthenticationService authenticationService,
+            IUserHelper userHelper,
+            AdministrationOptions administrationOptions)
+        {
+            _eRPDbContext = eRPDbContext;
+            _authenticationService = authenticationService;
+            _userHelper = userHelper;
+            _administrationOptions = administrationOptions;
+        }
+
+        #endregion
+
+        #region Actions
+
+        // Index View / redirect to Login
+        public IActionResult Index()
+        {
+            return RedirectToAction(nameof(Login));
+        }
+
+        // Login View
+        public IActionResult Login()
+        {
+            return View("~/Views/Account/Login.cshtml");
+        }
+
+        // POST: Account/Login
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public IActionResult Login(LoginModel login)
+        {
+            if (!ModelState.IsValid)
+            {
+                login.Password = String.Empty;
+
+                return View("~/Views/Account/Login.cshtml", login);
+            }
+
+            if (login.Username == _administrationOptions.Administrator)
+            {
+                _authenticationService.SignInAdmin(login.StayLoggedIn);
+
+                return RedirectToAction("Index", "Home");
+            }
+            else
+            {
+                _authenticationService.SignIn(login.Username, login.StayLoggedIn);
+
+                return RedirectToAction("Index", "Home");
+            }
+        }
+
+        // Logout View
+        public IActionResult Logout()
+        {
+            _authenticationService.SignOut();
+
+            return RedirectToAction(nameof(Login));
+        }
+
+        #endregion
+    }
+}

+ 45 - 0
GreenTree.Maschinenbestellungen.Web/Controllers/HomeController.cs

@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Logging;
+using GreenTree.Maschinenbestellungen.Web.Models;
+using GreenTree.Maschinenbestellungen.Domain.Model;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Authentication.Cookies;
+using GreenTree.Maschinenbestellungen.Services.Notification;
+using Microsoft.Extensions.Options;
+using GreenTree.Maschinenbestellungen.Web.Configuration;
+
+namespace GreenTree.Maschinenbestellungen.Web.Controllers
+{
+    public class HomeController : Controller
+    {
+        private readonly ILogger<HomeController> _logger;
+
+        private readonly INotificationService _mailNotificationService;
+
+        public HomeController(
+            ILogger<HomeController> logger,
+            INotificationService mailNotificationService,
+            IOptionMonitoringService optionMonitoringService)
+        {
+            _logger = logger;
+            _mailNotificationService = mailNotificationService;
+        }
+
+        [Authorize]
+        public IActionResult Index()
+        {
+            return View();
+        }
+
+        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+        public IActionResult Error()
+        {
+            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
+        }
+    }
+}

+ 177 - 0
GreenTree.Maschinenbestellungen.Web/Controllers/RightsController.cs

@@ -0,0 +1,177 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using GreenTree.Maschinenbestellungen.Core.Domain.Rights;
+using GreenTree.Maschinenbestellungen.Core.Helper;
+using GreenTree.Maschinenbestellungen.Domain.Model;
+using GreenTree.Maschinenbestellungen.Web.Models.Rights.User;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+
+namespace GreenTree.Maschinenbestellungen.Web.Controllers
+{
+    public class RightsController : Controller
+    {
+        #region DI fields
+
+        // The global DbContext
+        private readonly OrderDbContext _eRPDbContext;
+
+        // The global user helper
+        private readonly IUserHelper _userHelper;
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the RightsController class
+        /// </summary>
+        /// <param name="eRPDbContext">Global DbContext.</param>
+        /// <param name="userHelper">Global user helper.</param>
+        public RightsController(
+            OrderDbContext eRPDbContext,
+            IUserHelper userHelper)
+        {
+            _eRPDbContext = eRPDbContext;
+            _userHelper = userHelper;
+        }
+
+        #endregion
+
+        #region Actions
+
+        // GET: Rights
+        public ActionResult Index()
+        {
+            var users = _eRPDbContext.Users
+                .ToList()
+                .Select(u => new UserModel(u));
+
+            return View("~/Views/Rights/User/Index.cshtml", users);
+        }
+
+        // GET: Rights/Details/5
+        public ActionResult Details(int id)
+        {
+            var user = _eRPDbContext.Users
+                .FirstOrDefault(u => u.Id == id);
+
+            var userModel = new UserModel(user);
+
+            return View("~/Views/Rights/User/Details.cshtml", userModel);
+        }
+
+        // GET: Rights/Create
+        public ActionResult Create()
+        {
+            ViewData.Add("AvailablePolicies", Startup._availablePolicies);
+
+            return View("~/Views/Rights/User/Create.cshtml");
+        }
+
+        // POST: Rights/Create
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Create(UserModel userModel)
+        {
+            if (!ModelState.IsValid)
+                return View("~/Views/Rights/User/Create.cshtml", userModel);
+
+            var user = new User
+            {
+                Accountname = userModel.Accountname,
+                Password = _userHelper.HashString(userModel.Password, true),
+                Forename = userModel.Forename,
+                Lastname = userModel.Lastname,
+                MailAddress = userModel.MailAddress,
+                Birthdate = userModel.Birthdate,
+                Activated = true
+            };
+
+            if (userModel.Policies != null)
+            {
+                user.Policies = new List<UserPolicy>(
+                    userModel.Policies
+                        .Select(p => new UserPolicy
+                        {
+                            PolicyName = p,
+                            User = user
+                        }));
+            }
+
+            _eRPDbContext.Users.Add(user);
+            _eRPDbContext.SaveChanges();
+
+            return RedirectToAction(nameof(Index));
+        }
+
+        // GET: Rights/Edit/5
+        public ActionResult Edit(int id)
+        {
+            ViewData.Add("AvailablePolicies", Startup._availablePolicies);
+
+            var user = _eRPDbContext.Users
+                .FirstOrDefault(u => u.Id == id);
+
+            var userModel = new UserModel(user);
+
+            return View("~/Views/Rights/User/Edit.cshtml", userModel);
+        }
+
+        // POST: Rights/Edit/5
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Edit(int id, UserModel userModel)
+        {
+            if (!ModelState.IsValid)
+                return View("~/Views/Rights/User/Edit.cshtml", userModel);
+
+            var user = _eRPDbContext.Users
+                .FirstOrDefault(u => u.Id == id);
+
+            user.Accountname = userModel.Accountname;
+            user.Forename = userModel.Forename;
+            user.Lastname = userModel.Lastname;
+            user.MailAddress = userModel.MailAddress;
+            user.Birthdate = userModel.Birthdate;
+            user.Activated = userModel.Activated;
+
+            user.Policies.Clear();
+
+            _eRPDbContext.SaveChanges();
+
+            if (userModel.Policies != null)
+            {
+                user.Policies = new List<UserPolicy>(
+                    userModel.Policies
+                        .Select(p => new UserPolicy
+                        {
+                            PolicyName = p,
+                            User = user
+                        }));
+            }
+
+            _eRPDbContext.SaveChanges();
+
+            return RedirectToAction(nameof(Index));
+        }
+
+        // POST: Rights/Delete/5
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Delete(int id, IFormCollection collection)
+        {
+            var user = _eRPDbContext.Users
+                .FirstOrDefault(u => u.Id == id);
+
+            _eRPDbContext.Users.Remove(user);
+            _eRPDbContext.SaveChanges();
+
+            return RedirectToAction(nameof(Index));
+        }
+
+        #endregion
+    }
+}

+ 21 - 0
GreenTree.Maschinenbestellungen.Web/Dockerfile

@@ -0,0 +1,21 @@
+#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
+
+FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
+WORKDIR /app
+EXPOSE 80
+
+FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
+WORKDIR /src
+COPY ["GreenTree.Maschinenbestellungen.Web/GreenTree.Maschinenbestellungen.Web.csproj", "GreenTree.Maschinenbestellungen.Web/"]
+RUN dotnet restore "GreenTree.Maschinenbestellungen.Web/GreenTree.Maschinenbestellungen.Web.csproj"
+COPY . .
+WORKDIR "/src/GreenTree.Maschinenbestellungen.Web"
+RUN dotnet build "GreenTree.Maschinenbestellungen.Web.csproj" -c Release -o /app/build
+
+FROM build AS publish
+RUN dotnet publish "GreenTree.Maschinenbestellungen.Web.csproj" -c Release -o /app/publish
+
+FROM base AS final
+WORKDIR /app
+COPY --from=publish /app/publish .
+ENTRYPOINT ["dotnet", "GreenTree.Maschinenbestellungen.Web.dll"]

+ 486 - 0
GreenTree.Maschinenbestellungen.Web/Extension/HtmlContentExtension.cs

@@ -0,0 +1,486 @@
+using FluentValidation.Internal;
+using GreenTree.Maschinenbestellungen.Core.Extension;
+using Microsoft.AspNetCore.Html;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
+using Microsoft.AspNetCore.Mvc.Rendering;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Extension
+{
+    public static class HtmlContentExtension
+    {
+        #region Inputs
+
+        /// <summary>
+        /// Return HTML markup for the <paramref name="expression"/>, using a display template for a bootstrap extension token field.
+        /// See <see href="https://sliptree.github.io/bootstrap-tokenfield/">bootstrap-tokenfield</see> for more information of the 
+        /// input type.
+        /// </summary>
+        /// <typeparam name="TModel">Model type.</typeparam>
+        /// <typeparam name="TValue">Model value type.</typeparam>
+        /// <param name="htmlHelper">HtmlHelper context.</param>
+        /// <param name="expression">Expression for the requested model enumeration value.</param>
+        /// <param name="delimiter">The delimiter string used to seperate token values.</param>
+        /// <param name="htmlAttributes">Additional HTML attributes.</param>
+        /// <param name="availableValues">The available values for the tokenbox.</param>
+        /// <param name="allowOnlyOnce"><c>True</c> when every available value can only be selected once.</param>
+        public static IHtmlContent TokenBoxFor<TModel, TValue>(
+            this IHtmlHelper<TModel> htmlHelper,
+            Expression<Func<TModel, TValue>> expression,
+            string delimiter = "|",
+            object htmlAttributes = null,
+            string[] availableValues = null,
+            bool allowOnlyOnce = true) where TValue : IEnumerable<string>
+        {
+            var attributes = htmlAttributes == null
+                ? new string[0]
+                : htmlAttributes.GetType().GetProperties()
+                    .Select(p => String.Format("{0}='{1}'", p.Name.Replace("_", "-"), p.GetValue(htmlAttributes)))
+                    .ToArray();
+
+            var func = expression.Compile();
+
+            var id = Guid.NewGuid().ToShortString();
+
+            var scriptBuilder = new StringBuilder();
+
+            var memberInfo = expression.Body.NodeType == ExpressionType.MemberAccess
+                ? ((MemberExpression)expression.Body).Member
+                : null;
+
+            var type = expression.Body.GetType();
+
+            if (availableValues != null)
+            {
+                var autoComplete = JsonConvertWithoutQuotes(new
+                {
+                    autocomplete = new
+                    {
+                        source = availableValues,
+                        delay = 200
+                    },
+                    showAutocompleteOnFocus = true
+                });
+
+                scriptBuilder.AppendFormat(
+                    "<script>" +
+                    "   $('#{0}').tokenfield({1})", 
+                    id, autoComplete);
+
+                if (allowOnlyOnce)
+                {
+                    scriptBuilder.Append(
+                        ".on('tokenfield:createtoken', function (e) { " +
+                        "   if ($(this).tokenfield('getTokens').some(t => t.value === e.attrs.value)) return false;" +
+                        "})");
+                }
+
+                if (memberInfo != null)
+                {
+                    var inputCreationScriptPart = String.Format(
+                        "function (e) {{ " +
+                        "   $(\"[name = '{1}'\").remove();" +
+                        "   $(this).tokenfield('getTokens').forEach(" +
+                        "       function (obj) {{ $('#{0}').after('<input type=\"hidden\" name=\"{1}\" value=\"' + obj.value + '\" />'); }});" +
+                        "}}", id, memberInfo.Name);
+
+                    scriptBuilder.AppendFormat(
+                        ".on('tokenfield:createdtoken', {0})", inputCreationScriptPart);
+
+                    scriptBuilder.AppendFormat(
+                        ".on('tokenfield:removedtoken', {0})", inputCreationScriptPart);
+                }
+
+                scriptBuilder.Append(";</script>");
+            }
+            else
+            {
+                scriptBuilder.AppendFormat("<script>$('#{0}').tokenfield();</script>", id);
+            }
+
+            if (htmlHelper.ViewData.Model == null)
+            {
+                return new HtmlString(
+                    String.Format(
+                        "<input id='{0}' class='tokenBox' value='{1}' data-delimiter='{2}' {3} /> {4}",
+                        id,
+                        String.Empty,
+                        delimiter,
+                        String.Join(" ", attributes),
+                        scriptBuilder));
+            }
+            else
+            {
+                var values = func(htmlHelper.ViewData.Model);
+
+                var valueInputs = values
+                    .Select(v => String.Format(
+                        "<input type=\"hidden\" name=\"{0}\" value=\"{1}\" />",
+                        memberInfo == null
+                            ? id
+                            : memberInfo.Name,
+                        v));
+
+                return new HtmlString(
+                    String.Format(
+                        "<input id='{0}' class='tokenBox' value='{1}' data-delimiter='{2}' {3} /> {4} {5}",
+                        id,
+                        values == null
+                            ? String.Empty
+                            : String.Join(delimiter, values),
+                        delimiter,
+                        String.Join(" ", attributes),
+                        scriptBuilder,
+                        String.Join(" ", valueInputs)));
+            }
+        }
+
+        /// <summary>
+        /// Return HTML markup for the <paramref name="expression"/>, using a bootstrap badge containing 'Yes' or 'No'.
+        /// See <see href="https://getbootstrap.com/docs/4.1/components/badge/">bootstrap badge</see> for more information of the badge.
+        /// </summary>
+        /// <typeparam name="TModel">Model type.</typeparam>
+        /// <param name="htmlHelper">HtmlHelper context.</param>
+        /// <param name="expression">Expression for the requested model bool value.</param>
+        public static IHtmlContent YesNoBadgeFor<TModel>(
+            this IHtmlHelper<TModel> htmlHelper,
+            Expression<Func<TModel, bool>> expression)
+        {
+            var func = expression.Compile();
+
+            if (htmlHelper.ViewData.Model == null)
+            {
+                return new HtmlString("<span class='badge badge-secondary'>N/A</span>");
+            }
+            else
+            {
+                return
+                    func(htmlHelper.ViewData.Model)
+                        ? new HtmlString("<span class='badge badge-success'>Ja</span>")
+                        : new HtmlString("<span class='badge badge-danger'>Nein</span>");
+            }
+        }
+
+        /// <summary>
+        /// Return HTML markup for the <paramref name="expression"/>, using a display template for a country selection field.
+        /// </summary>
+        /// <typeparam name="TModel">Model type.</typeparam>
+        /// <typeparam name="TValue">Model value type.</typeparam>
+        /// <param name="htmlHelper">HtmlHelper context.</param>
+        /// <param name="expression">Expression for the requested model enumeration value.</param>
+        /// <param name="htmlAttributes">Additional HTML attributes.</param>
+        public static IHtmlContent CountrySelectionFor<TModel, TValue>(
+            this IHtmlHelper<TModel> htmlHelper,
+            Expression<Func<TModel, TValue>> expression,
+            object htmlAttributes = null)
+        {
+            var attributes = htmlAttributes == null
+                ? new string[0]
+                : htmlAttributes.GetType().GetProperties()
+                    .Select(p => String.Format("{0}='{1}'", p.Name.Replace("_", "-"), p.GetValue(htmlAttributes)))
+                    .ToArray();
+
+            var func = expression.Compile();
+
+            var funcVal = htmlHelper.ViewData.Model == null
+                ? String.Empty
+                : func(htmlHelper.ViewData.Model).ToString();
+
+            var memberInfo = expression.Body.NodeType == ExpressionType.MemberAccess
+                ? ((MemberExpression)expression.Body).Member
+                : null;
+
+            var name = memberInfo == null
+                ? Guid.NewGuid().ToShortString()
+                : memberInfo.Name;
+
+            var selectBuilder = new StringBuilder();
+            selectBuilder.AppendFormat("<select id=\"{0}\" name =\"{0}\" {1}>", name, String.Join(" ", htmlAttributes));
+
+            var countries = CultureInfo.GetCultures(CultureTypes.AllCultures)
+                .Where(c => c.LCID != CultureInfo.InvariantCulture.LCID && !c.IsNeutralCulture)
+                .Select(c => new RegionInfo(c.LCID))
+                .Distinct()
+                .OrderBy(r => r.DisplayName);
+
+            foreach (var country in countries)
+            {
+                if (country.DisplayName == funcVal)
+                    selectBuilder.AppendFormat("<option selected value=\"{0}\">{1}</option>", country.DisplayName, country.DisplayName);
+                else
+                    selectBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", country.DisplayName, country.DisplayName);
+            }
+
+            selectBuilder.Append("</select>");
+
+            return new HtmlString(selectBuilder.ToString());
+        }
+
+        /// <summary>
+        /// Generates a Span HTML element
+        /// </summary>
+        /// <param name="htmlHelper">HtmlHelper context.</param>
+        /// <param name="content">The span content text.</param>
+        /// <param name="htmlAttributes">Additional HTML attributes.</param>
+        /// <returns></returns>
+        public static IHtmlContent Span(this IHtmlHelper htmlHelper, string content, object htmlAttributes = null)
+        {
+            var attributes = htmlAttributes == null
+                ? new string[0]
+                : htmlAttributes.GetType().GetProperties()
+                    .Select(p => String.Format("{0}='{1}'", p.Name.Replace("_", "-"), p.GetValue(htmlAttributes)))
+                    .ToArray();
+
+            var htmlString = String.Format("<span {0}>{1}</span>", String.Join(" ", attributes), content);
+
+            return new HtmlString(htmlString);
+        }
+
+        /// <summary>
+        /// Return HTML markup for the <paramref name="valueExpression"/>, using a display template for a search selection field.
+        /// </summary>
+        /// <typeparam name="TModel">Model type.</typeparam>
+        /// <typeparam name="TValue">Model value type.</typeparam>
+        /// <param name="htmlHelper">HtmlHelper context.</param>
+        /// <param name="valueExpression">Expression for the requested model value.</param>
+        /// <param name="textExpression">Expression for the requested model text.</param>
+        /// <param name="searchActionUrl">POST action URL that returns a model enumeration as JSON result.</param>
+        /// <param name="htmlAttributesValue">Additional HTML attributes for the value input.</param>
+        /// <param name="htmlAttributesText">Additional HTML attributes for the text input.</param>
+        /// <returns></returns>
+        public static IHtmlContent SearchFor<TModel, TValue>(
+            this IHtmlHelper<TModel> htmlHelper, 
+            Expression<Func<TModel, TValue>> valueExpression,
+            Expression<Func<TModel, string>> textExpression,
+            string searchActionUrl,
+            object htmlAttributesValue = null,
+            object htmlAttributesText = null)
+        {
+            var attributesText = htmlAttributesText == null
+                ? new string[0]
+                : htmlAttributesText.GetType().GetProperties()
+                    .Where(p => p.Name != "name")
+                    .Select(p => String.Format("{0}='{1}'", p.Name.Replace("_", "-"), p.GetValue(htmlAttributesText)))
+                    .ToArray();
+
+            var attributesValue = htmlAttributesValue == null
+                ? new string[0]
+                : htmlAttributesValue.GetType().GetProperties()
+                    .Where(p => p.Name != "name")
+                    .Select(p => String.Format("{0}='{1}'", p.Name.Replace("_", "-"), p.GetValue(htmlAttributesValue)))
+                    .ToArray();
+
+            var id = RandomId();
+
+            var valFunc = valueExpression.Compile();
+
+            var funcVal = htmlHelper.ViewData.Model == null
+                ? default
+                : valFunc(htmlHelper.ViewData.Model);
+
+            var isDefaultValue = funcVal == null || (funcVal != null && funcVal.ToString() == default(TValue).ToString());
+
+            var textFunc = textExpression.Compile();
+
+            var funcText = htmlHelper.ViewData.Model == null
+                ? default
+                : textFunc(htmlHelper.ViewData.Model);
+
+            var memberInfoText = textExpression.Body.NodeType == ExpressionType.MemberAccess
+                ? ((MemberExpression)textExpression.Body).Member
+                : null;
+
+            var nameText = memberInfoText == null
+                ? Guid.NewGuid().ToShortString()
+                : memberInfoText.Name;
+
+            if (htmlAttributesText != null && htmlAttributesText.GetType().GetProperty("name") != null)
+                nameText = htmlAttributesText.GetType().GetProperty("name").GetValue(htmlAttributesText).ToString();
+
+            var memberInfoValue = valueExpression.Body.NodeType == ExpressionType.MemberAccess
+                ? ((MemberExpression)valueExpression.Body).Member
+                : null;
+
+            var nameValue = memberInfoValue == null
+                ? Guid.NewGuid().ToShortString()
+                : memberInfoValue.Name;
+
+            if (htmlAttributesValue != null && htmlAttributesValue.GetType().GetProperty("name") != null)
+                nameValue = htmlAttributesValue.GetType().GetProperty("name").GetValue(htmlAttributesValue).ToString();
+
+            var scriptBuilder = new StringBuilder();
+            scriptBuilder.AppendFormat(
+                "<script type='text/javascript'>\n" +
+                "$(document).ready(function() {{\n" +
+                "   $(\"#text_{0}\").on('keypress', function (e) {{\n" +
+                "       if (e.keyCode == 13)\n" +
+                "       {{\n" +
+                "           search_{0}();\n" +
+                "           e.preventDefault();\n" +
+                "       }};\n" +
+                "   }});\n" +
+                "   $(\"#text_{0}\").on('keydown', function (e) {{\n" +
+                "       if (e.keyCode == 8 && $(\"#value_{0}\").val() != '') {{\n" +
+                "           $(\"#text_{0}\").val('');\n" +
+                "           $(\"#value_{0}\").val('');\n" +
+                "           $(\"#text_{0}\").next().children('.fa-check-circle').fadeOut('fast', function() {{\n" +
+                "               $(\"#text_{0}\").next().children(\".fa-ellipsis-h\").fadeIn('fast');\n" +
+                "           }});\n" +
+                "           e.preventDefault();\n" +
+                "       }};\n" +
+                "   }});\n" +
+                "}});\n" +
+                "\n" +
+                "function search_{0}()\n" +
+                "{{\n" +
+                "   $.ajax({{\n" +
+                "       method: 'POST',\n" +
+                "       url: '{1}',\n" +
+                "       data:\n" +
+                "       {{\n" +
+                "           SearchTerm: $('#text_{0}').val()\n" +
+                "       }},\n" +
+                "       success: function(data) {{\n" +
+                "           $(\"#searchModal_{0}\").find('.list-group').empty();\n" +
+                "           if (data.length > 0)\n" +
+                "           {{\n" +
+                "               $(data).each(function(index, elem) {{\n" +
+                "                   $(\"#searchModal_{0}\").find('.list-group').append(\n" +
+                "                       \"<a href='#' class='list-group-item list-group-item-info list-group-item-action'" +
+                "                            data-toggle='list' data-val='{{0}}' data-text='{{1}}' ondblclick='select_{0}()'>{{1}}</a>\"\n" +
+                "                           .format(elem.searchId, elem.searchText));\n" +
+                "               }});\n" +
+                "           }}\n" +
+                "           else\n" +
+                "           {{\n" +
+                "           $(\"#searchModal_{0}\").find('.list-group').append(\n" +
+                "               \"'<button type='button' class='list-group-item'>Keine Treffer</button>'\");\n" +
+                "           }}\n" +
+                "           $(\"#searchModal_{0}\").modal('show');\n" +
+                "       }},\n" +
+                "       error: function(msg) {{\n" +
+                "           \n" +
+                "       }}\n" +
+                "   }});\n" +
+                "}}\n" +
+                "\n" +
+                "function select_{0}()\n" +
+                "{{\n" +
+                "   $(\"#searchModal_{0}\").modal('hide');\n" +
+                "   var val = $(\"#searchModal_{0}\").find('a.active').attr('data-val');\n" +
+                "   var text = $(\"#searchModal_{0}\").find('a.active').attr('data-text');\n" +
+                "   $(\"#value_{0}\").val(val);\n" +
+                "   $(\"#text_{0}\").val(text);\n" +
+                "   $(\"#text_{0}\").next().children('.fa-ellipsis-h').fadeOut('fast', function() {{\n" +
+                "       $(\"#text_{0}\").next().children('.fa-check-circle').fadeIn('fast');\n" +
+                "       $(\"#text_{0}\").focus();\n" +
+                "   }});\n" +
+                "}}" +
+                "</script>",
+                id, 
+                searchActionUrl
+            );
+
+            var contentBuilder = new StringBuilder();
+            contentBuilder.AppendFormat(
+                "<div class='input-group'>\n" +
+                    "<div class='input-group-prepend'>\n" +
+                        "<button class='btn btn-info fas fa-search' type='button' onclick='search_{0}()'></button>\n" +
+                    "</div>\n" +
+                    "<input id='text_{0}' type='text' name='{1}' value='{2}' class='form-control' placeholder='Suchbegriff'\n" +
+                    "       aria-label='Suchbegriff' aria-describedby='basic-addon1' {5} />\n" +
+                    "<div class='input-group-append'>\n" +
+                    "   <span class='input-group-text bg-success text-white rounded-right fas fa-cust-lh fa-check-circle' {7}></span>\n" +
+                    "   <span class='input-group-text rounded-right fas fa-cust-lh fa-ellipsis-h' {8}></span>\n" +
+                    "</div>\n" +
+                "</div>\n" +
+                "\n" +
+                "<input id='value_{0}' type='hidden' name='{3}' value='{4}' {6} />\n" +
+                "\n" +
+                "<div id='searchModal_{0}' class='modal fade'>\n" +
+                    "<div class='modal-dialog'>\n" +
+                        "<div class='modal-content'>\n" +
+                            "<div class='modal-header'>\n" +
+                                "<h4 class='modal-title'>Suchergebnisse</h4>\n" +
+                            "</div>\n" +
+                            "<div class='modal-body overflow-auto' style='max-height: 400px'>\n" +
+                                "<div class='list-group'>\n" +
+                                "</div>\n" +
+                            "</div>\n" +
+                            "<div class='modal-footer'>\n" +
+                                "<div class='btn btn-secondary' data-dismiss='modal'>Schließen</div>\n" +
+                                "<div class='btn btn-success' onclick='select_{0}()'>Auswählen</div>\n" +
+                            "</div>\n" +
+                        "</div>\n" +
+                    "</div>\n" +
+                "</div>",
+                id,
+                nameText,
+                funcText,
+                nameValue,
+                funcVal,
+                String.Join(" ", attributesText),
+                String.Join(" ", attributesValue),
+                (htmlHelper.ViewData.Model == null || isDefaultValue ? "style='display: none'" : String.Empty),
+                (htmlHelper.ViewData.Model == null || isDefaultValue ? String.Empty : "style='display: none'")
+            );
+
+            var htmlString = String.Format("{0}\n{1}", scriptBuilder.ToString(), contentBuilder.ToString());
+
+            return new HtmlString(htmlString);
+        }
+
+        #endregion
+
+        #region Helper
+
+        /// <summary>
+        /// Generates a random short ID string
+        /// </summary>
+        /// <param name="htmlHelper">HtmlHelper context.</param>
+        public static string RandomId(this IHtmlHelper htmlHelper)
+        {
+            return Guid.NewGuid().ToShortString();
+        }
+
+        /// <summary>
+        /// Generates a random short ID string
+        /// </summary>
+        public static string RandomId()
+        {
+            return Guid.NewGuid().ToShortString();
+        }
+
+        /// <summary>
+        /// Converts an object in a JS literal object format
+        /// </summary>
+        /// <param name="value">The object to be converted.</param>
+        private static string JsonConvertWithoutQuotes(object value)
+        {
+            var serializer = new JsonSerializer();
+            var stringWriter = new StringWriter();
+
+            using (var writer = new JsonTextWriter(stringWriter))
+            {
+                writer.QuoteName = false;
+
+                serializer.Serialize(writer, value);
+            }
+
+            return stringWriter.ToString();
+        }
+
+        #endregion
+    }
+}

+ 50 - 0
GreenTree.Maschinenbestellungen.Web/Extension/ViewDataExtension.cs

@@ -0,0 +1,50 @@
+using Microsoft.AspNetCore.Mvc.Rendering;
+using Microsoft.AspNetCore.Mvc.ViewFeatures;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Extension
+{
+    public static class ViewDataExtension
+    {
+        /// <summary>
+        /// Adds a predefined selection item list in the ViewData dictionary used by many HtmlContent input methods
+        /// </summary>
+        /// <typeparam name="TValue">The list base value type.</typeparam>
+        /// <param name="viewDataDict">The ViewData dictionary.</param>
+        /// <param name="key">The ViewData key.</param>
+        /// <param name="source">The base data source.</param>
+        /// <param name="valueExpression">The expression for the value.</param>
+        /// <param name="textExpression">The expression for the display text.</param>
+        /// <param name="selectedValue">The value of the optional pre selected item.</param>
+        public static void AddSelectList<TValue>(this ViewDataDictionary viewDataDict,
+            string key, IEnumerable<TValue> source, Func<TValue, object> valueExpression, Func<TValue, object> textExpression,
+            object selectedValue = null)
+        {
+            if (viewDataDict == null) return;
+
+            if (String.IsNullOrEmpty(key)) return;
+
+            if (source == null)
+                throw new ArgumentNullException("source", "The specified data source must not be NULL.");
+
+            var selectItemList = new List<SelectListItem>();
+
+            foreach (var item in source)
+            {
+                var val = valueExpression(item).ToString();
+                var text = textExpression(item).ToString();
+
+                if (selectedValue != null && val == selectedValue.ToString())
+                    selectItemList.Add(new SelectListItem(text, val, true));
+                else
+                    selectItemList.Add(new SelectListItem(text, val));
+            }
+
+            viewDataDict.Add(key, selectItemList);
+        }
+    }
+}

+ 36 - 0
GreenTree.Maschinenbestellungen.Web/GreenTree.Maschinenbestellungen.Web.csproj

@@ -0,0 +1,36 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+  <PropertyGroup>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <UserSecretsId>6c0b8996-b219-4547-a7e3-6c8ba8605b5b</UserSecretsId>
+    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="CsvHelper" Version="15.0.9" />
+    <PackageReference Include="FluentValidation.AspNetCore" Version="8.6.2" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.5" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="3.1.5" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.5">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
+    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.3" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\GreenTree.Maschinenbestellungen.Core\GreenTree.Maschinenbestellungen.Core.csproj" />
+    <ProjectReference Include="..\GreenTree.Maschinenbestellungen.Domain\GreenTree.Maschinenbestellungen.Domain.csproj" />
+    <ProjectReference Include="..\GreenTree.Maschinenbestellungen.Services\GreenTree.Maschinenbestellungen.Services.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="Models\Business\" />
+  </ItemGroup>
+
+</Project>

+ 116 - 0
GreenTree.Maschinenbestellungen.Web/Helper/ImportHelper.cs

@@ -0,0 +1,116 @@
+using CsvHelper;
+using GreenTree.Maschinenbestellungen.Web.Models.Import;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Helper
+{
+    public static class ImportHelper
+    {
+        /// <summary>
+        /// Checks an ImportModel instance for a valid import file for the specified data type <typeparamref name="T"/>
+        /// </summary>
+        /// <typeparam name="TEntity">The data type.</typeparam>
+        /// <param name="model">The import model.</param>
+        public static void CheckImport<TEntity>(ImportModel model)
+        {
+            CheckImport<TEntity, TEntity>(model);
+        }
+
+        /// <summary>
+        /// Checks an ImportModel instance for a valid import file for the specified data type <typeparamref name="T"/>
+        /// </summary>
+        /// <typeparam name="TEntity">The data type.</typeparam>
+        /// <typeparam name="TMap">The data map type.</typeparam>
+        /// <param name="model">The import model.</param>
+        public static void CheckImport<TEntity, TMap>(ImportModel model)
+        {
+            if (model == null)
+                throw new ArgumentNullException("model", "The importModel must not be NULL.");
+
+            if (model.ImportFile == null)
+                throw new ArgumentException("The importModel does not contain a file.", "model");
+
+            var tempfile = Path.GetTempFileName();
+
+            using var writer = new FileStream(tempfile, FileMode.Append);
+
+            model.ImportFile.CopyTo(writer);
+
+            writer.Close();
+
+            using (var reader = new StreamReader(tempfile))
+            {
+                using var csv = new CsvReader(reader, CultureInfo.InvariantCulture);
+
+                csv.Configuration.Delimiter = ";";
+                csv.Configuration.BadDataFound = null;
+
+                if (typeof(TEntity) != typeof(TMap))
+                    csv.Configuration.RegisterClassMap(typeof(TMap));
+
+                csv.Read();
+                csv.ReadHeader();
+
+                csv.ValidateHeader<TEntity>();
+            }
+        }
+
+        /// <summary>
+        /// Gets an object collection of <typeparamref name="T"/> from the import file
+        /// </summary>
+        /// <typeparam name="TEntity">The data type.</typeparam>
+        /// <param name="model">The import model.</param>
+        public static IEnumerable<TEntity> GetFromImport<TEntity>(ImportModel model)
+        {
+            return GetFromImport<TEntity, TEntity>(model);
+        }
+
+        /// <summary>
+        /// Gets an object collection of <typeparamref name="T"/> from the import file
+        /// </summary>
+        /// <typeparam name="TEntity">The data type.</typeparam>
+        /// <typeparam name="TMap">The data map type.</typeparam>
+        /// <param name="model">The import model.</param>
+        public static IEnumerable<TEntity> GetFromImport<TEntity, TMap>(ImportModel model)
+        {
+            if (model == null)
+                throw new ArgumentNullException("model", "The importModel must not be NULL.");
+
+            if (model.ImportFile == null)
+                throw new ArgumentException("The importModel does not contain a file.", "model");
+
+            var tempfile = Path.GetTempFileName();
+
+            using var writer = new FileStream(tempfile, FileMode.Append);
+
+            model.ImportFile.CopyTo(writer);
+
+            writer.Close();
+
+            using (var reader = new StreamReader(tempfile))
+            {
+                using var csv = new CsvReader(reader, CultureInfo.InvariantCulture);
+
+                csv.Configuration.Delimiter = ";";
+                csv.Configuration.BadDataFound = null;
+
+                if (typeof(TEntity) != typeof(TMap))
+                    csv.Configuration.RegisterClassMap(typeof(TMap));
+
+                csv.Read();
+                csv.ReadHeader();
+
+                csv.ValidateHeader<TEntity>();
+
+                var result = csv.GetRecords<TEntity>().ToArray();
+
+                return result;
+            }
+        }
+    }
+}

+ 43 - 0
GreenTree.Maschinenbestellungen.Web/ImportMaps/CustomerMap.cs

@@ -0,0 +1,43 @@
+using CsvHelper.Configuration;
+using GreenTree.Maschinenbestellungen.Core.Domain.Business;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.ImportMaps
+{
+    public sealed class CustomerMap : ClassMap<Customer>
+    {
+        #region Ctor
+
+        /// <summary>
+        /// Initialzes a new instnce of the CustomerMap class
+        /// </summary>
+        public CustomerMap()
+        {
+            AutoMap(CultureInfo.InvariantCulture);
+
+            Map(m => m.Title.Id).Name("TitleId").Default(1);
+            Map(m => m.Title.Name).Ignore();
+
+            Map(m => m.Tax.Id).Name("TaxId").Default(-1);
+            Map(m => m.Tax.Name).Ignore();
+            Map(m => m.Tax.ShortName).Ignore();
+            Map(m => m.Tax.Value).Ignore();
+
+            Map(m => m.CreatedOn).Ignore();
+            Map(m => m.CreatedBy).Ignore();
+
+            Map(m => m.ChangedOn).Ignore();
+            Map(m => m.ChangedBy).Ignore();
+
+            Map(m => m.CreationStatus).Ignore();
+
+            Map(m => m.Crafts).Ignore();
+        }
+
+        #endregion
+    }
+}

+ 33 - 0
GreenTree.Maschinenbestellungen.Web/Models/Account/LoginModel.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Models.Account
+{
+    public class LoginModel
+    {
+        #region Properties
+
+        /// <summary>
+        /// User accountname
+        /// </summary>
+        [Display(Name = "Kontoname / E-Mail", Prompt = "Kontoname oder E-Mail")]
+        public string Username { get; set; }
+
+        /// <summary>
+        /// User password
+        /// </summary>
+        [Display(Name = "Passwort", Prompt = "Password")]
+        public string Password { get; set; }
+
+        /// <summary>
+        /// Stay logged in status
+        /// </summary>
+        [Display(Name = "Eingeloggt bleiben")]
+        public bool StayLoggedIn { get; set; }
+
+        #endregion
+    }
+}

+ 11 - 0
GreenTree.Maschinenbestellungen.Web/Models/ErrorViewModel.cs

@@ -0,0 +1,11 @@
+using System;
+
+namespace GreenTree.Maschinenbestellungen.Web.Models
+{
+    public class ErrorViewModel
+    {
+        public string RequestId { get; set; }
+
+        public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+    }
+}

+ 102 - 0
GreenTree.Maschinenbestellungen.Web/Models/Rights/User/UserModel.cs

@@ -0,0 +1,102 @@
+using GreenTree.Maschinenbestellungen.Web.Models.Shared;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Models.Rights.User
+{
+    public class UserModel
+    {
+        #region Properties
+
+        /// <summary>
+        /// User Id
+        /// </summary>
+        [Display(Name = "ID")]
+        public int? Id { get; set; }
+
+        /// <summary>
+        /// User accountname
+        /// </summary>
+        [Display(Name = "Kontoname")]
+        public string Accountname { get; set; }
+
+        /// <summary>
+        /// User password (for creation)
+        /// </summary>
+        [Display(Name = "Passwort")]
+        public string Password { get; set; }
+
+        /// <summary>
+        /// User forename
+        /// </summary>
+        [Display(Name = "Vorname")]
+        public string Forename { get; set; }
+
+        /// <summary>
+        /// User lastname
+        /// </summary>
+        [Display(Name = "Nachname")]
+        public string Lastname { get; set; }
+
+        /// <summary>
+        /// User mail address
+        /// </summary>
+        [Display(Name = "Mail-Adresse")]
+        public string MailAddress { get; set; }
+
+        /// <summary>
+        /// User birthdate
+        /// </summary>
+        [Display(Name = "Geburtsdatum")]
+        [DisplayFormat(ApplyFormatInEditMode = false, DataFormatString = "{0:dd.MM.yyyy}")]
+        public DateTime Birthdate { get; set; }
+
+        /// <summary>
+        /// User activation status
+        /// </summary>
+        [Display(Name = "Aktiviert")]
+        public bool Activated { get; set; }
+
+        /// <summary>
+        /// User policies
+        /// </summary>
+        [Display(Name = "Rechte")]
+        public string[] Policies { get; set; }
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the UserModel class
+        /// </summary>
+        public UserModel() { }
+
+        /// <summary>
+        /// Initializes a new instance of the UserModel class
+        /// </summary>
+        /// <param name="user">Base user entity.</param>
+        public UserModel(Core.Domain.Rights.User user)
+        {
+            if (user == null) return;
+
+            Id = user.Id;
+            Accountname = user.Accountname;
+            Forename = user.Forename;
+            Lastname = user.Lastname;
+            MailAddress = user.MailAddress;
+            Birthdate = user.Birthdate.HasValue
+                ? user.Birthdate.Value
+                : DateTime.MinValue;
+            Activated = user.Activated.Value;
+            Policies = user.Policies
+                .Select(up => up.PolicyName)
+                .ToArray();
+        }
+
+        #endregion
+    }
+}

+ 20 - 0
GreenTree.Maschinenbestellungen.Web/Models/Shared/ISearchResult.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Models.Shared
+{
+    public interface ISearchResult
+    {
+        /// <summary>
+        /// Search result id
+        /// </summary>
+        public object SearchId { get; }
+
+        /// <summary>
+        /// Search result text
+        /// </summary>
+        public string SearchText { get; }
+    }
+}

+ 43 - 0
GreenTree.Maschinenbestellungen.Web/Models/Shared/SearchModel.cs

@@ -0,0 +1,43 @@
+using Microsoft.EntityFrameworkCore.Metadata.Internal;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Models.Shared
+{
+    public class SearchModel
+    {
+        #region Properties
+
+        /// <summary>
+        /// Path of the model property
+        /// </summary>
+        public string ModelPropertyPath { get; set; }
+
+        /// <summary>
+        /// Term to be searched for
+        /// </summary>
+        public string SearchTerm { get; set; }
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the SearchModel class
+        /// </summary>
+        public SearchModel() {  }
+
+        /// <summary>
+        /// Initializes a new instance of the SearchModel class
+        /// </summary>
+        /// <param name="modelPropertyPath">The path of the model property.</param>
+        public SearchModel(string modelPropertyPath) 
+        {
+            ModelPropertyPath = modelPropertyPath;
+        }
+
+        #endregion
+    }
+}

+ 65 - 0
GreenTree.Maschinenbestellungen.Web/Models/Shared/TrackingModel.cs

@@ -0,0 +1,65 @@
+using GreenTree.Maschinenbestellungen.Core.Domain.Shared;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Models.Shared
+{
+    public class TrackingModel
+    {
+        #region Properties
+
+        /// <summary>
+        /// Tracked creation user
+        /// </summary>
+        [Display(Name = "Erstellt von")]
+        public string CreatedBy { get; set; }
+
+        /// <summary>
+        /// Tracked creation datetime
+        /// </summary>
+        [Display(Name = "Erstellt am")]
+        [DisplayFormat(DataFormatString = "{0:dd.MM.yyyy - HH:mm \"Uhr\"}")]
+        public DateTime CreatedOn { get; set; }
+
+        /// <summary>
+        /// Tracked changed user
+        /// </summary>
+        [Display(Name = "Geändert von")]
+        public string ChangedBy { get; set; }
+
+        /// <summary>
+        /// Tracked changed datetime
+        /// </summary>
+        [Display(Name = "Geändert am")]
+        [DisplayFormat(DataFormatString = "{0:dd.MM.yyyy - HH:mm \"Uhr\"}")]
+        public DateTime? ChangedOn { get; set; }
+
+        #endregion
+
+        #region Ctor
+
+        /// <summary>
+        /// Initializes a new instance of the TrackModel class
+        /// </summary>
+        public TrackingModel() { }
+
+        /// <summary>
+        /// Initializes a new instance of the TrackModel class
+        /// </summary>
+        /// <param name="trackedEntity">The based tracked entity.</param>
+        public TrackingModel(TrackedEntity trackedEntity)
+        {
+            if (trackedEntity == null) return;
+
+            CreatedBy = trackedEntity.CreatedBy;
+            CreatedOn = trackedEntity.CreatedOn;
+            ChangedBy = trackedEntity.ChangedBy;
+            ChangedOn = trackedEntity.ChangedOn;
+        }
+
+        #endregion
+    }
+}

+ 26 - 0
GreenTree.Maschinenbestellungen.Web/Program.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
+
+namespace GreenTree.Maschinenbestellungen.Web
+{
+    public class Program
+    {
+        public static void Main(string[] args)
+        {
+            CreateHostBuilder(args).Build().Run();
+        }
+
+        public static IHostBuilder CreateHostBuilder(string[] args) =>
+            Host.CreateDefaultBuilder(args)
+                .ConfigureWebHostDefaults(webBuilder =>
+                {
+                    webBuilder.UseStartup<Startup>();
+                });
+    }
+}

+ 34 - 0
GreenTree.Maschinenbestellungen.Web/Properties/launchSettings.json

@@ -0,0 +1,34 @@
+{
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "http://localhost:55270",
+      "sslPort": 0
+    }
+  },
+  "profiles": {
+    "IIS Express": {
+      "commandName": "IISExpress",
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      },
+      "sqlDebugging": false
+    },
+    "GreenTree.Maschinenbestellungen.Web": {
+      "commandName": "Project",
+      "launchBrowser": true,
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      },
+      "applicationUrl": "http://localhost:5000"
+    },
+    "Docker": {
+      "commandName": "Docker",
+      "launchBrowser": true,
+      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
+      "publishAllPorts": true,
+      "useSSL": false
+    }
+  }
+}

+ 228 - 0
GreenTree.Maschinenbestellungen.Web/Startup.cs

@@ -0,0 +1,228 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+using FluentValidation.AspNetCore;
+using GreenTree.Maschinenbestellungen.Core.Helper;
+using GreenTree.Maschinenbestellungen.Domain.Model;
+using GreenTree.Maschinenbestellungen.Services.Authentication;
+using GreenTree.Maschinenbestellungen.Services.Authorization;
+using GreenTree.Maschinenbestellungen.Services.Geolocator;
+using GreenTree.Maschinenbestellungen.Services.Localization;
+using GreenTree.Maschinenbestellungen.Services.Notification;
+using GreenTree.Maschinenbestellungen.Web.Configuration;
+using GreenTree.Maschinenbestellungen.Web.Models;
+using Microsoft.AspNetCore.Authentication;
+using Microsoft.AspNetCore.Authentication.Cookies;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.HttpsPolicy;
+using Microsoft.AspNetCore.Localization;
+using Microsoft.AspNetCore.Mvc.Razor;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Options;
+using Porta.Kundenzähler.Services.Extension;
+
+namespace GreenTree.Maschinenbestellungen.Web
+{
+    public class Startup
+    {
+        #region Policies
+
+        /// <summary>
+        /// All available policies in the application
+        /// </summary>
+        public static readonly string[] _availablePolicies =
+        {
+            "User-View",
+            "User-Change",
+            "User-Delete"
+        };
+
+        #endregion
+
+        public Startup(IConfiguration configuration)
+        {
+            Configuration = configuration;
+        }
+
+        public IConfiguration Configuration { get; }
+
+        // This method gets called by the runtime. Use this method to add services to the container.
+        public void ConfigureServices(IServiceCollection services)
+        {
+            // Add MVC controller and views
+            services.AddControllersWithViews(options =>
+            {
+                //options.ModelBinderProviders.Insert(0, new CustomerModelBinderProvider());
+            });
+
+            // Add option handling
+            services.AddOptions();
+            services.AddSingleton(typeof(IOptionsMonitor<>), typeof(OptionsMonitor<>));
+
+            // Add the HttpContextAccessor as Singleton
+            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
+
+            // Add global administration notification options
+            var administrationOptions = Configuration.GetSection("AdministrationOptions").Get<AdministrationOptions>();
+
+            if (administrationOptions == null)
+                throw new Exception("The appsettings.json does not contain administration options.");
+
+            services.AddSingleton(administrationOptions);
+
+            // Add MailConfigurationOptions monitor
+            if (!Configuration.SectionExists("MailNotificationOptions"))
+                throw new Exception("The appsettings.json does not contain mail notification options.");
+
+            services.Configure<MailNotificationOptions>(Configuration.GetSection("MailNotificationOptions"));
+
+            // Add the mail notification service
+            services.AddSingleton<INotificationService, MailNotificationService>();
+
+            // Add global Google API options
+            var geocodingOptions = Configuration.GetSection("GoogleApiOptions").Get<GoogleApiOptions>();
+
+            if (geocodingOptions == null)
+                throw new Exception("The appsettings.json does not contain Google API options.");
+
+            services.AddSingleton(geocodingOptions);
+
+            // Add the Google Geocoding service
+            services.AddSingleton<IGeocodingService, GoogleGeocodingService>();
+
+            // Add global culture options
+            services.Configure<CultureOptions>(Configuration.GetSection("CultureOptions"));
+
+            // Add localization
+            services.Configure<RequestLocalizationOptions>(options =>
+            {
+                // Add global culture options
+                var cultureOptions = Configuration.GetSection("CultureOptions").Get<CultureOptions>();
+
+                var culture = cultureOptions == null || (cultureOptions.DefaultCulture != null && String.IsNullOrEmpty(cultureOptions.DefaultCulture))
+                    ? CultureInfo.CurrentCulture.Name
+                    : cultureOptions.DefaultCulture;
+
+                options.DefaultRequestCulture = new RequestCulture(culture);
+                options.RequestCultureProviders = new List<IRequestCultureProvider>
+                {
+                    new QueryStringRequestCultureProvider(),
+                    new CookieRequestCultureProvider()
+                };
+            });
+
+            // Add sessioning
+            services.AddSession(options =>
+            {
+                var sessionOptions = Configuration.GetSection("SessionOptions").Get<SessionOptions>();
+
+                options.IdleTimeout = sessionOptions.IdleTimeout;
+                options.Cookie.Name = sessionOptions.Cookie.Name;
+            });
+
+            // Add Counter DbContext
+            services.AddDbContextPool<OrderDbContext>(options =>
+            {
+                options.UseMySql(Configuration.GetConnectionString("ERPDatabase"));
+                options.UseLazyLoadingProxies();
+            });
+
+            // Add user helper service
+            services.AddScoped<IUserHelper, UserHelper>();
+
+            // Add MVC with FluentValidation reference
+            services.AddMvc()
+              .AddFluentValidation(fv => fv.RegisterValidatorsFromAssembly(Assembly.GetExecutingAssembly()));
+
+            // Add authentication
+            services.AddAuthentication(options => 
+                {
+                    options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
+                })
+                .AddCookie(options => 
+                {
+                    options.Cookie.HttpOnly = true;
+                    options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
+                    options.Cookie.SameSite = SameSiteMode.Strict;
+                    options.LoginPath = "/Account/Login";
+                    options.LogoutPath = "/Account/Logoff";
+                    options.ExpireTimeSpan = new TimeSpan(0, 24, 0, 0);
+                });
+
+            // Add the default custom authentication service
+            services.AddScoped<Services.Authentication.IAuthenticationService, DbContextAuthenticationService>();
+
+            // Add the default authorization handler
+            services.AddScoped<IAuthorizationHandler, DefaultAuthorizationHandler>();
+
+            services.AddAuthorization(options =>
+            {
+                options.DefaultPolicy = new AuthorizationPolicy(
+                    new[] { new DefaultAuthorizationPolicy(String.Empty) },
+                    new[] { CookieAuthenticationDefaults.AuthenticationScheme });
+
+                foreach (var policy in _availablePolicies)
+                {
+                    options.AddPolicy(policy, a =>
+                    {
+                        a.AuthenticationSchemes.Add(CookieAuthenticationDefaults.AuthenticationScheme);
+                        a.RequireAuthenticatedUser();
+                        a.AddRequirements(new DefaultAuthorizationPolicy(policy));
+                    });
+                }
+            });
+
+            // Add the DbContext custom authorization service
+            services.AddScoped<Services.Authorization.IAuthorizationService, CookieAuthorizationService>();
+
+            // Add the option monitoring service
+            services.AddSingleton<IOptionMonitoringService, DefaultOptionMonitoringService>();
+        }
+
+        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
+        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
+        {
+            if (env.IsDevelopment())
+            {
+                app.UseDeveloperExceptionPage();
+            }
+            else
+            {
+                app.UseExceptionHandler("/Home/Error");
+            }
+
+            app.UseStaticFiles();
+            app.UseRequestLocalization();
+
+            app.UseRouting();
+
+            app.UseAuthorization();
+            app.UseAuthentication();
+            app.UseCookiePolicy();
+
+            app.UseEndpoints(endpoints =>
+            {
+                endpoints.MapControllerRoute(
+                    name: "default",
+                    pattern: "{controller=Home}/{action=Index}/{id?}");
+            });
+
+            using (var scope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope())
+            {
+                using (var context = scope.ServiceProvider.GetService<OrderDbContext>())
+                {
+                    context.Database.Migrate();
+                }
+            }
+        }
+    }
+}

+ 104 - 0
GreenTree.Maschinenbestellungen.Web/Validators/LoginValidator.cs

@@ -0,0 +1,104 @@
+using FluentValidation;
+using GreenTree.Maschinenbestellungen.Core.Helper;
+using GreenTree.Maschinenbestellungen.Domain.Model;
+using GreenTree.Maschinenbestellungen.Services.Authorization;
+using GreenTree.Maschinenbestellungen.Web.Models.Account;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Validators
+{
+    public class LoginValidator : AbstractValidator<LoginModel>
+	{
+		#region DI fields
+
+		// The global DbContext
+		private readonly OrderDbContext _eRPDbContext;
+
+		// The global user helper
+		private readonly IUserHelper _userHelper;
+
+		// The global administration options
+		private readonly AdministrationOptions _administrationOptions;
+
+		#endregion
+
+		#region Ctor
+
+		/// <summary>
+		/// Initializes a new instance of the LoginValidator class
+		/// </summary>
+		/// <param name="eRPDbContext">Global DbContext.</param>
+		/// <param name="userHelper">Global user helper.</param>
+		public LoginValidator(
+			OrderDbContext eRPDbContext,
+			IUserHelper userHelper,
+			AdministrationOptions administrationOptions)
+		{
+			_eRPDbContext = eRPDbContext;
+			_userHelper = userHelper;
+			_administrationOptions = administrationOptions;
+
+			RuleFor(x => x.Username)
+				.NotEmpty()
+				.WithMessage("Benutzername erforderlich.")
+				.Custom((a, context) =>
+				{
+					if (a == _administrationOptions.Administrator)
+						return;
+
+					if (!_eRPDbContext.Users.Any(u => u.Accountname == a || u.MailAddress == a))
+					{
+						context.AddFailure("Benutzername nicht gefunden.");
+						return;
+					}
+				});
+
+			RuleFor(x => x.Password)
+				.NotEmpty()
+				.WithMessage("Passwort erforderlich.")
+				.Custom((p, context) =>
+				{
+					if (String.IsNullOrEmpty(p))
+						return;
+
+					var model = context.InstanceToValidate as LoginModel;
+
+					if (model == null)
+					{
+						context.AddFailure("Unbekannter Fehler.");
+						return;
+					}
+
+					if (model.Username == administrationOptions.Administrator)
+					{
+						if (_userHelper.HashString(p, false) == _administrationOptions.Password)
+							return;
+						else
+                        {
+							context.AddFailure("Kennwort falsch.");
+							return;
+						}
+					}
+
+					var user = _eRPDbContext.Users
+						.FirstOrDefault(u => u.Accountname == model.Username || u.MailAddress == model.Username);
+
+					if (user == null)
+					{
+						context.AddFailure("Unbekannter Fehler.");
+						return;
+					}
+
+					if (user.Password != _userHelper.HashString(p, true))
+						context.AddFailure("Kennwort falsch.");
+
+					return;
+				});
+		}
+
+		#endregion
+	}
+}

+ 63 - 0
GreenTree.Maschinenbestellungen.Web/Validators/UserValidator.cs

@@ -0,0 +1,63 @@
+using FluentValidation;
+using GreenTree.Maschinenbestellungen.Domain.Model;
+using GreenTree.Maschinenbestellungen.Services.Authorization;
+using GreenTree.Maschinenbestellungen.Web.Models.Rights.User;
+using Microsoft.AspNetCore.Identity;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security.Cryptography.X509Certificates;
+using System.Threading.Tasks;
+
+namespace GreenTree.Maschinenbestellungen.Web.Validators
+{
+	public class UserValidator : AbstractValidator<UserModel>
+	{
+		#region DI fields
+
+		// The global DbContext
+		private readonly OrderDbContext _eRPDbContext;
+
+		#endregion
+
+		#region Ctor
+
+		/// <summary>
+		/// Initializes a new instance of the UserValidator class
+		/// </summary>
+		/// <param name="eRPDbContext">Global DbContext.</param>
+		public UserValidator(OrderDbContext eRPDbContext)
+		{
+			_eRPDbContext = eRPDbContext;
+
+			RuleFor(x => x.Accountname)
+				.NotEmpty()
+				.Length(0, 16)
+				.WithMessage("Der Kontoname darf maximal 16 Zeichen lang sein.");
+
+			RuleFor(x => x.Accountname)
+				.Must(a => !_eRPDbContext.Users.Any(u => u.Accountname == a))
+				.When(x => _eRPDbContext.Users
+						.Any(u => u.Id != x.Id && u.Accountname == x.Accountname))
+				.WithMessage("Der Accountname wird bereits verwendet.");
+
+			RuleFor(x => x.Forename)
+				.NotEmpty()
+				.WithMessage("Es muss ein gültiger Vorname eingegeben werden.");
+
+			RuleFor(x => x.Lastname)
+				.NotEmpty()
+				.WithMessage("Es muss ein gültiger Nachname eingegeben werden.");
+
+			RuleFor(x => x.MailAddress)
+				.EmailAddress()
+				.WithMessage("Es muss eine gültige E-Mail Adresse eingegeben werden.");
+
+			RuleFor(x => x.Birthdate)
+				.LessThan(DateTime.Now.Date.AddYears(-12))
+				.WithMessage("Das Geburtsdatum muss mindestens 12 Jahre in der Vergangenheit liegen.");
+		}
+
+		#endregion
+	}
+}

+ 30 - 0
GreenTree.Maschinenbestellungen.Web/Views/Account/Login.cshtml

@@ -0,0 +1,30 @@
+@model GreenTree.Maschinenbestellungen.Web.Models.Account.LoginModel
+
+@{
+    ViewData["Title"] = "Login";
+    Layout = "~/Views/Shared/_Empty.cshtml";
+}
+
+<form asp-action="Login" class="form-signin">
+    <img class="mb-3 mt-5" src="~/img/strohrmann_logo.png" alt="" />
+    <div class="dropdown-divider"></div>
+    <h1 class="h3 mb-3 mt-3 font-weight-normal">Anmeldung</h1>
+    <label asp-for="Username" class="sr-only"></label>
+    <input asp-for="Username" class="form-control form-control-lg" />
+    <label asp-for="Password" class="sr-only"></label>
+    <input asp-for="Password" type="password" class="form-control form-control-lg" />
+    <div class="checkbox mb-3 mt-2">
+        <label>
+            <input asp-for="StayLoggedIn" />
+            @Html.LabelFor(model => model.StayLoggedIn)
+        </label>
+    </div>
+    <div class="mb-2 mt-2">
+        <span asp-validation-for="Username" class="text-danger"></span>
+    </div>
+    <div class="mb-2 mt-2">
+        <span asp-validation-for="Password" class="text-danger"></span>
+    </div>
+    <button class="btn btn-lg btn-primary btn-block" type="submit">Anmelden</button>
+    <p class="mt-5 mb-3 text-muted">© 2020 - GreenTree Studios</p>
+</form>

+ 8 - 0
GreenTree.Maschinenbestellungen.Web/Views/Home/Index.cshtml

@@ -0,0 +1,8 @@
+@{
+    ViewData["Title"] = "Home Page";
+}
+
+<div class="text-center">
+    <h1 class="display-4">Welcome</h1>
+    <p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
+</div>

+ 66 - 0
GreenTree.Maschinenbestellungen.Web/Views/Rights/User/Create.cshtml

@@ -0,0 +1,66 @@
+@model GreenTree.Maschinenbestellungen.Web.Models.Rights.User.UserModel
+
+@{
+	ViewData["Title"] = "Neuer Benutzer";
+}
+
+<h1>Benutzer anlegen</h1>
+
+<h4>Neuer Benutzer</h4>
+<hr />
+<div class="row">
+    <div class="col-md-4">
+        <form asp-action="Create">
+            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
+            <div class="form-group">
+                <label asp-for="Accountname" class="control-label"></label>
+                <input asp-for="Accountname" class="form-control" />
+                <span asp-validation-for="Accountname" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Password" class="control-label"></label>
+                <input asp-for="Password" class="form-control" />
+                <span asp-validation-for="Password" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Forename" class="control-label"></label>
+                <input asp-for="Forename" class="form-control" />
+                <span asp-validation-for="Forename" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Lastname" class="control-label"></label>
+                <input asp-for="Lastname" class="form-control" />
+                <span asp-validation-for="Lastname" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="MailAddress" class="control-label"></label>
+                <input asp-for="MailAddress" type="email" class="form-control" />
+                <span asp-validation-for="MailAddress" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Birthdate" class="control-label"></label>
+                <input asp-for="Birthdate" type="date" class="form-control" />
+                <span asp-validation-for="Birthdate" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Policies" class="control-label">Rechte</label>
+                @Html.TokenBoxFor(model => model.Policies, availableValues: (string[])ViewData["AvailablePolicies"], allowOnlyOnce: true)
+                <span asp-validation-for="Policies" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <input type="submit" value="Erstellen" class="btn btn-primary" />
+            </div>
+        </form>
+    </div>
+</div>
+
+<div>
+    <a asp-action="Index">Zurück zur Liste</a>
+</div>
+
+@section Scripts {
+    @{
+		await Html.RenderPartialAsync("_ValidationScriptsPartial");
+		await Html.RenderPartialAsync("_TokenBoxLibPartial");
+	}
+}

+ 66 - 0
GreenTree.Maschinenbestellungen.Web/Views/Rights/User/Details.cshtml

@@ -0,0 +1,66 @@
+@model GreenTree.Maschinenbestellungen.Web.Models.Rights.User.UserModel
+
+@{
+    ViewData["Title"] = "Benutzeranzeige";
+}
+
+<h1>Benutzeranzeige</h1>
+
+<div>
+    <h4>@Model.Lastname, @Model.Forename</h4>
+    <hr />
+    <dl class="row">
+        <dt class = "col-sm-2">
+            @Html.DisplayNameFor(model => model.Id)
+        </dt>
+        <dd class = "col-sm-10">
+            @Html.DisplayFor(model => model.Id)
+        </dd>
+        <dt class = "col-sm-2">
+            @Html.DisplayNameFor(model => model.Accountname)
+        </dt>
+        <dd class = "col-sm-10">
+            @Html.DisplayFor(model => model.Accountname)
+        </dd>
+        <dt class = "col-sm-2">
+            @Html.DisplayNameFor(model => model.Forename)
+        </dt>
+        <dd class = "col-sm-10">
+            @Html.DisplayFor(model => model.Forename)
+        </dd>
+        <dt class = "col-sm-2">
+            @Html.DisplayNameFor(model => model.Lastname)
+        </dt>
+        <dd class = "col-sm-10">
+            @Html.DisplayFor(model => model.Lastname)
+        </dd>
+        <dt class = "col-sm-2">
+            @Html.DisplayNameFor(model => model.Birthdate)
+        </dt>
+        <dd class = "col-sm-10">
+            @Html.DisplayFor(model => model.Birthdate)
+        </dd>
+        <dt class = "col-sm-2">
+            @Html.DisplayNameFor(model => model.Activated)
+        </dt>
+        <dd class = "col-sm-10">
+            @Html.YesNoBadgeFor(model => model.Activated)
+        </dd>
+        <dt class = "col-sm-2">
+            @Html.DisplayNameFor(model => model.Policies)
+        </dt>
+        <dd class = "col-sm-10">
+            @Html.TokenBoxFor(model => model.Policies)
+        </dd>
+    </dl>
+</div>
+<div>
+    @Html.ActionLink("Bearbeiten", "Edit", new { id = Model.Id }) |
+    <a asp-action="Index">Zurück zur Liste</a>
+</div>
+
+@section Scripts {
+    @{
+		await Html.RenderPartialAsync("_TokenBoxLibPartial");
+	}
+}

+ 64 - 0
GreenTree.Maschinenbestellungen.Web/Views/Rights/User/Edit.cshtml

@@ -0,0 +1,64 @@
+@model GreenTree.Maschinenbestellungen.Web.Models.Rights.User.UserModel
+
+@{
+    ViewData["Title"] = "Edit";
+}
+
+<h1>Bearbeiten</h1>
+
+<h4>@Model.Lastname, @Model.Forename</h4>
+<hr />
+<div class="row">
+    <div class="col-md-4">
+        <form asp-action="Edit">
+            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
+            <input asp-for="Id" type="hidden" class="form-control" />
+            <div class="form-group">
+                <label asp-for="Accountname" class="control-label"></label>
+                <input asp-for="Accountname" class="form-control" />
+                <span asp-validation-for="Accountname" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Forename" class="control-label"></label>
+                <input asp-for="Forename" class="form-control" />
+                <span asp-validation-for="Forename" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Lastname" class="control-label"></label>
+                <input asp-for="Lastname" class="form-control" />
+                <span asp-validation-for="Lastname" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Birthdate" class="control-label"></label>
+                <input asp-for="Birthdate" type="date" class="form-control" />
+                <span asp-validation-for="Birthdate" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <label asp-for="Activated" class="control-label">Aktiviert</label>
+                <select asp-for="Activated" class="form-control">
+                    <option value="true">Ja</option>
+                    <option value="false">Nein</option>
+                </select>
+            </div>
+            <div class="form-group">
+                <label asp-for="Policies" class="control-label">Rechte</label>
+                @Html.TokenBoxFor(model => model.Policies, availableValues: (string[])ViewData["AvailablePolicies"], allowOnlyOnce: true)
+                <span asp-validation-for="Policies" class="text-danger"></span>
+            </div>
+            <div class="form-group">
+                <input type="submit" value="Speichern" class="btn btn-primary" />
+            </div>
+        </form>
+    </div>
+</div>
+
+<div>
+    <a asp-action="Index">Zurück zur Liste</a>
+</div>
+
+@section Scripts {
+    @{
+		await Html.RenderPartialAsync("_ValidationScriptsPartial");
+		await Html.RenderPartialAsync("_TokenBoxLibPartial");
+	}
+}

+ 164 - 0
GreenTree.Maschinenbestellungen.Web/Views/Rights/User/Index.cshtml

@@ -0,0 +1,164 @@
+@model IEnumerable<GreenTree.Maschinenbestellungen.Web.Models.Rights.User.UserModel>
+
+@{
+    ViewData["Title"] = "Benutzerverwaltung";
+}
+
+<!-- Custom JavaScript -->
+<script>
+
+    $(window).resize(function () {
+        $(".dataTables_scrollBody").height($(window).height() - 260);
+    });
+
+    $(document).ready(function () {
+        $("#usersTable").DataTable({
+            scrollY: $(window).height() - 260 + "px",
+            autoWidth: true,
+            paging: false,
+            "bInfo": false,
+            columns: [
+                {
+                    data: "ID",
+                    orderable: true
+                },
+                {
+                    data: "Kontoname",
+                    orderable: true
+                },
+                {
+                    data: "Vorname",
+                    orderable: true
+                },
+                {
+                    data: "Nachname",
+                    orderable: true
+                },
+                {
+                    data: "Geburtsdatum",
+                    orderable: true
+                },
+                {
+                    data: "Aktiviert",
+                    orderable: true
+                },
+                {
+                    data: "Rechte",
+                    orderable: false
+                },
+                {
+                    data: "Aktionen",
+                    orderable: false
+				}
+            ],
+            language: {
+                zeroRecords: "Keine Einträge gefunden",
+                search: "Suchen:"
+			}
+        });
+    });
+
+    function showDeleteModal(id) {
+        if (!id) return;
+        $('#deleteModal').modal("show");
+        $("[name='id'").val(id);
+    }
+
+</script>
+
+<h1>Benutzerverwaltung</h1>
+
+<p>
+    <a asp-action="Create">Neuen Benutzer anlegen</a>
+</p>
+<table id="usersTable" class="table">
+    <thead>
+        <tr>
+            <th>
+                @Html.DisplayNameFor(model => model.Id)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.Accountname)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.Forename)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.Lastname)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.Birthdate)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.Activated)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.Policies)
+            </th>
+            <th>
+                Aktionen
+            </th>
+        </tr>
+    </thead>
+    <tbody>
+    @foreach (var item in Model) {
+        <tr>
+            <td>
+                @Html.DisplayFor(modelItem => item.Id)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.Accountname)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.Forename)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.Lastname)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.Birthdate)
+            </td>
+            <td>
+                @Html.YesNoBadgeFor(modelItem => item.Activated)
+            </td>
+            <td>
+                @Html.TokenBoxFor(modelItem => item.Policies)
+            </td>
+            <td>
+                @Html.ActionLink("Bearbeiten", "Edit", new { id = item.Id }) |
+                @Html.ActionLink("Anzeigen", "Details", new { id = item.Id }) |
+                <a href="#" onclick="showDeleteModal(@item.Id)">Löschen</a>
+            </td>
+        </tr>
+    }
+    </tbody>
+</table>
+
+<div id="deleteModal" class="modal fade" tabindex="-1" role="dialog">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">Benutzer löschen</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <form asp-action="Delete">
+                <div class="modal-body">
+                    <p>Sind Sie sicher, dass Sie diesen Benutzer löschen möchten?</p>
+                    <input name="id" type="hidden" />
+                </div>
+                <div class="modal-footer">
+                    <button type="submit" class="btn btn-primary">Ja</button>
+                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Nein</button>
+                </div>
+            </form>
+        </div>
+    </div>
+</div>
+
+@section Scripts {
+    @{
+		await Html.RenderPartialAsync("_TokenBoxLibPartial");
+	}
+}

+ 25 - 0
GreenTree.Maschinenbestellungen.Web/Views/Shared/Error.cshtml

@@ -0,0 +1,25 @@
+@model ErrorViewModel
+@{
+    ViewData["Title"] = "Error";
+}
+
+<h1 class="text-danger">Error.</h1>
+<h2 class="text-danger">An error occurred while processing your request.</h2>
+
+@if (Model.ShowRequestId)
+{
+    <p>
+        <strong>Request ID:</strong> <code>@Model.RequestId</code>
+    </p>
+}
+
+<h3>Development Mode</h3>
+<p>
+    Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
+</p>
+<p>
+    <strong>The Development environment shouldn't be enabled for deployed applications.</strong>
+    It can result in displaying sensitive information from exceptions to end users.
+    For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
+    and restarting the app.
+</p>

+ 76 - 0
GreenTree.Maschinenbestellungen.Web/Views/Shared/_Empty.cshtml

@@ -0,0 +1,76 @@
+@using Microsoft.AspNetCore.Authorization
+
+@inject IAuthorizationService AuthorizationService
+
+<!DOCTYPE html>
+<html lang="de">
+
+<head>
+
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <title>@ViewData["Title"] - Strohrmann ERP Login</title>
+
+    <!-- Bootstrap core CSS -->
+    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
+
+    <!-- FontAwesome core CSS -->
+    <link rel="stylesheet" href="~/lib/font-awesome/css/all.min.css" />
+
+    <!-- FontAwesome CSS -->
+    <link rel="stylesheet" href="~/lib/font-awesome/css/fontawesome.min.css" />
+
+    <!-- jQueryUI CSS -->
+    <link rel="stylesheet" href="~/lib/jqueryui/jquery-ui.min.css" />
+
+    <!-- Custom page CSS -->
+    <link rel="stylesheet" href="~/css/site.css" />
+
+        <!-- Custom styles for this template -->
+    <link rel="stylesheet" href="~/css/simple-sidebar.css" />
+
+</head>
+
+<body style="background-color: #f5f5f5">
+
+    <!-- jQuery core JavaScript -->
+    <script src="~/lib/jquery/dist/jquery.min.js"></script>
+
+    <!-- Bootstrap core JavaScript -->
+    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
+
+    <!-- jQuery UI JavaScript -->
+    <script src="~/lib/jqueryui/jquery-ui.min.js"></script>
+
+    <!-- DataTables JavaScript -->
+    <script src="~/lib/datatables/js/jquery.dataTables.min.js"></script>
+    <script src="~/lib/datatables/js/dataTables.bootstrap4.min.js"></script>
+
+    <!-- application core JavaScript -->
+    <script src="~/js/site.js" asp-append-version="true"></script>
+
+    @RenderSection("Scripts", required: false)
+
+    <div class="d-flex" id="wrapper">
+
+        <!-- Page Content -->
+        <div id="page-content-wrapper">
+
+            <nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom" style="height: 42px">
+
+            </nav>
+
+            <div class="container-fluid">
+                @RenderBody()
+            </div>
+        </div>
+        <!-- /#page-content-wrapper -->
+
+    </div>
+    <!-- /#wrapper -->
+
+</body>
+</html>

+ 159 - 0
GreenTree.Maschinenbestellungen.Web/Views/Shared/_Layout.cshtml

@@ -0,0 +1,159 @@
+@using Microsoft.AspNetCore.Authorization
+
+@inject GreenTree.Maschinenbestellungen.Services.Authorization.AdministrationOptions AdministrationOptions
+@inject GreenTree.Maschinenbestellungen.Services.Authorization.IAuthorizationService AuthorizationService
+
+@{ 
+	var isAdministrator = User.Claims
+        .Any(c => c.Type == System.Security.Claims.ClaimTypes.NameIdentifier &&
+                  c.Value == AdministrationOptions.Administrator);
+}
+
+<!DOCTYPE html>
+<html lang="de">
+
+<head>
+
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+    <meta name="description" content="">
+    <meta name="author" content="">
+
+    <title>@ViewData["Title"] - Maschinenbestellungen</title>
+
+    <!-- Bootstrap core CSS -->
+    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
+
+    <!-- Bootstrap plugins CSS -->
+    <link rel="stylesheet" href="~/lib/bootstrap-select/css/bootstrap-select.css" />
+
+    <!-- FontAwesome core CSS -->
+    <link rel="stylesheet" href="~/lib/font-awesome/css/all.min.css" />
+
+    <!-- FontAwesome CSS -->
+    <link rel="stylesheet" href="~/lib/font-awesome/css/fontawesome.min.css" />
+
+    <!-- jQueryUI CSS -->
+    <link rel="stylesheet" href="~/lib/jqueryui/jquery-ui.min.css" />
+
+    <!-- DataTables CSS -->
+    <link rel="stylesheet" href="~/lib/datatables/css/dataTables.bootstrap4.min.css" />
+
+    <!-- Custom page CSS -->
+    <link rel="stylesheet" href="~/css/site.css" />
+
+    <!-- Custom styles for this template -->
+    <link rel="stylesheet" href="~/css/simple-sidebar.css" />
+
+</head>
+
+<body>
+
+    <!-- jQuery core JavaScript -->
+    <script src="~/lib/jquery/dist/jquery.min.js"></script>
+
+    <!-- jQuery UI JavaScript -->
+    <script src="~/lib/jqueryui/jquery-ui.min.js"></script>
+
+    <!-- Popper JavaScript -->
+    <script src="~/lib/popper.js/umd/popper.min.js"></script>
+
+    <!-- Bootstrap core JavaScript -->
+    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
+
+    <!-- Bootstrap plugins JavaScript -->
+    <script src="~/lib/bootstrap-select/js/bootstrap-select.js"></script>
+    <script src="~/lib/bootstrap-select/js/i18n/defaults-de_DE.min.js"></script>
+
+    <!-- DataTables JavaScript -->
+    <script src="~/lib/datatables/js/jquery.dataTables.min.js"></script>
+    <script src="~/lib/datatables/js/dataTables.bootstrap4.min.js"></script>
+    <script src="~/lib/datatables-responsive/dataTables.responsive.js"></script>
+
+    <!-- application core JavaScript -->
+    <script src="~/js/site.js" asp-append-version="true"></script>
+
+    <!-- application extension JavaScript -->
+    <script src="~/js/extension.js" asp-append-version="true"></script>
+
+    @RenderSection("Scripts", required: false)
+
+    <div class="d-flex" id="wrapper">
+
+        <!-- Sidebar -->
+        <div class="bg-light border-right" id="sidebar-wrapper">
+            <div class="sidebar-heading">Strohrmann ERP</div>
+            <div class="list-group list-group-flush">
+                <h5 class="list-group-item">Dashboard</h5>
+                <a asp-controller="Home" asp-action="Index" class="list-group-item list-group-item-action bg-light">
+                    <span class="fas fa-fw fa-tachometer-alt"></span>
+                    <span>Übersicht</span>
+                </a>
+                @if (isAdministrator || AuthorizationService.UserHasCategoryPolicy(User.Identity, "User")) 
+                {
+                    <h5 class="list-group-item">Administration</h5>
+                    <a asp-controller="Rights" asp-action="Index" class="list-group-item list-group-item-action bg-light">
+                        <span class="fas fa-fw fa-user-friends w-10"></span>
+                        <span>Benutzerverwaltung</span>
+                    </a>
+                }
+            </div>
+        </div>
+        <!-- /#sidebar-wrapper -->
+
+        <!-- Page Content -->
+        <div id="page-content-wrapper">
+            <div id="contentHeadContainer" class="container-fluid pr-0">
+                <div class="row d-flex top-menu">
+                    <div class="mr-auto p-0">
+                        <nav class="navbar navbar-expand-lg navbar-light">
+                            <button class="btn btn-primary" id="menu-toggle" title="Menü ein- / ausklappen">
+                                <span class="fas fa-th-list"></span>
+                            </button>
+                        </nav>
+                    </div>
+                    <div class="d-none d-lg-inline p-2">
+                        <img class="align-middle mt-1" src="~/img/strohrmann_logo.png" title="Strohrmann" height="30" />
+                    </div>
+                    <div class="d-flex user-logo-container">
+                        <img class="align-self-center mr-1 ml-3" src="~/img/user_logo.png" title="@User.Identity.Name" height="40" />
+                        <span class="align-self-center mr-4 ml-1 text-white">
+                            <small>@User.Identity.Name</small>
+                        </span>
+                        <a class="btn btn-info btn-sm align-self-center mr-4" role="button" href="@Url.Action("Logout", "Account")">
+                            Ausloggen
+                        </a>
+                    </div>
+                </div>
+            </div>
+
+            <div id="contentBodyContainer" class="container-fluid overflow-auto">
+                @RenderBody()
+            </div>
+        </div>
+        <!-- /#page-content-wrapper -->
+
+    </div>
+    <!-- /#wrapper -->
+
+    <!-- Menu Toggle Script -->
+    <script type="text/javascript">
+
+        $("#menu-toggle").click(function(e) {
+            e.preventDefault();
+            $("#wrapper").toggleClass("toggled");
+        });
+
+        $(window).resize(function () {
+            $("#contentBodyContainer").height($(window).height() - $("#contentHeadContainer").height());
+        });
+
+        $(document).ready(function () {
+            $("#contentBodyContainer").height($(window).height() - $("#contentHeadContainer").height());
+        });
+
+    </script>
+
+</body>
+
+</html>

+ 5 - 0
GreenTree.Maschinenbestellungen.Web/Views/Shared/_TokenBoxLibPartial.cshtml

@@ -0,0 +1,5 @@
+<!-- Token field UI extension JavaScript -->
+<script src="~/lib/bootstrap-tokenfield/bootstrap-tokenfield.min.js"></script>
+
+<!-- Token field UI extension Stylesheet -->
+<link rel="stylesheet" href="~/lib/bootstrap-tokenfield/css/bootstrap-tokenfield.min.css" />

+ 2 - 0
GreenTree.Maschinenbestellungen.Web/Views/Shared/_ValidationScriptsPartial.cshtml

@@ -0,0 +1,2 @@
+<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
+<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

+ 7 - 0
GreenTree.Maschinenbestellungen.Web/Views/_ViewImports.cshtml

@@ -0,0 +1,7 @@
+@using System.Globalization;
+@using GreenTree.Maschinenbestellungen.Web
+@using GreenTree.Maschinenbestellungen.Web.Models
+@using GreenTree.Maschinenbestellungen.Web.Extension
+@using GreenTree.Maschinenbestellungen.Web.Models.Business
+@using GreenTree.Maschinenbestellungen.Core.Extension
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

+ 3 - 0
GreenTree.Maschinenbestellungen.Web/Views/_ViewStart.cshtml

@@ -0,0 +1,3 @@
+@{
+    Layout = "_Layout";
+}

+ 9 - 0
GreenTree.Maschinenbestellungen.Web/appsettings.Development.json

@@ -0,0 +1,9 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft": "Warning",
+      "Microsoft.Hosting.Lifetime": "Information"
+    }
+  }
+}

+ 37 - 0
GreenTree.Maschinenbestellungen.Web/appsettings.json

@@ -0,0 +1,37 @@
+{
+    "Logging": {
+        "LogLevel": {
+            "Default": "Information",
+            "Microsoft": "Warning",
+            "Microsoft.Hosting.Lifetime": "Information"
+        }
+    },
+    "AllowedHosts": "*",
+    "ConnectionStrings": {
+        "ERPDatabase": "Server=lynx-solutions.org;Port=33306;Database=Maschinenbestellungen;User Id=root;Password=dV84HTb68?s,;"
+    },
+    "SessionOptions": {
+        "IdleTimeout": "01:00:00",
+        "Cookie": {
+            "Name": "GreenTree.Maschinenbestellungen.Session"
+        }
+    },
+    "AdministrationOptions": {
+        "Administrator": "admin",
+        "Password": "a3b9c163f6c520407ff34cfdb83ca5c6"
+    },
+    "MailNotificationOptions": {
+        "From": "no-reply@Strohrmann-ERP.de",
+        "SmtpServerAddress": "lynx-solutions.org",
+        "SmtpServerUsername": "service",
+        "SmtpServerPassword": "14595809ad.",
+        "SmtpServerDomain": ""
+    },
+    "GoogleApiOptions": {
+        "ApiKey": "AIzaSyDJI7VrvPaCxG1u4rdEWoAjTfai2_6PWU4",
+        "Enabled": false
+    },
+    "CultureOptions": {
+        "DefaultCulture": "de-DE"
+    }
+}

+ 48 - 0
GreenTree.Maschinenbestellungen.Web/libman.json

@@ -0,0 +1,48 @@
+{
+  "version": "1.0",
+  "defaultProvider": "cdnjs",
+  "libraries": [
+    {
+      "library": "font-awesome@5.12.0-2",
+      "destination": "wwwroot/lib/font-awesome/"
+    },
+    {
+      "library": "datatables@1.10.20",
+      "destination": "wwwroot/lib/datatables/"
+    },
+    {
+      "library": "jqueryui@1.12.1",
+      "destination": "wwwroot/lib/jqueryui/"
+    },
+    {
+      "library": "bootstrap-tokenfield@0.12.0",
+      "destination": "wwwroot/lib/bootstrap-tokenfield/"
+    },
+    {
+      "library": "datatables-responsive@2.2.5",
+      "destination": "wwwroot/lib/datatables-responsive/"
+    },
+    {
+      "library": "bootstrap-select@1.13.18",
+      "destination": "wwwroot/lib/bootstrap-select/"
+    },
+    {
+      "library": "popper.js@2.4.4",
+      "destination": "wwwroot/lib/popper.js/",
+      "files": [
+        "umd/popper-base.js",
+        "umd/popper-base.js.map",
+        "umd/popper-base.min.js",
+        "umd/popper-base.min.js.map",
+        "umd/popper-lite.js",
+        "umd/popper-lite.js.map",
+        "umd/popper-lite.min.js",
+        "umd/popper-lite.min.js.map",
+        "umd/popper.js",
+        "umd/popper.js.map",
+        "umd/popper.min.js",
+        "umd/popper.min.js.map"
+      ]
+    }
+  ]
+}

+ 49 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/css/simple-sidebar.css

@@ -0,0 +1,49 @@
+/*!
+ * Start Bootstrap - Simple Sidebar (https://startbootstrap.com/template-overviews/simple-sidebar)
+ * Copyright 2013-2019 Start Bootstrap
+ * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-simple-sidebar/blob/master/LICENSE)
+ */
+body {
+  overflow-x: hidden;
+}
+
+#sidebar-wrapper {
+  min-height: 100vh;
+  margin-left: -15rem;
+  -webkit-transition: margin .25s ease-out;
+  -moz-transition: margin .25s ease-out;
+  -o-transition: margin .25s ease-out;
+  transition: margin .25s ease-out;
+}
+
+#sidebar-wrapper .sidebar-heading {
+  padding: 0.8rem 1.25rem;
+  font-size: 1.2rem;
+}
+
+#sidebar-wrapper .list-group {
+  width: 15rem;
+}
+
+#page-content-wrapper {
+  min-width: 100vw;
+}
+
+#wrapper.toggled #sidebar-wrapper {
+  margin-left: 0;
+}
+
+@media (min-width: 768px) {
+  #sidebar-wrapper {
+    margin-left: 0;
+  }
+
+  #page-content-wrapper {
+    min-width: 0;
+    width: 100%;
+  }
+
+  #wrapper.toggled #sidebar-wrapper {
+    margin-left: -15rem;
+  }
+}

+ 183 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/css/site.css

@@ -0,0 +1,183 @@
+/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
+for details on configuring this project to bundle and minify static web assets. */
+
+a.navbar-brand {
+  white-space: normal;
+  text-align: center;
+  word-break: break-all;
+}
+
+/* Provide sufficient contrast against white background */
+a {
+  color: #0366d6;
+}
+
+.btn-primary {
+  color: #fff;
+  background-color: #1b6ec2;
+  border-color: #1861ac;
+}
+
+.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
+  color: #fff;
+  background-color: #1b6ec2;
+  border-color: #1861ac;
+}
+
+/* Sticky footer styles
+-------------------------------------------------- */
+html {
+  font-size: 14px;
+}
+@media (min-width: 768px) {
+  html {
+    font-size: 16px;
+  }
+}
+
+.border-top {
+  border-top: 1px solid #e5e5e5;
+}
+.border-bottom {
+  border-bottom: 1px solid #e5e5e5;
+}
+
+.box-shadow {
+  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
+}
+
+button.accept-policy {
+  font-size: 1rem;
+  line-height: inherit;
+}
+
+/* Sticky footer styles
+-------------------------------------------------- */
+html {
+  position: relative;
+  min-height: 100%;
+}
+
+/* General  */
+
+body {
+  /* Margin bottom by footer height */
+  /*  margin-bottom: 60px;*/
+}
+
+.footer {
+  position: absolute;
+  bottom: 0;
+  width: 100%;
+  white-space: nowrap;
+  line-height: 60px; /* Vertically center the text there */
+}
+
+.divider-v {
+    height: auto;
+    width: 2px;
+    background-color: #A0A0A0;
+    margin: auto 12px;
+    clear: both;
+}
+
+.top-menu {
+    border-bottom: 1px solid #dee2e6 !important;
+    background-color: #f8f9fa !important;
+}
+
+/* Custom view styles */
+
+.form-signin {
+    width: 100%;
+    max-width: 330px;
+    padding: 15px;
+    margin: 0 auto;
+    text-align: center;
+}
+
+.form-signin #Username {
+    margin-bottom: -1px;
+    border-bottom-right-radius: 0;
+    border-bottom-left-radius: 0;
+}
+
+.form-signin #Password {
+    border-top-right-radius: 0;
+    border-top-left-radius: 0;
+}
+
+/* Scrollbar */
+
+::-webkit-scrollbar-track {
+    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
+    background-color: #F5F5F5;
+}
+
+::-webkit-scrollbar {
+    width: 8px;
+}
+
+::-webkit-scrollbar-thumb {
+    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.3);
+    background-color: #A0A0A0;
+}
+
+/* NavBar */
+
+.user-logo-container {
+    border-left-color: #F29000;
+    background-color: #F29000;
+    border-bottom-left-radius: 20px;
+    border-top-left-radius: 0;
+}
+
+.user-logo-content {
+    margin: auto 0;
+}
+
+.user-logo-container img {
+    width: 32px;
+    height: 32px;
+}
+
+/* Bootstrap extension and editing */
+
+.modal-header-info {
+    background-color: #17a2b8 !important;
+}
+
+.modal-content-header-custom {
+    border-top-left-radius: .4rem;
+    border-top-right-radius: .4rem;
+}
+
+.card-maxw {
+    max-width: 360px;
+}
+
+.card-sm-maxw {
+    max-width: 440px;
+}
+
+.card-md-maxw {
+    max-width: 560px;
+}
+
+.card-lg-maxw {
+    max-width: 700px;
+}
+
+.card-xl-maxw {
+    max-width: 760px;
+}
+
+.selectpicker-form {
+    background-color: white;
+    border: 1px solid #ced4da;
+}
+
+/* FontAwesome extension */
+.fa-cust-lh {
+    line-height: inherit;
+}

BIN=BIN
GreenTree.Maschinenbestellungen.Web/wwwroot/favicon.ico


BIN=BIN
GreenTree.Maschinenbestellungen.Web/wwwroot/img/icon-average-48.png


BIN=BIN
GreenTree.Maschinenbestellungen.Web/wwwroot/img/icon-sigma-48.png


BIN=BIN
GreenTree.Maschinenbestellungen.Web/wwwroot/img/strohrmann_logo.png


BIN=BIN
GreenTree.Maschinenbestellungen.Web/wwwroot/img/user_logo.png


+ 72 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/js/extension.js

@@ -0,0 +1,72 @@
+//************** JQuery extension **************//
+
+(function ($) {
+    var jqAppend = $.fn.append;
+    $.fn.append = function () {
+        // Make a list of arguments that are jQuery objects
+        var appendages = $.makeArray(arguments).filter(function (arg) {
+            return arg instanceof $;
+        });
+
+        // Call the actual function
+        var returnValue = jqAppend.apply(this, arguments);
+
+        // Trigger "append" event on all jQuery objects that were appended
+        for (var i = 0; i < appendages.length; ++i) {
+            appendages[i].trigger('append');
+        }
+
+        return returnValue;
+    };
+})(jQuery)
+
+jQuery.fn.restrictInput = function () {
+    return this.each(function () {
+        var input = $(this);
+        var restriction = input.attr("data-restriction");
+
+        switch (restriction) {
+            case "numberOnly":
+                input.keydown(function (event) {
+                    var keyCode = ('which' in event) ? event.which : event.keyCode;
+
+                    isNumeric = (keyCode >= 48 /* KeyboardEvent.DOM_VK_0 */ && keyCode <= 57 /* KeyboardEvent.DOM_VK_9 */) ||
+                        (keyCode >= 96 /* KeyboardEvent.DOM_VK_NUMPAD0 */ && keyCode <= 105 /* KeyboardEvent.DOM_VK_NUMPAD9 */);
+
+                    isControlChar = keyCode === 8;
+                    isDecimalChar = keyCode === 188;
+
+                    modifiers = (event.altKey || event.ctrlKey || event.shiftKey);
+
+                    if ((!isNumeric && !isControlChar && !isDecimalChar) || modifiers) {
+                        event.preventDefault();
+                    }
+                });
+                break;
+        }
+    });
+};
+
+//************** Array extension **************//
+
+Array.prototype.sum = function () {
+    var r = 0;
+    for (var i = 0; i < this.length; i++) {
+        r += this[i];
+    }
+    return r;
+};
+
+Array.prototype.avg = function () {
+    var r = 0;
+    for (var i = 0; i < this.length; i++) {
+        r += this[i];
+    }
+    return r / this.length;
+};
+
+//************** Number extension *************//
+
+Number.prototype.toUntrailingFixed = function (decimalPlaces) {
+    return (this).toFixed(decimalPlaces).replace(/([0-9]+(\.[0-9]+[1-9])?)(\.?0+$)/, '$1');
+}

+ 17 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/js/site.js

@@ -0,0 +1,17 @@
+// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
+// for details on configuring this project to bundle and minify static web assets.
+
+// Write your JavaScript code.
+
+// First, checks if it isn't implemented yet.
+if (!String.prototype.format) {
+    String.prototype.format = function () {
+        var args = arguments;
+        return this.replace(/{(\d+)}/g, function (match, number) {
+            return typeof args[number] != 'undefined'
+                ? args[number]
+                : match
+                ;
+        });
+    };
+}

+ 460 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/css/bootstrap-select.css

@@ -0,0 +1,460 @@
+/*!
+ * Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select)
+ *
+ * Copyright 2012-2020 SnapAppointments, LLC
+ * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
+ */
+
+@-webkit-keyframes bs-notify-fadeOut {
+  0% {
+    opacity: 0.9;
+  }
+  100% {
+    opacity: 0;
+  }
+}
+@-o-keyframes bs-notify-fadeOut {
+  0% {
+    opacity: 0.9;
+  }
+  100% {
+    opacity: 0;
+  }
+}
+@keyframes bs-notify-fadeOut {
+  0% {
+    opacity: 0.9;
+  }
+  100% {
+    opacity: 0;
+  }
+}
+select.bs-select-hidden,
+.bootstrap-select > select.bs-select-hidden,
+select.selectpicker {
+  display: none !important;
+}
+.bootstrap-select {
+  width: 220px \0;
+  /*IE9 and below*/
+  vertical-align: middle;
+}
+.bootstrap-select > .dropdown-toggle {
+  position: relative;
+  width: 100%;
+  text-align: right;
+  white-space: nowrap;
+  display: -webkit-inline-box;
+  display: -webkit-inline-flex;
+  display: -ms-inline-flexbox;
+  display: inline-flex;
+  -webkit-box-align: center;
+  -webkit-align-items: center;
+      -ms-flex-align: center;
+          align-items: center;
+  -webkit-box-pack: justify;
+  -webkit-justify-content: space-between;
+      -ms-flex-pack: justify;
+          justify-content: space-between;
+}
+.bootstrap-select > .dropdown-toggle:after {
+  margin-top: -1px;
+}
+.bootstrap-select > .dropdown-toggle.bs-placeholder,
+.bootstrap-select > .dropdown-toggle.bs-placeholder:hover,
+.bootstrap-select > .dropdown-toggle.bs-placeholder:focus,
+.bootstrap-select > .dropdown-toggle.bs-placeholder:active {
+  color: #999;
+}
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:hover,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:hover,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:hover,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:hover,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:hover,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:hover,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:focus,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:focus,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:focus,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:focus,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:focus,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:focus,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-primary:active,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-secondary:active,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-success:active,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-danger:active,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-info:active,
+.bootstrap-select > .dropdown-toggle.bs-placeholder.btn-dark:active {
+  color: rgba(255, 255, 255, 0.5);
+}
+.bootstrap-select > select {
+  position: absolute !important;
+  bottom: 0;
+  left: 50%;
+  display: block !important;
+  width: 0.5px !important;
+  height: 100% !important;
+  padding: 0 !important;
+  opacity: 0 !important;
+  border: none;
+  z-index: 0 !important;
+}
+.bootstrap-select > select.mobile-device {
+  top: 0;
+  left: 0;
+  display: block !important;
+  width: 100% !important;
+  z-index: 2 !important;
+}
+.has-error .bootstrap-select .dropdown-toggle,
+.error .bootstrap-select .dropdown-toggle,
+.bootstrap-select.is-invalid .dropdown-toggle,
+.was-validated .bootstrap-select select:invalid + .dropdown-toggle {
+  border-color: #b94a48;
+}
+.bootstrap-select.is-valid .dropdown-toggle,
+.was-validated .bootstrap-select select:valid + .dropdown-toggle {
+  border-color: #28a745;
+}
+.bootstrap-select.fit-width {
+  width: auto !important;
+}
+.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
+  width: 220px;
+}
+.bootstrap-select > select.mobile-device:focus + .dropdown-toggle,
+.bootstrap-select .dropdown-toggle:focus {
+  outline: thin dotted #333333 !important;
+  outline: 5px auto -webkit-focus-ring-color !important;
+  outline-offset: -2px;
+}
+.bootstrap-select.form-control {
+  margin-bottom: 0;
+  padding: 0;
+  border: none;
+  height: auto;
+}
+:not(.input-group) > .bootstrap-select.form-control:not([class*="col-"]) {
+  width: 100%;
+}
+.bootstrap-select.form-control.input-group-btn {
+  float: none;
+  z-index: auto;
+}
+.form-inline .bootstrap-select,
+.form-inline .bootstrap-select.form-control:not([class*="col-"]) {
+  width: auto;
+}
+.bootstrap-select:not(.input-group-btn),
+.bootstrap-select[class*="col-"] {
+  float: none;
+  display: inline-block;
+  margin-left: 0;
+}
+.bootstrap-select.dropdown-menu-right,
+.bootstrap-select[class*="col-"].dropdown-menu-right,
+.row .bootstrap-select[class*="col-"].dropdown-menu-right {
+  float: right;
+}
+.form-inline .bootstrap-select,
+.form-horizontal .bootstrap-select,
+.form-group .bootstrap-select {
+  margin-bottom: 0;
+}
+.form-group-lg .bootstrap-select.form-control,
+.form-group-sm .bootstrap-select.form-control {
+  padding: 0;
+}
+.form-group-lg .bootstrap-select.form-control .dropdown-toggle,
+.form-group-sm .bootstrap-select.form-control .dropdown-toggle {
+  height: 100%;
+  font-size: inherit;
+  line-height: inherit;
+  border-radius: inherit;
+}
+.bootstrap-select.form-control-sm .dropdown-toggle,
+.bootstrap-select.form-control-lg .dropdown-toggle {
+  font-size: inherit;
+  line-height: inherit;
+  border-radius: inherit;
+}
+.bootstrap-select.form-control-sm .dropdown-toggle {
+  padding: 0.25rem 0.5rem;
+}
+.bootstrap-select.form-control-lg .dropdown-toggle {
+  padding: 0.5rem 1rem;
+}
+.form-inline .bootstrap-select .form-control {
+  width: 100%;
+}
+.bootstrap-select.disabled,
+.bootstrap-select > .disabled {
+  cursor: not-allowed;
+}
+.bootstrap-select.disabled:focus,
+.bootstrap-select > .disabled:focus {
+  outline: none !important;
+}
+.bootstrap-select.bs-container {
+  position: absolute;
+  top: 0;
+  left: 0;
+  height: 0 !important;
+  padding: 0 !important;
+}
+.bootstrap-select.bs-container .dropdown-menu {
+  z-index: 1060;
+}
+.bootstrap-select .dropdown-toggle .filter-option {
+  position: static;
+  top: 0;
+  left: 0;
+  float: left;
+  height: 100%;
+  width: 100%;
+  text-align: left;
+  overflow: hidden;
+  -webkit-box-flex: 0;
+  -webkit-flex: 0 1 auto;
+      -ms-flex: 0 1 auto;
+          flex: 0 1 auto;
+}
+.bs3.bootstrap-select .dropdown-toggle .filter-option {
+  padding-right: inherit;
+}
+.input-group .bs3-has-addon.bootstrap-select .dropdown-toggle .filter-option {
+  position: absolute;
+  padding-top: inherit;
+  padding-bottom: inherit;
+  padding-left: inherit;
+  float: none;
+}
+.input-group .bs3-has-addon.bootstrap-select .dropdown-toggle .filter-option .filter-option-inner {
+  padding-right: inherit;
+}
+.bootstrap-select .dropdown-toggle .filter-option-inner-inner {
+  overflow: hidden;
+}
+.bootstrap-select .dropdown-toggle .filter-expand {
+  width: 0 !important;
+  float: left;
+  opacity: 0 !important;
+  overflow: hidden;
+}
+.bootstrap-select .dropdown-toggle .caret {
+  position: absolute;
+  top: 50%;
+  right: 12px;
+  margin-top: -2px;
+  vertical-align: middle;
+}
+.input-group .bootstrap-select.form-control .dropdown-toggle {
+  border-radius: inherit;
+}
+.bootstrap-select[class*="col-"] .dropdown-toggle {
+  width: 100%;
+}
+.bootstrap-select .dropdown-menu {
+  min-width: 100%;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+.bootstrap-select .dropdown-menu > .inner:focus {
+  outline: none !important;
+}
+.bootstrap-select .dropdown-menu.inner {
+  position: static;
+  float: none;
+  border: 0;
+  padding: 0;
+  margin: 0;
+  border-radius: 0;
+  -webkit-box-shadow: none;
+          box-shadow: none;
+}
+.bootstrap-select .dropdown-menu li {
+  position: relative;
+}
+.bootstrap-select .dropdown-menu li.active small {
+  color: rgba(255, 255, 255, 0.5) !important;
+}
+.bootstrap-select .dropdown-menu li.disabled a {
+  cursor: not-allowed;
+}
+.bootstrap-select .dropdown-menu li a {
+  cursor: pointer;
+  -webkit-user-select: none;
+     -moz-user-select: none;
+      -ms-user-select: none;
+          user-select: none;
+}
+.bootstrap-select .dropdown-menu li a.opt {
+  position: relative;
+  padding-left: 2.25em;
+}
+.bootstrap-select .dropdown-menu li a span.check-mark {
+  display: none;
+}
+.bootstrap-select .dropdown-menu li a span.text {
+  display: inline-block;
+}
+.bootstrap-select .dropdown-menu li small {
+  padding-left: 0.5em;
+}
+.bootstrap-select .dropdown-menu .notify {
+  position: absolute;
+  bottom: 5px;
+  width: 96%;
+  margin: 0 2%;
+  min-height: 26px;
+  padding: 3px 5px;
+  background: #f5f5f5;
+  border: 1px solid #e3e3e3;
+  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
+  pointer-events: none;
+  opacity: 0.9;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+.bootstrap-select .dropdown-menu .notify.fadeOut {
+  -webkit-animation: 300ms linear 750ms forwards bs-notify-fadeOut;
+       -o-animation: 300ms linear 750ms forwards bs-notify-fadeOut;
+          animation: 300ms linear 750ms forwards bs-notify-fadeOut;
+}
+.bootstrap-select .no-results {
+  padding: 3px;
+  background: #f5f5f5;
+  margin: 0 5px;
+  white-space: nowrap;
+}
+.bootstrap-select.fit-width .dropdown-toggle .filter-option {
+  position: static;
+  display: inline;
+  padding: 0;
+}
+.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner,
+.bootstrap-select.fit-width .dropdown-toggle .filter-option-inner-inner {
+  display: inline;
+}
+.bootstrap-select.fit-width .dropdown-toggle .bs-caret:before {
+  content: '\00a0';
+}
+.bootstrap-select.fit-width .dropdown-toggle .caret {
+  position: static;
+  top: auto;
+  margin-top: -1px;
+}
+.bootstrap-select.show-tick .dropdown-menu .selected span.check-mark {
+  position: absolute;
+  display: inline-block;
+  right: 15px;
+  top: 5px;
+}
+.bootstrap-select.show-tick .dropdown-menu li a span.text {
+  margin-right: 34px;
+}
+.bootstrap-select .bs-ok-default:after {
+  content: '';
+  display: block;
+  width: 0.5em;
+  height: 1em;
+  border-style: solid;
+  border-width: 0 0.26em 0.26em 0;
+  -webkit-transform-style: preserve-3d;
+          transform-style: preserve-3d;
+  -webkit-transform: rotate(45deg);
+      -ms-transform: rotate(45deg);
+       -o-transform: rotate(45deg);
+          transform: rotate(45deg);
+}
+.bootstrap-select.show-menu-arrow.open > .dropdown-toggle,
+.bootstrap-select.show-menu-arrow.show > .dropdown-toggle {
+  z-index: 1061;
+}
+.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:before {
+  content: '';
+  border-left: 7px solid transparent;
+  border-right: 7px solid transparent;
+  border-bottom: 7px solid rgba(204, 204, 204, 0.2);
+  position: absolute;
+  bottom: -4px;
+  left: 9px;
+  display: none;
+}
+.bootstrap-select.show-menu-arrow .dropdown-toggle .filter-option:after {
+  content: '';
+  border-left: 6px solid transparent;
+  border-right: 6px solid transparent;
+  border-bottom: 6px solid white;
+  position: absolute;
+  bottom: -4px;
+  left: 10px;
+  display: none;
+}
+.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:before {
+  bottom: auto;
+  top: -4px;
+  border-top: 7px solid rgba(204, 204, 204, 0.2);
+  border-bottom: 0;
+}
+.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle .filter-option:after {
+  bottom: auto;
+  top: -4px;
+  border-top: 6px solid white;
+  border-bottom: 0;
+}
+.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:before {
+  right: 12px;
+  left: auto;
+}
+.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle .filter-option:after {
+  right: 13px;
+  left: auto;
+}
+.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:before,
+.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:before,
+.bootstrap-select.show-menu-arrow.open > .dropdown-toggle .filter-option:after,
+.bootstrap-select.show-menu-arrow.show > .dropdown-toggle .filter-option:after {
+  display: block;
+}
+.bs-searchbox,
+.bs-actionsbox,
+.bs-donebutton {
+  padding: 4px 8px;
+}
+.bs-actionsbox {
+  width: 100%;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+.bs-actionsbox .btn-group button {
+  width: 50%;
+}
+.bs-donebutton {
+  float: left;
+  width: 100%;
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+}
+.bs-donebutton .btn-group button {
+  width: 100%;
+}
+.bs-searchbox + .bs-actionsbox {
+  padding: 0 8px 4px;
+}
+.bs-searchbox .form-control {
+  margin-bottom: 0;
+  width: 100%;
+  float: none;
+}
+/*# sourceMappingURL=bootstrap-select.css.map */

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/css/bootstrap-select.css.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/css/bootstrap-select.min.css


+ 3248 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/bootstrap-select.js

@@ -0,0 +1,3248 @@
+/*!
+ * Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select)
+ *
+ * Copyright 2012-2020 SnapAppointments, LLC
+ * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
+ */
+
+(function (root, factory) {
+  if (root === undefined && window !== undefined) root = window;
+  if (typeof define === 'function' && define.amd) {
+    // AMD. Register as an anonymous module unless amdModuleId is set
+    define(["jquery"], function (a0) {
+      return (factory(a0));
+    });
+  } else if (typeof module === 'object' && module.exports) {
+    // Node. Does not work with strict CommonJS, but
+    // only CommonJS-like environments that support module.exports,
+    // like Node.
+    module.exports = factory(require("jquery"));
+  } else {
+    factory(root["jQuery"]);
+  }
+}(this, function (jQuery) {
+
+(function ($) {
+  'use strict';
+
+  var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
+
+  var uriAttrs = [
+    'background',
+    'cite',
+    'href',
+    'itemtype',
+    'longdesc',
+    'poster',
+    'src',
+    'xlink:href'
+  ];
+
+  var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
+
+  var DefaultWhitelist = {
+    // Global attributes allowed on any supplied element below.
+    '*': ['class', 'dir', 'id', 'lang', 'role', 'tabindex', 'style', ARIA_ATTRIBUTE_PATTERN],
+    a: ['target', 'href', 'title', 'rel'],
+    area: [],
+    b: [],
+    br: [],
+    col: [],
+    code: [],
+    div: [],
+    em: [],
+    hr: [],
+    h1: [],
+    h2: [],
+    h3: [],
+    h4: [],
+    h5: [],
+    h6: [],
+    i: [],
+    img: ['src', 'alt', 'title', 'width', 'height'],
+    li: [],
+    ol: [],
+    p: [],
+    pre: [],
+    s: [],
+    small: [],
+    span: [],
+    sub: [],
+    sup: [],
+    strong: [],
+    u: [],
+    ul: []
+  }
+
+  /**
+   * A pattern that recognizes a commonly useful subset of URLs that are safe.
+   *
+   * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
+   */
+  var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
+
+  /**
+   * A pattern that matches safe data URLs. Only matches image, video and audio types.
+   *
+   * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
+   */
+  var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
+
+  function allowedAttribute (attr, allowedAttributeList) {
+    var attrName = attr.nodeName.toLowerCase()
+
+    if ($.inArray(attrName, allowedAttributeList) !== -1) {
+      if ($.inArray(attrName, uriAttrs) !== -1) {
+        return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
+      }
+
+      return true
+    }
+
+    var regExp = $(allowedAttributeList).filter(function (index, value) {
+      return value instanceof RegExp
+    })
+
+    // Check if a regular expression validates the attribute.
+    for (var i = 0, l = regExp.length; i < l; i++) {
+      if (attrName.match(regExp[i])) {
+        return true
+      }
+    }
+
+    return false
+  }
+
+  function sanitizeHtml (unsafeElements, whiteList, sanitizeFn) {
+    if (sanitizeFn && typeof sanitizeFn === 'function') {
+      return sanitizeFn(unsafeElements);
+    }
+
+    var whitelistKeys = Object.keys(whiteList);
+
+    for (var i = 0, len = unsafeElements.length; i < len; i++) {
+      var elements = unsafeElements[i].querySelectorAll('*');
+
+      for (var j = 0, len2 = elements.length; j < len2; j++) {
+        var el = elements[j];
+        var elName = el.nodeName.toLowerCase();
+
+        if (whitelistKeys.indexOf(elName) === -1) {
+          el.parentNode.removeChild(el);
+
+          continue;
+        }
+
+        var attributeList = [].slice.call(el.attributes);
+        var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
+
+        for (var k = 0, len3 = attributeList.length; k < len3; k++) {
+          var attr = attributeList[k];
+
+          if (!allowedAttribute(attr, whitelistedAttributes)) {
+            el.removeAttribute(attr.nodeName);
+          }
+        }
+      }
+    }
+  }
+
+  // Polyfill for browsers with no classList support
+  // Remove in v2
+  if (!('classList' in document.createElement('_'))) {
+    (function (view) {
+      if (!('Element' in view)) return;
+
+      var classListProp = 'classList',
+          protoProp = 'prototype',
+          elemCtrProto = view.Element[protoProp],
+          objCtr = Object,
+          classListGetter = function () {
+            var $elem = $(this);
+
+            return {
+              add: function (classes) {
+                classes = Array.prototype.slice.call(arguments).join(' ');
+                return $elem.addClass(classes);
+              },
+              remove: function (classes) {
+                classes = Array.prototype.slice.call(arguments).join(' ');
+                return $elem.removeClass(classes);
+              },
+              toggle: function (classes, force) {
+                return $elem.toggleClass(classes, force);
+              },
+              contains: function (classes) {
+                return $elem.hasClass(classes);
+              }
+            }
+          };
+
+      if (objCtr.defineProperty) {
+        var classListPropDesc = {
+          get: classListGetter,
+          enumerable: true,
+          configurable: true
+        };
+        try {
+          objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
+        } catch (ex) { // IE 8 doesn't support enumerable:true
+          // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36
+          // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected
+          if (ex.number === undefined || ex.number === -0x7FF5EC54) {
+            classListPropDesc.enumerable = false;
+            objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
+          }
+        }
+      } else if (objCtr[protoProp].__defineGetter__) {
+        elemCtrProto.__defineGetter__(classListProp, classListGetter);
+      }
+    }(window));
+  }
+
+  var testElement = document.createElement('_');
+
+  testElement.classList.add('c1', 'c2');
+
+  if (!testElement.classList.contains('c2')) {
+    var _add = DOMTokenList.prototype.add,
+        _remove = DOMTokenList.prototype.remove;
+
+    DOMTokenList.prototype.add = function () {
+      Array.prototype.forEach.call(arguments, _add.bind(this));
+    }
+
+    DOMTokenList.prototype.remove = function () {
+      Array.prototype.forEach.call(arguments, _remove.bind(this));
+    }
+  }
+
+  testElement.classList.toggle('c3', false);
+
+  // Polyfill for IE 10 and Firefox <24, where classList.toggle does not
+  // support the second argument.
+  if (testElement.classList.contains('c3')) {
+    var _toggle = DOMTokenList.prototype.toggle;
+
+    DOMTokenList.prototype.toggle = function (token, force) {
+      if (1 in arguments && !this.contains(token) === !force) {
+        return force;
+      } else {
+        return _toggle.call(this, token);
+      }
+    };
+  }
+
+  testElement = null;
+
+  // shallow array comparison
+  function isEqual (array1, array2) {
+    return array1.length === array2.length && array1.every(function (element, index) {
+      return element === array2[index];
+    });
+  };
+
+  // <editor-fold desc="Shims">
+  if (!String.prototype.startsWith) {
+    (function () {
+      'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
+      var defineProperty = (function () {
+        // IE 8 only supports `Object.defineProperty` on DOM elements
+        try {
+          var object = {};
+          var $defineProperty = Object.defineProperty;
+          var result = $defineProperty(object, object, object) && $defineProperty;
+        } catch (error) {
+        }
+        return result;
+      }());
+      var toString = {}.toString;
+      var startsWith = function (search) {
+        if (this == null) {
+          throw new TypeError();
+        }
+        var string = String(this);
+        if (search && toString.call(search) == '[object RegExp]') {
+          throw new TypeError();
+        }
+        var stringLength = string.length;
+        var searchString = String(search);
+        var searchLength = searchString.length;
+        var position = arguments.length > 1 ? arguments[1] : undefined;
+        // `ToInteger`
+        var pos = position ? Number(position) : 0;
+        if (pos != pos) { // better `isNaN`
+          pos = 0;
+        }
+        var start = Math.min(Math.max(pos, 0), stringLength);
+        // Avoid the `indexOf` call if no match is possible
+        if (searchLength + start > stringLength) {
+          return false;
+        }
+        var index = -1;
+        while (++index < searchLength) {
+          if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) {
+            return false;
+          }
+        }
+        return true;
+      };
+      if (defineProperty) {
+        defineProperty(String.prototype, 'startsWith', {
+          'value': startsWith,
+          'configurable': true,
+          'writable': true
+        });
+      } else {
+        String.prototype.startsWith = startsWith;
+      }
+    }());
+  }
+
+  if (!Object.keys) {
+    Object.keys = function (
+      o, // object
+      k, // key
+      r  // result array
+    ) {
+      // initialize object and result
+      r = [];
+      // iterate over object keys
+      for (k in o) {
+        // fill result array with non-prototypical keys
+        r.hasOwnProperty.call(o, k) && r.push(k);
+      }
+      // return result
+      return r;
+    };
+  }
+
+  if (HTMLSelectElement && !HTMLSelectElement.prototype.hasOwnProperty('selectedOptions')) {
+    Object.defineProperty(HTMLSelectElement.prototype, 'selectedOptions', {
+      get: function () {
+        return this.querySelectorAll(':checked');
+      }
+    });
+  }
+
+  function getSelectedOptions (select, ignoreDisabled) {
+    var selectedOptions = select.selectedOptions,
+        options = [],
+        opt;
+
+    if (ignoreDisabled) {
+      for (var i = 0, len = selectedOptions.length; i < len; i++) {
+        opt = selectedOptions[i];
+
+        if (!(opt.disabled || opt.parentNode.tagName === 'OPTGROUP' && opt.parentNode.disabled)) {
+          options.push(opt);
+        }
+      }
+
+      return options;
+    }
+
+    return selectedOptions;
+  }
+
+  // much faster than $.val()
+  function getSelectValues (select, selectedOptions) {
+    var value = [],
+        options = selectedOptions || select.selectedOptions,
+        opt;
+
+    for (var i = 0, len = options.length; i < len; i++) {
+      opt = options[i];
+
+      if (!(opt.disabled || opt.parentNode.tagName === 'OPTGROUP' && opt.parentNode.disabled)) {
+        value.push(opt.value);
+      }
+    }
+
+    if (!select.multiple) {
+      return !value.length ? null : value[0];
+    }
+
+    return value;
+  }
+
+  // set data-selected on select element if the value has been programmatically selected
+  // prior to initialization of bootstrap-select
+  // * consider removing or replacing an alternative method *
+  var valHooks = {
+    useDefault: false,
+    _set: $.valHooks.select.set
+  };
+
+  $.valHooks.select.set = function (elem, value) {
+    if (value && !valHooks.useDefault) $(elem).data('selected', true);
+
+    return valHooks._set.apply(this, arguments);
+  };
+
+  var changedArguments = null;
+
+  var EventIsSupported = (function () {
+    try {
+      new Event('change');
+      return true;
+    } catch (e) {
+      return false;
+    }
+  })();
+
+  $.fn.triggerNative = function (eventName) {
+    var el = this[0],
+        event;
+
+    if (el.dispatchEvent) { // for modern browsers & IE9+
+      if (EventIsSupported) {
+        // For modern browsers
+        event = new Event(eventName, {
+          bubbles: true
+        });
+      } else {
+        // For IE since it doesn't support Event constructor
+        event = document.createEvent('Event');
+        event.initEvent(eventName, true, false);
+      }
+
+      el.dispatchEvent(event);
+    } else if (el.fireEvent) { // for IE8
+      event = document.createEventObject();
+      event.eventType = eventName;
+      el.fireEvent('on' + eventName, event);
+    } else {
+      // fall back to jQuery.trigger
+      this.trigger(eventName);
+    }
+  };
+  // </editor-fold>
+
+  function stringSearch (li, searchString, method, normalize) {
+    var stringTypes = [
+          'display',
+          'subtext',
+          'tokens'
+        ],
+        searchSuccess = false;
+
+    for (var i = 0; i < stringTypes.length; i++) {
+      var stringType = stringTypes[i],
+          string = li[stringType];
+
+      if (string) {
+        string = string.toString();
+
+        // Strip HTML tags. This isn't perfect, but it's much faster than any other method
+        if (stringType === 'display') {
+          string = string.replace(/<[^>]+>/g, '');
+        }
+
+        if (normalize) string = normalizeToBase(string);
+        string = string.toUpperCase();
+
+        if (method === 'contains') {
+          searchSuccess = string.indexOf(searchString) >= 0;
+        } else {
+          searchSuccess = string.startsWith(searchString);
+        }
+
+        if (searchSuccess) break;
+      }
+    }
+
+    return searchSuccess;
+  }
+
+  function toInteger (value) {
+    return parseInt(value, 10) || 0;
+  }
+
+  // Borrowed from Lodash (_.deburr)
+  /** Used to map Latin Unicode letters to basic Latin letters. */
+  var deburredLetters = {
+    // Latin-1 Supplement block.
+    '\xc0': 'A',  '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
+    '\xe0': 'a',  '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
+    '\xc7': 'C',  '\xe7': 'c',
+    '\xd0': 'D',  '\xf0': 'd',
+    '\xc8': 'E',  '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
+    '\xe8': 'e',  '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
+    '\xcc': 'I',  '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
+    '\xec': 'i',  '\xed': 'i', '\xee': 'i', '\xef': 'i',
+    '\xd1': 'N',  '\xf1': 'n',
+    '\xd2': 'O',  '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
+    '\xf2': 'o',  '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
+    '\xd9': 'U',  '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
+    '\xf9': 'u',  '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
+    '\xdd': 'Y',  '\xfd': 'y', '\xff': 'y',
+    '\xc6': 'Ae', '\xe6': 'ae',
+    '\xde': 'Th', '\xfe': 'th',
+    '\xdf': 'ss',
+    // Latin Extended-A block.
+    '\u0100': 'A',  '\u0102': 'A', '\u0104': 'A',
+    '\u0101': 'a',  '\u0103': 'a', '\u0105': 'a',
+    '\u0106': 'C',  '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
+    '\u0107': 'c',  '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
+    '\u010e': 'D',  '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
+    '\u0112': 'E',  '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
+    '\u0113': 'e',  '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
+    '\u011c': 'G',  '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
+    '\u011d': 'g',  '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
+    '\u0124': 'H',  '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
+    '\u0128': 'I',  '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
+    '\u0129': 'i',  '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
+    '\u0134': 'J',  '\u0135': 'j',
+    '\u0136': 'K',  '\u0137': 'k', '\u0138': 'k',
+    '\u0139': 'L',  '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
+    '\u013a': 'l',  '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
+    '\u0143': 'N',  '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
+    '\u0144': 'n',  '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
+    '\u014c': 'O',  '\u014e': 'O', '\u0150': 'O',
+    '\u014d': 'o',  '\u014f': 'o', '\u0151': 'o',
+    '\u0154': 'R',  '\u0156': 'R', '\u0158': 'R',
+    '\u0155': 'r',  '\u0157': 'r', '\u0159': 'r',
+    '\u015a': 'S',  '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
+    '\u015b': 's',  '\u015d': 's', '\u015f': 's', '\u0161': 's',
+    '\u0162': 'T',  '\u0164': 'T', '\u0166': 'T',
+    '\u0163': 't',  '\u0165': 't', '\u0167': 't',
+    '\u0168': 'U',  '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
+    '\u0169': 'u',  '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
+    '\u0174': 'W',  '\u0175': 'w',
+    '\u0176': 'Y',  '\u0177': 'y', '\u0178': 'Y',
+    '\u0179': 'Z',  '\u017b': 'Z', '\u017d': 'Z',
+    '\u017a': 'z',  '\u017c': 'z', '\u017e': 'z',
+    '\u0132': 'IJ', '\u0133': 'ij',
+    '\u0152': 'Oe', '\u0153': 'oe',
+    '\u0149': "'n", '\u017f': 's'
+  };
+
+  /** Used to match Latin Unicode letters (excluding mathematical operators). */
+  var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
+
+  /** Used to compose unicode character classes. */
+  var rsComboMarksRange = '\\u0300-\\u036f',
+      reComboHalfMarksRange = '\\ufe20-\\ufe2f',
+      rsComboSymbolsRange = '\\u20d0-\\u20ff',
+      rsComboMarksExtendedRange = '\\u1ab0-\\u1aff',
+      rsComboMarksSupplementRange = '\\u1dc0-\\u1dff',
+      rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange + rsComboMarksExtendedRange + rsComboMarksSupplementRange;
+
+  /** Used to compose unicode capture groups. */
+  var rsCombo = '[' + rsComboRange + ']';
+
+  /**
+   * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
+   * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
+   */
+  var reComboMark = RegExp(rsCombo, 'g');
+
+  function deburrLetter (key) {
+    return deburredLetters[key];
+  };
+
+  function normalizeToBase (string) {
+    string = string.toString();
+    return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
+  }
+
+  // List of HTML entities for escaping.
+  var escapeMap = {
+    '&': '&amp;',
+    '<': '&lt;',
+    '>': '&gt;',
+    '"': '&quot;',
+    "'": '&#x27;',
+    '`': '&#x60;'
+  };
+
+  // Functions for escaping and unescaping strings to/from HTML interpolation.
+  var createEscaper = function (map) {
+    var escaper = function (match) {
+      return map[match];
+    };
+    // Regexes for identifying a key that needs to be escaped.
+    var source = '(?:' + Object.keys(map).join('|') + ')';
+    var testRegexp = RegExp(source);
+    var replaceRegexp = RegExp(source, 'g');
+    return function (string) {
+      string = string == null ? '' : '' + string;
+      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
+    };
+  };
+
+  var htmlEscape = createEscaper(escapeMap);
+
+  /**
+   * ------------------------------------------------------------------------
+   * Constants
+   * ------------------------------------------------------------------------
+   */
+
+  var keyCodeMap = {
+    32: ' ',
+    48: '0',
+    49: '1',
+    50: '2',
+    51: '3',
+    52: '4',
+    53: '5',
+    54: '6',
+    55: '7',
+    56: '8',
+    57: '9',
+    59: ';',
+    65: 'A',
+    66: 'B',
+    67: 'C',
+    68: 'D',
+    69: 'E',
+    70: 'F',
+    71: 'G',
+    72: 'H',
+    73: 'I',
+    74: 'J',
+    75: 'K',
+    76: 'L',
+    77: 'M',
+    78: 'N',
+    79: 'O',
+    80: 'P',
+    81: 'Q',
+    82: 'R',
+    83: 'S',
+    84: 'T',
+    85: 'U',
+    86: 'V',
+    87: 'W',
+    88: 'X',
+    89: 'Y',
+    90: 'Z',
+    96: '0',
+    97: '1',
+    98: '2',
+    99: '3',
+    100: '4',
+    101: '5',
+    102: '6',
+    103: '7',
+    104: '8',
+    105: '9'
+  };
+
+  var keyCodes = {
+    ESCAPE: 27, // KeyboardEvent.which value for Escape (Esc) key
+    ENTER: 13, // KeyboardEvent.which value for Enter key
+    SPACE: 32, // KeyboardEvent.which value for space key
+    TAB: 9, // KeyboardEvent.which value for tab key
+    ARROW_UP: 38, // KeyboardEvent.which value for up arrow key
+    ARROW_DOWN: 40 // KeyboardEvent.which value for down arrow key
+  }
+
+  var version = {
+    success: false,
+    major: '3'
+  };
+
+  try {
+    version.full = ($.fn.dropdown.Constructor.VERSION || '').split(' ')[0].split('.');
+    version.major = version.full[0];
+    version.success = true;
+  } catch (err) {
+    // do nothing
+  }
+
+  var selectId = 0;
+
+  var EVENT_KEY = '.bs.select';
+
+  var classNames = {
+    DISABLED: 'disabled',
+    DIVIDER: 'divider',
+    SHOW: 'open',
+    DROPUP: 'dropup',
+    MENU: 'dropdown-menu',
+    MENURIGHT: 'dropdown-menu-right',
+    MENULEFT: 'dropdown-menu-left',
+    // to-do: replace with more advanced template/customization options
+    BUTTONCLASS: 'btn-default',
+    POPOVERHEADER: 'popover-title',
+    ICONBASE: 'glyphicon',
+    TICKICON: 'glyphicon-ok'
+  }
+
+  var Selector = {
+    MENU: '.' + classNames.MENU
+  }
+
+  var elementTemplates = {
+    div: document.createElement('div'),
+    span: document.createElement('span'),
+    i: document.createElement('i'),
+    subtext: document.createElement('small'),
+    a: document.createElement('a'),
+    li: document.createElement('li'),
+    whitespace: document.createTextNode('\u00A0'),
+    fragment: document.createDocumentFragment()
+  }
+
+  elementTemplates.noResults = elementTemplates.li.cloneNode(false);
+  elementTemplates.noResults.className = 'no-results';
+
+  elementTemplates.a.setAttribute('role', 'option');
+  elementTemplates.a.className = 'dropdown-item';
+
+  elementTemplates.subtext.className = 'text-muted';
+
+  elementTemplates.text = elementTemplates.span.cloneNode(false);
+  elementTemplates.text.className = 'text';
+
+  elementTemplates.checkMark = elementTemplates.span.cloneNode(false);
+
+  var REGEXP_ARROW = new RegExp(keyCodes.ARROW_UP + '|' + keyCodes.ARROW_DOWN);
+  var REGEXP_TAB_OR_ESCAPE = new RegExp('^' + keyCodes.TAB + '$|' + keyCodes.ESCAPE);
+
+  var generateOption = {
+    li: function (content, classes, optgroup) {
+      var li = elementTemplates.li.cloneNode(false);
+
+      if (content) {
+        if (content.nodeType === 1 || content.nodeType === 11) {
+          li.appendChild(content);
+        } else {
+          li.innerHTML = content;
+        }
+      }
+
+      if (typeof classes !== 'undefined' && classes !== '') li.className = classes;
+      if (typeof optgroup !== 'undefined' && optgroup !== null) li.classList.add('optgroup-' + optgroup);
+
+      return li;
+    },
+
+    a: function (text, classes, inline) {
+      var a = elementTemplates.a.cloneNode(true);
+
+      if (text) {
+        if (text.nodeType === 11) {
+          a.appendChild(text);
+        } else {
+          a.insertAdjacentHTML('beforeend', text);
+        }
+      }
+
+      if (typeof classes !== 'undefined' && classes !== '') a.classList.add.apply(a.classList, classes.split(/\s+/));
+      if (inline) a.setAttribute('style', inline);
+
+      return a;
+    },
+
+    text: function (options, useFragment) {
+      var textElement = elementTemplates.text.cloneNode(false),
+          subtextElement,
+          iconElement;
+
+      if (options.content) {
+        textElement.innerHTML = options.content;
+      } else {
+        textElement.textContent = options.text;
+
+        if (options.icon) {
+          var whitespace = elementTemplates.whitespace.cloneNode(false);
+
+          // need to use <i> for icons in the button to prevent a breaking change
+          // note: switch to span in next major release
+          iconElement = (useFragment === true ? elementTemplates.i : elementTemplates.span).cloneNode(false);
+          iconElement.className = this.options.iconBase + ' ' + options.icon;
+
+          elementTemplates.fragment.appendChild(iconElement);
+          elementTemplates.fragment.appendChild(whitespace);
+        }
+
+        if (options.subtext) {
+          subtextElement = elementTemplates.subtext.cloneNode(false);
+          subtextElement.textContent = options.subtext;
+          textElement.appendChild(subtextElement);
+        }
+      }
+
+      if (useFragment === true) {
+        while (textElement.childNodes.length > 0) {
+          elementTemplates.fragment.appendChild(textElement.childNodes[0]);
+        }
+      } else {
+        elementTemplates.fragment.appendChild(textElement);
+      }
+
+      return elementTemplates.fragment;
+    },
+
+    label: function (options) {
+      var textElement = elementTemplates.text.cloneNode(false),
+          subtextElement,
+          iconElement;
+
+      textElement.innerHTML = options.display;
+
+      if (options.icon) {
+        var whitespace = elementTemplates.whitespace.cloneNode(false);
+
+        iconElement = elementTemplates.span.cloneNode(false);
+        iconElement.className = this.options.iconBase + ' ' + options.icon;
+
+        elementTemplates.fragment.appendChild(iconElement);
+        elementTemplates.fragment.appendChild(whitespace);
+      }
+
+      if (options.subtext) {
+        subtextElement = elementTemplates.subtext.cloneNode(false);
+        subtextElement.textContent = options.subtext;
+        textElement.appendChild(subtextElement);
+      }
+
+      elementTemplates.fragment.appendChild(textElement);
+
+      return elementTemplates.fragment;
+    }
+  }
+
+  function showNoResults (searchMatch, searchValue) {
+    if (!searchMatch.length) {
+      elementTemplates.noResults.innerHTML = this.options.noneResultsText.replace('{0}', '"' + htmlEscape(searchValue) + '"');
+      this.$menuInner[0].firstChild.appendChild(elementTemplates.noResults);
+    }
+  }
+
+  var Selectpicker = function (element, options) {
+    var that = this;
+
+    // bootstrap-select has been initialized - revert valHooks.select.set back to its original function
+    if (!valHooks.useDefault) {
+      $.valHooks.select.set = valHooks._set;
+      valHooks.useDefault = true;
+    }
+
+    this.$element = $(element);
+    this.$newElement = null;
+    this.$button = null;
+    this.$menu = null;
+    this.options = options;
+    this.selectpicker = {
+      main: {},
+      search: {},
+      current: {}, // current changes if a search is in progress
+      view: {},
+      isSearching: false,
+      keydown: {
+        keyHistory: '',
+        resetKeyHistory: {
+          start: function () {
+            return setTimeout(function () {
+              that.selectpicker.keydown.keyHistory = '';
+            }, 800);
+          }
+        }
+      }
+    };
+
+    this.sizeInfo = {};
+
+    // If we have no title yet, try to pull it from the html title attribute (jQuery doesnt' pick it up as it's not a
+    // data-attribute)
+    if (this.options.title === null) {
+      this.options.title = this.$element.attr('title');
+    }
+
+    // Format window padding
+    var winPad = this.options.windowPadding;
+    if (typeof winPad === 'number') {
+      this.options.windowPadding = [winPad, winPad, winPad, winPad];
+    }
+
+    // Expose public methods
+    this.val = Selectpicker.prototype.val;
+    this.render = Selectpicker.prototype.render;
+    this.refresh = Selectpicker.prototype.refresh;
+    this.setStyle = Selectpicker.prototype.setStyle;
+    this.selectAll = Selectpicker.prototype.selectAll;
+    this.deselectAll = Selectpicker.prototype.deselectAll;
+    this.destroy = Selectpicker.prototype.destroy;
+    this.remove = Selectpicker.prototype.remove;
+    this.show = Selectpicker.prototype.show;
+    this.hide = Selectpicker.prototype.hide;
+
+    this.init();
+  };
+
+  Selectpicker.VERSION = '1.13.18';
+
+  // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both.
+  Selectpicker.DEFAULTS = {
+    noneSelectedText: 'Nothing selected',
+    noneResultsText: 'No results matched {0}',
+    countSelectedText: function (numSelected, numTotal) {
+      return (numSelected == 1) ? '{0} item selected' : '{0} items selected';
+    },
+    maxOptionsText: function (numAll, numGroup) {
+      return [
+        (numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)',
+        (numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)'
+      ];
+    },
+    selectAllText: 'Select All',
+    deselectAllText: 'Deselect All',
+    doneButton: false,
+    doneButtonText: 'Close',
+    multipleSeparator: ', ',
+    styleBase: 'btn',
+    style: classNames.BUTTONCLASS,
+    size: 'auto',
+    title: null,
+    selectedTextFormat: 'values',
+    width: false,
+    container: false,
+    hideDisabled: false,
+    showSubtext: false,
+    showIcon: true,
+    showContent: true,
+    dropupAuto: true,
+    header: false,
+    liveSearch: false,
+    liveSearchPlaceholder: null,
+    liveSearchNormalize: false,
+    liveSearchStyle: 'contains',
+    actionsBox: false,
+    iconBase: classNames.ICONBASE,
+    tickIcon: classNames.TICKICON,
+    showTick: false,
+    template: {
+      caret: '<span class="caret"></span>'
+    },
+    maxOptions: false,
+    mobile: false,
+    selectOnTab: false,
+    dropdownAlignRight: false,
+    windowPadding: 0,
+    virtualScroll: 600,
+    display: false,
+    sanitize: true,
+    sanitizeFn: null,
+    whiteList: DefaultWhitelist
+  };
+
+  Selectpicker.prototype = {
+
+    constructor: Selectpicker,
+
+    init: function () {
+      var that = this,
+          id = this.$element.attr('id'),
+          element = this.$element[0],
+          form = element.form;
+
+      selectId++;
+      this.selectId = 'bs-select-' + selectId;
+
+      element.classList.add('bs-select-hidden');
+
+      this.multiple = this.$element.prop('multiple');
+      this.autofocus = this.$element.prop('autofocus');
+
+      if (element.classList.contains('show-tick')) {
+        this.options.showTick = true;
+      }
+
+      this.$newElement = this.createDropdown();
+      this.buildData();
+      this.$element
+        .after(this.$newElement)
+        .prependTo(this.$newElement);
+
+      // ensure select is associated with form element if it got unlinked after moving it inside newElement
+      if (form && element.form === null) {
+        if (!form.id) form.id = 'form-' + this.selectId;
+        element.setAttribute('form', form.id);
+      }
+
+      this.$button = this.$newElement.children('button');
+      this.$menu = this.$newElement.children(Selector.MENU);
+      this.$menuInner = this.$menu.children('.inner');
+      this.$searchbox = this.$menu.find('input');
+
+      element.classList.remove('bs-select-hidden');
+
+      if (this.options.dropdownAlignRight === true) this.$menu[0].classList.add(classNames.MENURIGHT);
+
+      if (typeof id !== 'undefined') {
+        this.$button.attr('data-id', id);
+      }
+
+      this.checkDisabled();
+      this.clickListener();
+
+      if (this.options.liveSearch) {
+        this.liveSearchListener();
+        this.focusedParent = this.$searchbox[0];
+      } else {
+        this.focusedParent = this.$menuInner[0];
+      }
+
+      this.setStyle();
+      this.render();
+      this.setWidth();
+      if (this.options.container) {
+        this.selectPosition();
+      } else {
+        this.$element.on('hide' + EVENT_KEY, function () {
+          if (that.isVirtual()) {
+            // empty menu on close
+            var menuInner = that.$menuInner[0],
+                emptyMenu = menuInner.firstChild.cloneNode(false);
+
+            // replace the existing UL with an empty one - this is faster than $.empty() or innerHTML = ''
+            menuInner.replaceChild(emptyMenu, menuInner.firstChild);
+            menuInner.scrollTop = 0;
+          }
+        });
+      }
+      this.$menu.data('this', this);
+      this.$newElement.data('this', this);
+      if (this.options.mobile) this.mobile();
+
+      this.$newElement.on({
+        'hide.bs.dropdown': function (e) {
+          that.$element.trigger('hide' + EVENT_KEY, e);
+        },
+        'hidden.bs.dropdown': function (e) {
+          that.$element.trigger('hidden' + EVENT_KEY, e);
+        },
+        'show.bs.dropdown': function (e) {
+          that.$element.trigger('show' + EVENT_KEY, e);
+        },
+        'shown.bs.dropdown': function (e) {
+          that.$element.trigger('shown' + EVENT_KEY, e);
+        }
+      });
+
+      if (element.hasAttribute('required')) {
+        this.$element.on('invalid' + EVENT_KEY, function () {
+          that.$button[0].classList.add('bs-invalid');
+
+          that.$element
+            .on('shown' + EVENT_KEY + '.invalid', function () {
+              that.$element
+                .val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened
+                .off('shown' + EVENT_KEY + '.invalid');
+            })
+            .on('rendered' + EVENT_KEY, function () {
+              // if select is no longer invalid, remove the bs-invalid class
+              if (this.validity.valid) that.$button[0].classList.remove('bs-invalid');
+              that.$element.off('rendered' + EVENT_KEY);
+            });
+
+          that.$button.on('blur' + EVENT_KEY, function () {
+            that.$element.trigger('focus').trigger('blur');
+            that.$button.off('blur' + EVENT_KEY);
+          });
+        });
+      }
+
+      setTimeout(function () {
+        that.buildList();
+        that.$element.trigger('loaded' + EVENT_KEY);
+      });
+    },
+
+    createDropdown: function () {
+      // Options
+      // If we are multiple or showTick option is set, then add the show-tick class
+      var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '',
+          multiselectable = this.multiple ? ' aria-multiselectable="true"' : '',
+          inputGroup = '',
+          autofocus = this.autofocus ? ' autofocus' : '';
+
+      if (version.major < 4 && this.$element.parent().hasClass('input-group')) {
+        inputGroup = ' input-group-btn';
+      }
+
+      // Elements
+      var drop,
+          header = '',
+          searchbox = '',
+          actionsbox = '',
+          donebutton = '';
+
+      if (this.options.header) {
+        header =
+          '<div class="' + classNames.POPOVERHEADER + '">' +
+            '<button type="button" class="close" aria-hidden="true">&times;</button>' +
+              this.options.header +
+          '</div>';
+      }
+
+      if (this.options.liveSearch) {
+        searchbox =
+          '<div class="bs-searchbox">' +
+            '<input type="search" class="form-control" autocomplete="off"' +
+              (
+                this.options.liveSearchPlaceholder === null ? ''
+                :
+                ' placeholder="' + htmlEscape(this.options.liveSearchPlaceholder) + '"'
+              ) +
+              ' role="combobox" aria-label="Search" aria-controls="' + this.selectId + '" aria-autocomplete="list">' +
+          '</div>';
+      }
+
+      if (this.multiple && this.options.actionsBox) {
+        actionsbox =
+          '<div class="bs-actionsbox">' +
+            '<div class="btn-group btn-group-sm btn-block">' +
+              '<button type="button" class="actions-btn bs-select-all btn ' + classNames.BUTTONCLASS + '">' +
+                this.options.selectAllText +
+              '</button>' +
+              '<button type="button" class="actions-btn bs-deselect-all btn ' + classNames.BUTTONCLASS + '">' +
+                this.options.deselectAllText +
+              '</button>' +
+            '</div>' +
+          '</div>';
+      }
+
+      if (this.multiple && this.options.doneButton) {
+        donebutton =
+          '<div class="bs-donebutton">' +
+            '<div class="btn-group btn-block">' +
+              '<button type="button" class="btn btn-sm ' + classNames.BUTTONCLASS + '">' +
+                this.options.doneButtonText +
+              '</button>' +
+            '</div>' +
+          '</div>';
+      }
+
+      drop =
+        '<div class="dropdown bootstrap-select' + showTick + inputGroup + '">' +
+          '<button type="button" tabindex="-1" class="' + this.options.styleBase + ' dropdown-toggle" ' + (this.options.display === 'static' ? 'data-display="static"' : '') + 'data-toggle="dropdown"' + autofocus + ' role="combobox" aria-owns="' + this.selectId + '" aria-haspopup="listbox" aria-expanded="false">' +
+            '<div class="filter-option">' +
+              '<div class="filter-option-inner">' +
+                '<div class="filter-option-inner-inner"></div>' +
+              '</div> ' +
+            '</div>' +
+            (
+              version.major === '4' ? ''
+              :
+              '<span class="bs-caret">' +
+                this.options.template.caret +
+              '</span>'
+            ) +
+          '</button>' +
+          '<div class="' + classNames.MENU + ' ' + (version.major === '4' ? '' : classNames.SHOW) + '">' +
+            header +
+            searchbox +
+            actionsbox +
+            '<div class="inner ' + classNames.SHOW + '" role="listbox" id="' + this.selectId + '" tabindex="-1" ' + multiselectable + '>' +
+                '<ul class="' + classNames.MENU + ' inner ' + (version.major === '4' ? classNames.SHOW : '') + '" role="presentation">' +
+                '</ul>' +
+            '</div>' +
+            donebutton +
+          '</div>' +
+        '</div>';
+
+      return $(drop);
+    },
+
+    setPositionData: function () {
+      this.selectpicker.view.canHighlight = [];
+      this.selectpicker.view.size = 0;
+      this.selectpicker.view.firstHighlightIndex = false;
+
+      for (var i = 0; i < this.selectpicker.current.data.length; i++) {
+        var li = this.selectpicker.current.data[i],
+            canHighlight = true;
+
+        if (li.type === 'divider') {
+          canHighlight = false;
+          li.height = this.sizeInfo.dividerHeight;
+        } else if (li.type === 'optgroup-label') {
+          canHighlight = false;
+          li.height = this.sizeInfo.dropdownHeaderHeight;
+        } else {
+          li.height = this.sizeInfo.liHeight;
+        }
+
+        if (li.disabled) canHighlight = false;
+
+        this.selectpicker.view.canHighlight.push(canHighlight);
+
+        if (canHighlight) {
+          this.selectpicker.view.size++;
+          li.posinset = this.selectpicker.view.size;
+          if (this.selectpicker.view.firstHighlightIndex === false) this.selectpicker.view.firstHighlightIndex = i;
+        }
+
+        li.position = (i === 0 ? 0 : this.selectpicker.current.data[i - 1].position) + li.height;
+      }
+    },
+
+    isVirtual: function () {
+      return (this.options.virtualScroll !== false) && (this.selectpicker.main.elements.length >= this.options.virtualScroll) || this.options.virtualScroll === true;
+    },
+
+    createView: function (isSearching, setSize, refresh) {
+      var that = this,
+          scrollTop = 0,
+          active = [],
+          selected,
+          prevActive;
+
+      this.selectpicker.isSearching = isSearching;
+      this.selectpicker.current = isSearching ? this.selectpicker.search : this.selectpicker.main;
+
+      this.setPositionData();
+
+      if (setSize) {
+        if (refresh) {
+          scrollTop = this.$menuInner[0].scrollTop;
+        } else if (!that.multiple) {
+          var element = that.$element[0],
+              selectedIndex = (element.options[element.selectedIndex] || {}).liIndex;
+
+          if (typeof selectedIndex === 'number' && that.options.size !== false) {
+            var selectedData = that.selectpicker.main.data[selectedIndex],
+                position = selectedData && selectedData.position;
+
+            if (position) {
+              scrollTop = position - ((that.sizeInfo.menuInnerHeight + that.sizeInfo.liHeight) / 2);
+            }
+          }
+        }
+      }
+
+      scroll(scrollTop, true);
+
+      this.$menuInner.off('scroll.createView').on('scroll.createView', function (e, updateValue) {
+        if (!that.noScroll) scroll(this.scrollTop, updateValue);
+        that.noScroll = false;
+      });
+
+      function scroll (scrollTop, init) {
+        var size = that.selectpicker.current.elements.length,
+            chunks = [],
+            chunkSize,
+            chunkCount,
+            firstChunk,
+            lastChunk,
+            currentChunk,
+            prevPositions,
+            positionIsDifferent,
+            previousElements,
+            menuIsDifferent = true,
+            isVirtual = that.isVirtual();
+
+        that.selectpicker.view.scrollTop = scrollTop;
+
+        chunkSize = Math.ceil(that.sizeInfo.menuInnerHeight / that.sizeInfo.liHeight * 1.5); // number of options in a chunk
+        chunkCount = Math.round(size / chunkSize) || 1; // number of chunks
+
+        for (var i = 0; i < chunkCount; i++) {
+          var endOfChunk = (i + 1) * chunkSize;
+
+          if (i === chunkCount - 1) {
+            endOfChunk = size;
+          }
+
+          chunks[i] = [
+            (i) * chunkSize + (!i ? 0 : 1),
+            endOfChunk
+          ];
+
+          if (!size) break;
+
+          if (currentChunk === undefined && scrollTop - 1 <= that.selectpicker.current.data[endOfChunk - 1].position - that.sizeInfo.menuInnerHeight) {
+            currentChunk = i;
+          }
+        }
+
+        if (currentChunk === undefined) currentChunk = 0;
+
+        prevPositions = [that.selectpicker.view.position0, that.selectpicker.view.position1];
+
+        // always display previous, current, and next chunks
+        firstChunk = Math.max(0, currentChunk - 1);
+        lastChunk = Math.min(chunkCount - 1, currentChunk + 1);
+
+        that.selectpicker.view.position0 = isVirtual === false ? 0 : (Math.max(0, chunks[firstChunk][0]) || 0);
+        that.selectpicker.view.position1 = isVirtual === false ? size : (Math.min(size, chunks[lastChunk][1]) || 0);
+
+        positionIsDifferent = prevPositions[0] !== that.selectpicker.view.position0 || prevPositions[1] !== that.selectpicker.view.position1;
+
+        if (that.activeIndex !== undefined) {
+          prevActive = that.selectpicker.main.elements[that.prevActiveIndex];
+          active = that.selectpicker.main.elements[that.activeIndex];
+          selected = that.selectpicker.main.elements[that.selectedIndex];
+
+          if (init) {
+            if (that.activeIndex !== that.selectedIndex) {
+              that.defocusItem(active);
+            }
+            that.activeIndex = undefined;
+          }
+
+          if (that.activeIndex && that.activeIndex !== that.selectedIndex) {
+            that.defocusItem(selected);
+          }
+        }
+
+        if (that.prevActiveIndex !== undefined && that.prevActiveIndex !== that.activeIndex && that.prevActiveIndex !== that.selectedIndex) {
+          that.defocusItem(prevActive);
+        }
+
+        if (init || positionIsDifferent) {
+          previousElements = that.selectpicker.view.visibleElements ? that.selectpicker.view.visibleElements.slice() : [];
+
+          if (isVirtual === false) {
+            that.selectpicker.view.visibleElements = that.selectpicker.current.elements;
+          } else {
+            that.selectpicker.view.visibleElements = that.selectpicker.current.elements.slice(that.selectpicker.view.position0, that.selectpicker.view.position1);
+          }
+
+          that.setOptionStatus();
+
+          // if searching, check to make sure the list has actually been updated before updating DOM
+          // this prevents unnecessary repaints
+          if (isSearching || (isVirtual === false && init)) menuIsDifferent = !isEqual(previousElements, that.selectpicker.view.visibleElements);
+
+          // if virtual scroll is disabled and not searching,
+          // menu should never need to be updated more than once
+          if ((init || isVirtual === true) && menuIsDifferent) {
+            var menuInner = that.$menuInner[0],
+                menuFragment = document.createDocumentFragment(),
+                emptyMenu = menuInner.firstChild.cloneNode(false),
+                marginTop,
+                marginBottom,
+                elements = that.selectpicker.view.visibleElements,
+                toSanitize = [];
+
+            // replace the existing UL with an empty one - this is faster than $.empty()
+            menuInner.replaceChild(emptyMenu, menuInner.firstChild);
+
+            for (var i = 0, visibleElementsLen = elements.length; i < visibleElementsLen; i++) {
+              var element = elements[i],
+                  elText,
+                  elementData;
+
+              if (that.options.sanitize) {
+                elText = element.lastChild;
+
+                if (elText) {
+                  elementData = that.selectpicker.current.data[i + that.selectpicker.view.position0];
+
+                  if (elementData && elementData.content && !elementData.sanitized) {
+                    toSanitize.push(elText);
+                    elementData.sanitized = true;
+                  }
+                }
+              }
+
+              menuFragment.appendChild(element);
+            }
+
+            if (that.options.sanitize && toSanitize.length) {
+              sanitizeHtml(toSanitize, that.options.whiteList, that.options.sanitizeFn);
+            }
+
+            if (isVirtual === true) {
+              marginTop = (that.selectpicker.view.position0 === 0 ? 0 : that.selectpicker.current.data[that.selectpicker.view.position0 - 1].position);
+              marginBottom = (that.selectpicker.view.position1 > size - 1 ? 0 : that.selectpicker.current.data[size - 1].position - that.selectpicker.current.data[that.selectpicker.view.position1 - 1].position);
+
+              menuInner.firstChild.style.marginTop = marginTop + 'px';
+              menuInner.firstChild.style.marginBottom = marginBottom + 'px';
+            } else {
+              menuInner.firstChild.style.marginTop = 0;
+              menuInner.firstChild.style.marginBottom = 0;
+            }
+
+            menuInner.firstChild.appendChild(menuFragment);
+
+            // if an option is encountered that is wider than the current menu width, update the menu width accordingly
+            // switch to ResizeObserver with increased browser support
+            if (isVirtual === true && that.sizeInfo.hasScrollBar) {
+              var menuInnerInnerWidth = menuInner.firstChild.offsetWidth;
+
+              if (init && menuInnerInnerWidth < that.sizeInfo.menuInnerInnerWidth && that.sizeInfo.totalMenuWidth > that.sizeInfo.selectWidth) {
+                menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px';
+              } else if (menuInnerInnerWidth > that.sizeInfo.menuInnerInnerWidth) {
+                // set to 0 to get actual width of menu
+                that.$menu[0].style.minWidth = 0;
+
+                var actualMenuWidth = menuInner.firstChild.offsetWidth;
+
+                if (actualMenuWidth > that.sizeInfo.menuInnerInnerWidth) {
+                  that.sizeInfo.menuInnerInnerWidth = actualMenuWidth;
+                  menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px';
+                }
+
+                // reset to default CSS styling
+                that.$menu[0].style.minWidth = '';
+              }
+            }
+          }
+        }
+
+        that.prevActiveIndex = that.activeIndex;
+
+        if (!that.options.liveSearch) {
+          that.$menuInner.trigger('focus');
+        } else if (isSearching && init) {
+          var index = 0,
+              newActive;
+
+          if (!that.selectpicker.view.canHighlight[index]) {
+            index = 1 + that.selectpicker.view.canHighlight.slice(1).indexOf(true);
+          }
+
+          newActive = that.selectpicker.view.visibleElements[index];
+
+          that.defocusItem(that.selectpicker.view.currentActive);
+
+          that.activeIndex = (that.selectpicker.current.data[index] || {}).index;
+
+          that.focusItem(newActive);
+        }
+      }
+
+      $(window)
+        .off('resize' + EVENT_KEY + '.' + this.selectId + '.createView')
+        .on('resize' + EVENT_KEY + '.' + this.selectId + '.createView', function () {
+          var isActive = that.$newElement.hasClass(classNames.SHOW);
+
+          if (isActive) scroll(that.$menuInner[0].scrollTop);
+        });
+    },
+
+    focusItem: function (li, liData, noStyle) {
+      if (li) {
+        liData = liData || this.selectpicker.main.data[this.activeIndex];
+        var a = li.firstChild;
+
+        if (a) {
+          a.setAttribute('aria-setsize', this.selectpicker.view.size);
+          a.setAttribute('aria-posinset', liData.posinset);
+
+          if (noStyle !== true) {
+            this.focusedParent.setAttribute('aria-activedescendant', a.id);
+            li.classList.add('active');
+            a.classList.add('active');
+          }
+        }
+      }
+    },
+
+    defocusItem: function (li) {
+      if (li) {
+        li.classList.remove('active');
+        if (li.firstChild) li.firstChild.classList.remove('active');
+      }
+    },
+
+    setPlaceholder: function () {
+      var that = this,
+          updateIndex = false;
+
+      if (this.options.title && !this.multiple) {
+        if (!this.selectpicker.view.titleOption) this.selectpicker.view.titleOption = document.createElement('option');
+
+        // this option doesn't create a new <li> element, but does add a new option at the start,
+        // so startIndex should increase to prevent having to check every option for the bs-title-option class
+        updateIndex = true;
+
+        var element = this.$element[0],
+            selectTitleOption = false,
+            titleNotAppended = !this.selectpicker.view.titleOption.parentNode,
+            selectedIndex = element.selectedIndex,
+            selectedOption = element.options[selectedIndex],
+            navigation = window.performance && window.performance.getEntriesByType('navigation'),
+            // Safari doesn't support getEntriesByType('navigation') - fall back to performance.navigation
+            isNotBackForward = (navigation && navigation.length) ? navigation[0].type !== 'back_forward' : window.performance.navigation.type !== 2;
+
+        if (titleNotAppended) {
+          // Use native JS to prepend option (faster)
+          this.selectpicker.view.titleOption.className = 'bs-title-option';
+          this.selectpicker.view.titleOption.value = '';
+
+          // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option.
+          // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs,
+          // if so, the select will have the data-selected attribute
+          selectTitleOption = !selectedOption || (selectedIndex === 0 && selectedOption.defaultSelected === false && this.$element.data('selected') === undefined);
+        }
+
+        if (titleNotAppended || this.selectpicker.view.titleOption.index !== 0) {
+          element.insertBefore(this.selectpicker.view.titleOption, element.firstChild);
+        }
+
+        // Set selected *after* appending to select,
+        // otherwise the option doesn't get selected in IE
+        // set using selectedIndex, as setting the selected attr to true here doesn't work in IE11
+        if (selectTitleOption && isNotBackForward) {
+          element.selectedIndex = 0;
+        } else if (document.readyState !== 'complete') {
+          // if navigation type is back_forward, there's a chance the select will have its value set by BFCache
+          // wait for that value to be set, then run render again
+          window.addEventListener('pageshow', function () {
+            if (that.selectpicker.view.displayedValue !== element.value) that.render();
+          });
+        }
+      }
+
+      return updateIndex;
+    },
+
+    buildData: function () {
+      var optionSelector = ':not([hidden]):not([data-hidden="true"])',
+          mainData = [],
+          optID = 0,
+          startIndex = this.setPlaceholder() ? 1 : 0; // append the titleOption if necessary and skip the first option in the loop
+
+      if (this.options.hideDisabled) optionSelector += ':not(:disabled)';
+
+      var selectOptions = this.$element[0].querySelectorAll('select > *' + optionSelector);
+
+      function addDivider (config) {
+        var previousData = mainData[mainData.length - 1];
+
+        // ensure optgroup doesn't create back-to-back dividers
+        if (
+          previousData &&
+          previousData.type === 'divider' &&
+          (previousData.optID || config.optID)
+        ) {
+          return;
+        }
+
+        config = config || {};
+        config.type = 'divider';
+
+        mainData.push(config);
+      }
+
+      function addOption (option, config) {
+        config = config || {};
+
+        config.divider = option.getAttribute('data-divider') === 'true';
+
+        if (config.divider) {
+          addDivider({
+            optID: config.optID
+          });
+        } else {
+          var liIndex = mainData.length,
+              cssText = option.style.cssText,
+              inlineStyle = cssText ? htmlEscape(cssText) : '',
+              optionClass = (option.className || '') + (config.optgroupClass || '');
+
+          if (config.optID) optionClass = 'opt ' + optionClass;
+
+          config.optionClass = optionClass.trim();
+          config.inlineStyle = inlineStyle;
+          config.text = option.textContent;
+
+          config.content = option.getAttribute('data-content');
+          config.tokens = option.getAttribute('data-tokens');
+          config.subtext = option.getAttribute('data-subtext');
+          config.icon = option.getAttribute('data-icon');
+
+          option.liIndex = liIndex;
+
+          config.display = config.content || config.text;
+          config.type = 'option';
+          config.index = liIndex;
+          config.option = option;
+          config.selected = !!option.selected;
+          config.disabled = config.disabled || !!option.disabled;
+
+          mainData.push(config);
+        }
+      }
+
+      function addOptgroup (index, selectOptions) {
+        var optgroup = selectOptions[index],
+            // skip placeholder option
+            previous = index - 1 < startIndex ? false : selectOptions[index - 1],
+            next = selectOptions[index + 1],
+            options = optgroup.querySelectorAll('option' + optionSelector);
+
+        if (!options.length) return;
+
+        var config = {
+              display: htmlEscape(optgroup.label),
+              subtext: optgroup.getAttribute('data-subtext'),
+              icon: optgroup.getAttribute('data-icon'),
+              type: 'optgroup-label',
+              optgroupClass: ' ' + (optgroup.className || '')
+            },
+            headerIndex,
+            lastIndex;
+
+        optID++;
+
+        if (previous) {
+          addDivider({ optID: optID });
+        }
+
+        config.optID = optID;
+
+        mainData.push(config);
+
+        for (var j = 0, len = options.length; j < len; j++) {
+          var option = options[j];
+
+          if (j === 0) {
+            headerIndex = mainData.length - 1;
+            lastIndex = headerIndex + len;
+          }
+
+          addOption(option, {
+            headerIndex: headerIndex,
+            lastIndex: lastIndex,
+            optID: config.optID,
+            optgroupClass: config.optgroupClass,
+            disabled: optgroup.disabled
+          });
+        }
+
+        if (next) {
+          addDivider({ optID: optID });
+        }
+      }
+
+      for (var len = selectOptions.length, i = startIndex; i < len; i++) {
+        var item = selectOptions[i];
+
+        if (item.tagName !== 'OPTGROUP') {
+          addOption(item, {});
+        } else {
+          addOptgroup(i, selectOptions);
+        }
+      }
+
+      this.selectpicker.main.data = this.selectpicker.current.data = mainData;
+    },
+
+    buildList: function () {
+      var that = this,
+          selectData = this.selectpicker.main.data,
+          mainElements = [],
+          widestOptionLength = 0;
+
+      if ((that.options.showTick || that.multiple) && !elementTemplates.checkMark.parentNode) {
+        elementTemplates.checkMark.className = this.options.iconBase + ' ' + that.options.tickIcon + ' check-mark';
+        elementTemplates.a.appendChild(elementTemplates.checkMark);
+      }
+
+      function buildElement (item) {
+        var liElement,
+            combinedLength = 0;
+
+        switch (item.type) {
+          case 'divider':
+            liElement = generateOption.li(
+              false,
+              classNames.DIVIDER,
+              (item.optID ? item.optID + 'div' : undefined)
+            );
+
+            break;
+
+          case 'option':
+            liElement = generateOption.li(
+              generateOption.a(
+                generateOption.text.call(that, item),
+                item.optionClass,
+                item.inlineStyle
+              ),
+              '',
+              item.optID
+            );
+
+            if (liElement.firstChild) {
+              liElement.firstChild.id = that.selectId + '-' + item.index;
+            }
+
+            break;
+
+          case 'optgroup-label':
+            liElement = generateOption.li(
+              generateOption.label.call(that, item),
+              'dropdown-header' + item.optgroupClass,
+              item.optID
+            );
+
+            break;
+        }
+
+        item.element = liElement;
+        mainElements.push(liElement);
+
+        // count the number of characters in the option - not perfect, but should work in most cases
+        if (item.display) combinedLength += item.display.length;
+        if (item.subtext) combinedLength += item.subtext.length;
+        // if there is an icon, ensure this option's width is checked
+        if (item.icon) combinedLength += 1;
+
+        if (combinedLength > widestOptionLength) {
+          widestOptionLength = combinedLength;
+
+          // guess which option is the widest
+          // use this when calculating menu width
+          // not perfect, but it's fast, and the width will be updating accordingly when scrolling
+          that.selectpicker.view.widestOption = mainElements[mainElements.length - 1];
+        }
+      }
+
+      for (var len = selectData.length, i = 0; i < len; i++) {
+        var item = selectData[i];
+
+        buildElement(item);
+      }
+
+      this.selectpicker.main.elements = this.selectpicker.current.elements = mainElements;
+    },
+
+    findLis: function () {
+      return this.$menuInner.find('.inner > li');
+    },
+
+    render: function () {
+      var that = this,
+          element = this.$element[0],
+          // ensure titleOption is appended and selected (if necessary) before getting selectedOptions
+          placeholderSelected = this.setPlaceholder() && element.selectedIndex === 0,
+          selectedOptions = getSelectedOptions(element, this.options.hideDisabled),
+          selectedCount = selectedOptions.length,
+          button = this.$button[0],
+          buttonInner = button.querySelector('.filter-option-inner-inner'),
+          multipleSeparator = document.createTextNode(this.options.multipleSeparator),
+          titleFragment = elementTemplates.fragment.cloneNode(false),
+          showCount,
+          countMax,
+          hasContent = false;
+
+      button.classList.toggle('bs-placeholder', that.multiple ? !selectedCount : !getSelectValues(element, selectedOptions));
+
+      if (!that.multiple && selectedOptions.length === 1) {
+        that.selectpicker.view.displayedValue = getSelectValues(element, selectedOptions);
+      }
+
+      if (this.options.selectedTextFormat === 'static') {
+        titleFragment = generateOption.text.call(this, { text: this.options.title }, true);
+      } else {
+        showCount = this.multiple && this.options.selectedTextFormat.indexOf('count') !== -1 && selectedCount > 1;
+
+        // determine if the number of selected options will be shown (showCount === true)
+        if (showCount) {
+          countMax = this.options.selectedTextFormat.split('>');
+          showCount = (countMax.length > 1 && selectedCount > countMax[1]) || (countMax.length === 1 && selectedCount >= 2);
+        }
+
+        // only loop through all selected options if the count won't be shown
+        if (showCount === false) {
+          if (!placeholderSelected) {
+            for (var selectedIndex = 0; selectedIndex < selectedCount; selectedIndex++) {
+              if (selectedIndex < 50) {
+                var option = selectedOptions[selectedIndex],
+                    thisData = this.selectpicker.main.data[option.liIndex],
+                    titleOptions = {};
+
+                if (this.multiple && selectedIndex > 0) {
+                  titleFragment.appendChild(multipleSeparator.cloneNode(false));
+                }
+
+                if (option.title) {
+                  titleOptions.text = option.title;
+                } else if (thisData) {
+                  if (thisData.content && that.options.showContent) {
+                    titleOptions.content = thisData.content.toString();
+                    hasContent = true;
+                  } else {
+                    if (that.options.showIcon) {
+                      titleOptions.icon = thisData.icon;
+                    }
+                    if (that.options.showSubtext && !that.multiple && thisData.subtext) titleOptions.subtext = ' ' + thisData.subtext;
+                    titleOptions.text = option.textContent.trim();
+                  }
+                }
+
+                titleFragment.appendChild(generateOption.text.call(this, titleOptions, true));
+              } else {
+                break;
+              }
+            }
+
+            // add ellipsis
+            if (selectedCount > 49) {
+              titleFragment.appendChild(document.createTextNode('...'));
+            }
+          }
+        } else {
+          var optionSelector = ':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';
+          if (this.options.hideDisabled) optionSelector += ':not(:disabled)';
+
+          // If this is a multiselect, and selectedTextFormat is count, then show 1 of 2 selected, etc.
+          var totalCount = this.$element[0].querySelectorAll('select > option' + optionSelector + ', optgroup' + optionSelector + ' option' + optionSelector).length,
+              tr8nText = (typeof this.options.countSelectedText === 'function') ? this.options.countSelectedText(selectedCount, totalCount) : this.options.countSelectedText;
+
+          titleFragment = generateOption.text.call(this, {
+            text: tr8nText.replace('{0}', selectedCount.toString()).replace('{1}', totalCount.toString())
+          }, true);
+        }
+      }
+
+      if (this.options.title == undefined) {
+        // use .attr to ensure undefined is returned if title attribute is not set
+        this.options.title = this.$element.attr('title');
+      }
+
+      // If the select doesn't have a title, then use the default, or if nothing is set at all, use noneSelectedText
+      if (!titleFragment.childNodes.length) {
+        titleFragment = generateOption.text.call(this, {
+          text: typeof this.options.title !== 'undefined' ? this.options.title : this.options.noneSelectedText
+        }, true);
+      }
+
+      // strip all HTML tags and trim the result, then unescape any escaped tags
+      button.title = titleFragment.textContent.replace(/<[^>]*>?/g, '').trim();
+
+      if (this.options.sanitize && hasContent) {
+        sanitizeHtml([titleFragment], that.options.whiteList, that.options.sanitizeFn);
+      }
+
+      buttonInner.innerHTML = '';
+      buttonInner.appendChild(titleFragment);
+
+      if (version.major < 4 && this.$newElement[0].classList.contains('bs3-has-addon')) {
+        var filterExpand = button.querySelector('.filter-expand'),
+            clone = buttonInner.cloneNode(true);
+
+        clone.className = 'filter-expand';
+
+        if (filterExpand) {
+          button.replaceChild(clone, filterExpand);
+        } else {
+          button.appendChild(clone);
+        }
+      }
+
+      this.$element.trigger('rendered' + EVENT_KEY);
+    },
+
+    /**
+     * @param [style]
+     * @param [status]
+     */
+    setStyle: function (newStyle, status) {
+      var button = this.$button[0],
+          newElement = this.$newElement[0],
+          style = this.options.style.trim(),
+          buttonClass;
+
+      if (this.$element.attr('class')) {
+        this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, ''));
+      }
+
+      if (version.major < 4) {
+        newElement.classList.add('bs3');
+
+        if (newElement.parentNode.classList && newElement.parentNode.classList.contains('input-group') &&
+            (newElement.previousElementSibling || newElement.nextElementSibling) &&
+            (newElement.previousElementSibling || newElement.nextElementSibling).classList.contains('input-group-addon')
+        ) {
+          newElement.classList.add('bs3-has-addon');
+        }
+      }
+
+      if (newStyle) {
+        buttonClass = newStyle.trim();
+      } else {
+        buttonClass = style;
+      }
+
+      if (status == 'add') {
+        if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' '));
+      } else if (status == 'remove') {
+        if (buttonClass) button.classList.remove.apply(button.classList, buttonClass.split(' '));
+      } else {
+        if (style) button.classList.remove.apply(button.classList, style.split(' '));
+        if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' '));
+      }
+    },
+
+    liHeight: function (refresh) {
+      if (!refresh && (this.options.size === false || Object.keys(this.sizeInfo).length)) return;
+
+      var newElement = elementTemplates.div.cloneNode(false),
+          menu = elementTemplates.div.cloneNode(false),
+          menuInner = elementTemplates.div.cloneNode(false),
+          menuInnerInner = document.createElement('ul'),
+          divider = elementTemplates.li.cloneNode(false),
+          dropdownHeader = elementTemplates.li.cloneNode(false),
+          li,
+          a = elementTemplates.a.cloneNode(false),
+          text = elementTemplates.span.cloneNode(false),
+          header = this.options.header && this.$menu.find('.' + classNames.POPOVERHEADER).length > 0 ? this.$menu.find('.' + classNames.POPOVERHEADER)[0].cloneNode(true) : null,
+          search = this.options.liveSearch ? elementTemplates.div.cloneNode(false) : null,
+          actions = this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) : null,
+          doneButton = this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) : null,
+          firstOption = this.$element.find('option')[0];
+
+      this.sizeInfo.selectWidth = this.$newElement[0].offsetWidth;
+
+      text.className = 'text';
+      a.className = 'dropdown-item ' + (firstOption ? firstOption.className : '');
+      newElement.className = this.$menu[0].parentNode.className + ' ' + classNames.SHOW;
+      newElement.style.width = 0; // ensure button width doesn't affect natural width of menu when calculating
+      if (this.options.width === 'auto') menu.style.minWidth = 0;
+      menu.className = classNames.MENU + ' ' + classNames.SHOW;
+      menuInner.className = 'inner ' + classNames.SHOW;
+      menuInnerInner.className = classNames.MENU + ' inner ' + (version.major === '4' ? classNames.SHOW : '');
+      divider.className = classNames.DIVIDER;
+      dropdownHeader.className = 'dropdown-header';
+
+      text.appendChild(document.createTextNode('\u200b'));
+
+      if (this.selectpicker.current.data.length) {
+        for (var i = 0; i < this.selectpicker.current.data.length; i++) {
+          var data = this.selectpicker.current.data[i];
+          if (data.type === 'option') {
+            li = data.element;
+            break;
+          }
+        }
+      } else {
+        li = elementTemplates.li.cloneNode(false);
+        a.appendChild(text);
+        li.appendChild(a);
+      }
+
+      dropdownHeader.appendChild(text.cloneNode(true));
+
+      if (this.selectpicker.view.widestOption) {
+        menuInnerInner.appendChild(this.selectpicker.view.widestOption.cloneNode(true));
+      }
+
+      menuInnerInner.appendChild(li);
+      menuInnerInner.appendChild(divider);
+      menuInnerInner.appendChild(dropdownHeader);
+      if (header) menu.appendChild(header);
+      if (search) {
+        var input = document.createElement('input');
+        search.className = 'bs-searchbox';
+        input.className = 'form-control';
+        search.appendChild(input);
+        menu.appendChild(search);
+      }
+      if (actions) menu.appendChild(actions);
+      menuInner.appendChild(menuInnerInner);
+      menu.appendChild(menuInner);
+      if (doneButton) menu.appendChild(doneButton);
+      newElement.appendChild(menu);
+
+      document.body.appendChild(newElement);
+
+      var liHeight = li.offsetHeight,
+          dropdownHeaderHeight = dropdownHeader ? dropdownHeader.offsetHeight : 0,
+          headerHeight = header ? header.offsetHeight : 0,
+          searchHeight = search ? search.offsetHeight : 0,
+          actionsHeight = actions ? actions.offsetHeight : 0,
+          doneButtonHeight = doneButton ? doneButton.offsetHeight : 0,
+          dividerHeight = $(divider).outerHeight(true),
+          // fall back to jQuery if getComputedStyle is not supported
+          menuStyle = window.getComputedStyle ? window.getComputedStyle(menu) : false,
+          menuWidth = menu.offsetWidth,
+          $menu = menuStyle ? null : $(menu),
+          menuPadding = {
+            vert: toInteger(menuStyle ? menuStyle.paddingTop : $menu.css('paddingTop')) +
+                  toInteger(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) +
+                  toInteger(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) +
+                  toInteger(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')),
+            horiz: toInteger(menuStyle ? menuStyle.paddingLeft : $menu.css('paddingLeft')) +
+                  toInteger(menuStyle ? menuStyle.paddingRight : $menu.css('paddingRight')) +
+                  toInteger(menuStyle ? menuStyle.borderLeftWidth : $menu.css('borderLeftWidth')) +
+                  toInteger(menuStyle ? menuStyle.borderRightWidth : $menu.css('borderRightWidth'))
+          },
+          menuExtras = {
+            vert: menuPadding.vert +
+                  toInteger(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) +
+                  toInteger(menuStyle ? menuStyle.marginBottom : $menu.css('marginBottom')) + 2,
+            horiz: menuPadding.horiz +
+                  toInteger(menuStyle ? menuStyle.marginLeft : $menu.css('marginLeft')) +
+                  toInteger(menuStyle ? menuStyle.marginRight : $menu.css('marginRight')) + 2
+          },
+          scrollBarWidth;
+
+      menuInner.style.overflowY = 'scroll';
+
+      scrollBarWidth = menu.offsetWidth - menuWidth;
+
+      document.body.removeChild(newElement);
+
+      this.sizeInfo.liHeight = liHeight;
+      this.sizeInfo.dropdownHeaderHeight = dropdownHeaderHeight;
+      this.sizeInfo.headerHeight = headerHeight;
+      this.sizeInfo.searchHeight = searchHeight;
+      this.sizeInfo.actionsHeight = actionsHeight;
+      this.sizeInfo.doneButtonHeight = doneButtonHeight;
+      this.sizeInfo.dividerHeight = dividerHeight;
+      this.sizeInfo.menuPadding = menuPadding;
+      this.sizeInfo.menuExtras = menuExtras;
+      this.sizeInfo.menuWidth = menuWidth;
+      this.sizeInfo.menuInnerInnerWidth = menuWidth - menuPadding.horiz;
+      this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth;
+      this.sizeInfo.scrollBarWidth = scrollBarWidth;
+      this.sizeInfo.selectHeight = this.$newElement[0].offsetHeight;
+
+      this.setPositionData();
+    },
+
+    getSelectPosition: function () {
+      var that = this,
+          $window = $(window),
+          pos = that.$newElement.offset(),
+          $container = $(that.options.container),
+          containerPos;
+
+      if (that.options.container && $container.length && !$container.is('body')) {
+        containerPos = $container.offset();
+        containerPos.top += parseInt($container.css('borderTopWidth'));
+        containerPos.left += parseInt($container.css('borderLeftWidth'));
+      } else {
+        containerPos = { top: 0, left: 0 };
+      }
+
+      var winPad = that.options.windowPadding;
+
+      this.sizeInfo.selectOffsetTop = pos.top - containerPos.top - $window.scrollTop();
+      this.sizeInfo.selectOffsetBot = $window.height() - this.sizeInfo.selectOffsetTop - this.sizeInfo.selectHeight - containerPos.top - winPad[2];
+      this.sizeInfo.selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft();
+      this.sizeInfo.selectOffsetRight = $window.width() - this.sizeInfo.selectOffsetLeft - this.sizeInfo.selectWidth - containerPos.left - winPad[1];
+      this.sizeInfo.selectOffsetTop -= winPad[0];
+      this.sizeInfo.selectOffsetLeft -= winPad[3];
+    },
+
+    setMenuSize: function (isAuto) {
+      this.getSelectPosition();
+
+      var selectWidth = this.sizeInfo.selectWidth,
+          liHeight = this.sizeInfo.liHeight,
+          headerHeight = this.sizeInfo.headerHeight,
+          searchHeight = this.sizeInfo.searchHeight,
+          actionsHeight = this.sizeInfo.actionsHeight,
+          doneButtonHeight = this.sizeInfo.doneButtonHeight,
+          divHeight = this.sizeInfo.dividerHeight,
+          menuPadding = this.sizeInfo.menuPadding,
+          menuInnerHeight,
+          menuHeight,
+          divLength = 0,
+          minHeight,
+          _minHeight,
+          maxHeight,
+          menuInnerMinHeight,
+          estimate,
+          isDropup;
+
+      if (this.options.dropupAuto) {
+        // Get the estimated height of the menu without scrollbars.
+        // This is useful for smaller menus, where there might be plenty of room
+        // below the button without setting dropup, but we can't know
+        // the exact height of the menu until createView is called later
+        estimate = liHeight * this.selectpicker.current.elements.length + menuPadding.vert;
+
+        isDropup = this.sizeInfo.selectOffsetTop - this.sizeInfo.selectOffsetBot > this.sizeInfo.menuExtras.vert && estimate + this.sizeInfo.menuExtras.vert + 50 > this.sizeInfo.selectOffsetBot;
+
+        // ensure dropup doesn't change while searching (so menu doesn't bounce back and forth)
+        if (this.selectpicker.isSearching === true) {
+          isDropup = this.selectpicker.dropup;
+        }
+
+        this.$newElement.toggleClass(classNames.DROPUP, isDropup);
+        this.selectpicker.dropup = isDropup;
+      }
+
+      if (this.options.size === 'auto') {
+        _minHeight = this.selectpicker.current.elements.length > 3 ? this.sizeInfo.liHeight * 3 + this.sizeInfo.menuExtras.vert - 2 : 0;
+        menuHeight = this.sizeInfo.selectOffsetBot - this.sizeInfo.menuExtras.vert;
+        minHeight = _minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight;
+        menuInnerMinHeight = Math.max(_minHeight - menuPadding.vert, 0);
+
+        if (this.$newElement.hasClass(classNames.DROPUP)) {
+          menuHeight = this.sizeInfo.selectOffsetTop - this.sizeInfo.menuExtras.vert;
+        }
+
+        maxHeight = menuHeight;
+        menuInnerHeight = menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert;
+      } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) {
+        for (var i = 0; i < this.options.size; i++) {
+          if (this.selectpicker.current.data[i].type === 'divider') divLength++;
+        }
+
+        menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert;
+        menuInnerHeight = menuHeight - menuPadding.vert;
+        maxHeight = menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight;
+        minHeight = menuInnerMinHeight = '';
+      }
+
+      this.$menu.css({
+        'max-height': maxHeight + 'px',
+        'overflow': 'hidden',
+        'min-height': minHeight + 'px'
+      });
+
+      this.$menuInner.css({
+        'max-height': menuInnerHeight + 'px',
+        'overflow-y': 'auto',
+        'min-height': menuInnerMinHeight + 'px'
+      });
+
+      // ensure menuInnerHeight is always a positive number to prevent issues calculating chunkSize in createView
+      this.sizeInfo.menuInnerHeight = Math.max(menuInnerHeight, 1);
+
+      if (this.selectpicker.current.data.length && this.selectpicker.current.data[this.selectpicker.current.data.length - 1].position > this.sizeInfo.menuInnerHeight) {
+        this.sizeInfo.hasScrollBar = true;
+        this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth + this.sizeInfo.scrollBarWidth;
+      }
+
+      if (this.options.dropdownAlignRight === 'auto') {
+        this.$menu.toggleClass(classNames.MENURIGHT, this.sizeInfo.selectOffsetLeft > this.sizeInfo.selectOffsetRight && this.sizeInfo.selectOffsetRight < (this.sizeInfo.totalMenuWidth - selectWidth));
+      }
+
+      if (this.dropdown && this.dropdown._popper) this.dropdown._popper.update();
+    },
+
+    setSize: function (refresh) {
+      this.liHeight(refresh);
+
+      if (this.options.header) this.$menu.css('padding-top', 0);
+
+      if (this.options.size !== false) {
+        var that = this,
+            $window = $(window);
+
+        this.setMenuSize();
+
+        if (this.options.liveSearch) {
+          this.$searchbox
+            .off('input.setMenuSize propertychange.setMenuSize')
+            .on('input.setMenuSize propertychange.setMenuSize', function () {
+              return that.setMenuSize();
+            });
+        }
+
+        if (this.options.size === 'auto') {
+          $window
+            .off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize')
+            .on('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize', function () {
+              return that.setMenuSize();
+            });
+        } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) {
+          $window.off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize');
+        }
+      }
+
+      this.createView(false, true, refresh);
+    },
+
+    setWidth: function () {
+      var that = this;
+
+      if (this.options.width === 'auto') {
+        requestAnimationFrame(function () {
+          that.$menu.css('min-width', '0');
+
+          that.$element.on('loaded' + EVENT_KEY, function () {
+            that.liHeight();
+            that.setMenuSize();
+
+            // Get correct width if element is hidden
+            var $selectClone = that.$newElement.clone().appendTo('body'),
+                btnWidth = $selectClone.css('width', 'auto').children('button').outerWidth();
+
+            $selectClone.remove();
+
+            // Set width to whatever's larger, button title or longest option
+            that.sizeInfo.selectWidth = Math.max(that.sizeInfo.totalMenuWidth, btnWidth);
+            that.$newElement.css('width', that.sizeInfo.selectWidth + 'px');
+          });
+        });
+      } else if (this.options.width === 'fit') {
+        // Remove inline min-width so width can be changed from 'auto'
+        this.$menu.css('min-width', '');
+        this.$newElement.css('width', '').addClass('fit-width');
+      } else if (this.options.width) {
+        // Remove inline min-width so width can be changed from 'auto'
+        this.$menu.css('min-width', '');
+        this.$newElement.css('width', this.options.width);
+      } else {
+        // Remove inline min-width/width so width can be changed
+        this.$menu.css('min-width', '');
+        this.$newElement.css('width', '');
+      }
+      // Remove fit-width class if width is changed programmatically
+      if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') {
+        this.$newElement[0].classList.remove('fit-width');
+      }
+    },
+
+    selectPosition: function () {
+      this.$bsContainer = $('<div class="bs-container" />');
+
+      var that = this,
+          $container = $(this.options.container),
+          pos,
+          containerPos,
+          actualHeight,
+          getPlacement = function ($element) {
+            var containerPosition = {},
+                // fall back to dropdown's default display setting if display is not manually set
+                display = that.options.display || (
+                  // Bootstrap 3 doesn't have $.fn.dropdown.Constructor.Default
+                  $.fn.dropdown.Constructor.Default ? $.fn.dropdown.Constructor.Default.display
+                  : false
+                );
+
+            that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi, '')).toggleClass(classNames.DROPUP, $element.hasClass(classNames.DROPUP));
+            pos = $element.offset();
+
+            if (!$container.is('body')) {
+              containerPos = $container.offset();
+              containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop();
+              containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft();
+            } else {
+              containerPos = { top: 0, left: 0 };
+            }
+
+            actualHeight = $element.hasClass(classNames.DROPUP) ? 0 : $element[0].offsetHeight;
+
+            // Bootstrap 4+ uses Popper for menu positioning
+            if (version.major < 4 || display === 'static') {
+              containerPosition.top = pos.top - containerPos.top + actualHeight;
+              containerPosition.left = pos.left - containerPos.left;
+            }
+
+            containerPosition.width = $element[0].offsetWidth;
+
+            that.$bsContainer.css(containerPosition);
+          };
+
+      this.$button.on('click.bs.dropdown.data-api', function () {
+        if (that.isDisabled()) {
+          return;
+        }
+
+        getPlacement(that.$newElement);
+
+        that.$bsContainer
+          .appendTo(that.options.container)
+          .toggleClass(classNames.SHOW, !that.$button.hasClass(classNames.SHOW))
+          .append(that.$menu);
+      });
+
+      $(window)
+        .off('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId)
+        .on('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId, function () {
+          var isActive = that.$newElement.hasClass(classNames.SHOW);
+
+          if (isActive) getPlacement(that.$newElement);
+        });
+
+      this.$element.on('hide' + EVENT_KEY, function () {
+        that.$menu.data('height', that.$menu.height());
+        that.$bsContainer.detach();
+      });
+    },
+
+    setOptionStatus: function (selectedOnly) {
+      var that = this;
+
+      that.noScroll = false;
+
+      if (that.selectpicker.view.visibleElements && that.selectpicker.view.visibleElements.length) {
+        for (var i = 0; i < that.selectpicker.view.visibleElements.length; i++) {
+          var liData = that.selectpicker.current.data[i + that.selectpicker.view.position0],
+              option = liData.option;
+
+          if (option) {
+            if (selectedOnly !== true) {
+              that.setDisabled(
+                liData.index,
+                liData.disabled
+              );
+            }
+
+            that.setSelected(
+              liData.index,
+              option.selected
+            );
+          }
+        }
+      }
+    },
+
+    /**
+     * @param {number} index - the index of the option that is being changed
+     * @param {boolean} selected - true if the option is being selected, false if being deselected
+     */
+    setSelected: function (index, selected) {
+      var li = this.selectpicker.main.elements[index],
+          liData = this.selectpicker.main.data[index],
+          activeIndexIsSet = this.activeIndex !== undefined,
+          thisIsActive = this.activeIndex === index,
+          prevActive,
+          a,
+          // if current option is already active
+          // OR
+          // if the current option is being selected, it's NOT multiple, and
+          // activeIndex is undefined:
+          //  - when the menu is first being opened, OR
+          //  - after a search has been performed, OR
+          //  - when retainActive is false when selecting a new option (i.e. index of the newly selected option is not the same as the current activeIndex)
+          keepActive = thisIsActive || (selected && !this.multiple && !activeIndexIsSet);
+
+      liData.selected = selected;
+
+      a = li.firstChild;
+
+      if (selected) {
+        this.selectedIndex = index;
+      }
+
+      li.classList.toggle('selected', selected);
+
+      if (keepActive) {
+        this.focusItem(li, liData);
+        this.selectpicker.view.currentActive = li;
+        this.activeIndex = index;
+      } else {
+        this.defocusItem(li);
+      }
+
+      if (a) {
+        a.classList.toggle('selected', selected);
+
+        if (selected) {
+          a.setAttribute('aria-selected', true);
+        } else {
+          if (this.multiple) {
+            a.setAttribute('aria-selected', false);
+          } else {
+            a.removeAttribute('aria-selected');
+          }
+        }
+      }
+
+      if (!keepActive && !activeIndexIsSet && selected && this.prevActiveIndex !== undefined) {
+        prevActive = this.selectpicker.main.elements[this.prevActiveIndex];
+
+        this.defocusItem(prevActive);
+      }
+    },
+
+    /**
+     * @param {number} index - the index of the option that is being disabled
+     * @param {boolean} disabled - true if the option is being disabled, false if being enabled
+     */
+    setDisabled: function (index, disabled) {
+      var li = this.selectpicker.main.elements[index],
+          a;
+
+      this.selectpicker.main.data[index].disabled = disabled;
+
+      a = li.firstChild;
+
+      li.classList.toggle(classNames.DISABLED, disabled);
+
+      if (a) {
+        if (version.major === '4') a.classList.toggle(classNames.DISABLED, disabled);
+
+        if (disabled) {
+          a.setAttribute('aria-disabled', disabled);
+          a.setAttribute('tabindex', -1);
+        } else {
+          a.removeAttribute('aria-disabled');
+          a.setAttribute('tabindex', 0);
+        }
+      }
+    },
+
+    isDisabled: function () {
+      return this.$element[0].disabled;
+    },
+
+    checkDisabled: function () {
+      if (this.isDisabled()) {
+        this.$newElement[0].classList.add(classNames.DISABLED);
+        this.$button.addClass(classNames.DISABLED).attr('aria-disabled', true);
+      } else {
+        if (this.$button[0].classList.contains(classNames.DISABLED)) {
+          this.$newElement[0].classList.remove(classNames.DISABLED);
+          this.$button.removeClass(classNames.DISABLED).attr('aria-disabled', false);
+        }
+      }
+    },
+
+    clickListener: function () {
+      var that = this,
+          $document = $(document);
+
+      $document.data('spaceSelect', false);
+
+      this.$button.on('keyup', function (e) {
+        if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) {
+          e.preventDefault();
+          $document.data('spaceSelect', false);
+        }
+      });
+
+      this.$newElement.on('show.bs.dropdown', function () {
+        if (version.major > 3 && !that.dropdown) {
+          that.dropdown = that.$button.data('bs.dropdown');
+          that.dropdown._menu = that.$menu[0];
+        }
+      });
+
+      this.$button.on('click.bs.dropdown.data-api', function () {
+        if (!that.$newElement.hasClass(classNames.SHOW)) {
+          that.setSize();
+        }
+      });
+
+      function setFocus () {
+        if (that.options.liveSearch) {
+          that.$searchbox.trigger('focus');
+        } else {
+          that.$menuInner.trigger('focus');
+        }
+      }
+
+      function checkPopperExists () {
+        if (that.dropdown && that.dropdown._popper && that.dropdown._popper.state.isCreated) {
+          setFocus();
+        } else {
+          requestAnimationFrame(checkPopperExists);
+        }
+      }
+
+      this.$element.on('shown' + EVENT_KEY, function () {
+        if (that.$menuInner[0].scrollTop !== that.selectpicker.view.scrollTop) {
+          that.$menuInner[0].scrollTop = that.selectpicker.view.scrollTop;
+        }
+
+        if (version.major > 3) {
+          requestAnimationFrame(checkPopperExists);
+        } else {
+          setFocus();
+        }
+      });
+
+      // ensure posinset and setsize are correct before selecting an option via a click
+      this.$menuInner.on('mouseenter', 'li a', function (e) {
+        var hoverLi = this.parentElement,
+            position0 = that.isVirtual() ? that.selectpicker.view.position0 : 0,
+            index = Array.prototype.indexOf.call(hoverLi.parentElement.children, hoverLi),
+            hoverData = that.selectpicker.current.data[index + position0];
+
+        that.focusItem(hoverLi, hoverData, true);
+      });
+
+      this.$menuInner.on('click', 'li a', function (e, retainActive) {
+        var $this = $(this),
+            element = that.$element[0],
+            position0 = that.isVirtual() ? that.selectpicker.view.position0 : 0,
+            clickedData = that.selectpicker.current.data[$this.parent().index() + position0],
+            clickedIndex = clickedData.index,
+            prevValue = getSelectValues(element),
+            prevIndex = element.selectedIndex,
+            prevOption = element.options[prevIndex],
+            triggerChange = true;
+
+        // Don't close on multi choice menu
+        if (that.multiple && that.options.maxOptions !== 1) {
+          e.stopPropagation();
+        }
+
+        e.preventDefault();
+
+        // Don't run if the select is disabled
+        if (!that.isDisabled() && !$this.parent().hasClass(classNames.DISABLED)) {
+          var option = clickedData.option,
+              $option = $(option),
+              state = option.selected,
+              $optgroup = $option.parent('optgroup'),
+              $optgroupOptions = $optgroup.find('option'),
+              maxOptions = that.options.maxOptions,
+              maxOptionsGrp = $optgroup.data('maxOptions') || false;
+
+          if (clickedIndex === that.activeIndex) retainActive = true;
+
+          if (!retainActive) {
+            that.prevActiveIndex = that.activeIndex;
+            that.activeIndex = undefined;
+          }
+
+          if (!that.multiple) { // Deselect all others if not multi select box
+            if (prevOption) prevOption.selected = false;
+            option.selected = true;
+            that.setSelected(clickedIndex, true);
+          } else { // Toggle the one we have chosen if we are multi select.
+            option.selected = !state;
+
+            that.setSelected(clickedIndex, !state);
+            that.focusedParent.focus();
+
+            if (maxOptions !== false || maxOptionsGrp !== false) {
+              var maxReached = maxOptions < getSelectedOptions(element).length,
+                  maxReachedGrp = maxOptionsGrp < $optgroup.find('option:selected').length;
+
+              if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) {
+                if (maxOptions && maxOptions == 1) {
+                  element.selectedIndex = -1;
+                  option.selected = true;
+                  that.setOptionStatus(true);
+                } else if (maxOptionsGrp && maxOptionsGrp == 1) {
+                  for (var i = 0; i < $optgroupOptions.length; i++) {
+                    var _option = $optgroupOptions[i];
+                    _option.selected = false;
+                    that.setSelected(_option.liIndex, false);
+                  }
+
+                  option.selected = true;
+                  that.setSelected(clickedIndex, true);
+                } else {
+                  var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText,
+                      maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText,
+                      maxTxt = maxOptionsArr[0].replace('{n}', maxOptions),
+                      maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp),
+                      $notify = $('<div class="notify"></div>');
+                  // If {var} is set in array, replace it
+                  /** @deprecated */
+                  if (maxOptionsArr[2]) {
+                    maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]);
+                    maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]);
+                  }
+
+                  option.selected = false;
+
+                  that.$menu.append($notify);
+
+                  if (maxOptions && maxReached) {
+                    $notify.append($('<div>' + maxTxt + '</div>'));
+                    triggerChange = false;
+                    that.$element.trigger('maxReached' + EVENT_KEY);
+                  }
+
+                  if (maxOptionsGrp && maxReachedGrp) {
+                    $notify.append($('<div>' + maxTxtGrp + '</div>'));
+                    triggerChange = false;
+                    that.$element.trigger('maxReachedGrp' + EVENT_KEY);
+                  }
+
+                  setTimeout(function () {
+                    that.setSelected(clickedIndex, false);
+                  }, 10);
+
+                  $notify[0].classList.add('fadeOut');
+
+                  setTimeout(function () {
+                    $notify.remove();
+                  }, 1050);
+                }
+              }
+            }
+          }
+
+          if (!that.multiple || (that.multiple && that.options.maxOptions === 1)) {
+            that.$button.trigger('focus');
+          } else if (that.options.liveSearch) {
+            that.$searchbox.trigger('focus');
+          }
+
+          // Trigger select 'change'
+          if (triggerChange) {
+            if (that.multiple || prevIndex !== element.selectedIndex) {
+              // $option.prop('selected') is current option state (selected/unselected). prevValue is the value of the select prior to being changed.
+              changedArguments = [option.index, $option.prop('selected'), prevValue];
+              that.$element
+                .triggerNative('change');
+            }
+          }
+        }
+      });
+
+      this.$menu.on('click', 'li.' + classNames.DISABLED + ' a, .' + classNames.POPOVERHEADER + ', .' + classNames.POPOVERHEADER + ' :not(.close)', function (e) {
+        if (e.currentTarget == this) {
+          e.preventDefault();
+          e.stopPropagation();
+          if (that.options.liveSearch && !$(e.target).hasClass('close')) {
+            that.$searchbox.trigger('focus');
+          } else {
+            that.$button.trigger('focus');
+          }
+        }
+      });
+
+      this.$menuInner.on('click', '.divider, .dropdown-header', function (e) {
+        e.preventDefault();
+        e.stopPropagation();
+        if (that.options.liveSearch) {
+          that.$searchbox.trigger('focus');
+        } else {
+          that.$button.trigger('focus');
+        }
+      });
+
+      this.$menu.on('click', '.' + classNames.POPOVERHEADER + ' .close', function () {
+        that.$button.trigger('click');
+      });
+
+      this.$searchbox.on('click', function (e) {
+        e.stopPropagation();
+      });
+
+      this.$menu.on('click', '.actions-btn', function (e) {
+        if (that.options.liveSearch) {
+          that.$searchbox.trigger('focus');
+        } else {
+          that.$button.trigger('focus');
+        }
+
+        e.preventDefault();
+        e.stopPropagation();
+
+        if ($(this).hasClass('bs-select-all')) {
+          that.selectAll();
+        } else {
+          that.deselectAll();
+        }
+      });
+
+      this.$button
+        .on('focus' + EVENT_KEY, function (e) {
+          var tabindex = that.$element[0].getAttribute('tabindex');
+
+          // only change when button is actually focused
+          if (tabindex !== undefined && e.originalEvent && e.originalEvent.isTrusted) {
+            // apply select element's tabindex to ensure correct order is followed when tabbing to the next element
+            this.setAttribute('tabindex', tabindex);
+            // set element's tabindex to -1 to allow for reverse tabbing
+            that.$element[0].setAttribute('tabindex', -1);
+            that.selectpicker.view.tabindex = tabindex;
+          }
+        })
+        .on('blur' + EVENT_KEY, function (e) {
+          // revert everything to original tabindex
+          if (that.selectpicker.view.tabindex !== undefined && e.originalEvent && e.originalEvent.isTrusted) {
+            that.$element[0].setAttribute('tabindex', that.selectpicker.view.tabindex);
+            this.setAttribute('tabindex', -1);
+            that.selectpicker.view.tabindex = undefined;
+          }
+        });
+
+      this.$element
+        .on('change' + EVENT_KEY, function () {
+          that.render();
+          that.$element.trigger('changed' + EVENT_KEY, changedArguments);
+          changedArguments = null;
+        })
+        .on('focus' + EVENT_KEY, function () {
+          if (!that.options.mobile) that.$button[0].focus();
+        });
+    },
+
+    liveSearchListener: function () {
+      var that = this;
+
+      this.$button.on('click.bs.dropdown.data-api', function () {
+        if (!!that.$searchbox.val()) {
+          that.$searchbox.val('');
+          that.selectpicker.search.previousValue = undefined;
+        }
+      });
+
+      this.$searchbox.on('click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api', function (e) {
+        e.stopPropagation();
+      });
+
+      this.$searchbox.on('input propertychange', function () {
+        var searchValue = that.$searchbox[0].value;
+
+        that.selectpicker.search.elements = [];
+        that.selectpicker.search.data = [];
+
+        if (searchValue) {
+          var i,
+              searchMatch = [],
+              q = searchValue.toUpperCase(),
+              cache = {},
+              cacheArr = [],
+              searchStyle = that._searchStyle(),
+              normalizeSearch = that.options.liveSearchNormalize;
+
+          if (normalizeSearch) q = normalizeToBase(q);
+
+          for (var i = 0; i < that.selectpicker.main.data.length; i++) {
+            var li = that.selectpicker.main.data[i];
+
+            if (!cache[i]) {
+              cache[i] = stringSearch(li, q, searchStyle, normalizeSearch);
+            }
+
+            if (cache[i] && li.headerIndex !== undefined && cacheArr.indexOf(li.headerIndex) === -1) {
+              if (li.headerIndex > 0) {
+                cache[li.headerIndex - 1] = true;
+                cacheArr.push(li.headerIndex - 1);
+              }
+
+              cache[li.headerIndex] = true;
+              cacheArr.push(li.headerIndex);
+
+              cache[li.lastIndex + 1] = true;
+            }
+
+            if (cache[i] && li.type !== 'optgroup-label') cacheArr.push(i);
+          }
+
+          for (var i = 0, cacheLen = cacheArr.length; i < cacheLen; i++) {
+            var index = cacheArr[i],
+                prevIndex = cacheArr[i - 1],
+                li = that.selectpicker.main.data[index],
+                liPrev = that.selectpicker.main.data[prevIndex];
+
+            if (li.type !== 'divider' || (li.type === 'divider' && liPrev && liPrev.type !== 'divider' && cacheLen - 1 !== i)) {
+              that.selectpicker.search.data.push(li);
+              searchMatch.push(that.selectpicker.main.elements[index]);
+            }
+          }
+
+          that.activeIndex = undefined;
+          that.noScroll = true;
+          that.$menuInner.scrollTop(0);
+          that.selectpicker.search.elements = searchMatch;
+          that.createView(true);
+          showNoResults.call(that, searchMatch, searchValue);
+        } else if (that.selectpicker.search.previousValue) { // for IE11 (#2402)
+          that.$menuInner.scrollTop(0);
+          that.createView(false);
+        }
+
+        that.selectpicker.search.previousValue =  searchValue;
+      });
+    },
+
+    _searchStyle: function () {
+      return this.options.liveSearchStyle || 'contains';
+    },
+
+    val: function (value) {
+      var element = this.$element[0];
+
+      if (typeof value !== 'undefined') {
+        var prevValue = getSelectValues(element);
+
+        changedArguments = [null, null, prevValue];
+
+        this.$element
+          .val(value)
+          .trigger('changed' + EVENT_KEY, changedArguments);
+
+        if (this.$newElement.hasClass(classNames.SHOW)) {
+          if (this.multiple) {
+            this.setOptionStatus(true);
+          } else {
+            var liSelectedIndex = (element.options[element.selectedIndex] || {}).liIndex;
+
+            if (typeof liSelectedIndex === 'number') {
+              this.setSelected(this.selectedIndex, false);
+              this.setSelected(liSelectedIndex, true);
+            }
+          }
+        }
+
+        this.render();
+
+        changedArguments = null;
+
+        return this.$element;
+      } else {
+        return this.$element.val();
+      }
+    },
+
+    changeAll: function (status) {
+      if (!this.multiple) return;
+      if (typeof status === 'undefined') status = true;
+
+      var element = this.$element[0],
+          previousSelected = 0,
+          currentSelected = 0,
+          prevValue = getSelectValues(element);
+
+      element.classList.add('bs-select-hidden');
+
+      for (var i = 0, data = this.selectpicker.current.data, len = data.length; i < len; i++) {
+        var liData = data[i],
+            option = liData.option;
+
+        if (option && !liData.disabled && liData.type !== 'divider') {
+          if (liData.selected) previousSelected++;
+          option.selected = status;
+          if (status === true) currentSelected++;
+        }
+      }
+
+      element.classList.remove('bs-select-hidden');
+
+      if (previousSelected === currentSelected) return;
+
+      this.setOptionStatus();
+
+      changedArguments = [null, null, prevValue];
+
+      this.$element
+        .triggerNative('change');
+    },
+
+    selectAll: function () {
+      return this.changeAll(true);
+    },
+
+    deselectAll: function () {
+      return this.changeAll(false);
+    },
+
+    toggle: function (e) {
+      e = e || window.event;
+
+      if (e) e.stopPropagation();
+
+      this.$button.trigger('click.bs.dropdown.data-api');
+    },
+
+    keydown: function (e) {
+      var $this = $(this),
+          isToggle = $this.hasClass('dropdown-toggle'),
+          $parent = isToggle ? $this.closest('.dropdown') : $this.closest(Selector.MENU),
+          that = $parent.data('this'),
+          $items = that.findLis(),
+          index,
+          isActive,
+          liActive,
+          activeLi,
+          offset,
+          updateScroll = false,
+          downOnTab = e.which === keyCodes.TAB && !isToggle && !that.options.selectOnTab,
+          isArrowKey = REGEXP_ARROW.test(e.which) || downOnTab,
+          scrollTop = that.$menuInner[0].scrollTop,
+          isVirtual = that.isVirtual(),
+          position0 = isVirtual === true ? that.selectpicker.view.position0 : 0;
+
+      // do nothing if a function key is pressed
+      if (e.which >= 112 && e.which <= 123) return;
+
+      isActive = that.$newElement.hasClass(classNames.SHOW);
+
+      if (
+        !isActive &&
+        (
+          isArrowKey ||
+          (e.which >= 48 && e.which <= 57) ||
+          (e.which >= 96 && e.which <= 105) ||
+          (e.which >= 65 && e.which <= 90)
+        )
+      ) {
+        that.$button.trigger('click.bs.dropdown.data-api');
+
+        if (that.options.liveSearch) {
+          that.$searchbox.trigger('focus');
+          return;
+        }
+      }
+
+      if (e.which === keyCodes.ESCAPE && isActive) {
+        e.preventDefault();
+        that.$button.trigger('click.bs.dropdown.data-api').trigger('focus');
+      }
+
+      if (isArrowKey) { // if up or down
+        if (!$items.length) return;
+
+        liActive = that.selectpicker.main.elements[that.activeIndex];
+        index = liActive ? Array.prototype.indexOf.call(liActive.parentElement.children, liActive) : -1;
+
+        if (index !== -1) {
+          that.defocusItem(liActive);
+        }
+
+        if (e.which === keyCodes.ARROW_UP) { // up
+          if (index !== -1) index--;
+          if (index + position0 < 0) index += $items.length;
+
+          if (!that.selectpicker.view.canHighlight[index + position0]) {
+            index = that.selectpicker.view.canHighlight.slice(0, index + position0).lastIndexOf(true) - position0;
+            if (index === -1) index = $items.length - 1;
+          }
+        } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { // down
+          index++;
+          if (index + position0 >= that.selectpicker.view.canHighlight.length) index = that.selectpicker.view.firstHighlightIndex;
+
+          if (!that.selectpicker.view.canHighlight[index + position0]) {
+            index = index + 1 + that.selectpicker.view.canHighlight.slice(index + position0 + 1).indexOf(true);
+          }
+        }
+
+        e.preventDefault();
+
+        var liActiveIndex = position0 + index;
+
+        if (e.which === keyCodes.ARROW_UP) { // up
+          // scroll to bottom and highlight last option
+          if (position0 === 0 && index === $items.length - 1) {
+            that.$menuInner[0].scrollTop = that.$menuInner[0].scrollHeight;
+
+            liActiveIndex = that.selectpicker.current.elements.length - 1;
+          } else {
+            activeLi = that.selectpicker.current.data[liActiveIndex];
+            offset = activeLi.position - activeLi.height;
+
+            updateScroll = offset < scrollTop;
+          }
+        } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { // down
+          // scroll to top and highlight first option
+          if (index === that.selectpicker.view.firstHighlightIndex) {
+            that.$menuInner[0].scrollTop = 0;
+
+            liActiveIndex = that.selectpicker.view.firstHighlightIndex;
+          } else {
+            activeLi = that.selectpicker.current.data[liActiveIndex];
+            offset = activeLi.position - that.sizeInfo.menuInnerHeight;
+
+            updateScroll = offset > scrollTop;
+          }
+        }
+
+        liActive = that.selectpicker.current.elements[liActiveIndex];
+
+        that.activeIndex = that.selectpicker.current.data[liActiveIndex].index;
+
+        that.focusItem(liActive);
+
+        that.selectpicker.view.currentActive = liActive;
+
+        if (updateScroll) that.$menuInner[0].scrollTop = offset;
+
+        if (that.options.liveSearch) {
+          that.$searchbox.trigger('focus');
+        } else {
+          $this.trigger('focus');
+        }
+      } else if (
+        (!$this.is('input') && !REGEXP_TAB_OR_ESCAPE.test(e.which)) ||
+        (e.which === keyCodes.SPACE && that.selectpicker.keydown.keyHistory)
+      ) {
+        var searchMatch,
+            matches = [],
+            keyHistory;
+
+        e.preventDefault();
+
+        that.selectpicker.keydown.keyHistory += keyCodeMap[e.which];
+
+        if (that.selectpicker.keydown.resetKeyHistory.cancel) clearTimeout(that.selectpicker.keydown.resetKeyHistory.cancel);
+        that.selectpicker.keydown.resetKeyHistory.cancel = that.selectpicker.keydown.resetKeyHistory.start();
+
+        keyHistory = that.selectpicker.keydown.keyHistory;
+
+        // if all letters are the same, set keyHistory to just the first character when searching
+        if (/^(.)\1+$/.test(keyHistory)) {
+          keyHistory = keyHistory.charAt(0);
+        }
+
+        // find matches
+        for (var i = 0; i < that.selectpicker.current.data.length; i++) {
+          var li = that.selectpicker.current.data[i],
+              hasMatch;
+
+          hasMatch = stringSearch(li, keyHistory, 'startsWith', true);
+
+          if (hasMatch && that.selectpicker.view.canHighlight[i]) {
+            matches.push(li.index);
+          }
+        }
+
+        if (matches.length) {
+          var matchIndex = 0;
+
+          $items.removeClass('active').find('a').removeClass('active');
+
+          // either only one key has been pressed or they are all the same key
+          if (keyHistory.length === 1) {
+            matchIndex = matches.indexOf(that.activeIndex);
+
+            if (matchIndex === -1 || matchIndex === matches.length - 1) {
+              matchIndex = 0;
+            } else {
+              matchIndex++;
+            }
+          }
+
+          searchMatch = matches[matchIndex];
+
+          activeLi = that.selectpicker.main.data[searchMatch];
+
+          if (scrollTop - activeLi.position > 0) {
+            offset = activeLi.position - activeLi.height;
+            updateScroll = true;
+          } else {
+            offset = activeLi.position - that.sizeInfo.menuInnerHeight;
+            // if the option is already visible at the current scroll position, just keep it the same
+            updateScroll = activeLi.position > scrollTop + that.sizeInfo.menuInnerHeight;
+          }
+
+          liActive = that.selectpicker.main.elements[searchMatch];
+
+          that.activeIndex = matches[matchIndex];
+
+          that.focusItem(liActive);
+
+          if (liActive) liActive.firstChild.focus();
+
+          if (updateScroll) that.$menuInner[0].scrollTop = offset;
+
+          $this.trigger('focus');
+        }
+      }
+
+      // Select focused option if "Enter", "Spacebar" or "Tab" (when selectOnTab is true) are pressed inside the menu.
+      if (
+        isActive &&
+        (
+          (e.which === keyCodes.SPACE && !that.selectpicker.keydown.keyHistory) ||
+          e.which === keyCodes.ENTER ||
+          (e.which === keyCodes.TAB && that.options.selectOnTab)
+        )
+      ) {
+        if (e.which !== keyCodes.SPACE) e.preventDefault();
+
+        if (!that.options.liveSearch || e.which !== keyCodes.SPACE) {
+          that.$menuInner.find('.active a').trigger('click', true); // retain active class
+          $this.trigger('focus');
+
+          if (!that.options.liveSearch) {
+            // Prevent screen from scrolling if the user hits the spacebar
+            e.preventDefault();
+            // Fixes spacebar selection of dropdown items in FF & IE
+            $(document).data('spaceSelect', true);
+          }
+        }
+      }
+    },
+
+    mobile: function () {
+      // ensure mobile is set to true if mobile function is called after init
+      this.options.mobile = true;
+      this.$element[0].classList.add('mobile-device');
+    },
+
+    refresh: function () {
+      // update options if data attributes have been changed
+      var config = $.extend({}, this.options, this.$element.data());
+      this.options = config;
+
+      this.checkDisabled();
+      this.buildData();
+      this.setStyle();
+      this.render();
+      this.buildList();
+      this.setWidth();
+
+      this.setSize(true);
+
+      this.$element.trigger('refreshed' + EVENT_KEY);
+    },
+
+    hide: function () {
+      this.$newElement.hide();
+    },
+
+    show: function () {
+      this.$newElement.show();
+    },
+
+    remove: function () {
+      this.$newElement.remove();
+      this.$element.remove();
+    },
+
+    destroy: function () {
+      this.$newElement.before(this.$element).remove();
+
+      if (this.$bsContainer) {
+        this.$bsContainer.remove();
+      } else {
+        this.$menu.remove();
+      }
+
+      if (this.selectpicker.view.titleOption && this.selectpicker.view.titleOption.parentNode) {
+        this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption);
+      }
+
+      this.$element
+        .off(EVENT_KEY)
+        .removeData('selectpicker')
+        .removeClass('bs-select-hidden selectpicker');
+
+      $(window).off(EVENT_KEY + '.' + this.selectId);
+    }
+  };
+
+  // SELECTPICKER PLUGIN DEFINITION
+  // ==============================
+  function Plugin (option) {
+    // get the args of the outer function..
+    var args = arguments;
+    // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them
+    // to get lost/corrupted in android 2.3 and IE9 #715 #775
+    var _option = option;
+
+    [].shift.apply(args);
+
+    // if the version was not set successfully
+    if (!version.success) {
+      // try to retreive it again
+      try {
+        version.full = ($.fn.dropdown.Constructor.VERSION || '').split(' ')[0].split('.');
+      } catch (err) {
+        // fall back to use BootstrapVersion if set
+        if (Selectpicker.BootstrapVersion) {
+          version.full = Selectpicker.BootstrapVersion.split(' ')[0].split('.');
+        } else {
+          version.full = [version.major, '0', '0'];
+
+          console.warn(
+            'There was an issue retrieving Bootstrap\'s version. ' +
+            'Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. ' +
+            'If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.',
+            err
+          );
+        }
+      }
+
+      version.major = version.full[0];
+      version.success = true;
+    }
+
+    if (version.major === '4') {
+      // some defaults need to be changed if using Bootstrap 4
+      // check to see if they have already been manually changed before forcing them to update
+      var toUpdate = [];
+
+      if (Selectpicker.DEFAULTS.style === classNames.BUTTONCLASS) toUpdate.push({ name: 'style', className: 'BUTTONCLASS' });
+      if (Selectpicker.DEFAULTS.iconBase === classNames.ICONBASE) toUpdate.push({ name: 'iconBase', className: 'ICONBASE' });
+      if (Selectpicker.DEFAULTS.tickIcon === classNames.TICKICON) toUpdate.push({ name: 'tickIcon', className: 'TICKICON' });
+
+      classNames.DIVIDER = 'dropdown-divider';
+      classNames.SHOW = 'show';
+      classNames.BUTTONCLASS = 'btn-light';
+      classNames.POPOVERHEADER = 'popover-header';
+      classNames.ICONBASE = '';
+      classNames.TICKICON = 'bs-ok-default';
+
+      for (var i = 0; i < toUpdate.length; i++) {
+        var option = toUpdate[i];
+        Selectpicker.DEFAULTS[option.name] = classNames[option.className];
+      }
+    }
+
+    var value;
+    var chain = this.each(function () {
+      var $this = $(this);
+      if ($this.is('select')) {
+        var data = $this.data('selectpicker'),
+            options = typeof _option == 'object' && _option;
+
+        if (!data) {
+          var dataAttributes = $this.data();
+
+          for (var dataAttr in dataAttributes) {
+            if (Object.prototype.hasOwnProperty.call(dataAttributes, dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
+              delete dataAttributes[dataAttr];
+            }
+          }
+
+          var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, dataAttributes, options);
+          config.template = $.extend({}, Selectpicker.DEFAULTS.template, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}), dataAttributes.template, options.template);
+          $this.data('selectpicker', (data = new Selectpicker(this, config)));
+        } else if (options) {
+          for (var i in options) {
+            if (Object.prototype.hasOwnProperty.call(options, i)) {
+              data.options[i] = options[i];
+            }
+          }
+        }
+
+        if (typeof _option == 'string') {
+          if (data[_option] instanceof Function) {
+            value = data[_option].apply(data, args);
+          } else {
+            value = data.options[_option];
+          }
+        }
+      }
+    });
+
+    if (typeof value !== 'undefined') {
+      // noinspection JSUnusedAssignment
+      return value;
+    } else {
+      return chain;
+    }
+  }
+
+  var old = $.fn.selectpicker;
+  $.fn.selectpicker = Plugin;
+  $.fn.selectpicker.Constructor = Selectpicker;
+
+  // SELECTPICKER NO CONFLICT
+  // ========================
+  $.fn.selectpicker.noConflict = function () {
+    $.fn.selectpicker = old;
+    return this;
+  };
+
+  // get Bootstrap's keydown event handler for either Bootstrap 4 or Bootstrap 3
+  function keydownHandler () {
+    if ($.fn.dropdown) {
+      // wait to define until function is called in case Bootstrap isn't loaded yet
+      var bootstrapKeydown = $.fn.dropdown.Constructor._dataApiKeydownHandler || $.fn.dropdown.Constructor.prototype.keydown;
+      return bootstrapKeydown.apply(this, arguments);
+    }
+  }
+
+  $(document)
+    .off('keydown.bs.dropdown.data-api')
+    .on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > [data-toggle="dropdown"]', keydownHandler)
+    .on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > .dropdown-menu', keydownHandler)
+    .on('keydown' + EVENT_KEY, '.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input', Selectpicker.prototype.keydown)
+    .on('focusin.modal', '.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input', function (e) {
+      e.stopPropagation();
+    });
+
+  // SELECTPICKER DATA-API
+  // =====================
+  $(window).on('load' + EVENT_KEY + '.data-api', function () {
+    $('.selectpicker').each(function () {
+      var $selectpicker = $(this);
+      Plugin.call($selectpicker, $selectpicker.data());
+    })
+  });
+})(jQuery);
+
+
+}));
+//# sourceMappingURL=bootstrap-select.js.map

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/bootstrap-select.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 7 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/bootstrap-select.min.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/bootstrap-select.min.js.map


+ 46 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-am_ET.js

@@ -0,0 +1,46 @@
+/*!
+ * Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select)
+ *
+ * Copyright 2012-2020 SnapAppointments, LLC
+ * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
+ */
+
+(function (root, factory) {
+  if (root === undefined && window !== undefined) root = window;
+  if (typeof define === 'function' && define.amd) {
+    // AMD. Register as an anonymous module unless amdModuleId is set
+    define(["jquery"], function (a0) {
+      return (factory(a0));
+    });
+  } else if (typeof module === 'object' && module.exports) {
+    // Node. Does not work with strict CommonJS, but
+    // only CommonJS-like environments that support module.exports,
+    // like Node.
+    module.exports = factory(require("jquery"));
+  } else {
+    factory(root["jQuery"]);
+  }
+}(this, function (jQuery) {
+
+(function ($) {
+  $.fn.selectpicker.defaults = {
+    noneSelectedText: 'ምንም አልተመረጠም',
+    noneResultsText: 'ከ{0} ጋር ተመሳሳይ ውጤት የለም',
+    countSelectedText: function (numSelected, numTotal) {
+      return (numSelected == 1) ? '{0} ምርጫ ተመርጧል' : '{0} ምርጫዎች ተመርጠዋል';
+    },
+    maxOptionsText: function (numAll, numGroup) {
+      return [
+        (numAll == 1) ? 'ገደብ ላይ ተደርሷል  (ቢበዛ {n} ምርጫ)' : 'ገደብ ላይ ተደርሷል  (ቢበዛ {n} ምርጫዎች)',
+        (numGroup == 1) ? 'የቡድን ገደብ ላይ ተደርሷል (ቢበዛ {n} ምርጫ)' : 'የቡድን ገደብ ላይ ተደርሷል (ቢበዛ {n} ምርጫዎች)'
+      ];
+    },
+    selectAllText: 'ሁሉም ይመረጥ',
+    deselectAllText: 'ሁሉም አይመረጥ',
+    multipleSeparator: ' ፣ '
+  };
+})(jQuery);
+
+
+}));
+//# sourceMappingURL=defaults-am_ET.js.map

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-am_ET.js.map


+ 8 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-am_ET.min.js

@@ -0,0 +1,8 @@
+/*!
+ * Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select)
+ *
+ * Copyright 2012-2020 SnapAppointments, LLC
+ * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
+ */
+
+!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){e.fn.selectpicker.defaults={noneSelectedText:"\u121d\u1295\u121d \u12a0\u120d\u1270\u1218\u1228\u1320\u121d",noneResultsText:"\u12a8{0} \u130b\u122d \u1270\u1218\u1233\u1233\u12ed \u12cd\u1324\u1275 \u12e8\u1208\u121d",countSelectedText:function(e,t){return 1==e?"{0} \u121d\u122d\u132b \u1270\u1218\u122d\u1327\u120d":"{0} \u121d\u122d\u132b\u12ce\u127d \u1270\u1218\u122d\u1320\u12cb\u120d"},maxOptionsText:function(e,t){return[1==e?"\u1308\u12f0\u1265 \u120b\u12ed \u1270\u12f0\u122d\u1237\u120d  (\u1262\u1260\u12db {n} \u121d\u122d\u132b)":"\u1308\u12f0\u1265 \u120b\u12ed \u1270\u12f0\u122d\u1237\u120d  (\u1262\u1260\u12db {n} \u121d\u122d\u132b\u12ce\u127d)",1==t?"\u12e8\u1261\u12f5\u1295 \u1308\u12f0\u1265 \u120b\u12ed \u1270\u12f0\u122d\u1237\u120d (\u1262\u1260\u12db {n} \u121d\u122d\u132b)":"\u12e8\u1261\u12f5\u1295 \u1308\u12f0\u1265 \u120b\u12ed \u1270\u12f0\u122d\u1237\u120d (\u1262\u1260\u12db {n} \u121d\u122d\u132b\u12ce\u127d)"]},selectAllText:"\u1201\u1209\u121d \u12ed\u1218\u1228\u1325",deselectAllText:"\u1201\u1209\u121d \u12a0\u12ed\u1218\u1228\u1325",multipleSeparator:" \u1363 "}});

+ 51 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-ar_AR.js

@@ -0,0 +1,51 @@
+/*!
+ * Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select)
+ *
+ * Copyright 2012-2020 SnapAppointments, LLC
+ * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
+ */
+
+(function (root, factory) {
+  if (root === undefined && window !== undefined) root = window;
+  if (typeof define === 'function' && define.amd) {
+    // AMD. Register as an anonymous module unless amdModuleId is set
+    define(["jquery"], function (a0) {
+      return (factory(a0));
+    });
+  } else if (typeof module === 'object' && module.exports) {
+    // Node. Does not work with strict CommonJS, but
+    // only CommonJS-like environments that support module.exports,
+    // like Node.
+    module.exports = factory(require("jquery"));
+  } else {
+    factory(root["jQuery"]);
+  }
+}(this, function (jQuery) {
+
+/*!
+ * Translated default messages for bootstrap-select.
+ * Locale: AR (Arabic)
+ * Author: Yasser Lotfy <y_l@alive.com>
+ */
+(function ($) {
+  $.fn.selectpicker.defaults = {
+    noneSelectedText: 'لم يتم إختيار شئ',
+    noneResultsText: 'لا توجد نتائج مطابقة لـ {0}',
+    countSelectedText: function (numSelected, numTotal) {
+      return (numSelected == 1) ? '{0} خيار تم إختياره' : '{0} خيارات تمت إختيارها';
+    },
+    maxOptionsText: function (numAll, numGroup) {
+      return [
+        (numAll == 1) ? 'تخطى الحد المسموح ({n} خيار بحد أقصى)' : 'تخطى الحد المسموح ({n} خيارات بحد أقصى)',
+        (numGroup == 1) ? 'تخطى الحد المسموح للمجموعة ({n} خيار بحد أقصى)' : 'تخطى الحد المسموح للمجموعة ({n} خيارات بحد أقصى)'
+      ];
+    },
+    selectAllText: 'إختيار الجميع',
+    deselectAllText: 'إلغاء إختيار الجميع',
+    multipleSeparator: '، '
+  };
+})(jQuery);
+
+
+}));
+//# sourceMappingURL=defaults-ar_AR.js.map

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
GreenTree.Maschinenbestellungen.Web/wwwroot/lib/bootstrap-select/js/i18n/defaults-ar_AR.js.map


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio