Bug & layout fixes
* Index.aspx: * Title.aspx: * YavscModel.csproj: * BlogEntry.cs: * yavsc.scrollnotif.js: * AccountController.cs: * BlogEntryCollection.cs: refactoring * yavsc.tags.js: Implements a js call to the tag & untag methods * PostActions.ascx: a better html structure * BasePost.cs: refactoring: allows the "PostActions" user control to use a common base object as post reference * NpgsqlBlogProvider.cs: implements the tag methods on db * ResultPages.cs: A multi-pages result meta info when one page only * yavsc.circles.js: * AccountController.cs: code formatting * BlogsController.cs: Untag a post * style.css: yastyle, yet a better one. * BlogsController.cs: View the Title after edition * App.master: * UserPosts.aspx: a nicer html structure * yavsc.js: Fixes notice & dimiss js * Login.aspx: refactoring * Edit.aspx: better html * UserPost.aspx: A promess to be allowed to tag. * Web.csproj: Adds yavsc.tags.js and yavsc.scrollnotifs.js to the project decription. * BlogManager.cs: Makes the blog manager expose of the new `UnTag` method * BlogProvider.cs: introduces a method to `untag` * FindBlogEntryFlags.cs: Find post entry by tag * LocalizedText.resx: * LocalizedText.Designer.cs: new translations: - "Tag" - "Edit" * LocalizedText.fr.resx: * LocalizedText.fr.Designer.cs: nouvelles traductions: - "Tag" - "Edit" * Profile.cs: a nicer stack trace at buggy usagemain
parent
c962998aaa
commit
d04a68db01
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||||
|
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||||
|
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
|
||||||
|
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||||
|
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
|
||||||
|
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
|
||||||
|
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
|
||||||
|
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
|
||||||
|
</sectionGroup>
|
||||||
|
</sectionGroup>
|
||||||
|
</sectionGroup>
|
||||||
|
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
|
||||||
|
<sectionGroup name="system.web">
|
||||||
|
<section name="membership" type="System.Web.Configuration.MembershipSection, System.Web" />
|
||||||
|
<section name="blog" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
|
||||||
|
<section name="thanks" type="Yavsc.ThanksConfigurationSection, Yavsc" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
|
||||||
|
<section name="catalog" type="Yavsc.Model.FrontOffice.Configuration.CatalogProvidersConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
|
||||||
|
<section name="workflow" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" allowLocation="true" requirePermission="false" allowDefinition="Everywhere" />
|
||||||
|
<section name="circleProviders" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" />
|
||||||
|
<section name="userNameManager" type="Yavsc.Model.DataProviderConfigurationSection, YavscModel" />
|
||||||
|
</sectionGroup>
|
||||||
|
<section name="paypal" type="PayPal.SDKConfigHandler, PayPal" />
|
||||||
|
</configSections>
|
||||||
|
<system.data>
|
||||||
|
<DbProviderFactories>
|
||||||
|
<add name="Npgsql Data Provider" invariant="Npgsql" support="FF" description=".Net Framework Data Provider for Postgresql Server" type="Npgsql.NpgsqlFactory, Npgsql" />
|
||||||
|
</DbProviderFactories>
|
||||||
|
</system.data>
|
||||||
|
<system.web>
|
||||||
|
<authentication mode="Forms" >
|
||||||
|
<forms loginUrl="login.aspx"
|
||||||
|
name=".ASPXFORMSAUTH" />
|
||||||
|
</authentication>
|
||||||
|
<authorization>
|
||||||
|
<deny users="?" />
|
||||||
|
</authorization>
|
||||||
|
<membership defaultProvider="NpgsqlMembershipProvider" userIsOnlineTimeWindow="1">
|
||||||
|
<providers>
|
||||||
|
<clear />
|
||||||
|
<add name="NpgsqlMembershipProvider" type="Npgsql.Web.NpgsqlMembershipProvider, NpgsqlMRPProviders"
|
||||||
|
connectionStringName="yavsc" enablePasswordRetrieval="false"
|
||||||
|
enablePasswordReset="true" requiresQuestionAndAnswer="false"
|
||||||
|
requiresUniqueEmail="true" passwordFormat="Clear" maxInvalidPasswordAttempts="5"
|
||||||
|
minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0"
|
||||||
|
passwordAttemptWindow="10" applicationName="/" autogenerateschema="false" />
|
||||||
|
</providers>
|
||||||
|
</membership>
|
||||||
|
<roleManager enabled="true" defaultProvider="NpgsqlRoleProvider">
|
||||||
|
<providers>
|
||||||
|
<clear />
|
||||||
|
<add name="NpgsqlRoleProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.NpgsqlRoleProvider, NpgsqlMRPProviders" autogenerateschema="false" />
|
||||||
|
</providers>
|
||||||
|
</roleManager>
|
||||||
|
<userNameManager defaultProvider="NpsqlUserNameProvider">
|
||||||
|
<providers>
|
||||||
|
<add name="NpsqlUserNameProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.RolesAndMembers.NpgsqlUserNameProvider, NpgsqlMRPProviders" autogenerateschema="false">
|
||||||
|
</add>
|
||||||
|
</providers>
|
||||||
|
</userNameManager>
|
||||||
|
<workflow defaultProvider="ITProvider">
|
||||||
|
<providers>
|
||||||
|
<clear />
|
||||||
|
<add name="ITProvider" type="Yavsc.ITCPNpgsqlProvider, ITContentProvider" applicationName="/" connectionStringName="yavsc" />
|
||||||
|
</providers>
|
||||||
|
</workflow>
|
||||||
|
<profile defaultProvider="NpgsqlProfileProvider">
|
||||||
|
<providers>
|
||||||
|
<clear />
|
||||||
|
<add name="NpgsqlProfileProvider" type="Npgsql.Web.NpgsqlProfileProvider, NpgsqlMRPProviders" connectionStringName="yavsc" applicationName="/" description="ProfileProvider for yavsc" />
|
||||||
|
</providers>
|
||||||
|
<properties>
|
||||||
|
<add name="Name" />
|
||||||
|
<add name="Phone" />
|
||||||
|
<add name="Mobile" />
|
||||||
|
<add name="Avatar" />
|
||||||
|
<add name="BlogVisible" type="System.Boolean" />
|
||||||
|
<add name="BlogTitle" />
|
||||||
|
<add name="WebSite" />
|
||||||
|
<add name="Address" />
|
||||||
|
<add name="CityAndState" />
|
||||||
|
<add name="ZipCode" />
|
||||||
|
<add name="Country" />
|
||||||
|
<add name="BankCode" />
|
||||||
|
<add name="IBAN" />
|
||||||
|
<add name="BIC" />
|
||||||
|
<add name="WicketCode" />
|
||||||
|
<add name="AccountNumber" />
|
||||||
|
<add name="BankedKey" />
|
||||||
|
<add name="gtoken" />
|
||||||
|
<add name="grefreshtoken" />
|
||||||
|
<add name="gtokentype" />
|
||||||
|
<add name="gtokenexpir" />
|
||||||
|
<add name="gcalapi" />
|
||||||
|
<add name="gcalid" />
|
||||||
|
<add name="gregid" />
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<blog defaultProvider="NpgsqlBlogProvider">
|
||||||
|
<providers>
|
||||||
|
<add name="NpgsqlBlogProvider" connectionStringName="yavsc" applicationName="/" type="Npgsql.Web.Blog.NpgsqlBlogProvider, NpgsqlBlogProvider" />
|
||||||
|
</providers>
|
||||||
|
</blog>
|
||||||
|
</system.web>
|
||||||
|
<connectionStrings>
|
||||||
|
<add name="yavsc" connectionString="Server=127.0.0.1;Port=5432;Database=totem;User Id=totemweb;Password=cZeoft2k5_d4;" providerName="Npgsql" />
|
||||||
|
</connectionStrings>
|
||||||
|
<appSettings>
|
||||||
|
<add key="MonoServerDefaultIndexFiles" value="index.html,Index.aspx" />
|
||||||
|
<add key="WorkflowContentProviderClass" value="yavsc.NpgsqlContentProvider" />
|
||||||
|
<add key="SmtpServer" value="smtp.free.fr" />
|
||||||
|
<add key="AdminEMail" value="paulschneider@free.fr" />
|
||||||
|
<add key="OwnerEMail" value="" />
|
||||||
|
<add key="Name" value="TOTEM PRODUCTION" />
|
||||||
|
<add key="DefaultController" value="Home" />
|
||||||
|
<add key="DefaultAvatar" value="/images/noavatar.png;image/png" />
|
||||||
|
<add key="RegistrationMessage" value="/RegistrationMail.txt" />
|
||||||
|
<!-- <add key="ClientValidationEnabled" value="true" /> -->
|
||||||
|
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||||
|
<add key="PayPalLogger" value="PayPal.Log.Log4netLogger" />
|
||||||
|
</appSettings>
|
||||||
|
</configuration>
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<BasePost>" %>
|
||||||
|
<aside>
|
||||||
|
(<%= Model.Posted.ToString("yyyy/MM/dd") %>
|
||||||
|
- <%= Model.Modified.ToString("yyyy/MM/dd") %> <%= Model.Visible? "":", Invisible!" %>)
|
||||||
|
<% if (Membership.GetUser()!=null) {
|
||||||
|
if (Membership.GetUser().UserName==Model.Author || Roles.IsUserInRole("Admin"))
|
||||||
|
{ %>
|
||||||
|
<i class="fa fa-tag"><%=Html.Translate("DoTag")%></i>
|
||||||
|
<a href="<%= Url.RouteUrl("Default", new { action = "Edit", controller = "Blogs", id = Model.Id })%>" class="actionlink">
|
||||||
|
<i class="fa fa-pencil"><%=Html.Translate("Edit")%></i>
|
||||||
|
</a>
|
||||||
|
<a href="<%= Url.RouteUrl("Default", new { action = "RemovePost", controller = "Blogs", id = Model.Id })%>" class="actionlink">
|
||||||
|
<i class="fa fa-remove"><%=Html.Translate("Remove")%></i></a>
|
||||||
|
<% }} %>
|
||||||
|
</aside>
|
||||||
@ -0,0 +1,137 @@
|
|||||||
|
//
|
||||||
|
// BasePost.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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Base post.
|
||||||
|
/// </summary>
|
||||||
|
public class BasePost {
|
||||||
|
/// <summary>
|
||||||
|
/// The identifier.
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
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>
|
||||||
|
/// The posted.
|
||||||
|
/// </summary>
|
||||||
|
private 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>
|
||||||
|
private 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private string author;
|
||||||
|
|
||||||
|
/// <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 author;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
author = 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 ; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue