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
|
|
@ -15,10 +15,12 @@ using System.Web.Profile;
|
|||
using System.Web.Script.Serialization;
|
||||
using System.Web.Mvc;
|
||||
using System.Text.RegularExpressions;
|
||||
using Yavsc.Model.Messaging;
|
||||
|
||||
namespace Yavsc.Helpers
|
||||
{
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Yavsc helpers.
|
||||
/// </summary>
|
||||
|
|
@ -219,10 +221,11 @@ namespace Yavsc.Helpers
|
|||
JavaScriptSerializer serializer = new JavaScriptSerializer();
|
||||
return serializer.Serialize(obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Notifies
|
||||
/// Notify the specified helper and message.
|
||||
/// </summary>
|
||||
/// <param name="ViewData">View data.</param>
|
||||
/// <param name="helper">Helper.</param>
|
||||
/// <param name="message">Message.</param>
|
||||
public static void Notify (this HtmlHelper helper, string message) {
|
||||
Notify (helper.ViewData, message);
|
||||
|
|
@ -232,10 +235,12 @@ namespace Yavsc.Helpers
|
|||
/// </summary>
|
||||
/// <param name="viewData">View data.</param>
|
||||
/// <param name="message">Message.</param>
|
||||
public static void Notify(ViewDataDictionary viewData, string message) {
|
||||
public static void Notify(ViewDataDictionary viewData, string message, string click_action=null) {
|
||||
if (viewData ["Notifications"] == null)
|
||||
viewData ["Notifications"] = new List<string> ();
|
||||
(viewData ["Notifications"] as List<string>).Add (message.Replace("\'","\\\'"));
|
||||
viewData ["Notifications"] = new List<Notification> ();
|
||||
(viewData ["Notifications"] as List<Notification>).Add (
|
||||
new Notification { body = message.Replace("\'","\\\'"),
|
||||
click_action = click_action } ) ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Files the list.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue