big refactoring, and more

New routes, new juice flow, the tags on posts
This commit is contained in:
Paul Schneider 2015-10-17 14:45:57 +02:00
commit 1805cb3e17
46 changed files with 1339 additions and 515 deletions

View file

@ -30,6 +30,8 @@ using System.ComponentModel.DataAnnotations;
namespace Yavsc.Model.Blogs
{
/// <summary>
/// Base post.
/// </summary>
@ -52,6 +54,9 @@ namespace Yavsc.Model.Blogs
id = value;
}
}
/// <summary>
/// The posted.
/// </summary>
@ -125,13 +130,21 @@ namespace Yavsc.Model.Blogs
}
}
/// <summary>
/// Gets or sets the photo.
/// </summary>
/// <value>The photo.</value>
public string Photo {
get;
set;
}
/// <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 ; }
}
}

View file

@ -12,16 +12,20 @@ namespace Yavsc.Model.Blogs
/// </summary>
public class BlogEntry : BasePost {
/// <summary>
/// Gets or sets the photo.
/// Gets or sets the circles allowed to read this ticket.
/// An empty collection specifies a public post.
/// </summary>
/// <value>The photo.</value>
public string Photo {
get;
set;
}
/// <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 ; }
string content;
@ -40,21 +44,6 @@ namespace Yavsc.Model.Blogs
}
}
/// <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 ; }
}
}

View file

@ -122,7 +122,11 @@ namespace Yavsc.Model.Blogs
orderby be.Posted descending
group
new PostInfoByTitle { Author=be.Author, Id=be.Id,
Posted=be.Posted, Modified=be.Modified, Intro = MarkdownHelper.MarkdownIntro(be.Content, out truncated) }
Posted=be.Posted, Modified=be.Modified,
Intro = MarkdownHelper.MarkdownIntro(be.Content, out truncated),
Visible = be.Visible,
Photo = be.Photo
}
by be.Title
into titlegroup
select titlegroup;
@ -137,8 +141,15 @@ namespace Yavsc.Model.Blogs
return from be in this
orderby be.Posted descending
group
new PostInfoByUser { Title=be.Title, Id=be.Id,
Posted=be.Posted, Modified=be.Modified, Intro = MarkdownHelper.MarkdownIntro(be.Content, out truncated) }
new PostInfoByUser {
Title=be.Title,
Id=be.Id,
Posted=be.Posted,
Modified=be.Modified,
Intro = MarkdownHelper.MarkdownIntro(be.Content, out truncated) ,
Photo = be.Photo,
Visible = be.Visible
}
by be.Author
into usergroup
select usergroup;

View file

@ -0,0 +1,45 @@
//
// PostTag.cs
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Configuration;
using System.Collections.Generic;
using Yavsc.Model.Blogs;
using System.Linq;
using Yavsc.Model.Circles;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace Yavsc.Model.Blogs
{
public class PostTag {
public long PostId { get; set; }
[StringLength(512)]
[RegularExpression(@"^[a-zA-Z0-9 ]+$",ErrorMessage = "Un tag n'est composé que de lettres et de chiffres, les espaces" +
"sont autorisés")]
[Required(ErrorMessage = "S'il vous plait, saisissez nom de tag")]
public string Tag { get; set; }
}
}

View file

@ -1,3 +1,16 @@
2015-10-17 Paul Schneider <paul@pschneider.fr>
* PostTag.cs:
* BasePost.cs:
* YavscModel.csproj:
* BlogEntry.cs:
* LocalizedText.resx:
* Automate.cs:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* BlogEntryCollection.cs:
* LocalizedText.fr.Designer.cs:
2015-10-13 Paul Schneider <paul@pschneider.fr>
* BasePost.cs: refactoring:

View file

@ -46,81 +46,27 @@ namespace Yavsc.Model {
}
}
public static string was_added_to_the_empty_role {
public static string EventWebPage {
get {
return ResourceManager.GetString("was_added_to_the_empty_role", resourceCulture);
return ResourceManager.GetString("EventWebPage", resourceCulture);
}
}
public static string Bill_edition {
public static string ProviderId {
get {
return ResourceManager.GetString("Bill_edition", resourceCulture);
return ResourceManager.GetString("ProviderId", resourceCulture);
}
}
public static string Tex_version {
public static string Pdf_version {
get {
return ResourceManager.GetString("Tex_version", resourceCulture);
return ResourceManager.GetString("Pdf_version", resourceCulture);
}
}
public static string Message_sent {
public static string Circles {
get {
return ResourceManager.GetString("Message_sent", resourceCulture);
}
}
public static string Count {
get {
return ResourceManager.GetString("Count", resourceCulture);
}
}
public static string Create {
get {
return ResourceManager.GetString("Create", resourceCulture);
}
}
public static string Description {
get {
return ResourceManager.GetString("Description", resourceCulture);
}
}
public static string Profile_edition {
get {
return ResourceManager.GetString("Profile_edition", resourceCulture);
}
}
public static string Title {
get {
return ResourceManager.GetString("Title", resourceCulture);
}
}
public static string My_Estimates {
get {
return ResourceManager.GetString("My_Estimates", resourceCulture);
}
}
public static string Google_error {
get {
return ResourceManager.GetString("Google_error", resourceCulture);
}
}
public static string StartDate {
get {
return ResourceManager.GetString("StartDate", resourceCulture);
}
}
public static string no_content {
get {
return ResourceManager.GetString("no_content", resourceCulture);
return ResourceManager.GetString("Circles", resourceCulture);
}
}
@ -130,27 +76,21 @@ namespace Yavsc.Model {
}
}
public static string Ciffer {
public static string Preview {
get {
return ResourceManager.GetString("Ciffer", resourceCulture);
return ResourceManager.GetString("Preview", resourceCulture);
}
}
public static string Modify {
public static string DisplayName {
get {
return ResourceManager.GetString("Modify", resourceCulture);
return ResourceManager.GetString("DisplayName", resourceCulture);
}
}
public static string MaxDate {
public static string none {
get {
return ResourceManager.GetString("MaxDate", resourceCulture);
}
}
public static string younotadmin {
get {
return ResourceManager.GetString("younotadmin", resourceCulture);
return ResourceManager.GetString("none", resourceCulture);
}
}
@ -160,9 +100,27 @@ namespace Yavsc.Model {
}
}
public static string Date_search {
public static string Not_Approuved {
get {
return ResourceManager.GetString("Date_search", resourceCulture);
return ResourceManager.GetString("Not_Approuved", resourceCulture);
}
}
public static string User_name {
get {
return ResourceManager.GetString("User_name", resourceCulture);
}
}
public static string Estimate_not_found {
get {
return ResourceManager.GetString("Estimate_not_found", resourceCulture);
}
}
public static string was_added_to_the_empty_role {
get {
return ResourceManager.GetString("was_added_to_the_empty_role", resourceCulture);
}
}
@ -172,42 +130,96 @@ namespace Yavsc.Model {
}
}
public static string Google_calendar {
get {
return ResourceManager.GetString("Google_calendar", resourceCulture);
}
}
public static string Welcome {
get {
return ResourceManager.GetString("Welcome", resourceCulture);
}
}
public static string Private_circle {
get {
return ResourceManager.GetString("Private_circle", resourceCulture);
}
}
public static string ImportException {
get {
return ResourceManager.GetString("ImportException", resourceCulture);
}
}
public static string Preview {
get {
return ResourceManager.GetString("Preview", resourceCulture);
}
}
public static string Register {
get {
return ResourceManager.GetString("Register", resourceCulture);
}
}
public static string View_source {
get {
return ResourceManager.GetString("View_source", resourceCulture);
}
}
public static string Hide_source {
get {
return ResourceManager.GetString("Hide_source", resourceCulture);
}
}
public static string access_denied {
get {
return ResourceManager.GetString("access_denied", resourceCulture);
}
}
public static string Ciffer {
get {
return ResourceManager.GetString("Ciffer", resourceCulture);
}
}
public static string Create {
get {
return ResourceManager.GetString("Create", resourceCulture);
}
}
public static string Submit {
get {
return ResourceManager.GetString("Submit", resourceCulture);
}
}
public static string ImgLocator {
get {
return ResourceManager.GetString("ImgLocator", resourceCulture);
}
}
public static string entries {
get {
return ResourceManager.GetString("entries", resourceCulture);
}
}
public static string Description {
get {
return ResourceManager.GetString("Description", resourceCulture);
}
}
public static string Google_error {
get {
return ResourceManager.GetString("Google_error", resourceCulture);
}
}
public static string Comment {
get {
return ResourceManager.GetString("Comment", resourceCulture);
}
}
public static string Tex_version {
get {
return ResourceManager.GetString("Tex_version", resourceCulture);
}
}
public static string Item_added_to_basket {
get {
return ResourceManager.GetString("Item_added_to_basket", resourceCulture);
}
}
public static string DuplicateUserName {
get {
return ResourceManager.GetString("DuplicateUserName", resourceCulture);
@ -220,69 +232,21 @@ namespace Yavsc.Model {
}
}
public static string EndDate {
public static string Hide {
get {
return ResourceManager.GetString("EndDate", resourceCulture);
return ResourceManager.GetString("Hide", resourceCulture);
}
}
public static string Google_calendar {
public static string Register {
get {
return ResourceManager.GetString("Google_calendar", resourceCulture);
return ResourceManager.GetString("Register", resourceCulture);
}
}
public static string Consultant {
public static string younotadmin {
get {
return ResourceManager.GetString("Consultant", resourceCulture);
}
}
public static string EventWebPage {
get {
return ResourceManager.GetString("EventWebPage", resourceCulture);
}
}
public static string ImgLocator {
get {
return ResourceManager.GetString("ImgLocator", resourceCulture);
}
}
public static string DoTag {
get {
return ResourceManager.GetString("DoTag", resourceCulture);
}
}
public static string Not_Approuved {
get {
return ResourceManager.GetString("Not_Approuved", resourceCulture);
}
}
public static string Private_circle {
get {
return ResourceManager.GetString("Private_circle", resourceCulture);
}
}
public static string DocTemplateException {
get {
return ResourceManager.GetString("DocTemplateException", resourceCulture);
}
}
public static string Unitary_cost {
get {
return ResourceManager.GetString("Unitary_cost", resourceCulture);
}
}
public static string Circles {
get {
return ResourceManager.GetString("Circles", resourceCulture);
return ResourceManager.GetString("younotadmin", resourceCulture);
}
}
@ -292,9 +256,15 @@ namespace Yavsc.Model {
}
}
public static string Remember_me {
public static string New_Tag {
get {
return ResourceManager.GetString("Remember_me", resourceCulture);
return ResourceManager.GetString("New_Tag", resourceCulture);
}
}
public static string Modify {
get {
return ResourceManager.GetString("Modify", resourceCulture);
}
}
@ -304,45 +274,21 @@ namespace Yavsc.Model {
}
}
public static string none {
public static string Title {
get {
return ResourceManager.GetString("none", resourceCulture);
return ResourceManager.GetString("Title", resourceCulture);
}
}
public static string User_List {
public static string Tag_name {
get {
return ResourceManager.GetString("User_List", resourceCulture);
return ResourceManager.GetString("Tag_name", resourceCulture);
}
}
public static string Estimate_not_found {
public static string Message_sent {
get {
return ResourceManager.GetString("Estimate_not_found", resourceCulture);
}
}
public static string ProviderId {
get {
return ResourceManager.GetString("ProviderId", resourceCulture);
}
}
public static string Welcome {
get {
return ResourceManager.GetString("Welcome", resourceCulture);
}
}
public static string Online {
get {
return ResourceManager.GetString("Online", resourceCulture);
}
}
public static string Home {
get {
return ResourceManager.GetString("Home", resourceCulture);
return ResourceManager.GetString("Message_sent", resourceCulture);
}
}
@ -352,57 +298,9 @@ namespace Yavsc.Model {
}
}
public static string MinDate {
public static string Bill_edition {
get {
return ResourceManager.GetString("MinDate", resourceCulture);
}
}
public static string Comment {
get {
return ResourceManager.GetString("Comment", resourceCulture);
}
}
public static string User_name {
get {
return ResourceManager.GetString("User_name", resourceCulture);
}
}
public static string DisplayName {
get {
return ResourceManager.GetString("DisplayName", resourceCulture);
}
}
public static string Pdf_version {
get {
return ResourceManager.GetString("Pdf_version", resourceCulture);
}
}
public static string ReadMore {
get {
return ResourceManager.GetString("ReadMore", resourceCulture);
}
}
public static string Item_added_to_basket {
get {
return ResourceManager.GetString("Item_added_to_basket", resourceCulture);
}
}
public static string role_created {
get {
return ResourceManager.GetString("role_created", resourceCulture);
}
}
public static string Edit {
get {
return ResourceManager.GetString("Edit", resourceCulture);
return ResourceManager.GetString("Bill_edition", resourceCulture);
}
}
@ -412,9 +310,81 @@ namespace Yavsc.Model {
}
}
public static string entries {
public static string MaxDate {
get {
return ResourceManager.GetString("entries", resourceCulture);
return ResourceManager.GetString("MaxDate", resourceCulture);
}
}
public static string Count {
get {
return ResourceManager.GetString("Count", resourceCulture);
}
}
public static string Edit {
get {
return ResourceManager.GetString("Edit", resourceCulture);
}
}
public static string Date_search {
get {
return ResourceManager.GetString("Date_search", resourceCulture);
}
}
public static string View_source {
get {
return ResourceManager.GetString("View_source", resourceCulture);
}
}
public static string role_created {
get {
return ResourceManager.GetString("role_created", resourceCulture);
}
}
public static string ReadMore {
get {
return ResourceManager.GetString("ReadMore", resourceCulture);
}
}
public static string EndDate {
get {
return ResourceManager.GetString("EndDate", resourceCulture);
}
}
public static string MinDate {
get {
return ResourceManager.GetString("MinDate", resourceCulture);
}
}
public static string User_List {
get {
return ResourceManager.GetString("User_List", resourceCulture);
}
}
public static string Remember_me {
get {
return ResourceManager.GetString("Remember_me", resourceCulture);
}
}
public static string Home {
get {
return ResourceManager.GetString("Home", resourceCulture);
}
}
public static string Consultant {
get {
return ResourceManager.GetString("Consultant", resourceCulture);
}
}
@ -423,5 +393,59 @@ namespace Yavsc.Model {
return ResourceManager.GetString("was_added_to_the_role", resourceCulture);
}
}
public static string DoTag {
get {
return ResourceManager.GetString("DoTag", resourceCulture);
}
}
public static string DocTemplateException {
get {
return ResourceManager.GetString("DocTemplateException", resourceCulture);
}
}
public static string no_content {
get {
return ResourceManager.GetString("no_content", resourceCulture);
}
}
public static string Unitary_cost {
get {
return ResourceManager.GetString("Unitary_cost", resourceCulture);
}
}
public static string Online {
get {
return ResourceManager.GetString("Online", resourceCulture);
}
}
public static string StartDate {
get {
return ResourceManager.GetString("StartDate", resourceCulture);
}
}
public static string Hide_source {
get {
return ResourceManager.GetString("Hide_source", resourceCulture);
}
}
public static string Profile_edition {
get {
return ResourceManager.GetString("Profile_edition", resourceCulture);
}
}
public static string My_Estimates {
get {
return ResourceManager.GetString("My_Estimates", resourceCulture);
}
}
}
}

View file

@ -148,9 +148,9 @@ namespace Yavsc.Model {
}
}
public static string younotadmin {
public static string New_Tag {
get {
return ResourceManager.GetString("younotadmin", resourceCulture);
return ResourceManager.GetString("New_Tag", resourceCulture);
}
}
@ -250,6 +250,12 @@ namespace Yavsc.Model {
}
}
public static string Submit {
get {
return ResourceManager.GetString("Submit", resourceCulture);
}
}
public static string Not_Approuved {
get {
return ResourceManager.GetString("Not Approuved", resourceCulture);
@ -286,6 +292,12 @@ namespace Yavsc.Model {
}
}
public static string Tag_name {
get {
return ResourceManager.GetString("Tag_name", resourceCulture);
}
}
public static string Remove {
get {
return ResourceManager.GetString("Remove", resourceCulture);
@ -298,6 +310,12 @@ namespace Yavsc.Model {
}
}
public static string Hide {
get {
return ResourceManager.GetString("Hide", resourceCulture);
}
}
public static string Estimate_not_found {
get {
return ResourceManager.GetString("Estimate_not_found", resourceCulture);
@ -370,6 +388,12 @@ namespace Yavsc.Model {
}
}
public static string younotadmin {
get {
return ResourceManager.GetString("younotadmin", resourceCulture);
}
}
public static string Item_added_to_basket {
get {
return ResourceManager.GetString("Item_added_to_basket", resourceCulture);

View file

@ -35,6 +35,7 @@
<data name="Google_error"><value>Erreur Google : {0}</value></data>
<data name="Hide_source"><value>Cacher le texte source du billet</value></data>
<data name="Home"><value>Accueil</value></data>
<data name="Hide"><value>Cacher</value></data>
<data name="ImgLocator"><value>URI de l'image</value></data>
<data name="ImportException"><value>Exception à l'import</value></data>
<data name="InternalServerError"><value>Erreur serveur interne</value></data>
@ -46,6 +47,7 @@
<data name="MinDate"><value>Date minimale du rendez-vous</value></data>
<data name="Modify"><value>Modifier</value></data>
<data name="My_Estimates"><value>Mes estimations</value></data>
<data name="New_Tag"><value>Nouveau Tag</value></data>
<data name="none"><value>aucun(e)</value></data>
<data name="Not Approuved"><value>Non approuvé</value></data>
<data name="no_content"><value>pas de contenu</value></data>
@ -63,8 +65,10 @@
<data name="Remove"><value>Supprimer</value></data>
<data name="role_created"><value>Rôle créé</value></data>
<data name="StartDate"><value>Date de démarrage</value></data>
<data name="Submit"><value>Soumettre</value></data>
<data name="Tex_version"><value>Version LaTeX</value></data>
<data name="Title"><value>Titre</value></data>
<data name="Tag_name"><value>Nom du tag</value></data>
<data name="Unitary_cost"><value>Coût unitaire</value></data>
<data name="User List"><value>Liste des utilisateurs</value><comment></comment></data>
<data name="User_name"><value>Nom d'utilisateur</value></data>

View file

@ -33,6 +33,7 @@
<data name="Estimate_not_found"><value>Estimate not found</value></data>
<data name="EventWebPage"><value>Event Web page</value></data>
<data name="Home"><value>Home</value></data>
<data name="Hide"><value>Hide</value></data>
<data name="Hide_source"><value>Hide the bill source text</value></data>
<data name="entries"><value>entries</value></data>
<data name="Google_calendar"><value>Google calendar</value></data>
@ -48,6 +49,7 @@
<data name="MinDate"><value>Minimal date for the rendez-vous</value></data>
<data name="Modify"><value>Modify</value></data>
<data name="My_Estimates"><value>My estimates</value></data>
<data name="New_Tag"><value>New Tag</value></data>
<data name="none"><value>none</value></data>
<data name="no_content"><value>no content</value></data>
<data name="Not_Approuved"><value>Not Approuved</value></data>
@ -66,8 +68,10 @@
<data name="Remove"><value>Remove</value></data>
<data name="role_created"><value>role created</value></data>
<data name="StartDate"><value>Start date</value></data>
<data name="Submit"><value>Submit</value></data>
<data name="Tex_version"><value>LaTeX version</value></data>
<data name="Title"><value>Title</value></data>
<data name="Tag_name"><value>Tag name</value></data>
<data name="Unitary_cost"><value>Unitary_cost</value></data>
<data name="User_List"><value>User List</value><comment></comment></data>
<data name="User_name"><value>User name</value></data>

View file

@ -31,7 +31,7 @@ namespace Yavsc.Model.WorkFlow
/// <summary>
/// Initializes a new instance of the Automate class.
/// </summary>
public Automate ()
public Automate ()
{
}
private Dictionary<TState,Dictionary<TLetter,TState>> transitions =

View file

@ -173,6 +173,7 @@
<Compile Include="Blogs\MarkdownHelper.cs" />
<Compile Include="Blogs\UTBlogEntryCollection.cs" />
<Compile Include="Blogs\BasePost.cs" />
<Compile Include="Blogs\PostTag.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>