pull/441/head
Armağan Ünlü 6 years ago
commit 1070432cec

@ -0,0 +1,625 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.BloggingTestApp.EntityFrameworkCore;
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{
[DbContext(typeof(BloggingTestAppDbContext))]
[Migration("20180924134933_Removed_Social_Links")]
partial class Removed_Social_Links
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.IsRequired()
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("NormalizedName");
b.ToTable("AbpRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AbpRoleClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount")
.ValueGeneratedOnAdd()
.HasColumnName("AccessFailedCount")
.HasDefaultValue(0);
b.Property<string>("ConcurrencyStamp")
.IsRequired()
.HasColumnName("ConcurrencyStamp")
.HasMaxLength(256);
b.Property<string>("Email")
.HasColumnName("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("LockoutEnabled")
.HasDefaultValue(false);
b.Property<DateTimeOffset?>("LockoutEnd");
b.Property<string>("NormalizedEmail")
.HasColumnName("NormalizedEmail")
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasColumnName("NormalizedUserName")
.HasMaxLength(256);
b.Property<string>("PasswordHash")
.HasColumnName("PasswordHash")
.HasMaxLength(256);
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasDefaultValue(false);
b.Property<string>("SecurityStamp")
.IsRequired()
.HasColumnName("SecurityStamp")
.HasMaxLength(256);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<bool>("TwoFactorEnabled")
.ValueGeneratedOnAdd()
.HasColumnName("TwoFactorEnabled")
.HasDefaultValue(false);
b.Property<string>("UserName")
.IsRequired()
.HasColumnName("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("Email");
b.HasIndex("NormalizedEmail");
b.HasIndex("NormalizedUserName");
b.HasIndex("UserName");
b.ToTable("AbpUsers");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("ClaimValue")
.HasMaxLength(1024);
b.Property<Guid?>("TenantId");
b.Property<Guid>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AbpUserClaims");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(64);
b.Property<string>("ProviderDisplayName")
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(196);
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "LoginProvider");
b.HasIndex("LoginProvider", "ProviderKey");
b.ToTable("AbpUserLogins");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.Property<Guid>("UserId");
b.Property<Guid>("RoleId");
b.Property<Guid?>("TenantId");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId", "UserId");
b.ToTable("AbpUserRoles");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.Property<Guid>("UserId");
b.Property<string>("LoginProvider")
.HasMaxLength(128);
b.Property<string>("Name");
b.Property<Guid?>("TenantId");
b.Property<string>("Value");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AbpUserTokens");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Blogging.Blogs.Blog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnName("Description")
.HasMaxLength(1024);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasMaxLength(256);
b.Property<string>("ShortName")
.IsRequired()
.HasColumnName("ShortName")
.HasMaxLength(32);
b.HasKey("Id");
b.ToTable("BlgBlogs");
});
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId");
b.Property<Guid>("PostId")
.HasColumnName("PostId");
b.Property<Guid?>("RepliedCommentId")
.HasColumnName("RepliedCommentId");
b.Property<string>("Text")
.IsRequired()
.HasColumnName("Text")
.HasMaxLength(1024);
b.HasKey("Id");
b.HasIndex("PostId");
b.HasIndex("RepliedCommentId");
b.ToTable("BlgComments");
});
modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("BlogId")
.HasColumnName("BlogId");
b.Property<string>("Content")
.HasColumnName("Content")
.HasMaxLength(1048576);
b.Property<string>("CoverImage")
.IsRequired()
.HasColumnName("CoverImage");
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId");
b.Property<int>("ReadCount");
b.Property<string>("Title")
.IsRequired()
.HasColumnName("Title")
.HasMaxLength(512);
b.Property<string>("Url")
.IsRequired()
.HasColumnName("Url")
.HasMaxLength(64);
b.HasKey("Id");
b.HasIndex("BlogId");
b.ToTable("BlgPosts");
});
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{
b.Property<Guid>("PostId")
.HasColumnName("PostId");
b.Property<Guid>("TagId")
.HasColumnName("TagId");
b.Property<DateTime>("CreationTime");
b.Property<Guid?>("CreatorId");
b.HasKey("PostId", "TagId");
b.HasIndex("TagId");
b.ToTable("BlgPostTags");
});
modelBuilder.Entity("Volo.Blogging.Tagging.Tag", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnName("Description")
.HasMaxLength(512);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
.HasDefaultValue(false);
b.Property<DateTime?>("LastModificationTime")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasColumnName("Name")
.HasMaxLength(64);
b.Property<int>("UsageCount")
.HasColumnName("UsageCount");
b.HasKey("Id");
b.ToTable("BlgTags");
});
modelBuilder.Entity("Volo.Blogging.Users.BlogUser", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Email")
.HasColumnName("Email")
.HasMaxLength(256);
b.Property<bool>("EmailConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("EmailConfirmed")
.HasDefaultValue(false);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("PhoneNumber")
.HasColumnName("PhoneNumber")
.HasMaxLength(16);
b.Property<bool>("PhoneNumberConfirmed")
.ValueGeneratedOnAdd()
.HasColumnName("PhoneNumberConfirmed")
.HasDefaultValue(false);
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<string>("UserName")
.IsRequired()
.HasColumnName("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.ToTable("BlgUsers");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.Identity.IdentityUser")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser")
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Blogging.Comments.Comment", b =>
{
b.HasOne("Volo.Blogging.Posts.Post")
.WithMany()
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Blogging.Comments.Comment")
.WithMany()
.HasForeignKey("RepliedCommentId");
});
modelBuilder.Entity("Volo.Blogging.Posts.Post", b =>
{
b.HasOne("Volo.Blogging.Blogs.Blog")
.WithMany()
.HasForeignKey("BlogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Blogging.Posts.PostTag", b =>
{
b.HasOne("Volo.Blogging.Posts.Post")
.WithMany("Tags")
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Blogging.Tagging.Tag")
.WithMany()
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

@ -0,0 +1,63 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
{
public partial class Removed_Social_Links : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Facebook",
table: "BlgBlogs");
migrationBuilder.DropColumn(
name: "Github",
table: "BlgBlogs");
migrationBuilder.DropColumn(
name: "Instagram",
table: "BlgBlogs");
migrationBuilder.DropColumn(
name: "StackOverflow",
table: "BlgBlogs");
migrationBuilder.DropColumn(
name: "Twitter",
table: "BlgBlogs");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Facebook",
table: "BlgBlogs",
maxLength: 128,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Github",
table: "BlgBlogs",
maxLength: 128,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Instagram",
table: "BlgBlogs",
maxLength: 128,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "StackOverflow",
table: "BlgBlogs",
maxLength: 128,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Twitter",
table: "BlgBlogs",
maxLength: 128,
nullable: true);
}
}
}

@ -305,18 +305,6 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("Description")
.HasMaxLength(1024);
b.Property<string>("Facebook")
.HasColumnName("Facebook")
.HasMaxLength(128);
b.Property<string>("Github")
.HasColumnName("Github")
.HasMaxLength(128);
b.Property<string>("Instagram")
.HasColumnName("Instagram")
.HasMaxLength(128);
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnName("IsDeleted")
@ -338,14 +326,6 @@ namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations
.HasColumnName("ShortName")
.HasMaxLength(32);
b.Property<string>("StackOverflow")
.HasColumnName("StackOverflow")
.HasMaxLength(128);
b.Property<string>("Twitter")
.HasColumnName("Twitter")
.HasMaxLength(128);
b.HasKey("Id");
b.ToTable("BlgBlogs");

@ -10,15 +10,5 @@ namespace Volo.Blogging.Blogs.Dtos
public string ShortName { get; set; }
public string Description { get; set; }
public string Facebook { get; set; }
public string Twitter { get; set; }
public string Instagram { get; set; }
public string Github { get; set; }
public string StackOverflow { get; set; }
}
}

