mirror of https://github.com/abpframework/abp.git
8 changed files with 119 additions and 0 deletions
@ -0,0 +1,27 @@ |
|||
@using Volo.Abp.Users |
|||
@inject ICurrentUser CurrentUser |
|||
|
|||
@if (CurrentUser.IsAuthenticated) |
|||
{ |
|||
<div class="my-simple-widget"> |
|||
<h2>My Simple Widget</h2> |
|||
<p>This is a simple widget!</p> |
|||
</div> |
|||
} |
|||
|
|||
<div class="rate"> |
|||
<input type="radio" id="star5" name="rate" value="5"/> |
|||
<label for="star5" title="5 stars"></label> |
|||
|
|||
<input type="radio" id="star4" name="rate" value="4"/> |
|||
<label for="star4" title="4 stars"></label> |
|||
|
|||
<input type="radio" id="star3" name="rate" value="3"/> |
|||
<label for="star3" title="3 stars"></label> |
|||
|
|||
<input type="radio" id="star2" name="rate" value="2"/> |
|||
<label for="star2" title="2 stars"></label> |
|||
|
|||
<input type="radio" id="star1" name="rate" value="1"/> |
|||
<label for="star1" title="1 star"></label> |
|||
</div> |
|||
@ -0,0 +1,13 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Rating |
|||
{ |
|||
public class RatingScriptBundleContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/Pages/CmsKit/Shared/Components/Rating/default.js"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Rating |
|||
{ |
|||
public class RatingStyleBundleContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/Pages/CmsKit/Shared/Components/Rating/default.css"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; |
|||
|
|||
namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Rating |
|||
{ |
|||
[ViewComponent(Name = "CmsRating")] |
|||
[Widget( |
|||
StyleTypes = new[] {typeof(RatingStyleBundleContributor)}, |
|||
ScriptTypes = new[] {typeof(RatingScriptBundleContributor)}, |
|||
RefreshUrl = "/CmsKitPublicWidgets/Rating" |
|||
)] |
|||
public class RatingViewComponent : AbpViewComponent |
|||
{ |
|||
public IViewComponentResult Invoke() |
|||
{ |
|||
return View("~/Pages/CmsKit/Shared/Components/Rating/Default.cshtml"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
.rate { |
|||
float: left; |
|||
height: 46px; |
|||
padding: 0 10px; |
|||
} |
|||
.rate:not(:checked) > input { |
|||
position:absolute; |
|||
top:-9999px; |
|||
} |
|||
.rate:not(:checked) > label { |
|||
float:right; |
|||
width:1em; |
|||
overflow:hidden; |
|||
white-space:nowrap; |
|||
cursor:pointer; |
|||
font-size:30px; |
|||
color:#ccc; |
|||
} |
|||
.rate:not(:checked) > label:before { |
|||
content: '★ '; |
|||
} |
|||
.rate > input:checked ~ label { |
|||
color: #ffc700; |
|||
} |
|||
.rate:not(:checked) > label:hover, |
|||
.rate:not(:checked) > label:hover ~ label { |
|||
color: #deb217; |
|||
} |
|||
.rate > input:checked + label:hover, |
|||
.rate > input:checked + label:hover ~ label, |
|||
.rate > input:checked ~ label:hover, |
|||
.rate > input:checked ~ label:hover ~ label, |
|||
.rate > label:hover ~ input:checked ~ label { |
|||
color: #c59b08; |
|||
} |
|||
@ -0,0 +1 @@ |
|||
|
|||
Loading…
Reference in new issue