Skip to content

Commit

Permalink
Merge pull request abpframework#20025 from abpframework/8.1-cmskit-de…
Browse files Browse the repository at this point in the history
…sign

Set a ratio to the CMS Kit blog post images
  • Loading branch information
oykuermann authored Jun 13, 2024
2 parents 394edd6 + 878cd16 commit 5d7d992
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
<abp-card-header title="@L["New"].Value"></abp-card-header>
<abp-card-body>
<div class="mb-3">
<label class="form-label">@L["CoverImage"]</label>
<input type="file" id="BlogPostCoverImage" class="form-control" />
<label class="form-label">@L["CoverImage"] <span class="badge text-bg-light">16:9</span></label>
<input type="file" id="BlogPostCoverImage" class="form-control" accept="image/*" />
</div>

<form asp-page="/CmsKit/BlogPosts/Create" id="form-blog-post-create">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<br/>
}
</div>
<label class="form-label">@L["CoverImage"]</label>
<input type="file" id="BlogPostCoverImage" class="form-control"/>
<label class="form-label">@L["CoverImage"]<span class="badge text-bg-light">16:9</span></label>
<input type="file" id="BlogPostCoverImage" class="form-control" accept="image/*" />
</div>

<form asp-page="/CmsKit/BlogPosts/Update" id="form-blog-post-update">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<div class="row">
<div @Html.Raw(isScrollIndexEnabled ? "class=\"col-md-10 col-sm-12\"" : "class=\"col-md-12\"")>
<abp-card class="mb-4">
<img src="/api/cms-kit/media/@Model.ViewModel.CoverImageMediaId" class="card-img-top" onerror="this.src='@dummyImageSource'" />
<img src="/api/cms-kit/media/@Model.ViewModel.CoverImageMediaId" class="card-img-ratio" onerror="this.src='@dummyImageSource'" />
<input hidden id="BlogId" value="@Model.ViewModel.Id" />
<abp-card-body>
<abp-row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<span class="font-weight-bold author-name-span" data-author-id="@blog.Author.Id">@@@blog.Author?.UserName</span>
<small style="opacity:.65;">@blog.CreationTime</small>
</p>
<p style="min-height: 60px;">@blog.ShortDescription</p>
<p class="cms-blogpost-desc-preview">@blog.ShortDescription</p>
<div class="d-grid gap-2">
<a href="/@CmsBlogsWebConsts.BlogsRoutePrefix/@Model.BlogSlug/@blog.Slug" class="btn btn-light">
@L["Read"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ span.area-title {
min-width: 276px;
}

.card-img-ratio {
aspect-ratio: 16 / 9;
object-fit: cover;
}

#scroll-index {
position: sticky;
top: 20px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.card-img-top {
.card-img-top {
aspect-ratio: 16 / 9;
object-fit: cover;
}

.popover {
Expand All @@ -7,4 +9,12 @@

.author-name-span{
cursor: pointer;
}

.cms-blogpost-desc-preview {
min-height: 60px;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}

0 comments on commit 5d7d992

Please sign in to comment.