Skip to content

Commit a017813

Browse files
committed
Version 1.3
1 parent a15f531 commit a017813

File tree

7 files changed

+37
-27
lines changed

7 files changed

+37
-27
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The goal of this project is to "blogify" ASP.NET applications; Blogifier.Core bu
44

55
## Demo site
66

7-
The [demo site](http://blogifier.azurewebsites.net) is a playground you can use to check out Blogifier features. You can register new user and write post to test admin panel.
7+
The [demo site](http://blogifiercore.azurewebsites.net) is a playground you can use to check out Blogifier features. You can register new user and write post to test admin panel.
88

99
![demo site](https://user-images.githubusercontent.com/1932785/30626484-dfc57f74-9d8f-11e7-9896-4dedcaad641b.PNG)
1010

@@ -31,7 +31,7 @@ Designed for cross-platform development, every build pushed to Windows and Linux
3131
```
3232
Install-Package Blogifier.Core
3333
```
34-
3. Configure services and application in Startup.cs to use Blogifier:
34+
3. Configure services and application in Startup.cs to use Blogifier (example for MS SQL Server):
3535
```csharp
3636
public void ConfigureServices(IServiceCollection services)
3737
{

samples/WebApp/Data/core.db

0 Bytes
Binary file not shown.

samples/WebApp/Views/Blogifier/Admin/Custom/Index.cshtml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,19 @@
4747
<span class="item-info-date" aria-label="Publish date">@publishedLbl</span>
4848
</div>
4949
<span class="item-status @publishedClass"><i class="fa fa-circle"></i></span>
50-
<button class="btn-unstyled item-favorite" onclick="postsController.featured('@item.BlogPostId', this)">
51-
@if (item.IsFeatured)
52-
{
53-
<i class="fa fa-star"></i>
54-
}
55-
else
56-
{
57-
<i class="fa fa-star-o"></i>
58-
}
59-
</button>
50+
@if (Model.Profile.IsAdmin)
51+
{
52+
<button class="btn-unstyled item-favorite" onclick="postsController.featured('@item.BlogPostId', this)">
53+
@if (item.IsFeatured)
54+
{
55+
<i class="fa fa-star"></i>
56+
}
57+
else
58+
{
59+
<i class="fa fa-star-o"></i>
60+
}
61+
</button>
62+
}
6063
<a class="item-show" href="~/@ApplicationSettings.BlogRoute@item.Slug" target="_blank" role="button"><i class="fa fa-external-link-square"></i></a>
6164
</li>
6265
}

samples/WebApp/appsettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"Blogifier": {
1212
"BlogRoute": "blog/",
1313
"SingleBlog": false,
14-
"Title": "Blogifier.Core Demo",
15-
"Description": "This is a demo site to showcase Blogifier.Core features and capabilities",
14+
"Title": "Blogifier.Core",
15+
"Description": "Blogifier.Core sample application",
1616
"AdminTheme": "Standard",
1717
"BlogTheme": "OneTwo"
1818
}

src/Blogifier.Core/Blogifier.Core.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.0</TargetFramework>
5-
<AssemblyVersion>1.2.5.0</AssemblyVersion>
6-
<FileVersion>1.2.5.0</FileVersion>
7-
<Version>1.2.5.0</Version>
5+
<AssemblyVersion>1.3.0.0</AssemblyVersion>
6+
<FileVersion>1.3.0.0</FileVersion>
7+
<Version>1.3.0.0</Version>
88
<Authors>blogifierdotnet</Authors>
99
<Company>Blogifier</Company>
1010
<Description>Blogifier.Core will add full-featured, multi-user blog to your ASP.NET Core application. Along with administration panel to create, update and publish posts, upload files and images, expose RSS feed to subscribers and more.</Description>

src/Blogifier.Core/Controllers/Api/PostsController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ public IActionResult Unpublish(int id)
129129
[HttpPut("featured/{id:int}")]
130130
public IActionResult Featured(int id, string act = "add")
131131
{
132+
var profile = GetProfile();
133+
if (!profile.IsAdmin)
134+
return Unauthorized();
135+
132136
var post = _db.BlogPosts.Single(p => p.Id == id);
133137
if (post == null)
134138
return NotFound();

src/Blogifier.Core/Views/Blogifier/Admin/Standard/Index.cshtml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,19 @@
4747
<span class="item-info-date" aria-label="Publish date">@publishedLbl</span>
4848
</div>
4949
<span class="item-status @publishedClass"><i class="fa fa-circle"></i></span>
50-
<button class="btn-unstyled item-favorite" onclick="postsController.featured('@item.BlogPostId', this)">
51-
@if (item.IsFeatured)
52-
{
53-
<i class="fa fa-star"></i>
54-
}
55-
else
56-
{
57-
<i class="fa fa-star-o"></i>
58-
}
59-
</button>
50+
@if (Model.Profile.IsAdmin)
51+
{
52+
<button class="btn-unstyled item-favorite" onclick="postsController.featured('@item.BlogPostId', this)">
53+
@if (item.IsFeatured)
54+
{
55+
<i class="fa fa-star"></i>
56+
}
57+
else
58+
{
59+
<i class="fa fa-star-o"></i>
60+
}
61+
</button>
62+
}
6063
<a class="item-show" href="~/@ApplicationSettings.BlogRoute@item.Slug" target="_blank" role="button"><i class="fa fa-external-link-square"></i></a>
6164
</li>
6265
}

0 commit comments

Comments
 (0)