mirror of https://github.com/abpframework/abp
parent
c55ac614b0
commit
9842510325
@ -1,42 +1,49 @@
|
||||
@inject ICurrentUser CurrentUser
|
||||
@inject IHtmlLocalizer<CmsKitResource> L
|
||||
@using Volo.Abp.Users
|
||||
@using Volo.CmsKit.Localization
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@model Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.ReactionSelection.ReactionSelectionViewComponent.ReactionSelectionViewModel
|
||||
|
||||
@if (CurrentUser.IsAuthenticated || Model.Reactions.Count(r => r.Count > 0) > 0)
|
||||
{
|
||||
<div class="p-3 my-3 card">
|
||||
<div class="row">
|
||||
<div class="col-auto text-left">
|
||||
<span class="area-title">
|
||||
Reactions
|
||||
</span>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<span class="cms-reaction-area" data-entity-type="@Model.EntityType" data-entity-id="@Model.EntityId">
|
||||
|
||||
@foreach (var reaction in Model.Reactions.Where(r => r.Count > 0))
|
||||
{
|
||||
<span class="ml-1 cms-reaction-icon @(reaction.IsSelectedByCurrentUser ? "cms-reaction-icon-selected" : "")" data-reaction-name="@reaction.Name" data-click-action="@(CurrentUser.IsAuthenticated ? "true" : "false")">
|
||||
<i class="@reaction.Icon"></i>
|
||||
<small class="text-muted" style="opacity: .45;">@(reaction.Count)</small>
|
||||
</span>
|
||||
}
|
||||
@if (CurrentUser.IsAuthenticated)
|
||||
{
|
||||
<a class="cms-reaction-select-icon btn btn-secondary text-light btn-sm py-1 ml-2" href="javascript:;">
|
||||
<i class="fa fa-smile-o"></i>
|
||||
</a>
|
||||
<div class="cms-reaction-selection-popover-content" style="display: none">
|
||||
@foreach (var reaction in Model.Reactions)
|
||||
{
|
||||
<span class="m-2 p-2 w-25 d-inline-block text-center cms-reaction-icon @(reaction.IsSelectedByCurrentUser ? "shadow-sm bg-light rounded cms-reaction-icon-selected" : "")" data-reaction-name="@reaction.Name">
|
||||
<i class="@reaction.Icon fa-2x"></i>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
<div class="p-3 my-3 card">
|
||||
<div class="row">
|
||||
<div class="col-auto text-left">
|
||||
<span class="area-title">
|
||||
Reactions
|
||||
</span>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<span class="cms-reaction-area" data-entity-type="@Model.EntityType" data-entity-id="@Model.EntityId">
|
||||
|
||||
@foreach (var reaction in Model.Reactions.Where(r => r.Count > 0))
|
||||
{
|
||||
<span class="ml-1 cms-reaction-icon @(reaction.IsSelectedByCurrentUser ? "cms-reaction-icon-selected" : "")" data-reaction-name="@reaction.Name" data-click-action="@(CurrentUser.IsAuthenticated ? "true" : "false")">
|
||||
<i class="@reaction.Icon"></i>
|
||||
<small class="text-muted" style="opacity: .45;">@(reaction.Count)</small>
|
||||
</span>
|
||||
}
|
||||
@if (CurrentUser.IsAuthenticated)
|
||||
{
|
||||
<a class="cms-reaction-select-icon btn btn-secondary text-light btn-sm py-1 ml-2" href="javascript:;">
|
||||
<i class="fa fa-smile-o"></i>
|
||||
</a>
|
||||
<div class="cms-reaction-selection-popover-content" style="display: none">
|
||||
@foreach (var reaction in Model.Reactions)
|
||||
{
|
||||
<span class="m-2 p-2 w-25 d-inline-block text-center cms-reaction-icon @(reaction.IsSelectedByCurrentUser ? "shadow-sm bg-light rounded cms-reaction-icon-selected" : "")" data-reaction-name="@reaction.Name">
|
||||
<i class="@reaction.Icon fa-2x"></i>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="ms-reaction-select-icon btn btn-secondary text-light btn-sm py-1 ml-2" data-authenticated="True" data-toggle="popover" data-placement="right" data-html="true" data-content="<div class='text-center'><a href='@Model.LoginUrl' class='btn btn-primary btn-block'>@L["LoginToReact"]</a></div>">
|
||||
<i class="fa fa-smile-o"></i>
|
||||
</span>
|
||||
}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
Loading…
Reference in new issue