à lire: README.md et Features.md
* README.md: mise à jour des priorités * 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
This commit is contained in:
parent
a24687f107
commit
eee67fa62e
6 changed files with 82 additions and 7 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
2015-12-01 Paul Schneider <paul@pschneider.fr>
|
||||||
|
|
||||||
|
* README.md: mise à jour des priorités
|
||||||
|
|
||||||
2015-11-30 Paul Schneider <paul@pschneider.fr>
|
2015-11-30 Paul Schneider <paul@pschneider.fr>
|
||||||
|
|
||||||
* .gitignore: ignorer ma config
|
* .gitignore: ignorer ma config
|
||||||
|
|
|
||||||
25
README.md
25
README.md
|
|
@ -5,6 +5,12 @@ yavsc
|
||||||
|
|
||||||
# à faire, par ordre de priorité
|
# à 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`
|
1) Créer un contrôle "bouton utilisateur" `UserNameControl`
|
||||||
avec
|
avec
|
||||||
|
|
@ -16,13 +22,20 @@ yavsc
|
||||||
|
|
||||||
2) Refabrication de l'Api :
|
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(long id)```,
|
* ```long PostFile(BlogEntry be)```,
|
||||||
used for creation when the given id is 0, in which case, the entry id created is returned.
|
Utilisée pour la creation quand id est à 0, auquel cas, l'identiffiant
|
||||||
Otherwise, used for import in the post spécified by its id, in which case, 0 is returned.
|
du post créé est renvoyé en retour (non nul).
|
||||||
* `long Post(BlogEntry be)`, used to create or update a given or not
|
Sinon, c'est une mise a jour des propriétés
|
||||||
blog entry content. the returned value is the entry id at creation, or 0.
|
du billet, et on renvoie zero.
|
||||||
|
|
||||||
|
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)
|
3) Corriger un peu le thème clair (fond de titres trop sombre)
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,7 @@ namespace Yavsc
|
||||||
AreaRegistration.RegisterAllAreas ();
|
AreaRegistration.RegisterAllAreas ();
|
||||||
WebApiConfig.Register (GlobalConfiguration.Configuration);
|
WebApiConfig.Register (GlobalConfiguration.Configuration);
|
||||||
RegisterRoutes (RouteTable.Routes);
|
RegisterRoutes (RouteTable.Routes);
|
||||||
|
AjaxHelper.GlobalizationScriptPath = "~/Scripts/globalize";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,17 @@
|
||||||
|
2015-12-01 Paul Schneider <paul@pschneider.fr>
|
||||||
|
|
||||||
|
* 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 <paul@pschneider.fr>
|
2015-11-30 Paul Schneider <paul@pschneider.fr>
|
||||||
|
|
||||||
* p8-av4.jpg:
|
* p8-av4.jpg:
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@ using Yavsc.Model.Messaging;
|
||||||
using System.Runtime.Serialization.Json;
|
using System.Runtime.Serialization.Json;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
namespace Yavsc.Helpers
|
namespace Yavsc.Helpers
|
||||||
{
|
{
|
||||||
|
|
@ -47,7 +50,47 @@ namespace Yavsc.Helpers
|
||||||
new Notification { body = QuoteJavascriptString((string)message),
|
new Notification { body = QuoteJavascriptString((string)message),
|
||||||
click_action = click_action } ) ;
|
click_action = click_action } ) ;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Globalizations the script.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The script.</returns>
|
||||||
|
/// <param name="ajaxHelper">Ajax helper.</param>
|
||||||
|
public static MvcHtmlString YaGlobalizationScript(this AjaxHelper ajaxHelper)
|
||||||
|
{
|
||||||
|
return YaGlobalizationScript(ajaxHelper, CultureInfo.CurrentCulture);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Globalizations the script.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The script.</returns>
|
||||||
|
/// <param name="ajaxHelper">Ajax helper.</param>
|
||||||
|
/// <param name="cultureInfo">Culture info.</param>
|
||||||
|
[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);
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Quotes the javascript string.
|
/// Quotes the javascript string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
|
||||||
$('[data-type="rate-bill"]').rate({target: 'Blogs/Rate'});
|
$('[data-type="rate-bill"]').rate({target: 'Blogs/Rate'});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<%=Ajax.GlobalizationScript()%>
|
<%=Ajax.YaGlobalizationScript()%>
|
||||||
<script src="<%=Url.Content("~/Scripts/yavsc.js")%>"></script>
|
<script src="<%=Url.Content("~/Scripts/yavsc.js")%>"></script>
|
||||||
<script src="<%=Url.Content("~/Scripts/yavsc.tags.js")%>"></script>
|
<script src="<%=Url.Content("~/Scripts/yavsc.tags.js")%>"></script>
|
||||||
<script src="<%=Url.Content("~/Scripts/yavsc.rate.js")%>"></script>
|
<script src="<%=Url.Content("~/Scripts/yavsc.rate.js")%>"></script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue