2017-10-04 23:53:47 +02:00
|
|
|
@model BlogPost
|
2016-05-17 18:22:18 +02:00
|
|
|
|
|
|
|
|
@{
|
|
|
|
|
ViewData["Title"] = SR["Blog post edition"];
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-01 01:31:55 +01:00
|
|
|
@section header {
|
2016-08-03 16:38:25 +02:00
|
|
|
|
2017-03-29 10:38:37 +02:00
|
|
|
<link href="~/css/main/quill.snow.css" rel="stylesheet">
|
|
|
|
|
<link href="~/css/main/dropzone.css" rel="stylesheet">
|
2016-05-17 18:22:18 +02:00
|
|
|
|
|
|
|
|
<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>
|
2017-01-25 10:42:26 +01:00
|
|
|
<script src="~/js/dropzone.js"></script>
|
|
|
|
|
<script src="~/js/quill.js"></script>
|
|
|
|
|
<script src="~/js/to-markdown.js"></script>
|
2019-09-01 01:31:55 +01:00
|
|
|
|
|
|
|
|
|
2019-08-25 01:47:46 +01:00
|
|
|
@{ await Html.RenderPartialAsync("_FSScriptsPartial"); }
|
2019-09-01 01:31:55 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@section scripts {
|
2016-05-17 18:22:18 +02:00
|
|
|
<script>
|
2019-09-05 21:04:57 +01:00
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
2019-09-01 01:31:55 +01:00
|
|
|
if (typeof(allowCircleToBlog) !== 'undefined') {
|
|
|
|
|
$('input.Blogcirle[type=checkbox]').on('change', allowCircleToBlog);
|
|
|
|
|
}
|
2017-01-24 15:07:27 +01:00
|
|
|
$(".mdcoding").addClass('hidden');
|
2019-09-05 21:04:57 +01:00
|
|
|
$("#contentview").on('drop', function(){drop(event);});
|
|
|
|
|
$("#contentview").on('dragover', function(){allowDrop(event);});
|
2017-01-24 15:07:27 +01:00
|
|
|
var onchange = function(){
|
|
|
|
|
var nv = $(this).val();
|
|
|
|
|
var tid = $(this).data('from');
|
2017-01-24 15:42:21 +01:00
|
|
|
$('#'+tid).html(htmlize(nv));
|
2017-01-24 15:07:27 +01:00
|
|
|
};
|
2019-09-05 21:04:57 +01:00
|
|
|
|
2017-01-24 15:07:27 +01:00
|
|
|
$("#Content").change(onchange);
|
|
|
|
|
$("#Title").change(onchange);
|
|
|
|
|
$('#vcbtn').change(function(){
|
|
|
|
|
var vc = $(this).prop('checked');
|
|
|
|
|
if (vc) {
|
|
|
|
|
$("#contentview").addClass('hidden');
|
|
|
|
|
$("#titleview").addClass('hidden');
|
|
|
|
|
$(".mdcoding").removeClass('hidden');
|
|
|
|
|
} else {
|
|
|
|
|
$("#contentview").removeClass('hidden');
|
|
|
|
|
$("#titleview").removeClass('hidden');
|
|
|
|
|
$(".mdcoding").addClass('hidden');
|
|
|
|
|
}
|
|
|
|
|
});
|
2016-05-17 18:22:18 +02:00
|
|
|
|
2017-01-24 15:42:21 +01:00
|
|
|
var initQuill = function() {
|
|
|
|
|
var editortitre = new Quill('#titleview', {
|
|
|
|
|
modules: { toolbar: '#Titletoolbar' },
|
|
|
|
|
theme: 'snow'
|
|
|
|
|
});
|
|
|
|
|
var editorcontenu = new Quill('#contentview', {
|
|
|
|
|
modules: { toolbar: '#contentbar' },
|
|
|
|
|
theme: 'snow'
|
|
|
|
|
});
|
|
|
|
|
editortitre.on('selection-change', function(range) {
|
|
|
|
|
if (range) {
|
|
|
|
|
$('#contentbar').addClass('hidden');
|
|
|
|
|
$('#Titletoolbar').removeClass('hidden');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
editortitre.on('text-change',function(delta,source){
|
|
|
|
|
if (source=='user')
|
|
|
|
|
{
|
2017-10-22 13:06:51 +02:00
|
|
|
updateMD('Title',$('#ql-editor-1').html())
|
2017-01-24 15:42:21 +01:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
editorcontenu.on('selection-change', function(range) {
|
|
|
|
|
if (range) {
|
|
|
|
|
$('#contentbar').removeClass('hidden');
|
|
|
|
|
$('#Titletoolbar').addClass('hidden');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
editorcontenu.on('text-change',function(delta,source){
|
|
|
|
|
if (source=='user')
|
|
|
|
|
{
|
2017-10-22 13:06:51 +02:00
|
|
|
updateMD('Content',$('#ql-editor-2').html())
|
2017-01-24 15:42:21 +01:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
initQuill();
|
2016-05-17 18:22:18 +02:00
|
|
|
|
2019-08-25 01:47:46 +01:00
|
|
|
|
2016-05-30 18:30:35 +02:00
|
|
|
|
2016-05-17 18:22:18 +02:00
|
|
|
});
|
|
|
|
|
</script>
|
2016-08-03 16:38:25 +02:00
|
|
|
@Html.Partial("_ValidationScriptsPartial")
|
2019-09-01 01:31:55 +01:00
|
|
|
|
2016-05-17 18:22:18 +02:00
|
|
|
}
|
|
|
|
|
<h2 > @SR["Blog post edition"] </h2>
|
2017-01-24 15:07:27 +01:00
|
|
|
<label><input type="checkbox" id="vcbtn" />Editer le code source Markdown</label>
|
2016-05-17 18:22:18 +02:00
|
|
|
|
2017-05-27 18:29:17 +02:00
|
|
|
<div asp-validation-summary="ValidationSummary.All" class="text-danger"></div>
|
2017-01-20 14:20:44 +01:00
|
|
|
|
|
|
|
|
|
2016-08-02 17:02:38 +02:00
|
|
|
<div id="Titletoolbar" class="hidden ql-snow ql-toolbar">
|
2016-05-17 18:22:18 +02:00
|
|
|
<button class="ql-format-button ql-bold"></button>
|
|
|
|
|
<button class="ql-format-button ql-italic"></button>
|
2016-08-03 16:38:25 +02:00
|
|
|
<button class="ql-format-button ql-underline"></button>
|
2016-05-17 18:22:18 +02:00
|
|
|
<button class="ql-format-button ql-strike"></button>
|
|
|
|
|
</div>
|
|
|
|
|
|
2017-01-31 13:22:30 +01:00
|
|
|
|
2017-05-27 18:29:17 +02:00
|
|
|
<img class="blogphoto" alt="" src="@Model.Photo" title="Photo associée au post">
|
|
|
|
|
<h2 title="Titre du post" class="blogtitle" id="titleview" ismarkdown>@Model.Title</h2>
|
2016-05-17 18:22:18 +02:00
|
|
|
|
|
|
|
|
<div id="contentbar" class="hidden ql-snow ql-toolbar">
|
2016-08-03 16:38:25 +02:00
|
|
|
<span class="ql-format-group">
|
2016-05-17 18:22:18 +02:00
|
|
|
<button class="ql-format-button ql-bold"></button>
|
|
|
|
|
<button class="ql-format-button ql-italic"></button>
|
|
|
|
|
<button class="ql-format-button ql-underline"></button>
|
|
|
|
|
<button class="ql-format-button ql-strike"></button>
|
2016-08-03 16:38:25 +02:00
|
|
|
<environment names="Development">
|
2016-05-17 18:22:18 +02:00
|
|
|
<button class="ql-format-button ql-link"></button>
|
2016-08-03 16:38:25 +02:00
|
|
|
<button class="ql-format-button ql-image"></button>
|
2017-10-15 22:36:30 +02:00
|
|
|
<button class="ql-format-button ql-video"></button>
|
|
|
|
|
<button class="ql-format-button ql-file"></button>
|
2016-08-03 16:38:25 +02:00
|
|
|
</environment>
|
2016-05-17 18:22:18 +02:00
|
|
|
</span>
|
|
|
|
|
<span class="ql-format-group">
|
|
|
|
|
<span title="List" class="ql-format-button ql-list"></span>
|
|
|
|
|
<span class="ql-format-separator"></span>
|
|
|
|
|
<span title="Bullet" class="ql-format-button ql-bullet"></span>
|
|
|
|
|
<span class="ql-format-separator"></span>
|
|
|
|
|
<select title="Text Alignment" class="ql-align">
|
|
|
|
|
<option value="left" label="Left" selected=""></option>
|
|
|
|
|
<option value="center" label="Center"></option>
|
|
|
|
|
<option value="right" label="Right"></option>
|
|
|
|
|
<option value="justify" label="Justify"></option>
|
|
|
|
|
</select>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
2017-10-22 13:06:51 +02:00
|
|
|
<div title="Contenu du post" id="contentview" markdown="@Model.Content"></div>
|
2016-05-17 18:22:18 +02:00
|
|
|
|
|
|
|
|
<hr>
|
2017-05-27 18:29:17 +02:00
|
|
|
<form asp-action="@ViewData["PostTarget"]">
|
2016-05-17 18:22:18 +02:00
|
|
|
<div class="form-horizontal">
|
|
|
|
|
|
|
|
|
|
<hr />
|
2017-10-22 16:22:54 +02:00
|
|
|
<p class="text-success">@ViewData["StatusMessage"]</p>
|
2016-05-17 18:22:18 +02:00
|
|
|
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
|
|
|
|
<input type="hidden" asp-for="Id" />
|
|
|
|
|
<input type="hidden" asp-for="AuthorId" />
|
2017-01-24 15:07:27 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-group mdcoding">
|
2016-08-02 17:02:38 +02:00
|
|
|
<label asp-for="Title" class="col-md-2 control-label"></label>
|
2016-05-17 18:22:18 +02:00
|
|
|
<div class="col-md-10">
|
2017-01-24 15:07:27 +01:00
|
|
|
<input asp-for="Title" class="form-control" data-from="titleview"/>
|
2017-01-21 22:36:43 +01:00
|
|
|
<span asp-validation-for="Title" class="text-danger" >
|
|
|
|
|
</span>
|
2016-05-17 18:22:18 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-09-05 21:04:57 +01:00
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label asp-for="Lang" class="col-md-2 control-label"></label>
|
|
|
|
|
<div class="col-md-10">
|
|
|
|
|
<select asp-for="Lang" class="form-control" asp-items="@ViewBag.LangItems" >
|
|
|
|
|
</select>
|
|
|
|
|
<span asp-validation-for="Lang" class="text-danger" >
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
2016-05-17 18:22:18 +02:00
|
|
|
<div class="form-group">
|
2016-08-02 17:26:00 +02:00
|
|
|
<label asp-for="Photo" class="col-md-2 control-label"></label>
|
2016-05-17 18:22:18 +02:00
|
|
|
<div class="col-md-10">
|
2016-08-02 17:26:00 +02:00
|
|
|
<input asp-for="Photo" class="form-control" />
|
2017-01-21 22:36:43 +01:00
|
|
|
<span asp-validation-for="Photo" class="text-danger" >
|
|
|
|
|
</span>
|
2016-05-17 18:22:18 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2017-01-24 15:07:27 +01:00
|
|
|
<div class="form-group mdcoding">
|
|
|
|
|
<label asp-for="Content" class="col-md-2 control-label" ></label>
|
2016-05-17 18:22:18 +02:00
|
|
|
<div class="col-md-10">
|
2017-01-24 15:07:27 +01:00
|
|
|
<textarea asp-for="Content" class="form-control" id="Content" data-from="contentview">
|
2016-05-17 18:22:18 +02:00
|
|
|
</textarea>
|
2017-01-21 22:36:43 +01:00
|
|
|
<span asp-validation-for="Content" class="text-danger" >
|
|
|
|
|
</span>
|
2016-05-17 18:22:18 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2016-08-02 17:02:38 +02:00
|
|
|
<label asp-for="Visible" class="col-md-2 control-label"></label>
|
2016-05-17 18:22:18 +02:00
|
|
|
<div class="col-md-10">
|
2016-08-02 17:02:38 +02:00
|
|
|
<input asp-for="Visible" class="form-control"/>
|
2016-05-17 18:22:18 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2017-01-20 14:20:44 +01:00
|
|
|
<div class="form-group">
|
|
|
|
|
<label asp-for="ACL" class="col-md-2 control-label"></label>
|
|
|
|
|
<div class="col-md-10">
|
2017-02-02 13:49:47 +01:00
|
|
|
@Component.Invoke("CirclesControl",Model)
|
2017-01-20 14:20:44 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2016-05-17 18:22:18 +02:00
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="col-md-offset-2 col-md-10">
|
|
|
|
|
<input type="submit" value="Save" class="btn btn-default" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
2016-05-31 14:44:07 +02:00
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
</div>
|
2017-01-13 16:31:40 +01:00
|
|
|
@await Component.InvokeAsync("Directory","")
|
2016-05-17 18:22:18 +02:00
|
|
|
<div >
|
2019-08-25 01:47:46 +01:00
|
|
|
@{ await Html.RenderPartialAsync("_PostFilesPartial"); }
|
2016-05-17 18:22:18 +02:00
|
|
|
</div>
|
|
|
|
|
<div>
|
2019-06-23 00:05:23 +01:00
|
|
|
<a asp-action="Index">@SR["Back to List"]</a>
|
2016-05-17 18:22:18 +02:00
|
|
|
</div>
|
|
|
|
|
|