
and each post can display a dedicated photo. * NpgsqlBlogProvider.cs: implements a blog post photo storage * BlogsController.cs: implements a method to update the photo url * style.css: yastyle * AdminController.cs: refactoring the notification: Introduces a static `Notice` method, server side, to populate an array in `ViewData`, used in the paster page. * BlogsController.cs: Controls the photo update * YavscHelpers.cs: * yavsc.circles.js: * HomeController.cs: * GoogleController.cs: notification refactoring * App.master: - notification refactoring - html structure in the `nav` * hallo.js: event 'hallomodified' now also occurs at image modifications * to-markdown.js: ?Fixes? html images alt text and title to Markdown * yavsc.js: implements the photo in database * Edit.aspx: A nicer bill edition, with a photo * UserPost.aspx: Displays the photo * UserPosts.aspx: Fixes the new usage of `ResultPages` * Web.config: totem custo * instdbws.sql: adds a `photo` field in the `blog` table * BlogEntry.cs: defines the photo in the model * BlogManager.cs: a new method to set the photo on a blog post. * BlogProvider.cs: the blog provider now also gives some photo * LocalizedText.fr.Designer.cs: Reordering the french localisation resource * LocalizedText.fr.resx: Reorders the french localisation resource
153 lines
2.9 KiB
C#
153 lines
2.9 KiB
C#
using System;
|
|
using System.Configuration;
|
|
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Yavsc.Model.Circles;
|
|
using System.Web.Mvc;
|
|
|
|
namespace Yavsc.Model.Blogs
|
|
{
|
|
/// <summary>
|
|
/// Blog entry.
|
|
/// </summary>
|
|
public class BlogEntry {
|
|
long id;
|
|
|
|
|
|
/// <summary>
|
|
/// Gets or sets the identifier.
|
|
/// </summary>
|
|
/// <value>The identifier.</value>
|
|
[DisplayName("Identifiant numérique de billet")]
|
|
public long Id {
|
|
get {
|
|
return id;
|
|
}
|
|
set {
|
|
id = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets the photo.
|
|
/// </summary>
|
|
/// <value>The photo.</value>
|
|
public string Photo {
|
|
get;
|
|
set;
|
|
}
|
|
|
|
string title;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the title.
|
|
/// </summary>
|
|
/// <value>The title.</value>
|
|
[DisplayName("Titre du billet")]
|
|
[StringLength(512)]
|
|
[RegularExpression("^[^:%&?]*$",ErrorMessage = "Les caratères suivants sont invalides pour un titre: :%&?")]
|
|
[Required(ErrorMessage = "S'il vous plait, saisissez un titre")]
|
|
public string Title {
|
|
get {
|
|
return title;
|
|
}
|
|
set {
|
|
title = value;
|
|
}
|
|
}
|
|
|
|
string content;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the content.
|
|
/// </summary>
|
|
/// <value>The content.</value>
|
|
[DisplayName("Corps du billet")]
|
|
[Required(ErrorMessage = "S'il vous plait, saisissez un texte.")]
|
|
public string Content {
|
|
get {
|
|
return content;
|
|
}
|
|
set {
|
|
content = value;
|
|
}
|
|
}
|
|
|
|
string userName;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the name of the user.
|
|
/// </summary>
|
|
/// <value>The name of the user.</value>
|
|
[StringLength(255)]
|
|
[DisplayName("Auteur")]
|
|
public string Author {
|
|
get {
|
|
return userName;
|
|
}
|
|
set {
|
|
userName = value;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// The posted.
|
|
/// </summary>
|
|
public DateTime posted;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the posted.
|
|
/// </summary>
|
|
/// <value>The posted.</value>
|
|
[DisplayName("Date de creation")]
|
|
public DateTime Posted {
|
|
get {
|
|
return posted;
|
|
}
|
|
set {
|
|
posted = value;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// The modified.
|
|
/// </summary>
|
|
public DateTime modified;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the modified.
|
|
/// </summary>
|
|
/// <value>The modified.</value>
|
|
[DisplayName("Date de modification")]
|
|
public DateTime Modified {
|
|
get {
|
|
return modified;
|
|
}
|
|
set {
|
|
modified = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether this <see cref="Yavsc.Model.Blogs.BlogEntry"/> is visible.
|
|
/// </summary>
|
|
/// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
|
|
public bool Visible { get; set ; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the circles allowed to read this ticket.
|
|
/// An empty collection specifies a public post.
|
|
/// </summary>
|
|
/// <value>The circles.</value>
|
|
[Display(Name="Cercles autorisés")]
|
|
public long[] AllowedCircles { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the tags.
|
|
/// </summary>
|
|
/// <value>The tags.</value>
|
|
public string [] Tags { get; set ; }
|
|
|
|
|
|
}
|
|
|
|
}
|