diff --git a/OutOfSchool/OutOfSchool.DataAccess/Models/User.cs b/OutOfSchool/OutOfSchool.DataAccess/Models/User.cs index 6b6707ab5b..00e7a04513 100644 --- a/OutOfSchool/OutOfSchool.DataAccess/Models/User.cs +++ b/OutOfSchool/OutOfSchool.DataAccess/Models/User.cs @@ -11,5 +11,11 @@ public class User : IdentityUser [DataType(DataType.DateTime)] public DateTime LastLogin { get; set; } + + public string LastName { get; set; } + + public string MiddleName { get; set; } + + public string FirstName { get; set; } } } \ No newline at end of file diff --git a/OutOfSchool/OutOfSchool.IdentityServer.Tests/Controllers/AuthControllerTests.cs b/OutOfSchool/OutOfSchool.IdentityServer.Tests/Controllers/AuthControllerTests.cs index 43b09f51d3..91e238af88 100644 --- a/OutOfSchool/OutOfSchool.IdentityServer.Tests/Controllers/AuthControllerTests.cs +++ b/OutOfSchool/OutOfSchool.IdentityServer.Tests/Controllers/AuthControllerTests.cs @@ -223,13 +223,13 @@ public async Task ExternalLogin_ReturnsNotImplementedEx() { new TestCaseData(new RegisterViewModel() { - Username = "Baron", + Email = "test123@gmail.com", PhoneNumber = "0502391222", ReturnUrl = "Return url", }), new TestCaseData(new RegisterViewModel() { - Username = "Baron", + Email = "test123@gmail.com", PhoneNumber = "0502391222", ReturnUrl = "Return url2", }), diff --git a/OutOfSchool/OutOfSchool.IdentityServer/Controllers/AuthController.cs b/OutOfSchool/OutOfSchool.IdentityServer/Controllers/AuthController.cs index 25249dd57b..5df72f744e 100644 --- a/OutOfSchool/OutOfSchool.IdentityServer/Controllers/AuthController.cs +++ b/OutOfSchool/OutOfSchool.IdentityServer/Controllers/AuthController.cs @@ -138,12 +138,16 @@ public async Task Register(RegisterViewModel model) var user = new User() { - UserName = model.Username, - PhoneNumber = model.PhoneNumber, - CreatingTime = DateTime.Now, + UserName = model.Email, + FirstName = model.FirstName, + LastName = model.LastName, + MiddleName = model.MiddleName, + Email = model.Email, + PhoneNumber = model.PhoneNumber, + CreatingTime = DateTime.Now, }; - var result = await userManager.CreateAsync(user, model.Password); + var result = await userManager.CreateAsync(user, model.Password); if (result.Succeeded) { IdentityResult roleAssignResult = IdentityResult.Failed(); @@ -178,7 +182,12 @@ public async Task Register(RegisterViewModel model) else { foreach (var error in result.Errors) - { + { + if (error.Code == "DuplicateUserName") + { + error.Description = $"Email {error.Description.Substring(10).Split('\'')[0]} is alredy taken"; + } + ModelState.AddModelError(string.Empty, error.Description); } } diff --git a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20210413215419_updatedUser.Designer.cs b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20210413215419_updatedUser.Designer.cs new file mode 100644 index 0000000000..99d333fed0 --- /dev/null +++ b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20210413215419_updatedUser.Designer.cs @@ -0,0 +1,851 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using OutOfSchool.Services; + +namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations +{ + [DbContext(typeof(OutOfSchoolDbContext))] + [Migration("20210413215419_updatedUser")] + partial class updatedUser + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.2"); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Address", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("BuildingNumber") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(15) + .HasColumnType("nvarchar(15)"); + + b.Property("District") + .HasColumnType("nvarchar(max)"); + + b.Property("Latitude") + .HasColumnType("float"); + + b.Property("Longitude") + .HasColumnType("float"); + + b.Property("Region") + .HasColumnType("nvarchar(max)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.HasKey("Id"); + + b.ToTable("Addresses"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.BirthCertificate", b => + { + b.Property("Id") + .HasColumnType("bigint"); + + b.Property("SvidDate") + .HasColumnType("datetime2"); + + b.Property("SvidNum") + .HasColumnType("nvarchar(max)"); + + b.Property("SvidNumMD5") + .HasColumnType("nvarchar(max)"); + + b.Property("SvidSer") + .HasColumnType("nvarchar(max)"); + + b.Property("SvidWho") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("BirthCertificates"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Categories"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Child", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("DateOfBirth") + .HasColumnType("datetime2"); + + b.Property("FirstName") + .HasMaxLength(40) + .HasColumnType("nvarchar(40)"); + + b.Property("Gender") + .HasColumnType("int"); + + b.Property("LastName") + .HasMaxLength(40) + .HasColumnType("nvarchar(40)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("Patronymic") + .HasMaxLength(40) + .HasColumnType("nvarchar(40)"); + + b.Property("SocialGroupId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("ParentId"); + + b.HasIndex("SocialGroupId"); + + b.ToTable("Children"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Parent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)"); + + b.Property("MiddleName") + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Parents"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Provider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("AttachedDocuments") + .HasColumnType("nvarchar(max)"); + + b.Property("AuthorityHolder") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Director") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("DirectorBirthDay") + .HasColumnType("datetime2"); + + b.Property("DirectorPhone") + .HasColumnType("nvarchar(max)"); + + b.Property("DirectorPosition") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("EDRPOU") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Facebook") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Form") + .HasColumnType("nvarchar(max)"); + + b.Property("INPP") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Index") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Instagram") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("IsSubmitPZ1") + .HasColumnType("bit"); + + b.Property("KOATUU") + .HasColumnType("nvarchar(max)"); + + b.Property("MFO") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ManagerialBody") + .HasColumnType("nvarchar(max)"); + + b.Property("Ownership") + .HasColumnType("int"); + + b.Property("Profile") + .HasColumnType("int"); + + b.Property("ShortTitle") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Website") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("UserId"); + + b.ToTable("Providers"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.SocialGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("SocialGroups"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Subcategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.ToTable("Subcategories"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Teacher", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("BirthDay") + .HasColumnType("datetime2"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("Image") + .HasColumnType("nvarchar(max)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("MiddleName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("WorkshopId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("WorkshopId"); + + b.ToTable("Teachers"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.User", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatingTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("LastLogin") + .HasColumnType("datetime2"); + + b.Property("LastName") + .HasColumnType("nvarchar(max)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("MiddleName") + .HasColumnType("nvarchar(max)"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Workshop", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .UseIdentityColumn(); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("CategoryId") + .HasColumnType("bigint"); + + b.Property("DaysPerWeek") + .HasColumnType("int"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DisabilityOptionsDesc") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Facebook") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("Head") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("HeadBirthDate") + .HasColumnType("datetime2"); + + b.Property("Image") + .HasColumnType("nvarchar(max)"); + + b.Property("Instagram") + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("MaxAge") + .HasColumnType("int"); + + b.Property("MinAge") + .HasColumnType("int"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("ProviderId") + .HasColumnType("bigint"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("Website") + .HasColumnType("nvarchar(max)"); + + b.Property("WithDisabilityOptions") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("AddressId"); + + b.HasIndex("CategoryId"); + + b.HasIndex("ProviderId"); + + b.ToTable("Workshops"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("OutOfSchool.Services.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("OutOfSchool.Services.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OutOfSchool.Services.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("OutOfSchool.Services.Models.User", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.BirthCertificate", b => + { + b.HasOne("OutOfSchool.Services.Models.Child", "Child") + .WithOne("BirthCertificate") + .HasForeignKey("OutOfSchool.Services.Models.BirthCertificate", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Child"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Child", b => + { + b.HasOne("OutOfSchool.Services.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OutOfSchool.Services.Models.Parent", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OutOfSchool.Services.Models.SocialGroup", "SocialGroup") + .WithMany("Children") + .HasForeignKey("SocialGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Address"); + + b.Navigation("Parent"); + + b.Navigation("SocialGroup"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Parent", b => + { + b.HasOne("OutOfSchool.Services.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Provider", b => + { + b.HasOne("OutOfSchool.Services.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("OutOfSchool.Services.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Address"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Subcategory", b => + { + b.HasOne("OutOfSchool.Services.Models.Category", "Category") + .WithMany("Subcategories") + .HasForeignKey("CategoryId"); + + b.Navigation("Category"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Teacher", b => + { + b.HasOne("OutOfSchool.Services.Models.Workshop", "Workshop") + .WithMany("Teachers") + .HasForeignKey("WorkshopId"); + + b.Navigation("Workshop"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Workshop", b => + { + b.HasOne("OutOfSchool.Services.Models.Address", "Address") + .WithMany() + .HasForeignKey("AddressId"); + + b.HasOne("OutOfSchool.Services.Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId"); + + b.HasOne("OutOfSchool.Services.Models.Provider", "Provider") + .WithMany("Workshops") + .HasForeignKey("ProviderId"); + + b.Navigation("Address"); + + b.Navigation("Category"); + + b.Navigation("Provider"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Category", b => + { + b.Navigation("Subcategories"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Child", b => + { + b.Navigation("BirthCertificate"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Parent", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Provider", b => + { + b.Navigation("Workshops"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.SocialGroup", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("OutOfSchool.Services.Models.Workshop", b => + { + b.Navigation("Teachers"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20210413215419_updatedUser.cs b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20210413215419_updatedUser.cs new file mode 100644 index 0000000000..7e0c3e6f35 --- /dev/null +++ b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20210413215419_updatedUser.cs @@ -0,0 +1,43 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations +{ + public partial class updatedUser : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "LastName", + table: "AspNetUsers", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "FirstName", + table: "AspNetUsers", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "MiddleName", + table: "AspNetUsers", + type: "nvarchar(max)", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "LastName", + table: "AspNetUsers"); + + migrationBuilder.DropColumn( + name: "FirstName", + table: "AspNetUsers"); + + migrationBuilder.DropColumn( + name: "MiddleName", + table: "AspNetUsers"); + } + } +} diff --git a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/OutOfSchoolDbContextModelSnapshot.cs b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/OutOfSchoolDbContextModelSnapshot.cs index 3df8b7e7f8..550fab50af 100644 --- a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/OutOfSchoolDbContextModelSnapshot.cs +++ b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/OutOfSchoolDbContextModelSnapshot.cs @@ -157,7 +157,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("bigint") .UseIdentityColumn(); - b.Property("BuildingNumb") + b.Property("BuildingNumber") .IsRequired() .HasMaxLength(15) .HasColumnType("nvarchar(15)"); @@ -243,7 +243,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("datetime2"); b.Property("FirstName") - .IsRequired() .HasMaxLength(40) .HasColumnType("nvarchar(40)"); @@ -251,7 +250,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int"); b.Property("LastName") - .IsRequired() .HasMaxLength(40) .HasColumnType("nvarchar(40)"); @@ -259,7 +257,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("bigint"); b.Property("Patronymic") - .IsRequired() .HasMaxLength(40) .HasColumnType("nvarchar(40)"); @@ -299,15 +296,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasMaxLength(40) .HasColumnType("nvarchar(40)"); - b.Property("UserId") - .HasColumnType("bigint"); - - b.Property("UserId1") + b.Property("UserId") + .IsRequired() .HasColumnType("nvarchar(450)"); b.HasKey("Id"); - b.HasIndex("UserId1"); + b.HasIndex("UserId"); b.ToTable("Parents"); }); @@ -520,15 +515,24 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("EmailConfirmed") .HasColumnType("bit"); + b.Property("FirstName") + .HasColumnType("nvarchar(max)"); + b.Property("LastLogin") .HasColumnType("datetime2"); + b.Property("LastName") + .HasColumnType("nvarchar(max)"); + b.Property("LockoutEnabled") .HasColumnType("bit"); b.Property("LockoutEnd") .HasColumnType("datetimeoffset"); + b.Property("MiddleName") + .HasColumnType("nvarchar(max)"); + b.Property("NormalizedEmail") .HasMaxLength(256) .HasColumnType("nvarchar(256)"); @@ -748,7 +752,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.HasOne("OutOfSchool.Services.Models.User", "User") .WithMany() - .HasForeignKey("UserId1"); + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); b.Navigation("User"); }); diff --git a/OutOfSchool/OutOfSchool.IdentityServer/ViewModels/RegisterViewModel.cs b/OutOfSchool/OutOfSchool.IdentityServer/ViewModels/RegisterViewModel.cs index 7e81226f24..402961caad 100644 --- a/OutOfSchool/OutOfSchool.IdentityServer/ViewModels/RegisterViewModel.cs +++ b/OutOfSchool/OutOfSchool.IdentityServer/ViewModels/RegisterViewModel.cs @@ -5,9 +5,13 @@ namespace OutOfSchool.IdentityServer.ViewModels { public class RegisterViewModel { - [Required] - [MinLength(5)] - public string Username { get; set; } + [Required(ErrorMessage = "FirstName is required")] + public string FirstName { get; set; } + + [Required(ErrorMessage = "LastName is required")] + public string LastName { get; set; } + + public string MiddleName { get; set; } [Required(ErrorMessage = "Password is required")] [RegularExpression( diff --git a/OutOfSchool/OutOfSchool.IdentityServer/Views/Auth/Login.cshtml b/OutOfSchool/OutOfSchool.IdentityServer/Views/Auth/Login.cshtml index e2d7254857..9cddb5f0c4 100644 --- a/OutOfSchool/OutOfSchool.IdentityServer/Views/Auth/Login.cshtml +++ b/OutOfSchool/OutOfSchool.IdentityServer/Views/Auth/Login.cshtml @@ -20,7 +20,7 @@ + \ No newline at end of file diff --git a/OutOfSchool/OutOfSchool.IdentityServer/wwwroot/css/site.css b/OutOfSchool/OutOfSchool.IdentityServer/wwwroot/css/site.css index 4d4bc2d39c..38bf57334b 100644 --- a/OutOfSchool/OutOfSchool.IdentityServer/wwwroot/css/site.css +++ b/OutOfSchool/OutOfSchool.IdentityServer/wwwroot/css/site.css @@ -1,16 +1,22 @@ -html, body { - height: 100%; +html, +body { + height: 100%; } -body { +body { margin: 0; font-family: "Open Sans", sans-serif; font-size: 0.8125rem; line-height: 1.125rem; - background-color: #F8F8F8; + background-color: #f8f8f8; color: #333333; } -h1, h2, h3, h4, h5, h6 { +h1, +h2, +h3, +h4, +h5, +h6 { font-family: "Innerspace"; color: #000000; margin: 0; @@ -39,68 +45,76 @@ h6 { font-size: 0.6875rem; line-height: 0.9375rem; } - +.validation-summary-errors li { + list-style-type: none !important; + text-align: center !important; +} a { text-decoration: none; color: inherit; } -.login__wrapper{ - display: flex; - flex-direction: column; - align-items: center; - margin: 0; - padding: 10px; -} -.login__text, .login__label, .login__link{ - font-weight: 400; - font-family: Roboto,Helvetica Neue,sans-serif; - letter-spacing: normal; -} - .login__label{ - margin-top: 10px; - font-size: 1.2rem; -} -.login__input{ - max-width: 800px; - width: 100%; - height: 2rem; - border: none; - outline: none; - font-size: 2rem; - border-bottom: 1px solid silver; - cursor: text; +.login__wrapper { + display: flex; + flex-direction: column; + align-items: center; + margin: 0; + padding: 10px; +} +.login__text, +.login__label, +.login__link { + font-weight: 400; + font-family: Roboto, Helvetica Neue, sans-serif; + letter-spacing: normal; +} +.login__label { + margin-top: 10px; + font-size: 1.2rem; } -.login__input:focus{ - border-bottom: 1px solid #4158d0; +.login__input { + max-width: 800px; + width: 100%; + height: 2rem; + border: none; + outline: none; + font-size: 2rem; + border-bottom: 1px solid silver; + cursor: text; +} +.login__input:focus { + border-bottom: 1px solid #4158d0; } .login__button { - text-align: center; - outline: none; - border: none; - margin: 20px; - padding: 10px; - font-size: 1.5rem; - border-radius: 4px; - color: rgba(0, 0, 0, 0.87); - background-color: #fff; - box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.5), 0 2px 2px 0 rgba(0, 0, 0, 0.5), 0 1px 5px 0 rgba(0, 0, 0, 0.5); - cursor: pointer; -} -.login__button:hover{ - box-shadow: 0 3px 1px -2px #4158d0, 0 2px 2px 0 #4158d0, 0 1px 5px 0 #4158d0; + text-align: center; + outline: none; + border: none; + margin: 20px; + padding: 10px; + font-size: 1.5rem; + border-radius: 4px; + color: rgba(0, 0, 0, 0.87); + background-color: #fff; + box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.5), 0 2px 2px 0 rgba(0, 0, 0, 0.5), + 0 1px 5px 0 rgba(0, 0, 0, 0.5); + cursor: pointer; +} +.login__button:hover { + box-shadow: 0 3px 1px -2px #4158d0, 0 2px 2px 0 #4158d0, 0 1px 5px 0 #4158d0; } .login .login__link { - border-bottom: 1px solid silver; - text-decoration: none; - cursor: pointer; - color: rgba(0, 0, 0, 0.87); + border-bottom: 1px solid silver; + text-decoration: none; + cursor: pointer; + color: rgba(0, 0, 0, 0.87); } -.login__link{ - font-size: 1.5rem; +.login__link { + font-size: 1.5rem; } -.login__link:hover, .login__input:focus, .login__button:hover{ - color: #4158d0; +.login__link:hover, +.login__input:focus, +.login__button:hover { + color: #4158d0; } .registration { @@ -110,288 +124,316 @@ a { } .registration_wrapper { - background: #FFFFFF; - box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08); - border-radius: 5px; - padding: 3rem 4.3125rem; - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - width: 640px; - } - .registration_title { - line-height: 20px; - text-align: center; - color: #444444; - margin: 0; - } - .registration_subtitle { - line-height: 18px; - text-align: center; - color: #AAAAAA; - margin: 16px 0 0 0; - } - .registration_social { - margin-top: 24px; - } - .registration_button { - border: none; - outline: none; - background: inherit; - margin: 0 0.3rem; - cursor: pointer; - } - .registration_option { - font-size: 0.8125rem; - line-height: 18px; - text-align: center; - color: #333333; - position: relative; - margin-top: 24px; - } - .registration_option:after { - content: ''; - display: block; - position: absolute; - height: 1px; - width: 7rem; - background-color: #E3E3E3; - left: 0%; - top: 50%; - transform: translate(-120%, -50%); - } - .registration_option:before { - content: ''; - display: block; - position: absolute; - height: 1px; - width: 7rem; - background-color: #E3E3E3; - right: 0%; - top: 50%; - transform: translate(120%, -50%); - } - .registration_form { - margin-top: 24px; - width: 80%; - } - .registration_star { - color: red; - display: inline; - } - .registration_list { - list-style: none; - padding: 0; - margin: 0; - width: 100%; - } - .registration_item { - display: flex; - flex-direction: column; - position: relative; + background: #ffffff; + box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.08); + border-radius: 5px; + padding: 3rem 4.3125rem; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + width: 640px; +} +.registration_title { + line-height: 20px; + text-align: center; + color: #444444; + margin: 0; +} +.registration_subtitle { + line-height: 18px; + text-align: center; + color: #aaaaaa; + margin: 16px 0 0 0; +} +.registration_social { + margin-top: 24px; +} +.registration_button { + border: none; + outline: none; + background: inherit; + margin: 0 0.3rem; + cursor: pointer; +} +.registration_option { + font-size: 0.8125rem; + line-height: 18px; + text-align: center; + color: #333333; + position: relative; + margin-top: 24px; +} +.registration_option:after { + content: ""; + display: block; + position: absolute; + height: 1px; + width: 7rem; + background-color: #e3e3e3; + left: 0%; + top: 50%; + transform: translate(-120%, -50%); +} +.registration_option:before { + content: ""; + display: block; + position: absolute; + height: 1px; + width: 7rem; + background-color: #e3e3e3; + right: 0%; + top: 50%; + transform: translate(120%, -50%); +} +.registration_form { + margin-top: 24px; + width: 80%; +} +.registration_star { + color: red; + display: inline; +} +.registration_list { + list-style: none; + padding: 0; + margin: 0; + width: 100%; +} +.registration_item { + display: flex; + flex-direction: column; + position: relative; + width: 100%; + margin: 16px 0; + box-sizing: border-box; +} +.registration_item-maturity { + flex-direction: row; + gap: 8px; + font-family: Open Sans; + font-style: normal; + font-weight: normal; + font-size: 13px; + line-height: 18px; + color: #444444; + margin-top: 24px; +} +.registration_item-accept { + margin: 24px auto 0 auto; + text-align: center; + display: block; + font-family: Open Sans; + font-style: normal; + font-weight: normal; + font-size: 13px; + line-height: 18px; + color: #333333; + width: 95%; +} +.registration_item-tip { + margin: 0; + font-family: Open Sans; + font-style: normal; + font-weight: normal; + font-size: 13px; + line-height: 18px; + color: #aaaaaa; +} +.registration_item-password { + margin-bottom: 8px; +} +.registration_link { + color: #3849f9; + font-weight: bold; + text-decoration: underline; +} +.registration_as { + display: flex; + align-items: center; + position: relative; + margin-top: 8px; +} +.registration_type { + width: 50%; + display: flex; + align-items: center; + justify-content: center; + gap: 0.3rem; + height: 34px; + padding: 0; + font-family: Open Sans; + font-style: normal; + font-weight: bold; + font-size: 0.8125rem; + line-height: 100%; + color: #272425; + background: inherit; + outline: none; + cursor: pointer; + border: 1px solid #e3e3e3; + transition: 0.5s ease all; +} +.registration_type:nth-child(1) { + border-radius: 20px 0 0 20px; + border-right: none; +} +.registration_type:nth-child(2) { + border-radius: 0 20px 20px 0; + border-left: none; +} +.registration_type:hover { + border-color: #3849f9; +} +.registration_type:hover ~ .registration_divider { + background: #3849f9; +} +.registration_type-active { + border-color: #3849f9; + color: #3849f9; + background: rgba(56, 73, 249, 0.07); +} +.registration_type-active ~ .registration_divider { + background: #3849f9; +} +.registration_type-active svg path { + fill: #3849f9; +} +.registration_divider { + transition: 0.5s ease all; + position: absolute; + height: 100%; + width: 1px; + background: #e3e3e3; + left: 50%; + transform: translateX(-50%); +} +.registration_icon-person { + height: 13px; + width: 11px; +} +.registration_icon-provider { + width: 13px; + height: 17px; +} +.registration_input { + box-sizing: border-box; + border: 1px solid #e3e3e3; + border-radius: 20px; + height: 30px; + width: 100%; + margin-top: 8px !important; + padding: 0 0 0 16px !important; + outline: none; + font-family: Open Sans; + font-style: normal; + font-weight: normal; + font-size: 13px; + line-height: 30px; + color: #333333; +} +.registration_input-password { + font-size: 30px; + padding-right: 30px !important; +} +.registration_label { + font-family: Innerspace; + font-style: normal; + font-weight: bold; + font-size: 13px; + line-height: 15px; + color: #333333; +} +.registration_phone { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; + width: 100%; +} +.registration_phone-code { + margin-top: 8px; + border: 1px solid #e3e3e3; + border-radius: 21px; + height: 30px; + width: 59px; + text-align: center; + font-family: Open Sans; + font-style: normal; + font-weight: normal; + font-size: 13px; + line-height: 26px; + color: #333333; +} +.registration_submit { + border: none; + outline: none; + height: 34px; + width: 12rem; + margin: 16px auto; + background: #3849f9; + border-radius: 20px; + font-family: Innerspace; + font-style: normal; + font-weight: bold; + font-size: 13px; + line-height: 34px; + color: #ffffff; + cursor: pointer; +} +.registration_privacy { + border: none; + outline: none; + background: inherit; + position: absolute; + bottom: 0; + right: 8px; + width: 30px; + height: 30px; + display: flex !important; + align-items: center !important; + justify-content: center !important; +} +.registration_privacy img { + height: 16px; + width: auto; +} + +.field-validation-error { + color: #ff0000; + font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif; + font-size: 12px; +} + +.field-validation-valid { + display: none; +} + +.input-validation-error { + border: 1px solid #ff0000 !important; + background-color: #ffeeee !important; +} + +.validation-summary-errors { + font-weight: bold !important; + color: #ff0000 !important; +} + +.validation-summary-valid { + display: none; +} + +.maturity { + color: #ff0000; + visibility: hidden; +} + +@media screen and (max-width: 750px) { + .registration_wrapper { width: 100%; - margin: 16px 0; - box-sizing: border-box; - } - .registration_item-maturity { - flex-direction: row; - gap: 8px; - font-family: Open Sans; - font-style: normal; - font-weight: normal; - font-size: 13px; - line-height: 18px; - color: #444444; - margin-top: 24px; + padding: 3rem 0.4rem; } - .registration_item-accept { - margin: 24px auto 0 auto; - text-align: center; - display: block; - font-family: Open Sans; - font-style: normal; - font-weight: normal; - font-size: 13px; - line-height: 18px; - color: #333333; + .registration_form { width: 95%; } - .registration_item-tip { - margin: 0; - font-family: Open Sans; - font-style: normal; - font-weight: normal; - font-size: 13px; - line-height: 18px; - color: #AAAAAA; - } - .registration_item-password { - margin-bottom: 8px; - } - .registration_link { - color: #3849F9; - font-weight: bold; - text-decoration: underline; - } - .registration_as { - display: flex; - align-items: center; - position: relative; - margin-top: 8px; - } - .registration_type { - width: 50%; - display: flex; - align-items: center; - justify-content: center; - gap: 0.3rem; - height: 34px; - padding: 0; - font-family: Open Sans; - font-style: normal; - font-weight: bold; - font-size: 0.8125rem; - line-height: 100%; - color: #272425; - background: inherit; - outline: none; - cursor: pointer; - border: 1px solid #E3E3E3; - transition: 0.5s ease all; - } - .registration_type:nth-child(1) { - border-radius: 20px 0 0 20px; - border-right: none; - } - .registration_type:nth-child(2) { - border-radius: 0 20px 20px 0; - border-left: none; - } - .registration_type:hover { - border-color: #3849F9; - } - .registration_type:hover ~ .registration_divider { - background: #3849F9; - } - .registration_type-active { - border-color: #3849F9; - color: #3849F9; - background: rgba(56, 73, 249, 0.07); - } - .registration_type-active ~ .registration_divider { - background: #3849F9; - } - .registration_type-active svg path { - fill: #3849F9; - } - .registration_divider { - transition: 0.5s ease all; - position: absolute; - height: 100%; - width: 1px; - background: #E3E3E3; - left: 50%; - transform: translateX(-50%); - } - .registration_icon-person { - height: 13px; - width: 11px; - } - .registration_icon-provider { - width: 13px; - height: 17px; - } - .registration_input { - box-sizing: border-box; - border: 1px solid #E3E3E3; - border-radius: 20px; - height: 30px; - width: 100%; - margin-top: 8px; - padding: 0 0 0 16px; - outline: none; - font-family: Open Sans; - font-style: normal; - font-weight: normal; - font-size: 13px; - line-height: 30px; - color: #333333; - } - .registration_input-password { - font-size: 30px; - padding-right: 30px; - } - .registration_label { - font-family: Innerspace; - font-style: normal; - font-weight: bold; - font-size: 13px; - line-height: 15px; - color: #333333; - } - .registration_phone { - display: flex; - align-items: center; - justify-content: space-between; - gap: 8px; - width: 100%; - } - .registration_phone-code { - margin-top: 8px; - border: 1px solid #E3E3E3; - border-radius: 21px; - height: 30px; - width: 59px; - text-align: center; - font-family: Open Sans; - font-style: normal; - font-weight: normal; - font-size: 13px; - line-height: 26px; - color: #333333; - } - .registration_submit { - border: none; - outline: none; - height: 34px; - width: 12rem; - margin: 16px auto; - background: #3849F9; - border-radius: 20px; - font-family: Innerspace; - font-style: normal; - font-weight: bold; - font-size: 13px; - line-height: 34px; - color: #FFFFFF; - cursor: pointer; - } - .registration_privacy { - border: none; - outline: none; - background: inherit; - position: absolute; - bottom: 0; - right: 8px; - width: 30px; - height: 30px; - padding: 0; - display: flex; - align-items: center; - justify-content: center; - } - .registration_privacy img { - height: 16px; - width: auto; - } - - @media screen and (max-width: 750px) { - .registration_wrapper { - width: 100%; - padding: 3rem 0.4rem; - } - .registration_form { - width: 95%; - } - } \ No newline at end of file +} diff --git a/OutOfSchool/OutOfSchool.IdentityServer/wwwroot/js/site.js b/OutOfSchool/OutOfSchool.IdentityServer/wwwroot/js/site.js new file mode 100644 index 0000000000..5bfc8bbca8 --- /dev/null +++ b/OutOfSchool/OutOfSchool.IdentityServer/wwwroot/js/site.js @@ -0,0 +1,78 @@ +let btn_parent = document.getElementById('btn_parent'); +let btn_provider = document.getElementById('btn_provider'); +let btn_register = document.getElementById('btn_register'); + +let passwordEye = document.getElementById('password_eye'); +let confirmPasswordEye = document.getElementById('confirm_password_eye'); + +let check_passwordEye = false; +let check_confirmPasswordEye = false; + +let password = document.getElementById('password'); +let repeatPassword = document.getElementById('repeat_password'); + +if (password.className.includes('input-validation-error')) { + let elements = document.getElementsByClassName('registration_privacy'); + for (let element of elements) { + element.style.height = "65px"; + } +} + +if (document.getElementsByClassName('validation-summary-errors').length > 0) { + document.getElementById("user_mail").className += ' input-validation-error'; +} + +btn_parent.addEventListener('click', function () { + btn_parent.className = "registration_type registration_type-active"; + btn_provider.className = "registration_type"; + btn_register.setAttribute("name", "Parent"); +}) + +btn_provider.addEventListener('click', function () { + btn_provider.className = "registration_type registration_type-active"; + btn_parent.className = "registration_type"; + btn_register.setAttribute("name", "Provider"); +}) + +passwordEye.addEventListener('click', function () { + if (check_passwordEye) { + passwordEye.src = "/icons/ic_eye.svg"; + check_passwordEye = false; + password.style.fontSize = "30px"; + password.setAttribute("type", "Password"); + + } else { + passwordEye.src = "/icons/eye.svg"; + check_passwordEye = true; + password.style.fontSize = "20px"; + password.setAttribute("type", "Text"); + } +}) + +confirmPasswordEye.addEventListener('click', function () { + if (check_confirmPasswordEye) { + confirmPasswordEye.src = "/icons/ic_eye.svg"; + check_confirmPasswordEye = false; + repeatPassword.style.fontSize = "30px"; + repeatPassword.setAttribute("type", "Password"); + } else { + confirmPasswordEye.src = "/icons/eye.svg"; + check_confirmPasswordEye = true; + repeatPassword.style.fontSize = "20px"; + repeatPassword.setAttribute("type", "Text"); + } +}) + +function validateForm(form) { + if (!form.maturity.checked) { + document.getElementById('maturity').style.visibility = 'visible'; + return false; + } + else { + document.getElementById('maturity').style.visibility = 'hidden'; + return true; + } +} + + +