Improves notification system
* ICalendarManager.cs: WIP booking TODO a calendar provider
* NpgsqlProfileProvider.cs: Fixes the defaultValue specification from
config file
* BlogsController.cs:
* AccountController.cs:
* CalendarController.cs: refactoring : the Yavsc controller name
* instdbws.sql: a new profile value : a boolean, `AllowCookies` :'{
* style.css: a class to display notification
* HomeController.cs: Notifies users this site uses cookies (what for
an information!)
If authenticated, at dimissing this notification, the user's profile
is updated,
and he'll not mess up anymore with the info.
* App.master:
* YavscHelpers.cs: adds usage of click_action value at
displaying a notification.
* yavsc.js: Implements the notification `click_action`
* Web.config: * enables anonymous profiles
* adds a new `allowcookies` profile property
* Web.csproj: Yavsc controller refactoring
* YaEvent.cs:
* IFreeDateSet.cs: WIP booking
* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: implements the message "uses cookies"
* YavscModel.csproj: refactoring
* Notification.cs: The Yavsc otification will start as a Google one
...
many properties are not yet used, but all seems usefull.
* Web.config: code prettying
* YavscController.cs: Gives Yavsc a concrete base controller
This commit is contained in:
parent
0e6da27309
commit
b8446c2d3e
26 changed files with 256 additions and 116 deletions
|
|
@ -14,6 +14,8 @@ using Yavsc.Helpers;
|
|||
using Yavsc;
|
||||
using System.Web.Mvc;
|
||||
using Yavsc.Model.Blogs;
|
||||
using System.Web.Security;
|
||||
using System.Web.Profile;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
|
|
@ -85,6 +87,17 @@ namespace Yavsc.Controllers
|
|||
/// </summary>
|
||||
public ActionResult Index ()
|
||||
{
|
||||
var anonid = Request.AnonymousID;
|
||||
if (Session.IsNewSession) {
|
||||
if (!Request.IsAuthenticated) {
|
||||
ProfileBase anonymousProfile = ProfileBase.Create(anonid);
|
||||
object ac = anonymousProfile.GetPropertyValue ("allowcookies");
|
||||
if (ac is string && ac!="true")
|
||||
YavscHelpers.Notify (ViewData, LocalizedText.ThisSiteUsesCookies,
|
||||
"function(){Yavsc.ajax(\"/Yavsc/AllowCookies\", { id:'"+anonid+"' });}");
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string tagname in new string[] {"Accueil","Événements","Mentions légales"})
|
||||
{
|
||||
TagInfo ti = BlogManager.GetTagInfo (tagname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue