refabrique

This commit is contained in:
Paul Schneider 2016-08-02 17:02:38 +02:00
commit 7c603b3cec
17 changed files with 1797 additions and 139 deletions

View file

@ -13,31 +13,31 @@
<div asp-validation-summary="ValidationSummary.All" class="text-danger"></div>
<div class="form-group">
<label asp-for="title" class="col-md-2 control-label"></label>
<label asp-for="Title" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="title" class="form-control" />
<span asp-validation-for="title" class="text-danger" ></span>
<input asp-for="Title" class="form-control" />
<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>
<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>
<input asp-for="Photo" class="form-control" />
<span asp-validation-for="Photo" class="text-danger" ></span>
</div>
</div>
<div class="form-group">
<label asp-for="bcontent" class="col-md-2 control-label"></label>
<label asp-for="Content" class="col-md-2 control-label"></label>
<div class="col-md-10">
<textarea asp-for="bcontent" class="form-control" >
<textarea asp-for="Content" class="form-control" >
</textarea>
<span asp-validation-for="bcontent" class="text-danger" ></span>
<span asp-validation-for="Content" class="text-danger" ></span>
</div>
</div>
<div class="form-group">
<label asp-for="visible" class="col-md-2 control-label"></label>
<label asp-for="Visible" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="visible" class="form-control"/>
<input asp-for="Visible" class="form-control"/>
</div>
</div>
<div class="form-group">

View file

@ -1,13 +1,10 @@
@model Yavsc.Models.Blog
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Delete</title>
</head>
<body>
@{
ViewData["Title"] = "Delete";
}
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}
<h3>Are you sure you want to delete this?</h3>
<div>
@ -21,46 +18,46 @@
@Model.Author
</dd>
<dt>
@Html.DisplayNameFor(model => model.bcontent)
@Html.DisplayNameFor(model => model.Content)
</dt>
<dd>
@Html.DisplayFor(model => model.bcontent)
@Html.DisplayFor(model => model.Content)
</dd>
<dt>
@Html.DisplayNameFor(model => model.modified)
@Html.DisplayNameFor(model => model.Modified)
</dt>
<dd>
@Html.DisplayFor(model => model.modified)
@Html.DisplayFor(model => model.Modified)
</dd>
<dt>
@Html.DisplayNameFor(model => model.photo)
@Html.DisplayNameFor(model => model.Photo)
</dt>
<dd>
@Html.DisplayFor(model => model.photo)
@Html.DisplayFor(model => model.Photo)
</dd>
<dt>
@Html.DisplayNameFor(model => model.posted)
@Html.DisplayNameFor(model => model.Posted)
</dt>
<dd>
@Html.DisplayFor(model => model.posted)
@Html.DisplayFor(model => model.Posted)
</dd>
<dt>
@Html.DisplayNameFor(model => model.rate)
@Html.DisplayNameFor(model => model.Rate)
</dt>
<dd>
@Html.DisplayFor(model => model.rate)
@Html.DisplayFor(model => model.Rate)
</dd>
<dt>
@Html.DisplayNameFor(model => model.title)
@Html.DisplayNameFor(model => model.Title)
</dt>
<dd>
@Html.DisplayFor(model => model.title)
@Html.DisplayFor(model => model.Title)
</dd>
<dt>
@Html.DisplayNameFor(model => model.visible)
@Html.DisplayNameFor(model => model.Visible)
</dt>
<dd>
@Html.DisplayFor(model => model.visible)
@Html.DisplayFor(model => model.Visible)
</dd>
</dl>
@ -70,9 +67,4 @@
<a asp-action="Index">Back to List</a>
</div>
</form>
</div>
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}
</body>
</html>
</div>

View file

@ -9,16 +9,16 @@
<hr />
<dl class="dl-horizontal">
<dt>
@SR[Html.DisplayNameFor(model => model.title)]
@SR[Html.DisplayNameFor(model => model.Title)]
</dt>
<dd>
@Html.DisplayFor(model => model.title)
@Html.DisplayFor(model => model.Title)
</dd>
<dt>
@SR[Html.DisplayNameFor(model => model.photo)]
@SR[Html.DisplayNameFor(model => model.Photo)]
</dt>
<dd>
@Html.DisplayFor(model => model.photo)
@Html.DisplayFor(model => model.Photo)
</dd>
<dt>
@SR["Author"]
@ -30,34 +30,34 @@
@SR["Content"]
</dt>
<dd>
<div markdown="@Model.bcontent" base="~/@Model.Id"
<div markdown="@Model.Content" base="~/@Model.Id"
site="SiteSettings.Value"></div>
</dd>
<dt>
@SR[Html.DisplayNameFor(model => model.modified)]
@SR[Html.DisplayNameFor(model => model.Modified)]
</dt>
<dd>
@Html.DisplayFor(model => model.modified)
@Html.DisplayFor(model => model.Modified)
</dd>
<dt>
@SR[Html.DisplayNameFor(model => model.posted)]
@SR[Html.DisplayNameFor(model => model.Posted)]
</dt>
<dd>
@Html.DisplayFor(model => model.posted)
@Html.DisplayFor(model => model.Posted)
</dd>
<dt>
@SR[Html.DisplayNameFor(model => model.rate)]
@SR[Html.DisplayNameFor(model => model.Rate)]
</dt>
<dd>
@Html.DisplayFor(model => model.rate)
@Html.DisplayFor(model => model.Rate)
</dd>
<dt>
@SR[Html.DisplayNameFor(model => model.visible)]
@SR[Html.DisplayNameFor(model => model.Visible)]
</dt>
<dd>
@Html.DisplayFor(model => model.visible)
@Html.DisplayFor(model => model.Visible)
</dd>
</dl>
</div>

View file

@ -44,8 +44,8 @@
<script>
$(document).ready(function() {
var editortitre = new Quill('#titlecnt', {
modules: { toolbar: '#titletoolbar' },
var editortitre = new Quill('#Titlecnt', {
modules: { toolbar: '#Titletoolbar' },
theme: 'snow'
});
var editorcontenu = new Quill('#contentcnt', {
@ -55,31 +55,31 @@
editortitre.on('selection-change', function(range) {
if (range) {
$('#contentbar').addClass('hidden');
$('#titletoolbar').removeClass('hidden');
$('#Titletoolbar').removeClass('hidden');
}
});
editortitre.on('text-change',function(delta,source){
if (source=='user')
{
updateMD('title',$('#titlecnt').html())
updateMD('Title',$('#Titlecnt').html())
}
});
editorcontenu.on('selection-change', function(range) {
if (range) {
$('#contentbar').removeClass('hidden');
$('#titletoolbar').addClass('hidden');
$('#Titletoolbar').addClass('hidden');
}
});
editorcontenu.on('text-change',function(delta,source){
if (source=='user')
{
updateMD('bcontent',$('#contentcnt').html())
updateMD('Content',$('#contentcnt').html())
}
});
$('#contentcnt').focus(function(){
$('#contentbar').removeClass('hidden');
$('#titletoolbar').addClass('hidden');
$('#Titletoolbar').addClass('hidden');
})
Dropzone.options.postfiles= {
@ -100,13 +100,13 @@ editorcontenu.on('text-change',function(delta,source){
}
<h2 > @SR["Blog post edition"] </h2>
<div id="titletoolbar" class="hidden ql-snow ql-toolbar">
<div id="Titletoolbar" class="hidden ql-snow ql-toolbar">
<button class="ql-format-button ql-bold"></button>
<button class="ql-format-button ql-italic"></button>
<button class="ql-format-button ql-strike"></button>
</div>
<h2 id="titlecnt"><markdown>@Model.title</markdown></h2>
<h2 id="Titlecnt"><markdown>@Model.Title</markdown></h2>
<div id="contentbar" class="hidden ql-snow ql-toolbar">
<button class="ql-format-button ql-bold"></button>
@ -132,7 +132,7 @@ editorcontenu.on('text-change',function(delta,source){
</span>
</div>
<div markdown="@Model.bcontent" base="~/@Model.Id" site="SiteSettings.Value" id="contentcnt" ></div>
<div markdown="@Model.Content" base="~/@Model.Id" site="SiteSettings.Value" id="contentcnt" ></div>
<hr>
@ -146,10 +146,10 @@ editorcontenu.on('text-change',function(delta,source){
<input type="hidden" asp-for="Id" />
<input type="hidden" asp-for="AuthorId" />
<div class="form-group">
<label asp-for="title" class="col-md-2 control-label"></label>
<label asp-for="Title" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="title" class="form-control" />
<span asp-validation-for="title" class="text-danger" />
<input asp-for="Title" class="form-control" />
<span asp-validation-for="Title" class="text-danger" />
</div>
</div>
<div class="form-group">
@ -160,17 +160,17 @@ editorcontenu.on('text-change',function(delta,source){
</div>
</div>
<div class="form-group">
<label asp-for="bcontent" class="col-md-2 control-label"></label>
<label asp-for="Content" class="col-md-2 control-label"></label>
<div class="col-md-10">
<textarea asp-for="bcontent" class="form-control" >
<textarea asp-for="Content" class="form-control" >
</textarea>
<span asp-validation-for="bcontent" class="text-danger" />
<span asp-validation-for="Content" class="text-danger" />
</div>
</div>
<div class="form-group">
<label asp-for="visible" class="col-md-2 control-label"></label>
<label asp-for="Visible" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="visible" class="form-control"/>
<input asp-for="Visible" class="form-control"/>
</div>
</div>

View file

@ -12,7 +12,7 @@
<table class="table">
<tr>
<th>
@SR[Html.DisplayNameFor(model => model.title)]
@SR[Html.DisplayNameFor(model => model.Title)]
</th>
<th>
@SR["Author"]
@ -26,18 +26,18 @@
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.photo)
<markdown>@item.title</markdown>
@Html.DisplayFor(modelItem => item.Photo)
<markdown>@item.Title</markdown>
</td>
<td>
@item.Author.UserName
</td>
<td>
<span style="font-size:x-small;">
posté le @item.posted.ToString("dddd d MMM yyyy à H:mm")
@if ((item.modified - item.posted).Minutes > 10)
posté le @item.Posted.ToString("dddd d MMM yyyy à H:mm")
@if ((item.Modified - item.Posted).Minutes > 10)
{ 
@:- Modifié le @item.modified.ToString("dddd d MMM yyyy à H:mm")
@:- Modifié le @item.Modified.ToString("dddd d MMM yyyy à H:mm")
}
</span>
</td>

View file

@ -14,25 +14,25 @@
@SR["Author"]
</th>
<th>
@Html.DisplayNameFor(model => model.bcontent)
@Html.DisplayNameFor(model => model.Content)
</th>
<th>
@Html.DisplayNameFor(model => model.modified)
@Html.DisplayNameFor(model => model.Modified)
</th>
<th>
@Html.DisplayNameFor(model => model.photo)
@Html.DisplayNameFor(model => model.Photo)
</th>
<th>
@Html.DisplayNameFor(model => model.posted)
@Html.DisplayNameFor(model => model.Posted)
</th>
<th>
@Html.DisplayNameFor(model => model.rate)
@Html.DisplayNameFor(model => model.Rate)
</th>
<th>
@Html.DisplayNameFor(model => model.title)
@Html.DisplayNameFor(model => model.Title)
</th>
<th>
@Html.DisplayNameFor(model => model.visible)
@Html.DisplayNameFor(model => model.Visible)
</th>
<th></th>
</tr>
@ -43,25 +43,25 @@
@item.Author?.UserName
</td>
<td>
<div md-content="@item.bcontent"/>@item.bcontent
<div md-content="@item.Content"/>@item.Content
</td>
<td>
@Html.DisplayFor(modelItem => item.modified)
@Html.DisplayFor(modelItem => item.Modified)
</td>
<td>
@Html.DisplayFor(modelItem => item.photo)
@Html.DisplayFor(modelItem => item.Photo)
</td>
<td>
@Html.DisplayFor(modelItem => item.posted)
@Html.DisplayFor(modelItem => item.Posted)
</td>
<td>
@Html.DisplayFor(modelItem => item.rate)
@Html.DisplayFor(modelItem => item.Rate)
</td>
<td>
@Html.DisplayFor(modelItem => item.title)
@Html.DisplayFor(modelItem => item.Title)
</td>
<td>
@Html.DisplayFor(modelItem => item.visible)
@Html.DisplayFor(modelItem => item.Visible)
</td>
<td>
<ul class="actiongroup">

View file

@ -14,25 +14,25 @@
@SR["Author"]
</th>
<th>
@Html.DisplayNameFor(model => model.bcontent)
@Html.DisplayNameFor(model => model.Content)
</th>
<th>
@Html.DisplayNameFor(model => model.modified)
@Html.DisplayNameFor(model => model.Modified)
</th>
<th>
@Html.DisplayNameFor(model => model.photo)
@Html.DisplayNameFor(model => model.Photo)
</th>
<th>
@Html.DisplayNameFor(model => model.posted)
@Html.DisplayNameFor(model => model.Posted)
</th>
<th>
@Html.DisplayNameFor(model => model.rate)
@Html.DisplayNameFor(model => model.Rate)
</th>
<th>
@Html.DisplayNameFor(model => model.title)
@Html.DisplayNameFor(model => model.Title)
</th>
<th>
@Html.DisplayNameFor(model => model.visible)
@Html.DisplayNameFor(model => model.Visible)
</th>
<th></th>
</tr>
@ -43,25 +43,31 @@
@item.Author?.UserName
</td>
<td>
<div md-content="@item.bcontent"/>@item.bcontent
<div md-content="@item.Content"/>
</td>
<td>
@Html.DisplayFor(modelItem => item.modified)
<table>
<tr>
<td>
@Html.DisplayFor(modelItem => item.Modified)
</td>
<td>
@Html.DisplayFor(modelItem => item.photo)
@Html.DisplayFor(modelItem => item.Photo)
</td>
<td>
@Html.DisplayFor(modelItem => item.posted)
@Html.DisplayFor(modelItem => item.Posted)
</td>
<td>
@Html.DisplayFor(modelItem => item.rate)
@Html.DisplayFor(modelItem => item.Rate)
</td>
<td>
@Html.DisplayFor(modelItem => item.title)
@Html.DisplayFor(modelItem => item.Title)
</td>
<td>
@Html.DisplayFor(modelItem => item.visible)
@Html.DisplayFor(modelItem => item.Visible)
</td>
</tr>
</table>
</td>
<td>
<ul class="actiongroup">