@ -7,15 +7,5 @@ namespace Volo.Blogging.Blogs.Dtos
public string ShortName { get; set; }
public string Description { get; set; }
public string Facebook { get; set; }
public string Twitter { get; set; }
public string Instagram { get; set; }
public string Github { get; set; }
public string StackOverflow { get; set; }
}
}

@ -9,15 +9,5 @@ namespace Volo.Blogging.Blogs.Dtos
public string ShortName { get; set; }
public string Description { get; set; }
public string Facebook { get; set; }
public string Twitter { get; set; }
public string Instagram { get; set; }
public string Github { get; set; }
public string StackOverflow { get; set; }
}
}

@ -62,12 +62,7 @@ namespace Volo.Blogging.Blogs
{
var newBlog = await _blogRepository.InsertAsync(new Blog(GuidGenerator.Create(), input.Name, input.ShortName)
{
Description = input.Description,
Facebook = input.Facebook,
Twitter = input.Twitter,
Instagram = input.Instagram,
Github = input.Github,
StackOverflow = input.StackOverflow
Description = input.Description
});
return ObjectMapper.Map<Blog, BlogDto>(newBlog);
@ -81,11 +76,6 @@ namespace Volo.Blogging.Blogs
blog.SetName(input.Name);
blog.SetShortName(input.ShortName);
blog.Description = input.Description;
blog.Facebook = input.Facebook;
blog.Twitter = input.Twitter;
blog.Instagram = input.Instagram;
blog.Github = input.Github;
blog.StackOverflow = input.StackOverflow;
return ObjectMapper.Map<Blog, BlogDto>(blog);
}

@ -7,7 +7,5 @@
public const int MaxShortNameLength = 32;
public const int MaxDescriptionLength = 1024;
public const int MaxSocialLinkLength = 128;
}
}

@ -16,21 +16,6 @@ namespace Volo.Blogging.Blogs
[CanBeNull]
public virtual string Description { get; set; }
[CanBeNull]
public virtual string Facebook { get; set; }
[CanBeNull]
public virtual string Twitter { get; set; }
[CanBeNull]
public virtual string Instagram { get; set; }
[CanBeNull]
public virtual string Github { get; set; }
[CanBeNull]
public virtual string StackOverflow { get; set; }
protected Blog()
{

@ -38,11 +38,6 @@ namespace Volo.Blogging.EntityFrameworkCore
b.ConfigureFullAudited();
b.Property(x => x.Name).IsRequired().HasMaxLength(BlogConsts.MaxNameLength).HasColumnName(nameof(Blog.Name));
b.Property(x => x.Facebook).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.Facebook));
b.Property(x => x.Twitter).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.Twitter));
b.Property(x => x.Instagram).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.Instagram));
b.Property(x => x.Github).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.Github));
b.Property(x => x.StackOverflow).HasMaxLength(BlogConsts.MaxSocialLinkLength).HasColumnName(nameof(Blog.StackOverflow));
b.Property(x => x.ShortName).IsRequired().HasMaxLength(BlogConsts.MaxShortNameLength).HasColumnName(nameof(Blog.ShortName));
b.Property(x => x.Description).IsRequired(false).HasMaxLength(BlogConsts.MaxDescriptionLength).HasColumnName(nameof(Blog.Description));
});

@ -8,26 +8,13 @@
}
<form asp-page="/Admin/Blogs/Create">
<abp-dynamic-form submit-button="false" abp-model="Blog" asp-page="/Admin/Blogs/Create">
<abp-modal size="@(AbpModalSize.Large)">
<abp-modal-header title="@L["Create"].Value"></abp-modal-header>
<abp-modal-body>
<abp-tabs>
<abp-tab title="@L["Info"].Value">
<abp-input asp-for="Blog.Name"/>
<abp-input asp-for="Blog.ShortName"/>
<abp-input asp-for="Blog.Description"/>
</abp-tab>
<abp-tab title="@L["Social"].Value">
<abp-input asp-for="Blog.Facebook" />
<abp-input asp-for="Blog.Twitter" />
<abp-input asp-for="Blog.Instagram" />
<abp-input asp-for="Blog.Github" />
<abp-input asp-for="Blog.StackOverflow" />
</abp-tab>
</abp-tabs>
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)">
</abp-modal-footer>
</abp-modal>
</form>
</abp-dynamic-form>

@ -54,21 +54,6 @@ namespace Volo.Blogging.Pages.Admin.Blogs
[StringLength(BlogConsts.MaxDescriptionLength)]
public string Description { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string Facebook { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string Twitter { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string Instagram { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string Github { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string StackOverflow { get; set; }
}
}
}

@ -8,27 +8,13 @@
}
<form asp-page="/Admin/Blogs/Edit">
<abp-dynamic-form asp-page="/Admin/Blogs/Edit">
<abp-modal size="@(AbpModalSize.Large)">
<abp-modal-header title="@L["Edit"].Value"></abp-modal-header>
<abp-modal-body>
<abp-tabs>
<abp-tab title="@L["Info"].Value">
<abp-input asp-for="Blog.Id" />
<abp-input asp-for="Blog.Name" />
<abp-input asp-for="Blog.ShortName" />
<abp-input asp-for="Blog.Description" />
</abp-tab>
<abp-tab title="@L["Social"].Value">
<abp-input asp-for="Blog.Facebook" />
<abp-input asp-for="Blog.Twitter" />
<abp-input asp-for="Blog.Instagram" />
<abp-input asp-for="Blog.Github" />
<abp-input asp-for="Blog.StackOverflow" />
</abp-tab>
</abp-tabs>
<abp-form-content />
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel|AbpModalButtons.Save)">
</abp-modal-footer>
</abp-modal>
</form>
</abp-dynamic-form>

@ -48,12 +48,7 @@ namespace Volo.Blogging.Pages.Admin.Blogs
{
Name = Blog.Name,
ShortName = Blog.ShortName,
Description = Blog.Description,
Facebook = Blog.Facebook,
Twitter = Blog.Twitter,
Instagram = Blog.Instagram,
Github = Blog.Github,
StackOverflow = Blog.StackOverflow
Description = Blog.Description
});
}
@ -73,21 +68,6 @@ namespace Volo.Blogging.Pages.Admin.Blogs
[StringLength(BlogConsts.MaxDescriptionLength)]
public string Description { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string Facebook { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string Twitter { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string Instagram { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string Github { get; set; }
[StringLength(BlogConsts.MaxSocialLinkLength)]
public string StackOverflow { get; set; }
}
}

@ -49,40 +49,6 @@
<a asp-page="./New" asp-route-blogShortName="@Model.BlogShortName">@L["CreateANewPost"]</a>
<span class="vs-seperator">|</span>
}
@if (!string.IsNullOrWhiteSpace(Model.Blog.Facebook))
{
<a href="https://Facebook.com/@Model.Blog.Facebook" target="_blank">
<i class="fa fa-facebook"></i>
</a>
<span class="vs-seperator">|</span>
}
@if (!string.IsNullOrWhiteSpace(Model.Blog.Twitter))
{
<a href="https://twitter.com/@Model.Blog.Twitter" target="_blank">
<i class="fa fa-twitter"></i>
</a>
<span class="vs-seperator">|</span>
}
@if (!string.IsNullOrWhiteSpace(Model.Blog.Instagram))
{
<a href="https://Instagram.com/@Model.Blog.Instagram" target="_blank">
<i class="fa fa-instagram"></i>
</a>
<span class="vs-seperator">|</span>
}
@if (!string.IsNullOrWhiteSpace(Model.Blog.Github))
{
<a href="https://Github.com/@Model.Blog.Github" target="_blank">
<i class="fa fa-github"></i>
</a>
<span class="vs-seperator">|</span>
}
@if (!string.IsNullOrWhiteSpace(Model.Blog.StackOverflow))
{
<a href="https://StackOverflow.com/@Model.Blog.StackOverflow" target="_blank">
<i class="fa fa-stack-overflow"></i>
</a>
}
</div>
</div>
</div>

@ -88,16 +88,4 @@
$(this).off('submit').submit();
});
$('#Post_Title').on("change paste keyup", function() {
var title = $('#Post_Title').val();
if (title.length > 64) {
title = title.substring(0, 64);
}
title = title.replace(' ','-');
title = title.replace(new RegExp(' ', 'g'), '-');
$('#Post_Url').val(title);
});
})(jQuery);

@ -86,7 +86,14 @@
$(this).off('submit').submit();
});
$('#Post_Title').on("change paste keyup", function() {
var urlEdited = false;
var reflectedChange = false;
$('#Post_Title').on("change paste keyup", function () {
if (urlEdited) {
return;
}
var title = $('#Post_Title').val();
if (title.length > 64) {
@ -95,7 +102,15 @@
title = title.replace(' ', '-');
title = title.replace(new RegExp(' ', 'g'), '-');
reflectedChange = true;
$('#Post_Url').val(title);
reflectedChange = false;
});
$('#Post_Url').change(function () {
if (!reflectedChange) {
urlEdited = true;
}
});
})(jQuery);

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
@ -43,7 +44,7 @@ namespace Volo.Docs.Documents
public bool IsEmpty => Text == null && Path == null;
public bool IsOpened(string documentName)
public bool IsSelected(string documentName)
{
if (documentName == null)
{
@ -55,18 +56,19 @@ namespace Volo.Docs.Documents
return documentName == Path;
}
var isOpened = false;
var isSelected = false;
foreach (var n in Items)
{
if (n.IsOpened(documentName))
if (n.IsSelected(documentName))
{
isOpened = true;
isSelected = true;
break;
}
}
return isOpened;
return isSelected;
}
}
public class NavigationWithDetailsDto : DocumentWithDetailsDto
@ -76,9 +78,15 @@ namespace Volo.Docs.Documents
public void ConvertItems()
{
RootNode = string.IsNullOrWhiteSpace(Content) ?
new NavigationNode() :
JsonConvert.DeserializeObject<NavigationNode>(Content);
try
{
RootNode = JsonConvert.DeserializeObject<NavigationNode>(Content);
}
catch (JsonException)
{
//todo: should log the exception?
RootNode = new NavigationNode();
}
}
}
}

