Основа для ASP-сайта для просмотра сущностей

This commit is contained in:
2025-10-02 13:04:30 +04:00
parent 781546b84c
commit d23d81fb53
107 changed files with 83814 additions and 97 deletions
@@ -20,6 +20,7 @@ Derived
↳ [ArchetypeProcessor](ArchetypeProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ArchetypeProcessor')
↳ [BackgroundProcessor](BackgroundProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.BackgroundProcessor')
↳ [ClassProcessor](ClassProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ClassProcessor')
↳ [DeityCategoryProcessor](DeityCategoryProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor')
↳ [DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor')
↳ [DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor')
↳ [FeatProcessor](FeatProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.FeatProcessor')
@@ -0,0 +1,10 @@
#### [Pf2eDataScrapper](index.md 'index')
### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityCategoryProcessor](DeityCategoryProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor')
## DeityCategoryProcessor\.Add\(\) Method
Добавление основной сущности в контекст базы данных\.
```csharp
protected override void Add();
```
@@ -0,0 +1,13 @@
#### [Pf2eDataScrapper](index.md 'index')
### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityCategoryProcessor](DeityCategoryProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor')
## DeityCategoryProcessor\.Object Property
Основная сущность\.
```csharp
public virtual Pf2eModel.Model.Structure.DeityCategory Object { get; }
```
#### Property Value
[Pf2eModel\.Model\.Structure\.DeityCategory](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Structure.DeityCategory 'Pf2eModel\.Model\.Structure\.DeityCategory')
@@ -0,0 +1,12 @@
#### [Pf2eDataScrapper](index.md 'index')
### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityCategoryProcessor](DeityCategoryProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor')
## DeityCategoryProcessor\.Process\(\) Method
Основной метод обработки данных\.
```csharp
public override void Process();
```
Implements [Process\(\)](IProcessor.Process().md 'Pf2eDataScrapper\.Processors\.Definitions\.IProcessor\.Process\(\)')
@@ -0,0 +1,10 @@
#### [Pf2eDataScrapper](index.md 'index')
### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityCategoryProcessor](DeityCategoryProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor')
## DeityCategoryProcessor\.ProcessDescription\(\) Method
Обработка описания категории\.
```csharp
private void ProcessDescription();
```
@@ -0,0 +1,13 @@
#### [Pf2eDataScrapper](index.md 'index')
### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityCategoryProcessor](DeityCategoryProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor')
## DeityCategoryProcessor\.Type Property
Тип сущности\.
```csharp
public override Pf2eModel.Model.Enum.EntityType Type { get; }
```
#### Property Value
[Pf2eModel\.Model\.Enum\.EntityType](https://docs.microsoft.com/en-us/dotnet/api/Pf2eModel.Model.Enum.EntityType 'Pf2eModel\.Model\.Enum\.EntityType')
@@ -0,0 +1,21 @@
#### [Pf2eDataScrapper](index.md 'index')
### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types')
## DeityCategoryProcessor Class
```csharp
internal class DeityCategoryProcessor : Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.AbstractEntityProcessor
```
Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System\.Object') 🡒 [AbstractInputProcessor](AbstractInputProcessor.md 'Pf2eDataScrapper\.Processors\.Definitions\.AbstractInputProcessor') 🡒 [AbstractEntityProcessor](AbstractEntityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.AbstractEntityProcessor') 🡒 DeityCategoryProcessor
| Properties | |
| :--- | :--- |
| [Object](DeityCategoryProcessor.Object.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor\.Object') | Основная сущность\. |
| [Type](DeityCategoryProcessor.Type.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor\.Type') | Тип сущности\. |
| Methods | |
| :--- | :--- |
| [Add\(\)](DeityCategoryProcessor.Add().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor\.Add\(\)') | Добавление основной сущности в контекст базы данных\. |
| [Process\(\)](DeityCategoryProcessor.Process().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor\.Process\(\)') | Основной метод обработки данных\. |
| [ProcessDescription\(\)](DeityCategoryProcessor.ProcessDescription().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor\.ProcessDescription\(\)') | Обработка описания категории\. |
@@ -0,0 +1,17 @@
#### [Pf2eDataScrapper](index.md 'index')
### [Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types](Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types').[DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor')
## DeityProcessor\.ProcessCategory\(string\) Method
Обработка категории божества\.
```csharp
private void ProcessCategory(string categoryName);
```
#### Parameters
<a name='Pf2eDataScrapper.Importers.Implementations.Aonprd.Processors.Types.DeityProcessor.ProcessCategory(string).categoryName'></a>
`categoryName` [System\.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System\.String')
Название категории\.
@@ -21,6 +21,7 @@ Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.
| [MarkdownLinkRegex\(\)](DeityProcessor.MarkdownLinkRegex().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.MarkdownLinkRegex\(\)') | |
| [Process\(\)](DeityProcessor.Process().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.Process\(\)') | Основной метод обработки данных\. |
| [ProcessAttributes\(\)](DeityProcessor.ProcessAttributes().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessAttributes\(\)') | Обработка атрибутов божества\. |
| [ProcessCategory\(string\)](DeityProcessor.ProcessCategory(string).md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessCategory\(string\)') | Обработка категории божества\. |
| [ProcessDomainMarkdown\(string, bool\)](DeityProcessor.ProcessDomainMarkdown(string,bool).md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessDomainMarkdown\(string, bool\)') | Обработка markdown\-строки с доменами\. |
| [ProcessDomains\(\)](DeityProcessor.ProcessDomains().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessDomains\(\)') | Обработка доменов божества\. |
| [ProcessFonts\(\)](DeityProcessor.ProcessFonts().md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor\.ProcessFonts\(\)') | Обработка божественной силы\. |
@@ -11,6 +11,7 @@
| [ArchetypeProcessor](ArchetypeProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ArchetypeProcessor') | |
| [BackgroundProcessor](BackgroundProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.BackgroundProcessor') | |
| [ClassProcessor](ClassProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.ClassProcessor') | |
| [DeityCategoryProcessor](DeityCategoryProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityCategoryProcessor') | |
| [DeityProcessor](DeityProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DeityProcessor') | |
| [DomainProcessor](DomainProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.DomainProcessor') | |
| [FeatProcessor](FeatProcessor.md 'Pf2eDataScrapper\.Importers\.Implementations\.Aonprd\.Processors\.Types\.FeatProcessor') | |
@@ -0,0 +1,13 @@
#### [Pf2eModel](index.md 'index')
### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity')
## Deity\.CategoryEntity Property
Категория божества \(связь\)\.
```csharp
public Pf2eModel.Model.Structure.DeityCategory? CategoryEntity { get; set; }
```
#### Property Value
[DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Structure\.DeityCategory')
@@ -0,0 +1,13 @@
#### [Pf2eModel](index.md 'index')
### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity')
## Deity\.CategoryId Property
Идентификатор категории божества\.
```csharp
public System.Nullable<int> CategoryId { get; set; }
```
#### Property Value
[System\.Nullable&lt;](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1')[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32')[&gt;](https://docs.microsoft.com/en-us/dotnet/api/System.Nullable-1 'System\.Nullable\`1')
+2
View File
@@ -18,6 +18,8 @@ Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity')
| [Anathema](Deity.Anathema.md 'Pf2eModel\.Model\.Structure\.Deity\.Anathema') | Анафемы божества\. |
| [AreaOfConcern](Deity.AreaOfConcern.md 'Pf2eModel\.Model\.Structure\.Deity\.AreaOfConcern') | Область покровительства божества\. |
| [Category](Deity.Category.md 'Pf2eModel\.Model\.Structure\.Deity\.Category') | Категория божества\. |
| [CategoryEntity](Deity.CategoryEntity.md 'Pf2eModel\.Model\.Structure\.Deity\.CategoryEntity') | Категория божества \(связь\)\. |
| [CategoryId](Deity.CategoryId.md 'Pf2eModel\.Model\.Structure\.Deity\.CategoryId') | Идентификатор категории божества\. |
| [DeityAttributes](Deity.DeityAttributes.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityAttributes') | Атрибуты божества\. |
| [DeityDomains](Deity.DeityDomains.md 'Pf2eModel\.Model\.Structure\.Deity\.DeityDomains') | Домены божества\. |
| [DeitySpells](Deity.DeitySpells.md 'Pf2eModel\.Model\.Structure\.Deity\.DeitySpells') | Заклинания божества\. |
@@ -0,0 +1,13 @@
#### [Pf2eModel](index.md 'index')
### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Structure\.DeityCategory')
## DeityCategory\.Description Property
Описание категории\.
```csharp
public Pf2eModel.Model.Common.I18n.LocaleString Description { get; set; }
```
#### Property Value
[LocaleString](LocaleString.md 'Pf2eModel\.Model\.Common\.I18n\.LocaleString')
@@ -0,0 +1,15 @@
#### [Pf2eModel](index.md 'index')
### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Structure\.DeityCategory')
## DeityCategory\.Entity Property
Корневая сущность\.
```csharp
public Pf2eModel.Model.Base.Entity Entity { get; set; }
```
Implements [Entity](IEntity.Entity.md 'Pf2eModel\.Model\.IEntity\.Entity')
#### Property Value
[Entity](Entity.md 'Pf2eModel\.Model\.Base\.Entity')
@@ -0,0 +1,15 @@
#### [Pf2eModel](index.md 'index')
### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure').[DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Structure\.DeityCategory')
## DeityCategory\.Id Property
Идентификатор сущности\.
```csharp
public int Id { get; set; }
```
Implements [Id](IEntity.Id.md 'Pf2eModel\.Model\.IEntity\.Id')
#### Property Value
[System\.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System\.Int32')
+20
View File
@@ -0,0 +1,20 @@
#### [Pf2eModel](index.md 'index')
### [Pf2eModel\.Model\.Structure](Pf2eModel.Model.Structure.md 'Pf2eModel\.Model\.Structure')
## DeityCategory Class
Категория божества\.
```csharp
public class DeityCategory : Pf2eModel.Model.IEntity
```
Inheritance [System\.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System\.Object') &#129106; DeityCategory
Implements [IEntity](IEntity.md 'Pf2eModel\.Model\.IEntity')
| Properties | |
| :--- | :--- |
| [Description](DeityCategory.Description.md 'Pf2eModel\.Model\.Structure\.DeityCategory\.Description') | Описание категории\. |
| [Entity](DeityCategory.Entity.md 'Pf2eModel\.Model\.Structure\.DeityCategory\.Entity') | Корневая сущность\. |
| [Id](DeityCategory.Id.md 'Pf2eModel\.Model\.Structure\.DeityCategory\.Id') | Идентификатор сущности\. |
+6
View File
@@ -129,3 +129,9 @@ public enum EntityType
`Rule` 19
Правило\.
<a name='Pf2eModel.Model.Enum.EntityType.DeityCategory'></a>
`DeityCategory` 20
Категория божества\.
+1
View File
@@ -17,6 +17,7 @@ Derived
&#8627; [Class](Class.md 'Pf2eModel\.Model\.Structure\.Class')
&#8627; [Condition](Condition.md 'Pf2eModel\.Model\.Structure\.Condition')
&#8627; [Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity')
&#8627; [DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Structure\.DeityCategory')
&#8627; [Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain')
&#8627; [Feat](Feat.md 'Pf2eModel\.Model\.Structure\.Feat')
&#8627; [Heritage](Heritage.md 'Pf2eModel\.Model\.Structure\.Heritage')
@@ -14,6 +14,7 @@
| [Class](Class.md 'Pf2eModel\.Model\.Structure\.Class') | Класс\. |
| [Condition](Condition.md 'Pf2eModel\.Model\.Structure\.Condition') | Состояние\. |
| [Deity](Deity.md 'Pf2eModel\.Model\.Structure\.Deity') | Божество\. |
| [DeityCategory](DeityCategory.md 'Pf2eModel\.Model\.Structure\.DeityCategory') | Категория божества\. |
| [Domain](Domain.md 'Pf2eModel\.Model\.Structure\.Domain') | Домен\. |
| [Feat](Feat.md 'Pf2eModel\.Model\.Structure\.Feat') | Способность\. |
| [Heritage](Heritage.md 'Pf2eModel\.Model\.Structure\.Heritage') | Наследие\. |
+6
View File
@@ -19,6 +19,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "output", "output", "{36D591
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pf2eModel", "Pf2eModel\Pf2eModel.csproj", "{D32B7787-D912-4B21-B341-7C1F42F62D36}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pf2eWeb", "Pf2eWeb\Pf2eWeb.csproj", "{B2EDB12D-ED1E-4590-8CDC-BABB2926524F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +35,10 @@ Global
{D32B7787-D912-4B21-B341-7C1F42F62D36}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D32B7787-D912-4B21-B341-7C1F42F62D36}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D32B7787-D912-4B21-B341-7C1F42F62D36}.Release|Any CPU.Build.0 = Release|Any CPU
{B2EDB12D-ED1E-4590-8CDC-BABB2926524F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2EDB12D-ED1E-4590-8CDC-BABB2926524F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2EDB12D-ED1E-4590-8CDC-BABB2926524F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2EDB12D-ED1E-4590-8CDC-BABB2926524F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Migrations
{
[DbContext(typeof(Pf2eDbContext))]
[Migration("20250929053912_1")]
[Migration("20251002070001_1")]
partial class _1
{
/// <inheritdoc />
@@ -34,7 +34,7 @@ namespace Pf2eModel.Migrations
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_type", new[] { "covenant", "deity", "pantheon", "philosophy" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "deity_category", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "ancestry", "ancestry-feature", "archetype", "bonus", "calling", "campaign-feature", "class", "class-feature", "curse", "deityboon", "general", "pfsboon", "skill", "uncategorized" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "hobby", "other", "russian" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" });
@@ -1149,6 +1149,16 @@ namespace Pf2eModel.Migrations
.HasColumnOrder(3)
.HasComment("Категория божества");
b.Property<int?>("CategoryEntityId")
.HasColumnType("integer")
.HasColumnName("category_entity_id");
b.Property<int?>("CategoryId")
.HasColumnType("integer")
.HasColumnName("category_id")
.HasColumnOrder(12)
.HasComment("Идентификатор категории божества");
b.Property<string>("Edicts")
.IsRequired()
.HasColumnType("jsonb")
@@ -1197,9 +1207,33 @@ namespace Pf2eModel.Migrations
b.HasKey("Id")
.HasName("pk_deities");
b.HasIndex("CategoryEntityId")
.HasDatabaseName("ix_deities_category_entity_id");
b.ToTable("deities", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Structure.DeityCategory", b =>
{
b.Property<int>("Id")
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(1)
.HasComment("Идентификатор");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("description")
.HasColumnOrder(2)
.HasComment("Описание категории");
b.HasKey("Id")
.HasName("pk_deity_categories");
b.ToTable("deity_categories", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityAttribute", b =>
{
b.Property<int>("Id")
@@ -2488,6 +2522,11 @@ namespace Pf2eModel.Migrations
modelBuilder.Entity("Pf2eModel.Model.Structure.Deity", b =>
{
b.HasOne("Pf2eModel.Model.Structure.DeityCategory", "CategoryEntity")
.WithMany()
.HasForeignKey("CategoryEntityId")
.HasConstraintName("fk_deities_deity_categories_category_entity_id");
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
.WithOne()
.HasForeignKey("Pf2eModel.Model.Structure.Deity", "Id")
@@ -2495,6 +2534,20 @@ namespace Pf2eModel.Migrations
.IsRequired()
.HasConstraintName("fk_deities_entities_id");
b.Navigation("CategoryEntity");
b.Navigation("Entity");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.DeityCategory", b =>
{
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
.WithOne()
.HasForeignKey("Pf2eModel.Model.Structure.DeityCategory", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_deity_categories_entities_id");
b.Navigation("Entity");
});
@@ -24,7 +24,7 @@ namespace Pf2eModel.Migrations
.Annotation("Npgsql:Enum:deity_type", "covenant,deity,pantheon,philosophy")
.Annotation("Npgsql:Enum:element_enum", "air,earth,fire,metal,universal,water,wood")
.Annotation("Npgsql:Enum:entity_rarity", "common,rare,uncommon,unique")
.Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,domain,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown")
.Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,deity_category,domain,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown")
.Annotation("Npgsql:Enum:feat_category", "ancestry,ancestry-feature,archetype,bonus,calling,campaign-feature,class,class-feature,curse,deityboon,general,pfsboon,skill,uncategorized")
.Annotation("Npgsql:Enum:locale_type", "english,hobby,other,russian")
.Annotation("Npgsql:Enum:size_enum", "huge,large,medium,small,tiny")
@@ -230,26 +230,17 @@ namespace Pf2eModel.Migrations
});
migrationBuilder.CreateTable(
name: "deities",
name: "deity_categories",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
type = table.Column<DeityType>(type: "deity_type", nullable: false, comment: "Тип божества"),
category = table.Column<string>(type: "text", nullable: false, comment: "Категория божества"),
fonts = table.Column<DeityFonts>(type: "deity_fonts", nullable: false, comment: "Тип божественной силы"),
sanctification = table.Column<DeitySanctification>(type: "deity_sanctification", nullable: false, comment: "Тип освящения"),
sanctification_must = table.Column<bool>(type: "boolean", nullable: false, comment: "Обязательное освящение"),
edicts = table.Column<string>(type: "jsonb", nullable: false, comment: "Заветы божества"),
anathema = table.Column<string>(type: "jsonb", nullable: false, comment: "Анафемы божества"),
religious_symbol = table.Column<string>(type: "jsonb", nullable: false, comment: "Религиозный символ божества"),
sacred_animal = table.Column<string>(type: "jsonb", nullable: false, comment: "Священное животное божества"),
area_of_concern = table.Column<string>(type: "jsonb", nullable: false, comment: "Область покровительства божества")
description = table.Column<string>(type: "jsonb", nullable: false, comment: "Описание категории")
},
constraints: table =>
{
table.PrimaryKey("pk_deities", x => x.id);
table.PrimaryKey("pk_deity_categories", x => x.id);
table.ForeignKey(
name: "fk_deities_entities_id",
name: "fk_deity_categories_entities_id",
column: x => x.id,
principalTable: "entities",
principalColumn: "id",
@@ -781,65 +772,35 @@ namespace Pf2eModel.Migrations
});
migrationBuilder.CreateTable(
name: "deity_attributes",
name: "deities",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
deity_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор божества"),
attribute = table.Column<AttributeValues>(type: "attribute_values", nullable: false, comment: "Атрибут божества")
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
type = table.Column<DeityType>(type: "deity_type", nullable: false, comment: "Тип божества"),
category = table.Column<string>(type: "text", nullable: false, comment: "Категория божества"),
fonts = table.Column<DeityFonts>(type: "deity_fonts", nullable: false, comment: "Тип божественной силы"),
sanctification = table.Column<DeitySanctification>(type: "deity_sanctification", nullable: false, comment: "Тип освящения"),
sanctification_must = table.Column<bool>(type: "boolean", nullable: false, comment: "Обязательное освящение"),
edicts = table.Column<string>(type: "jsonb", nullable: false, comment: "Заветы божества"),
anathema = table.Column<string>(type: "jsonb", nullable: false, comment: "Анафемы божества"),
religious_symbol = table.Column<string>(type: "jsonb", nullable: false, comment: "Религиозный символ божества"),
sacred_animal = table.Column<string>(type: "jsonb", nullable: false, comment: "Священное животное божества"),
area_of_concern = table.Column<string>(type: "jsonb", nullable: false, comment: "Область покровительства божества"),
category_id = table.Column<int>(type: "integer", nullable: true, comment: "Идентификатор категории божества"),
category_entity_id = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_deity_attributes", x => x.id);
table.PrimaryKey("pk_deities", x => x.id);
table.ForeignKey(
name: "fk_deity_attributes_deities_deity_id",
column: x => x.deity_id,
principalTable: "deities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "deity_training",
columns: table => new
{
deity_id = table.Column<int>(type: "integer", nullable: false),
skills_id = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_deity_training", x => new { x.deity_id, x.skills_id });
name: "fk_deities_deity_categories_category_entity_id",
column: x => x.category_entity_id,
principalTable: "deity_categories",
principalColumn: "id");
table.ForeignKey(
name: "fk_deity_training_deities_deity_id",
column: x => x.deity_id,
principalTable: "deities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_deity_training_trainings_skills_id",
column: x => x.skills_id,
principalTable: "trainings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "deity_weapons",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
deity_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор божества"),
weapon = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Название оружия")
},
constraints: table =>
{
table.PrimaryKey("pk_deity_weapons", x => x.id);
table.ForeignKey(
name: "fk_deity_weapons_deities_deity_id",
column: x => x.deity_id,
principalTable: "deities",
name: "fk_deities_entities_id",
column: x => x.id,
principalTable: "entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
@@ -963,33 +924,6 @@ namespace Pf2eModel.Migrations
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "deity_spells",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
deity_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор божества"),
level = table.Column<int>(type: "integer", nullable: false, comment: "Уровень заклинания"),
spell_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор заклинания")
},
constraints: table =>
{
table.PrimaryKey("pk_deity_spells", x => x.id);
table.ForeignKey(
name: "fk_deity_spells_deities_deity_id",
column: x => x.deity_id,
principalTable: "deities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_deity_spells_spells_spell_id",
column: x => x.spell_id,
principalTable: "spells",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "domains",
columns: table => new
@@ -1154,6 +1088,97 @@ namespace Pf2eModel.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "deity_attributes",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
deity_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор божества"),
attribute = table.Column<AttributeValues>(type: "attribute_values", nullable: false, comment: "Атрибут божества")
},
constraints: table =>
{
table.PrimaryKey("pk_deity_attributes", x => x.id);
table.ForeignKey(
name: "fk_deity_attributes_deities_deity_id",
column: x => x.deity_id,
principalTable: "deities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "deity_spells",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
deity_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор божества"),
level = table.Column<int>(type: "integer", nullable: false, comment: "Уровень заклинания"),
spell_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор заклинания")
},
constraints: table =>
{
table.PrimaryKey("pk_deity_spells", x => x.id);
table.ForeignKey(
name: "fk_deity_spells_deities_deity_id",
column: x => x.deity_id,
principalTable: "deities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_deity_spells_spells_spell_id",
column: x => x.spell_id,
principalTable: "spells",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "deity_training",
columns: table => new
{
deity_id = table.Column<int>(type: "integer", nullable: false),
skills_id = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_deity_training", x => new { x.deity_id, x.skills_id });
table.ForeignKey(
name: "fk_deity_training_deities_deity_id",
column: x => x.deity_id,
principalTable: "deities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_deity_training_trainings_skills_id",
column: x => x.skills_id,
principalTable: "trainings",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "deity_weapons",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
deity_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор божества"),
weapon = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Название оружия")
},
constraints: table =>
{
table.PrimaryKey("pk_deity_weapons", x => x.id);
table.ForeignKey(
name: "fk_deity_weapons_deities_deity_id",
column: x => x.deity_id,
principalTable: "deities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "archetype_feats",
columns: table => new
@@ -1328,6 +1353,11 @@ namespace Pf2eModel.Migrations
table: "class_trainings",
column: "training_id");
migrationBuilder.CreateIndex(
name: "ix_deities_category_entity_id",
table: "deities",
column: "category_entity_id");
migrationBuilder.CreateIndex(
name: "ix_deity_attributes_deity_id",
table: "deity_attributes",
@@ -1647,6 +1677,9 @@ namespace Pf2eModel.Migrations
migrationBuilder.DropTable(
name: "spells");
migrationBuilder.DropTable(
name: "deity_categories");
migrationBuilder.DropTable(
name: "subclass_groups");
@@ -31,7 +31,7 @@ namespace Pf2eModel.Migrations
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_type", new[] { "covenant", "deity", "pantheon", "philosophy" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "element_enum", new[] { "air", "earth", "fire", "metal", "universal", "water", "wood" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "rare", "uncommon", "unique" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "deity_category", "domain", "feat", "heritage", "language", "ritual", "rule", "spell", "subclass", "subclass_group", "trait", "unknown" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "ancestry", "ancestry-feature", "archetype", "bonus", "calling", "campaign-feature", "class", "class-feature", "curse", "deityboon", "general", "pfsboon", "skill", "uncategorized" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "hobby", "other", "russian" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "size_enum", new[] { "huge", "large", "medium", "small", "tiny" });
@@ -1146,6 +1146,16 @@ namespace Pf2eModel.Migrations
.HasColumnOrder(3)
.HasComment("Категория божества");
b.Property<int?>("CategoryEntityId")
.HasColumnType("integer")
.HasColumnName("category_entity_id");
b.Property<int?>("CategoryId")
.HasColumnType("integer")
.HasColumnName("category_id")
.HasColumnOrder(12)
.HasComment("Идентификатор категории божества");
b.Property<string>("Edicts")
.IsRequired()
.HasColumnType("jsonb")
@@ -1194,9 +1204,33 @@ namespace Pf2eModel.Migrations
b.HasKey("Id")
.HasName("pk_deities");
b.HasIndex("CategoryEntityId")
.HasDatabaseName("ix_deities_category_entity_id");
b.ToTable("deities", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Structure.DeityCategory", b =>
{
b.Property<int>("Id")
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(1)
.HasComment("Идентификатор");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("description")
.HasColumnOrder(2)
.HasComment("Описание категории");
b.HasKey("Id")
.HasName("pk_deity_categories");
b.ToTable("deity_categories", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Structure.DeityRelation.DeityAttribute", b =>
{
b.Property<int>("Id")
@@ -2485,6 +2519,11 @@ namespace Pf2eModel.Migrations
modelBuilder.Entity("Pf2eModel.Model.Structure.Deity", b =>
{
b.HasOne("Pf2eModel.Model.Structure.DeityCategory", "CategoryEntity")
.WithMany()
.HasForeignKey("CategoryEntityId")
.HasConstraintName("fk_deities_deity_categories_category_entity_id");
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
.WithOne()
.HasForeignKey("Pf2eModel.Model.Structure.Deity", "Id")
@@ -2492,6 +2531,20 @@ namespace Pf2eModel.Migrations
.IsRequired()
.HasConstraintName("fk_deities_entities_id");
b.Navigation("CategoryEntity");
b.Navigation("Entity");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.DeityCategory", b =>
{
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
.WithOne()
.HasForeignKey("Pf2eModel.Model.Structure.DeityCategory", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_deity_categories_entities_id");
b.Navigation("Entity");
});
+45
View File
@@ -0,0 +1,45 @@
@page
@model Pf2eWeb.Pages.EntityModel
@{
ViewData["Title"] = "Entity";
}
<h1>Entity</h1>
<div>
<h4>Class</h4>
<hr />
<dl class="row">
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Class.Entity)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Class.Entity.Description)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Class.Hp)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Class.Hp)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Class.Spellcasting)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Class.Spellcasting)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Class.Tradition)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Class.Tradition)
</dd>
<dt class="col-sm-2">
@Html.DisplayNameFor(model => model.Class.AdditionalTrainedSkills)
</dt>
<dd class="col-sm-10">
@Html.DisplayFor(model => model.Class.AdditionalTrainedSkills)
</dd>
</dl>
</div>
+64
View File
@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using Pf2eModel;
using Pf2eModel.Model;
using Pf2eModel.Model.Base;
using Pf2eModel.Model.Enum;
using Pf2eModel.Model.Structure;
namespace Pf2eWeb.Pages
{
public class EntityModel : PageModel
{
private readonly Pf2eModel.Pf2eDbContext _context;
public EntityModel(Pf2eModel.Pf2eDbContext context)
{
_context = context;
}
public IEntity Entity;
public Dictionary<string, string> Fields = [];
public Dictionary<string, List<Entity>> References = [];
public async Task<IActionResult> OnGetAsync(string type, string slug)
{
Entity entity =
_context
.Entities.Where(e =>
e.Slug == slug && e.Type == EntityTypeModel.Enum<EntityType>(type)
)
.Include(e => e.Sources)
.ThenInclude(s => s.Source)
.Include(e => e.Keywords)
.Include(e => e.Externals)
.ThenInclude(x => x.Target)
.Include(e => e.Traits)
.ThenInclude(t => t.Entity)
.FirstOrDefault() ?? throw new("Entity is null");
/*
if (id == null)
{
return NotFound();
}
var class = await _context.Classes.FirstOrDefaultAsync(m => m.Id == id);
if (class is not null)
{
Class = class;
return Page();
}
*/
return NotFound();
}
}
}
+105
View File
@@ -0,0 +1,105 @@
@page
@using Pf2eModel.Model.Common.I18n
@model EntityTypeModel
@{
ViewData["Title"] = "Entities — " + Model.CurrentType;
}
<h1>@ViewData["Title"]</h1>
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Entity[0].Id)
</th>
<th>
@Html.DisplayNameFor(model => model.Entity[0].Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Entity[0].Type)
</th>
<th>
@Html.DisplayNameFor(model => model.Entity[0].Slug)
</th>
<th>
@Html.DisplayNameFor(model => model.Entity[0].Rarity)
</th>
<th>
@Html.DisplayNameFor(model => model.Entity[0].IsTranslated)
</th>
<th>
@Html.DisplayNameFor(model => model.Entity[0].IsChecked)
</th>
<th>
@Html.DisplayNameFor(model => model.Entity[0].IsLegacy)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Entity)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
<a asp-page="./Details" asp-route-id="@item.Id">
@Html.DisplayFor(modelItem => item.Name[LocaleType.English])
</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.Type)
</td>
<td>
@Html.DisplayFor(modelItem => item.Slug)
</td>
<td>
@Html.DisplayFor(modelItem => item.Rarity)
</td>
<td>
@Html.DisplayFor(modelItem => item.IsTranslated)
</td>
<td>
@Html.DisplayFor(modelItem => item.IsChecked)
</td>
<td>
@Html.DisplayFor(modelItem => item.IsLegacy)
</td>
</tr>
}
</tbody>
</table>
<nav aria-label="Page navigation example">
<ul class="pagination">
<li class="page-item @(Model.CurrentPage == 1 ? "disabled" : "")">
<a class="page-link" asp-page="./EntityType" asp-route-type="@Model.CurrentType" asp-route-pageNum="@(Model.CurrentPage - 1)">Previous</a>
</li>
@foreach (var num in Model.Pagination)
{
@if (num == Model.CurrentPage)
{
<li class="page-item active">
<a class="page-link" asp-page="./EntityType" asp-route-type="@Model.CurrentType" asp-route-pageNum="@(num)">@num</a>
</li>
}
else if (num == -1)
{
<li class="page-item disabled">
<a class="page-link" href="#">...</a>
</li>
}
else
{
<li class="page-item">
<a class="page-link" asp-page="./EntityType" asp-route-type="@Model.CurrentType" asp-route-pageNum="@(num)">@num</a>
</li>
}
}
<li class="page-item @(Model.CurrentPage == Model.LastPage ? "disabled" : "")">
<a class="page-link" asp-page="./EntityType" asp-route-type="@Model.CurrentType" asp-route-pageNum="@(Model.CurrentPage + 1)">Next</a>
</li>
</ul>
</nav>
+106
View File
@@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using NpgsqlTypes;
using Pf2eModel;
using Pf2eModel.Model.Base;
using Pf2eModel.Model.Enum;
namespace Pf2eWeb.Pages
{
public class EntityTypeModel : PageModel
{
private readonly Pf2eDbContext _context;
public EntityTypeModel(Pf2eDbContext context)
{
_context = context;
}
[BindProperty(SupportsGet = true)]
public int? PageNum { get; set; }
public IList<Entity> Entity { get; set; } = default!;
public EntityType CurrentType;
public int LastPage;
public int CurrentPage => PageNum ?? 1;
public const int PerPage = 30;
public void OnGet(string type)
{
CurrentType = Enum<EntityType>(type);
int count = _context.Entities.Count(entity => entity.Type == CurrentType);
LastPage = (int)Math.Ceiling(count / (double)PerPage);
Entity = _context
.Entities.Where(entity => entity.Type == CurrentType)
.Skip((CurrentPage - 1) * PerPage)
.Take(PerPage)
.ToList();
}
/// <summary>
/// Преобразование значения из JSON в перечисление.
/// </summary>
/// <param name="value">Значение, которое нужно преобразовать</param>
/// <returns>Объект типа `T`, если преобразование успешно, иначе выбрасывает исключение</returns>
public static T Enum<T>(string value)
where T : Enum
{
foreach (System.Reflection.FieldInfo field in typeof(T).GetFields())
{
List<string> variants = [field.Name];
if (
Attribute.GetCustomAttribute(field, typeof(PgNameAttribute))
is PgNameAttribute pgAttribute
)
{
variants.Add(pgAttribute.PgName);
}
if (variants.Contains(value))
{
return (T)field.GetValue(null)!;
}
}
throw new Exception($"Can't resolve enum value \"{value}\" for type {typeof(T)}");
}
public List<int> Pagination
{
get
{
List<int> pages = [1];
int start = Math.Max(2, CurrentPage - 1);
int end = Math.Min(LastPage - 1, CurrentPage + 1);
if (start > 2)
pages.Add(-1);
for (int i = start; i <= end; i++)
pages.Add(i);
if (end < LastPage - 1)
pages.Add(-1);
if (LastPage > 1)
pages.Add(LastPage);
return pages;
}
}
}
}
+26
View File
@@ -0,0 +1,26 @@
@page
@model ErrorModel
@{
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 the <strong>Development</strong> environment displays 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>
+26
View File
@@ -0,0 +1,26 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Pf2eWeb.Pages;
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
public class ErrorModel : PageModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
+32
View File
@@ -0,0 +1,32 @@
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
<table>
<thead>
<tr>
<td>Type</td>
<td>Rows</td>
</tr>
</thead>
<tbody>
@foreach (var row in Model.Data)
{
<tr>
<td>
<a asp-page="./EntityType" asp-route-type="@row.Key">
@row.Key
</a>
</td>
<td>@row.Value</td>
</tr>
}
</tbody>
</table>
+28
View File
@@ -0,0 +1,28 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Pf2eModel;
using Pf2eModel.Model.Enum;
namespace Pf2eWeb.Pages;
public class IndexModel : PageModel
{
private readonly ILogger<IndexModel> _logger;
public readonly Pf2eDbContext Context;
public Dictionary<EntityType, int> Data { get; set; } = new();
public IndexModel(ILogger<IndexModel> logger, Pf2eDbContext context)
{
_logger = logger;
Context = context;
}
public void OnGet()
{
Data = Context
.Entities.GroupBy(e => e.Type)
.ToDictionary(entities => entities.Key, entities => entities.Count());
}
}
+8
View File
@@ -0,0 +1,8 @@
@page
@model PrivacyModel
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>
+18
View File
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Pf2eWeb.Pages;
public class PrivacyModel : PageModel
{
private readonly ILogger<PrivacyModel> _logger;
public PrivacyModel(ILogger<PrivacyModel> logger)
{
_logger = logger;
}
public void OnGet()
{
}
}
+52
View File
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - Pf2eWeb</title>
<script type="importmap"></script>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/Pf2eWeb.styles.css" asp-append-version="true" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-page="/Index">Pf2eWeb</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2025 - Pf2eWeb - <a asp-area="" asp-page="/Privacy">Privacy</a>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
+48
View File
@@ -0,0 +1,48 @@
/* Please see documentation at https://learn.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;
}
a {
color: #0077cc;
}
.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;
}
.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;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px;
}
@@ -0,0 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.min.js"></script>
+3
View File
@@ -0,0 +1,3 @@
@using Pf2eWeb
@namespace Pf2eWeb.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+3
View File
@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}
+23
View File
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Content Remove="Pages\Type.cshtml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="dotenv.net" Version="3.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="Npgsql" Version="9.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Pf2eModel\Pf2eModel.csproj" />
</ItemGroup>
</Project>
+35
View File
@@ -0,0 +1,35 @@
using dotenv.net;
using dotenv.net.Utilities;
using Microsoft.EntityFrameworkCore;
using Pf2eModel;
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
DotEnv.Load();
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddDbContext<Pf2eDbContext>(options =>
options.UseNpgsql(EnvReader.GetStringValue("DATABASE_CONNECTION"))
);
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.MapStaticAssets();
app.MapRazorPages().WithStaticAssets();
app.Run();
+23
View File
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5050",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7210;http://localhost:5050",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"DetailedErrors": true,
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
+31
View File
@@ -0,0 +1,31 @@
html {
font-size: 14px;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px;
}
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
color: var(--bs-secondary-color);
text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
text-align: start;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

+4
View File
@@ -0,0 +1,4 @@
// Please see documentation at https://learn.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.
+22
View File
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2011-2021 Twitter, Inc.
Copyright (c) 2011-2021 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,597 @@
/*!
* Bootstrap Reboot v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
:root,
[data-bs-theme=light] {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-primary-text-emphasis: #052c65;
--bs-secondary-text-emphasis: #2b2f32;
--bs-success-text-emphasis: #0a3622;
--bs-info-text-emphasis: #055160;
--bs-warning-text-emphasis: #664d03;
--bs-danger-text-emphasis: #58151c;
--bs-light-text-emphasis: #495057;
--bs-dark-text-emphasis: #495057;
--bs-primary-bg-subtle: #cfe2ff;
--bs-secondary-bg-subtle: #e2e3e5;
--bs-success-bg-subtle: #d1e7dd;
--bs-info-bg-subtle: #cff4fc;
--bs-warning-bg-subtle: #fff3cd;
--bs-danger-bg-subtle: #f8d7da;
--bs-light-bg-subtle: #fcfcfd;
--bs-dark-bg-subtle: #ced4da;
--bs-primary-border-subtle: #9ec5fe;
--bs-secondary-border-subtle: #c4c8cb;
--bs-success-border-subtle: #a3cfbb;
--bs-info-border-subtle: #9eeaf9;
--bs-warning-border-subtle: #ffe69c;
--bs-danger-border-subtle: #f1aeb5;
--bs-light-border-subtle: #e9ecef;
--bs-dark-border-subtle: #adb5bd;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg: #fff;
--bs-body-bg-rgb: 255, 255, 255;
--bs-emphasis-color: #000;
--bs-emphasis-color-rgb: 0, 0, 0;
--bs-secondary-color: rgba(33, 37, 41, 0.75);
--bs-secondary-color-rgb: 33, 37, 41;
--bs-secondary-bg: #e9ecef;
--bs-secondary-bg-rgb: 233, 236, 239;
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
--bs-tertiary-color-rgb: 33, 37, 41;
--bs-tertiary-bg: #f8f9fa;
--bs-tertiary-bg-rgb: 248, 249, 250;
--bs-heading-color: inherit;
--bs-link-color: #0d6efd;
--bs-link-color-rgb: 13, 110, 253;
--bs-link-decoration: underline;
--bs-link-hover-color: #0a58ca;
--bs-link-hover-color-rgb: 10, 88, 202;
--bs-code-color: #d63384;
--bs-highlight-color: #212529;
--bs-highlight-bg: #fff3cd;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-xxl: 2rem;
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
--bs-border-radius-pill: 50rem;
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
--bs-focus-ring-width: 0.25rem;
--bs-focus-ring-opacity: 0.25;
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
--bs-form-valid-color: #198754;
--bs-form-valid-border-color: #198754;
--bs-form-invalid-color: #dc3545;
--bs-form-invalid-border-color: #dc3545;
}
[data-bs-theme=dark] {
color-scheme: dark;
--bs-body-color: #dee2e6;
--bs-body-color-rgb: 222, 226, 230;
--bs-body-bg: #212529;
--bs-body-bg-rgb: 33, 37, 41;
--bs-emphasis-color: #fff;
--bs-emphasis-color-rgb: 255, 255, 255;
--bs-secondary-color: rgba(222, 226, 230, 0.75);
--bs-secondary-color-rgb: 222, 226, 230;
--bs-secondary-bg: #343a40;
--bs-secondary-bg-rgb: 52, 58, 64;
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
--bs-tertiary-color-rgb: 222, 226, 230;
--bs-tertiary-bg: #2b3035;
--bs-tertiary-bg-rgb: 43, 48, 53;
--bs-primary-text-emphasis: #6ea8fe;
--bs-secondary-text-emphasis: #a7acb1;
--bs-success-text-emphasis: #75b798;
--bs-info-text-emphasis: #6edff6;
--bs-warning-text-emphasis: #ffda6a;
--bs-danger-text-emphasis: #ea868f;
--bs-light-text-emphasis: #f8f9fa;
--bs-dark-text-emphasis: #dee2e6;
--bs-primary-bg-subtle: #031633;
--bs-secondary-bg-subtle: #161719;
--bs-success-bg-subtle: #051b11;
--bs-info-bg-subtle: #032830;
--bs-warning-bg-subtle: #332701;
--bs-danger-bg-subtle: #2c0b0e;
--bs-light-bg-subtle: #343a40;
--bs-dark-bg-subtle: #1a1d20;
--bs-primary-border-subtle: #084298;
--bs-secondary-border-subtle: #41464b;
--bs-success-border-subtle: #0f5132;
--bs-info-border-subtle: #087990;
--bs-warning-border-subtle: #997404;
--bs-danger-border-subtle: #842029;
--bs-light-border-subtle: #495057;
--bs-dark-border-subtle: #343a40;
--bs-heading-color: inherit;
--bs-link-color: #6ea8fe;
--bs-link-hover-color: #8bb9fe;
--bs-link-color-rgb: 110, 168, 254;
--bs-link-hover-color-rgb: 139, 185, 254;
--bs-code-color: #e685b5;
--bs-highlight-color: #dee2e6;
--bs-highlight-bg: #664d03;
--bs-border-color: #495057;
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
--bs-form-valid-color: #75b798;
--bs-form-valid-border-color: #75b798;
--bs-form-invalid-color: #ea868f;
--bs-form-invalid-border-color: #ea868f;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
color: var(--bs-heading-color);
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.1875em;
color: var(--bs-highlight-color);
background-color: var(--bs-highlight-bg);
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline;
}
a:hover {
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: var(--bs-font-monospace);
font-size: 1em;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: var(--bs-code-color);
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.1875rem 0.375rem;
font-size: 0.875em;
color: var(--bs-body-bg);
background-color: var(--bs-body-color);
border-radius: 0.25rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: var(--bs-secondary-color);
text-align: left;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none !important;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: left;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: left;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
::file-selector-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,594 @@
/*!
* Bootstrap Reboot v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
:root,
[data-bs-theme=light] {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-primary-text-emphasis: #052c65;
--bs-secondary-text-emphasis: #2b2f32;
--bs-success-text-emphasis: #0a3622;
--bs-info-text-emphasis: #055160;
--bs-warning-text-emphasis: #664d03;
--bs-danger-text-emphasis: #58151c;
--bs-light-text-emphasis: #495057;
--bs-dark-text-emphasis: #495057;
--bs-primary-bg-subtle: #cfe2ff;
--bs-secondary-bg-subtle: #e2e3e5;
--bs-success-bg-subtle: #d1e7dd;
--bs-info-bg-subtle: #cff4fc;
--bs-warning-bg-subtle: #fff3cd;
--bs-danger-bg-subtle: #f8d7da;
--bs-light-bg-subtle: #fcfcfd;
--bs-dark-bg-subtle: #ced4da;
--bs-primary-border-subtle: #9ec5fe;
--bs-secondary-border-subtle: #c4c8cb;
--bs-success-border-subtle: #a3cfbb;
--bs-info-border-subtle: #9eeaf9;
--bs-warning-border-subtle: #ffe69c;
--bs-danger-border-subtle: #f1aeb5;
--bs-light-border-subtle: #e9ecef;
--bs-dark-border-subtle: #adb5bd;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg: #fff;
--bs-body-bg-rgb: 255, 255, 255;
--bs-emphasis-color: #000;
--bs-emphasis-color-rgb: 0, 0, 0;
--bs-secondary-color: rgba(33, 37, 41, 0.75);
--bs-secondary-color-rgb: 33, 37, 41;
--bs-secondary-bg: #e9ecef;
--bs-secondary-bg-rgb: 233, 236, 239;
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
--bs-tertiary-color-rgb: 33, 37, 41;
--bs-tertiary-bg: #f8f9fa;
--bs-tertiary-bg-rgb: 248, 249, 250;
--bs-heading-color: inherit;
--bs-link-color: #0d6efd;
--bs-link-color-rgb: 13, 110, 253;
--bs-link-decoration: underline;
--bs-link-hover-color: #0a58ca;
--bs-link-hover-color-rgb: 10, 88, 202;
--bs-code-color: #d63384;
--bs-highlight-color: #212529;
--bs-highlight-bg: #fff3cd;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-xxl: 2rem;
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
--bs-border-radius-pill: 50rem;
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
--bs-focus-ring-width: 0.25rem;
--bs-focus-ring-opacity: 0.25;
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
--bs-form-valid-color: #198754;
--bs-form-valid-border-color: #198754;
--bs-form-invalid-color: #dc3545;
--bs-form-invalid-border-color: #dc3545;
}
[data-bs-theme=dark] {
color-scheme: dark;
--bs-body-color: #dee2e6;
--bs-body-color-rgb: 222, 226, 230;
--bs-body-bg: #212529;
--bs-body-bg-rgb: 33, 37, 41;
--bs-emphasis-color: #fff;
--bs-emphasis-color-rgb: 255, 255, 255;
--bs-secondary-color: rgba(222, 226, 230, 0.75);
--bs-secondary-color-rgb: 222, 226, 230;
--bs-secondary-bg: #343a40;
--bs-secondary-bg-rgb: 52, 58, 64;
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
--bs-tertiary-color-rgb: 222, 226, 230;
--bs-tertiary-bg: #2b3035;
--bs-tertiary-bg-rgb: 43, 48, 53;
--bs-primary-text-emphasis: #6ea8fe;
--bs-secondary-text-emphasis: #a7acb1;
--bs-success-text-emphasis: #75b798;
--bs-info-text-emphasis: #6edff6;
--bs-warning-text-emphasis: #ffda6a;
--bs-danger-text-emphasis: #ea868f;
--bs-light-text-emphasis: #f8f9fa;
--bs-dark-text-emphasis: #dee2e6;
--bs-primary-bg-subtle: #031633;
--bs-secondary-bg-subtle: #161719;
--bs-success-bg-subtle: #051b11;
--bs-info-bg-subtle: #032830;
--bs-warning-bg-subtle: #332701;
--bs-danger-bg-subtle: #2c0b0e;
--bs-light-bg-subtle: #343a40;
--bs-dark-bg-subtle: #1a1d20;
--bs-primary-border-subtle: #084298;
--bs-secondary-border-subtle: #41464b;
--bs-success-border-subtle: #0f5132;
--bs-info-border-subtle: #087990;
--bs-warning-border-subtle: #997404;
--bs-danger-border-subtle: #842029;
--bs-light-border-subtle: #495057;
--bs-dark-border-subtle: #343a40;
--bs-heading-color: inherit;
--bs-link-color: #6ea8fe;
--bs-link-hover-color: #8bb9fe;
--bs-link-color-rgb: 110, 168, 254;
--bs-link-hover-color-rgb: 139, 185, 254;
--bs-code-color: #e685b5;
--bs-highlight-color: #dee2e6;
--bs-highlight-bg: #664d03;
--bs-border-color: #495057;
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
--bs-form-valid-color: #75b798;
--bs-form-valid-border-color: #75b798;
--bs-form-invalid-color: #ea868f;
--bs-form-invalid-border-color: #ea868f;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
color: var(--bs-heading-color);
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-right: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-right: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.1875em;
color: var(--bs-highlight-color);
background-color: var(--bs-highlight-bg);
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline;
}
a:hover {
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: var(--bs-font-monospace);
font-size: 1em;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: var(--bs-code-color);
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.1875rem 0.375rem;
font-size: 0.875em;
color: var(--bs-body-bg);
background-color: var(--bs-body-color);
border-radius: 0.25rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: var(--bs-secondary-color);
text-align: right;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none !important;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: right;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: right;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
::file-selector-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,23 @@
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,435 @@
/**
* @license
* Unobtrusive validation support library for jQuery and jQuery Validate
* Copyright (c) .NET Foundation. All rights reserved.
* Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
* @version v4.0.0
*/
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
/*global document: false, jQuery: false */
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports
module.exports = factory(require('jquery-validation'));
} else {
// Browser global
jQuery.validator.unobtrusive = factory(jQuery);
}
}(function ($) {
var $jQval = $.validator,
adapters,
data_validation = "unobtrusiveValidation";
function setValidationValues(options, ruleName, value) {
options.rules[ruleName] = value;
if (options.message) {
options.messages[ruleName] = options.message;
}
}
function splitAndTrim(value) {
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
}
function escapeAttributeValue(value) {
// As mentioned on http://api.jquery.com/category/selectors/
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
}
function getModelPrefix(fieldName) {
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
}
function appendModelPrefix(value, prefix) {
if (value.indexOf("*.") === 0) {
value = value.replace("*.", prefix);
}
return value;
}
function onError(error, inputElement) { // 'this' is the form element
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;
container.removeClass("field-validation-valid").addClass("field-validation-error");
error.data("unobtrusiveContainer", container);
if (replace) {
container.empty();
error.removeClass("input-validation-error").appendTo(container);
}
else {
error.hide();
}
}
function onErrors(event, validator) { // 'this' is the form element
var container = $(this).find("[data-valmsg-summary=true]"),
list = container.find("ul");
if (list && list.length && validator.errorList.length) {
list.empty();
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
$.each(validator.errorList, function () {
$("<li />").html(this.message).appendTo(list);
});
}
}
function onSuccess(error) { // 'this' is the form element
var container = error.data("unobtrusiveContainer");
if (container) {
var replaceAttrValue = container.attr("data-valmsg-replace"),
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
container.addClass("field-validation-valid").removeClass("field-validation-error");
error.removeData("unobtrusiveContainer");
if (replace) {
container.empty();
}
}
}
function onReset(event) { // 'this' is the form element
var $form = $(this),
key = '__jquery_unobtrusive_validation_form_reset';
if ($form.data(key)) {
return;
}
// Set a flag that indicates we're currently resetting the form.
$form.data(key, true);
try {
$form.data("validator").resetForm();
} finally {
$form.removeData(key);
}
$form.find(".validation-summary-errors")
.addClass("validation-summary-valid")
.removeClass("validation-summary-errors");
$form.find(".field-validation-error")
.addClass("field-validation-valid")
.removeClass("field-validation-error")
.removeData("unobtrusiveContainer")
.find(">*") // If we were using valmsg-replace, get the underlying error
.removeData("unobtrusiveContainer");
}
function validationInfo(form) {
var $form = $(form),
result = $form.data(data_validation),
onResetProxy = $.proxy(onReset, form),
defaultOptions = $jQval.unobtrusive.options || {},
execInContext = function (name, args) {
var func = defaultOptions[name];
func && $.isFunction(func) && func.apply(form, args);
};
if (!result) {
result = {
options: { // options structure passed to jQuery Validate's validate() method
errorClass: defaultOptions.errorClass || "input-validation-error",
errorElement: defaultOptions.errorElement || "span",
errorPlacement: function () {
onError.apply(form, arguments);
execInContext("errorPlacement", arguments);
},
invalidHandler: function () {
onErrors.apply(form, arguments);
execInContext("invalidHandler", arguments);
},
messages: {},
rules: {},
success: function () {
onSuccess.apply(form, arguments);
execInContext("success", arguments);
}
},
attachValidation: function () {
$form
.off("reset." + data_validation, onResetProxy)
.on("reset." + data_validation, onResetProxy)
.validate(this.options);
},
validate: function () { // a validation function that is called by unobtrusive Ajax
$form.validate();
return $form.valid();
}
};
$form.data(data_validation, result);
}
return result;
}
$jQval.unobtrusive = {
adapters: [],
parseElement: function (element, skipAttach) {
/// <summary>
/// Parses a single HTML element for unobtrusive validation attributes.
/// </summary>
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
/// validation to the form. If parsing just this single element, you should specify true.
/// If parsing several elements, you should specify false, and manually attach the validation
/// to the form when you are finished. The default is false.</param>
var $element = $(element),
form = $element.parents("form")[0],
valInfo, rules, messages;
if (!form) { // Cannot do client-side validation without a form
return;
}
valInfo = validationInfo(form);
valInfo.options.rules[element.name] = rules = {};
valInfo.options.messages[element.name] = messages = {};
$.each(this.adapters, function () {
var prefix = "data-val-" + this.name,
message = $element.attr(prefix),
paramValues = {};
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
prefix += "-";
$.each(this.params, function () {
paramValues[this] = $element.attr(prefix + this);
});
this.adapt({
element: element,
form: form,
message: message,
params: paramValues,
rules: rules,
messages: messages
});
}
});
$.extend(rules, { "__dummy__": true });
if (!skipAttach) {
valInfo.attachValidation();
}
},
parse: function (selector) {
/// <summary>
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated
/// with the [data-val=true] attribute value and enables validation according to the data-val-*
/// attribute values.
/// </summary>
/// <param name="selector" type="String">Any valid jQuery selector.</param>
// $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
// element with data-val=true
var $selector = $(selector),
$forms = $selector.parents()
.addBack()
.filter("form")
.add($selector.find("form"))
.has("[data-val=true]");
$selector.find("[data-val=true]").each(function () {
$jQval.unobtrusive.parseElement(this, true);
});
$forms.each(function () {
var info = validationInfo(this);
if (info) {
info.attachValidation();
}
});
}
};
adapters = $jQval.unobtrusive.adapters;
adapters.add = function (adapterName, params, fn) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
/// mmmm is the parameter name).</param>
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
/// attributes into jQuery Validate rules and/or messages.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
if (!fn) { // Called with no params, just a function
fn = params;
params = [];
}
this.push({ name: adapterName, params: params, adapt: fn });
return this;
};
adapters.addBool = function (adapterName, ruleName) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation rule has no parameter values.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
/// of adapterName will be used instead.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, function (options) {
setValidationValues(options, ruleName || adapterName, true);
});
};
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
/// have a minimum value.</param>
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
/// have a maximum value.</param>
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
/// have both a minimum and maximum value.</param>
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
/// contains the minimum value. The default is "min".</param>
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
/// contains the maximum value. The default is "max".</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
var min = options.params.min,
max = options.params.max;
if (min && max) {
setValidationValues(options, minMaxRuleName, [min, max]);
}
else if (min) {
setValidationValues(options, minRuleName, min);
}
else if (max) {
setValidationValues(options, maxRuleName, max);
}
});
};
adapters.addSingleVal = function (adapterName, attribute, ruleName) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
/// the jQuery Validate validation rule has a single value.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
/// The default is "val".</param>
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
/// of adapterName will be used instead.</param>
/// <returns type="jQuery.validator.unobtrusive.adapters" />
return this.add(adapterName, [attribute || "val"], function (options) {
setValidationValues(options, ruleName || adapterName, options.params[attribute]);
});
};
$jQval.addMethod("__dummy__", function (value, element, params) {
return true;
});
$jQval.addMethod("regex", function (value, element, params) {
var match;
if (this.optional(element)) {
return true;
}
match = new RegExp(params).exec(value);
return (match && (match.index === 0) && (match[0].length === value.length));
});
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
var match;
if (nonalphamin) {
match = value.match(/\W/g);
match = match && match.length >= nonalphamin;
}
return match;
});
if ($jQval.methods.extension) {
adapters.addSingleVal("accept", "mimtype");
adapters.addSingleVal("extension", "extension");
} else {
// for backward compatibility, when the 'extension' validation method does not exist, such as with versions
// of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
// validating the extension, and ignore mime-type validations as they are not supported.
adapters.addSingleVal("extension", "extension", "accept");
}
adapters.addSingleVal("regex", "pattern");
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
adapters.add("equalto", ["other"], function (options) {
var prefix = getModelPrefix(options.element.name),
other = options.params.other,
fullOtherName = appendModelPrefix(other, prefix),
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
setValidationValues(options, "equalTo", element);
});
adapters.add("required", function (options) {
// jQuery Validate equates "required" with "mandatory" for checkbox elements
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
setValidationValues(options, "required", true);
}
});
adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
var value = {
url: options.params.url,
type: options.params.type || "GET",
data: {}
},
prefix = getModelPrefix(options.element.name);
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
var paramName = appendModelPrefix(fieldName, prefix);
value.data[paramName] = function () {
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']");
// For checkboxes and radio buttons, only pick up values from checked fields.
if (field.is(":checkbox")) {
return field.filter(":checked").val() || field.filter(":hidden").val() || '';
}
else if (field.is(":radio")) {
return field.filter(":checked").val() || '';
}
return field.val();
};
});
setValidationValues(options, "remote", value);
});
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
if (options.params.min) {
setValidationValues(options, "minlength", options.params.min);
}
if (options.params.nonalphamin) {
setValidationValues(options, "nonalphamin", options.params.nonalphamin);
}
if (options.params.regex) {
setValidationValues(options, "regex", options.params.regex);
}
});
adapters.add("fileextensions", ["extensions"], function (options) {
setValidationValues(options, "extension", options.params.extensions);
});
$(function () {
$jQval.unobtrusive.parse(document);
});
return $jQval.unobtrusive;
}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,22 @@
The MIT License (MIT)
=====================
Copyright Jörn Zaefferer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More