diff --git a/ChangeLog b/ChangeLog index edbc78c0..b45b3497 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-12-01 Paul Schneider + + * README.md: mise à jour des priorités + 2015-11-30 Paul Schneider * .gitignore: ignorer ma config diff --git a/README.md b/README.md index 46aec131..8dd1e463 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,12 @@ yavsc # à faire, par ordre de priorité +0) Rendre pliable les groupes de champs de formulaire + +0.1) Donner des descriptions textuelles au cotes (ex: dans le cadre d'un prestataire, ses 5 cotes seraient +par exemple "Nouvelle star" "Artiste local" "Artiste régional" "Star nationale" "Star internationale" + +0.2) Fixer l'edition de la côte zéro. (y en a 6, ou onze avec les moitiés, pas cinq (ni dix avec les moitiés)) 1) Créer un contrôle "bouton utilisateur" `UserNameControl` avec @@ -16,13 +22,20 @@ yavsc 2) Refabrication de l'Api : - Concerning the blog entry edition, we only need Two methods: + concernant la mise à jour la creation et l'edition d'un post, on + doit pouvoir fondre tout en une seule methode : + + * ```long PostFile(BlogEntry be)```, + Utilisée pour la creation quand id est à 0, auquel cas, l'identiffiant + du post créé est renvoyé en retour (non nul). + Sinon, c'est une mise a jour des propriétés + du billet, et on renvoie zero. - * ```long PostFile(long id)```, - used for creation when the given id is 0, in which case, the entry id created is returned. - Otherwise, used for import in the post spécified by its id, in which case, 0 is returned. - * `long Post(BlogEntry be)`, used to create or update a given or not - blog entry content. the returned value is the entry id at creation, or 0. + Dans tous les cas, toutes les propriétés du post sont fournies car mises à jour, + et on effectue la reception des fichiers attachés. + Dans le cas de l'edition (id non nul), + seules les propriétés spécifiées non nulles sont mises à jour + (NDLR:la visibilité est donc par exemple toujours mis à jour). 3) Corriger un peu le thème clair (fond de titres trop sombre) diff --git a/web/App_Code/Global.asax.cs b/web/App_Code/Global.asax.cs index 1687c6ee..7971d349 100644 --- a/web/App_Code/Global.asax.cs +++ b/web/App_Code/Global.asax.cs @@ -98,6 +98,7 @@ namespace Yavsc AreaRegistration.RegisterAllAreas (); WebApiConfig.Register (GlobalConfiguration.Configuration); RegisterRoutes (RouteTable.Routes); + AjaxHelper.GlobalizationScriptPath = "~/Scripts/globalize"; } /// diff --git a/web/ChangeLog b/web/ChangeLog index 3aaae2a0..cc4627ac 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,3 +1,17 @@ +2015-12-01 Paul Schneider + + * Global.asax.cs: Fixe un 404 Not Found sur le script + d'internationalisation. + + * YavscAjaxHelper.cs: Fixe un 404 Not Found sur le script + d'internationalisation: + Implementation d'une alternative à Ajax.GlobalisationScript() + de Mono System.Web.MVC + + + * App.master: utilise la nouvelle methode pour construire les + references aux scripts d'internationalisation + 2015-11-30 Paul Schneider * p8-av4.jpg: diff --git a/web/Helpers/YavscAjaxHelper.cs b/web/Helpers/YavscAjaxHelper.cs index 642a52f6..f83e8d14 100644 --- a/web/Helpers/YavscAjaxHelper.cs +++ b/web/Helpers/YavscAjaxHelper.cs @@ -25,6 +25,9 @@ using Yavsc.Model.Messaging; using System.Runtime.Serialization.Json; using System.IO; using System.Text; +using System.Globalization; +using System.Diagnostics.CodeAnalysis; +using System.Web; namespace Yavsc.Helpers { @@ -47,7 +50,47 @@ namespace Yavsc.Helpers new Notification { body = QuoteJavascriptString((string)message), click_action = click_action } ) ; } + /// + /// Globalizations the script. + /// + /// The script. + /// Ajax helper. + public static MvcHtmlString YaGlobalizationScript(this AjaxHelper ajaxHelper) + { + return YaGlobalizationScript(ajaxHelper, CultureInfo.CurrentCulture); + } + /// + /// Globalizations the script. + /// + /// The script. + /// Ajax helper. + /// Culture info. + [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "ajaxHelper", Justification = "This is an extension method")] + public static MvcHtmlString YaGlobalizationScript(this AjaxHelper ajaxHelper, CultureInfo cultureInfo) + { + return YaGlobalizationScriptHelper(AjaxHelper.GlobalizationScriptPath, cultureInfo); + } + + internal static MvcHtmlString YaGlobalizationScriptHelper(string scriptPath, CultureInfo cultureInfo) + { + if (cultureInfo == null) + { + throw new ArgumentNullException("cultureInfo"); + } + // references the global script : + TagBuilder tagBuilder = new TagBuilder("script"); + tagBuilder.MergeAttribute("type", "text/javascript"); + string src = VirtualPathUtility.AppendTrailingSlash(scriptPath) + "globalize.js"; + tagBuilder.MergeAttribute("src", VirtualPathUtility.ToAbsolute (src)); + + TagBuilder tagCurrentBuilder = new TagBuilder("script"); + string srccurrent = VirtualPathUtility.AppendTrailingSlash(scriptPath) + "cultures/globalize.culture." + HttpUtility.UrlEncode(cultureInfo.Name) + ".js"; + tagCurrentBuilder.MergeAttribute("src", VirtualPathUtility.ToAbsolute (srccurrent)); + + string html = tagBuilder.ToString(TagRenderMode.Normal)+tagCurrentBuilder.ToString(TagRenderMode.Normal); + return new MvcHtmlString(html); + } /// /// Quotes the javascript string. /// diff --git a/web/Models/App.master b/web/Models/App.master index cb3f2d7f..ae003857 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -27,7 +27,7 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>'; $('[data-type="rate-bill"]').rate({target: 'Blogs/Rate'}); }); -<%=Ajax.GlobalizationScript()%> +<%=Ajax.YaGlobalizationScript()%>