@ -60,12 +60,6 @@ namespace Volo.Docs.Documents
dto.Project = ObjectMapper.Map<Project, ProjectDto>(project);
//if (normalize)
//{
// dto.Content = NormalizeLinks(dto.Content, project.ShortName, version);
// dto.Content = NormalizeImages(dto.Content, dto.RawRootUrl);
//}
return dto;
}

@ -9,7 +9,7 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers
[HtmlTargetElement("ul", Attributes = "root-node")]
public class TreeTagHelper : TagHelper
{
private const string LiItemTemplate = @"<li>
private const string LiItemTemplate = @"<li class='{6}'>
<label class='tree-toggle {3}'>
<span class='plus-icon'>
<i class='fa fa-{4}'></i>
@ -51,7 +51,7 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers
{
var content = "";
var isAnyNodeOpenedInThisLevel = node.Items?.Any(n => n.IsOpened(SelectedDocumentName)) ?? false;
var isAnyNodeOpenedInThisLevel = node.Items?.Any(n => n.IsSelected(SelectedDocumentName)) ?? false;
node.Items?.ForEach(innerNode =>
{
@ -72,11 +72,12 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers
private string GetLeafNode(NavigationNode node, string content)
{
var cssClass = node.Path.IsNullOrEmpty() ? "tree-toggle" : "";
var anchorCss = node.Path.IsNullOrEmpty() ? "tree-toggle" : "";
var isNodeSelected = node.IsSelected(SelectedDocumentName);
if (node.IsOpened(SelectedDocumentName))
if (isNodeSelected)
{
cssClass += " opened";
anchorCss += " opened";
}
return string.Format(LiItemTemplate,
@ -85,7 +86,8 @@ namespace Volo.Docs.Areas.Documents.Helpers.TagHelpers
content,
node.HasChildItems ? "nav-header" : "last-link",
node.HasChildItems ? "chevron-down" : "long-arrow-right",
cssClass);
anchorCss ,
isNodeSelected? "selected-tree" : "");
}
}

@ -72,7 +72,6 @@
<div class="input-group">
<div class="input-group-prepend">
<label class="input-group-text" >Version</label>
</div>
@Html.DropDownList("Version", Model.Versions.Select(v => new SelectListItem
{
@ -84,6 +83,12 @@
</div>
</div>
}
@* @if (Model.Versions.Any())
{
<div class="col-md-12 docs-version">
<select asp-items="Model.VersionSelectItems" class="form-control" onchange="window.location.replace(this.value)"></select>
</div>
} *@
<ul root-node="@Model.Navigation.RootNode"
version="@(Model.Version.IsNullOrEmpty() ? "latest" : Model.Version)"

@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Volo.Docs.Documents;
using Volo.Docs.Formatting;
@ -24,6 +25,13 @@ namespace Volo.Docs.Pages.Documents.Project
public List<VersionInfo> Versions { get; private set; }
public List<SelectListItem> VersionSelectItems => Versions.Select(v => new SelectListItem
{
Text = v.DisplayText,
Value = "/documents/" + ProjectName + "/" + v.Version + "/" + DocumentName,
Selected = v.IsSelected
}).ToList();
public NavigationWithDetailsDto Navigation { get; private set; }
private readonly IDocumentAppService _documentAppService;
@ -95,7 +103,5 @@ namespace Volo.Docs.Pages.Documents.Project
Versions.Insert(0, DocsWebConsts.DefaultVersion);
}
}
}
Loading…
Cancel
Save