The blogspot iis now in the PostIt app,
All checks were successful
Dotnet build and test / build (pull_request) Successful in 21m55s
All checks were successful
Dotnet build and test / build (pull_request) Successful in 21m55s
no more creation/edition from here
This commit is contained in:
parent
6a69a20364
commit
efc2296858
7 changed files with 2 additions and 292 deletions
|
|
@ -90,73 +90,6 @@ namespace Yavsc.Org.Controllers
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: Blog/Create
|
|
||||||
[Authorize()]
|
|
||||||
public IActionResult Create(string title)
|
|
||||||
{
|
|
||||||
var result = new BlogPostEditViewModel
|
|
||||||
(new Models.Blog.BlogPost
|
|
||||||
{
|
|
||||||
Title = title
|
|
||||||
}, true);
|
|
||||||
SetLangItems();
|
|
||||||
return View(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST: Blog/Create
|
|
||||||
[HttpPost, Authorize, ValidateAntiForgeryToken]
|
|
||||||
public IActionResult Create(Models.Blog.BlogPost blogInput)
|
|
||||||
{
|
|
||||||
if (ModelState.IsValid)
|
|
||||||
{
|
|
||||||
var uid = User.GetUserId();
|
|
||||||
Models.Blog.BlogPost post = blogSpotService.Create(uid, blogInput);
|
|
||||||
blogSpotService.AttachFiles(Request.Form.Files, uid, post.Id);
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
return View("Edit", blogInput);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Authorize()]
|
|
||||||
// GET: Blog/Edit/5
|
|
||||||
public async Task<IActionResult> Edit(long? id)
|
|
||||||
{
|
|
||||||
if (id == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var blog = await blogSpotService.GetPostForEdition(User, id.Value);
|
|
||||||
if (blog == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SetLangItems();
|
|
||||||
return View(blog);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (AuthorizationFailureException)
|
|
||||||
{
|
|
||||||
return new ChallengeResult();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// POST: Blog/Edit/5
|
|
||||||
[HttpPost]
|
|
||||||
[ValidateAntiForgeryToken, Authorize()]
|
|
||||||
public async Task<IActionResult> Edit(BlogPostEditViewModel blogEdit)
|
|
||||||
{
|
|
||||||
if (ModelState.IsValid)
|
|
||||||
{
|
|
||||||
await blogSpotService.Modify(User, blogEdit);
|
|
||||||
ViewBag.StatusMessage = "Post modified";
|
|
||||||
return RedirectToAction("Index");
|
|
||||||
}
|
|
||||||
return View(blogEdit);
|
|
||||||
}
|
|
||||||
|
|
||||||
// GET: Blog/Delete/5
|
// GET: Blog/Delete/5
|
||||||
[ActionName("Delete"), Authorize()]
|
[ActionName("Delete"), Authorize()]
|
||||||
|
|
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
@model BlogPostEditViewModel
|
|
||||||
|
|
||||||
@{
|
|
||||||
ViewBag.Title = "Blog post edition";
|
|
||||||
}
|
|
||||||
|
|
||||||
@section header {
|
|
||||||
|
|
||||||
<link href="~/css/main/dropzone.css" rel="stylesheet">
|
|
||||||
<link href="~/css/dropzone-basic.min.css" rel="stylesheet">
|
|
||||||
<script src="~/js/dropzone.bundle.min.js" asp-append-version="true"></script>
|
|
||||||
|
|
||||||
@{ await Html.RenderPartialAsync("_FSScriptsPartial"); }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
<h2>Blog post</h2>
|
|
||||||
<label><input type="checkbox" id="vcbtn" />Editer le code source Markdown</label>
|
|
||||||
|
|
||||||
<div asp-validation-summary="All" class="text-danger"></div>
|
|
||||||
|
|
||||||
<img class="blogphoto" alt="" src="@Model.Photo" title="Photo associée au post">
|
|
||||||
<h2 title="Titre du post" class="blogtitle" id="titleview" >@Model.Title</h2>
|
|
||||||
|
|
||||||
<div title="Contenu du post" id="contentview">@Model.Article</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<form asp-controller="Blogspot" asp-action="Create">
|
|
||||||
<div class="form-horizontal">
|
|
||||||
|
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
|
||||||
|
|
||||||
<div class="form-group mdcoding">
|
|
||||||
<label asp-for="Title" class="col-md-2 control-label"></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
<input asp-for="Title" class="form-control" data-from="titleview"/>
|
|
||||||
<span asp-validation-for="Title" class="text-danger" >
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label asp-for="Photo" class="col-md-2 control-label"></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
<input asp-for="Photo" class="form-control" />
|
|
||||||
<span asp-validation-for="Photo" class="text-danger" >
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group mdcoding">
|
|
||||||
<label asp-for="Article" class="col-md-2 control-label" ></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
<textarea asp-for="Article" class="form-control" id="Article" data-from="contentview">
|
|
||||||
</textarea>
|
|
||||||
<span asp-validation-for="Article" class="text-danger" >
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label asp-for="ACL" class="col-md-2 control-label"></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
@await Component.InvokeAsync("CirclesControl", Model)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label asp-for="Publish" class="col-md-2 control-label"></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
<input asp-for="Publish" class="form-control" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-md-offset-2 col-md-10">
|
|
||||||
<button class="btn btn-primary" >Save</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
@await Component.InvokeAsync(name: "Directory",arguments: new {subdir="."})
|
|
||||||
<div >
|
|
||||||
@{ await Html.RenderPartialAsync("_PostFilesPartial"); }
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a asp-action="Index">Back to List</a>
|
|
||||||
</div>
|
|
||||||
|
|
@ -98,8 +98,5 @@ $('#commentValidation').html(
|
||||||
<p><i>Vous devez être identifié pour commenter.</i> </p>
|
<p><i>Vous devez être identifié pour commenter.</i> </p>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if ((await AuthorizationService.AuthorizeAsync(User, Model, new EditPermission())).Succeeded) {
|
|
||||||
<a asp-action="Edit" asp-route-id="@Model.Id" class="btn btn-link">Edit</a>
|
|
||||||
}
|
|
||||||
<a asp-action="Index" class="btn btn-link">Back to List</a>
|
<a asp-action="Index" class="btn btn-link">Back to List</a>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,120 +0,0 @@
|
||||||
@model BlogPostEditViewModel
|
|
||||||
@{
|
|
||||||
ViewBag.Title = "Blog post edition";
|
|
||||||
}
|
|
||||||
|
|
||||||
@section header {
|
|
||||||
|
|
||||||
<link href="~/css/main/dropzone.css" rel="stylesheet">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.box__dragndrop,
|
|
||||||
.box__uploading,
|
|
||||||
.box__success,
|
|
||||||
.box__error {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box.has-advanced-upload {
|
|
||||||
background-color: white;
|
|
||||||
outline: 2px dashed black;
|
|
||||||
outline-offset: -10px;
|
|
||||||
}
|
|
||||||
.box.has-advanced-upload .box__dragndrop {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
.box.is-dragover {
|
|
||||||
background-color: grey;
|
|
||||||
}
|
|
||||||
.ql-snow.ql-toolbar {
|
|
||||||
border: outset grey 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
<script src="~/js/dropzone.bundle.min.js" asp-append-version="true"></script>
|
|
||||||
|
|
||||||
|
|
||||||
@{ await Html.RenderPartialAsync("_FSScriptsPartial"); }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
<h2 >Blog post</h2>
|
|
||||||
<label><input type="checkbox" id="vcbtn" />Editer le code source Markdown</label>
|
|
||||||
|
|
||||||
<div asp-validation-summary="All" class="text-danger"></div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="Titletoolbar" class="hidden ql-snow ql-toolbar">
|
|
||||||
<button class="ql-format-button ql-italic"></button>
|
|
||||||
<button class="ql-format-button ql-underline"></button>
|
|
||||||
<button class="ql-format-button ql-strike"></button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<img class="blogphoto" alt="" src="@Model.Photo" title="Photo associée au post">
|
|
||||||
<h2 title="Titre du post" class="blogtitle" id="titleview" >@Model.Title</h2>
|
|
||||||
|
|
||||||
<form asp-action="Edit">
|
|
||||||
<div class="form-horizontal">
|
|
||||||
|
|
||||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
|
||||||
@Html.HiddenFor(m=>m.Id)
|
|
||||||
|
|
||||||
<div class="form-group mdcoding">
|
|
||||||
<label asp-for="Title" class="col-md-2 control-label"></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
<input asp-for="Title" class="form-control" data-from="titleview"/>
|
|
||||||
<span asp-validation-for="Title" class="text-danger" >
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label asp-for="Photo" class="col-md-2 control-label"></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
<input asp-for="Photo" class="form-control" />
|
|
||||||
<span asp-validation-for="Photo" class="text-danger" >
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group mdcoding">
|
|
||||||
<label asp-for="Article" class="col-md-2 control-label" ></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
<textarea asp-for="Article" class="form-control"
|
|
||||||
id="Article" data-from="contentview">
|
|
||||||
</textarea>
|
|
||||||
<span asp-validation-for="Article" class="text-danger" >
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label asp-for="ACL" class="col-md-2 control-label"></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
@await Component.InvokeAsync("CirclesControl", Model)
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label asp-for="Publish" class="col-md-2 control-label"></label>
|
|
||||||
<div class="col-md-10">
|
|
||||||
<input type="checkbox" asp-for="Publish" class="form-control" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-md-offset-2 col-md-10">
|
|
||||||
<input type="submit" value="Save" class="btn btn-primary" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
@await Component.InvokeAsync("Directory","")
|
|
||||||
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<div >
|
|
||||||
@{ await Html.RenderPartialAsync("_PostFilesPartial"); }
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<a asp-action="Index">Back to List</a>
|
|
||||||
</div>
|
|
||||||
|
|
@ -39,11 +39,6 @@
|
||||||
}
|
}
|
||||||
<h2>@ViewBag.Title</h2>
|
<h2>@ViewBag.Title</h2>
|
||||||
<p class="text-success">@ViewBag.StatusMessage</p>
|
<p class="text-success">@ViewBag.StatusMessage</p>
|
||||||
@if (User.IsSignedIn()) {
|
|
||||||
<p>
|
|
||||||
<a asp-action="Create">Create a new article</a>
|
|
||||||
</p>
|
|
||||||
}
|
|
||||||
|
|
||||||
<div class="blog-index">
|
<div class="blog-index">
|
||||||
@{
|
@{
|
||||||
|
|
@ -78,8 +73,6 @@
|
||||||
}
|
}
|
||||||
@if ((await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded)
|
@if ((await AuthorizationService.AuthorizeAsync(User, post, new EditPermission())).Succeeded)
|
||||||
{
|
{
|
||||||
<a asp-action="Edit" asp-route-id="@post.Id" class="btn btn-primary">Edit</a>
|
|
||||||
|
|
||||||
<a asp-action="Delete" asp-route-id="@post.Id" class="btn btn-danger">Delete</a>
|
<a asp-action="Delete" asp-route-id="@post.Id" class="btn btn-danger">Delete</a>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,6 @@
|
||||||
<h2 markdown="@ViewBag.Title"></h2>
|
<h2 markdown="@ViewBag.Title"></h2>
|
||||||
<p class="text-success">@ViewBag.StatusMessage</p>
|
<p class="text-success">@ViewBag.StatusMessage</p>
|
||||||
|
|
||||||
<p>
|
|
||||||
<a asp-action="Create" asp-route-title="@ViewBag.Title">Poster au même titre</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
|
|
||||||
@foreach (var item in Model) {
|
@foreach (var item in Model) {
|
||||||
|
|
@ -32,8 +28,7 @@
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
@if ((await AuthorizationService.AuthorizeAsync(User, item, new EditPermission())).Succeeded) {
|
@if ((await AuthorizationService.AuthorizeAsync(User, item, new EditPermission())).Succeeded) {
|
||||||
<li><a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-primary">Edit</a>
|
|
||||||
</li>
|
|
||||||
<li><a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Delete</a>
|
<li><a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Delete</a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue