Skip to content

Commit

Permalink
Public link
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriaWei committed Sep 26, 2024
1 parent e84ebbc commit a00f350
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
25 changes: 10 additions & 15 deletions src/ZKEACMS.Article/Views/Article/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@
@{
Script.Reqiured("validate").AtFoot();
Script.Reqiured("tinymce").AtFoot();
string publicUrl = articleUrlService.GetPublicUrl(Model).FirstOrDefault();
string publicUrl = articleUrlService.GetPublicUrl(Model)?.FirstOrDefault();
}
@inject ZKEACMS.Article.Service.IArticleUrlService articleUrlService
<div class="panel panel-default">
<div class="panel-heading">
@L("Edit")
<span class="pull-right">
@if (!Model.IsPublish)
{
<span class="badge">
@L("Unpublished")
</span>
}
else
{
<a href="@Url.PathContent(publicUrl)" target="_blank" class="badge">
@L("Published")
</a>
}
<span class="badge">
@(Model.IsPublish ? L("Published") : L("Unpublished"))
</span>
@if (Model.IsPublish && publicUrl.IsNotNullAndWhiteSpace())
{
<span class="pull-right">
<a href="@Url.PathContent(publicUrl)" target="_blank" class="badge glyphicon glyphicon-share-alt">
</a>
</span>
}
</div>
<div class="panel-body">
@using (Html.BeginForm())
Expand Down
25 changes: 10 additions & 15 deletions src/ZKEACMS.Product/Views/Product/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@
@{
Script.Reqiured("validate").AtFoot();
Script.Reqiured("tinymce").AtFoot();
string publicUrl = productUrlService.GetPublicUrl(Model).FirstOrDefault();
string publicUrl = productUrlService.GetPublicUrl(Model)?.FirstOrDefault();
}
@inject ZKEACMS.Product.Service.IProductUrlService productUrlService
<div class="panel panel-default">
<div class="panel-heading">
@L("Edit")
<span class="pull-right">
@if (!Model.IsPublish)
{
<span class="badge">
@L("Unpublished")
</span>
}
else
{
<a href="@Url.PathContent(publicUrl)" target="_blank" class="badge">
@L("Published")
</a>
}
<span class="badge">
@(Model.IsPublish ? L("Published") : L("Unpublished"))
</span>
@if (Model.IsPublish && publicUrl.IsNotNullAndWhiteSpace())
{
<span class="pull-right">
<a href="@Url.PathContent(publicUrl)" target="_blank" class="badge glyphicon glyphicon-share-alt">
</a>
</span>
}
</div>
<div class="panel-body">
@using (Html.BeginForm())
Expand Down

0 comments on commit a00f350

Please sign in to comment.