nouveau module jQuery pour

afficher/cacher les groupes de champ de formulaire

* yavsc.hidefieldset.js: Creation d'un nouveau module jQuery pour
  afficher/cacher les champ de formulaire en cliquant sur le titre des
  groupes de champ.

* style.css: style plus compact pour les fieldset

* App.master: appelle l'initialisation des widget hidefieldset

* Profile.aspx: mettre tous les elements fils d'un groupe champ dans
  des noeud cachable.

* Yavsc.csproj: referencer le nouveau script dans le projet

* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: traductions
main
Paul Schneider 10 years ago
parent 7e9e42f1eb
commit c6a9793c49
11 changed files with 125 additions and 26 deletions

@ -146,7 +146,7 @@ display:inline-block;
border-radius: 1em;
padding: 1em;
}
.spanel {
.spanel, fieldset {
max-width: 18em;
display: inline-block;
padding: .3em;
@ -254,9 +254,9 @@ input, select, textarea {
white-space: pre-wrap;
}
#avatar {
float: left;
margin:1em;
.avatar {
vertical-align: middle;
max-height: 1.3em; max-width: 1.3em;
}
.comment {

@ -1,3 +1,18 @@
2015-12-01 Paul Schneider <paul@pschneider.fr>
* yavsc.hidefieldset.js: Creation d'un nouveau module jQuery
pour afficher/cacher les champ de formulaire en cliquant sur
le titre des groupes de champ.
* style.css: style plus compact pour les fieldset
* App.master: appelle l'initialisation des widget hidefieldset
* Profile.aspx: mettre tous les elements fils d'un groupe
champ dans des noeud cachable.
* Yavsc.csproj: referencer le nouveau script dans le projet
2015-12-01 Paul Schneider <paul@pschneider.fr>
* Global.asax.cs: Fixe un 404 Not Found sur le script

@ -31,6 +31,7 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>';
<script src="<%=Url.Content("~/Scripts/yavsc.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.hidefieldset.js")%>"></script>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>

@ -0,0 +1,42 @@
(function() {
(function(jQuery) {
return jQuery.widget('Yavsc.hidefieldset', {
options: {
jsCallBack: null,
disabled: false
},
button: null,
_create: function() {
var $ctl = $(this.element);
var _this = this;
var _btn = $ctl.children('legend');
if (!this.options.disabled && _btn) {
_btn.addClass('actionlink');
_btn.addClass('fa');
_btn.addClass('fa-eye');
this.button = _btn;
$ctl.children(':not(legend)').hide();
this.button.click( function (e) {
if ( _btn.hasClass('fa-eye') ) {
_btn.removeClass('fa-eye');
_btn.addClass('fa-eye-slash');
$ctl.children(':not(legend)').show();
}
else {
_btn.addClass('fa-eye');
_btn.removeClass('fa-eye-slash');
$ctl.children(':not(legend)').hide();
}
});
}
},
})})(jQuery);
}).call(this);
$(document).ready(function(){
$('fieldset').hidefieldset();
});

@ -29,7 +29,11 @@
<%= Html.ValidationSummary() %>
<%= Html.Hidden("UserName",ViewData["ProfileUserName"]) %>
<fieldset><legend>Informations publiques</legend>
<fieldset><legend>Informations publiques
<i>
<img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" alt="avatar" class="avatar" />
<%=Html.Encode(Model.UserName)%> APE:<%=Model.MEACode%> <%=Model.WebSite%> </i></legend>
<span>
<%= Html.LabelFor(model => model.MEACode) %> :
<%= Html.DropDownList("MEACode") %>
<%= Html.ValidationMessage("MEACode", "*") %>
@ -45,22 +49,27 @@
<%= Html.ValidationMessage("WebSite", "*") %>
<br>
Avatar : <img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" alt="avatar" class="iconsmall" />
Avatar :
<input type="file" id="AvatarFile" name="AvatarFile"/>
<%= Html.ValidationMessage("AvatarFile", "*") %>
</span>
</fieldset>
<fieldset><legend>Informations administratives</legend>
<fieldset><legend>Informations administratives
<i><%= string.IsNullOrWhiteSpace(Model.Name)?"KO":Html.Encode(Model.Name) %>
</i>
</legend>
<span>
<%= Html.LabelFor(model => model.Name) %> :
<%= Html.TextBox("Name") %>
<%= Html.ValidationMessage("Name", "*") %>
<%= Html.ValidationMessage("Name", "*") %></span>
</fieldset>
<fieldset><legend>Blog</legend>
<div class="spanel">
<fieldset><legend>Blog <i><%=Html.Encode(Model.BlogTitle)%>
<%= Model.BlogVisible?null:Html.Translate("hidden") %>
</i></legend>
<div class="spanel">
<%= Html.LabelFor(model => model.BlogVisible) %> :
<%= Html.CheckBox("BlogVisible") %>
<%= Html.ValidationMessage("BlogVisible", "*") %>
@ -72,7 +81,10 @@ Avatar : <img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" a
</div>
</fieldset>
<fieldset><legend>Contact</legend>
<fieldset><legend>Contact
<i><%=Html.Encode(Model.Phone)%> <%=Html.Encode(Model.Mobile)%>
<%=Html.Encode(Model.HasPostalAddress?"adresse OK":"adresse KO")%></i>
</legend>
<div class="spanel">
<%= Html.LabelFor(model => model.Phone) %>
<%= Html.TextBox("Phone") %>
@ -99,14 +111,18 @@ Avatar : <img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" a
<%= Html.ValidationMessage("Country", "*") %>
</div>
</fieldset>
<fieldset><legend>Disponibilité</legend>
<fieldset><legend>Disponibilité
<i><%=Html.Encode(
string.IsNullOrWhiteSpace(Model.GoogleCalendar)?"KO":"OK")%></i></legend>
<div class="spanel">
<%= Html.LabelFor(model => model.GoogleCalendar) %> :
<%= Html.Encode(Model.GoogleCalendar) %>
<%= Html.ActionLink("Choisir l'agenda","ChooseCalendar","Google",new { returnUrl= Request.Url.AbsolutePath }, new { @class="actionlink" }) %>
</div></fieldset>
<fieldset><legend>Informations de facturation</legend>
<fieldset><legend>Informations de facturation
<i> <%=Html.Encode(Model.HasBankAccount?"OK":"KO")%> </i>
</legend>
<div class="spanel">
<%= Html.LabelFor(model => model.BankCode) %> :
@ -136,11 +152,14 @@ Avatar : <img src="<%=Url.AvatarUrl(HttpContext.Current.User.Identity.Name)%>" a
<%= Html.ValidationMessage("IBAN", "*") %>
</div>
</fieldset>
<fieldset><legend>Interface utilisateur</legend>
<fieldset><legend>Interface utilisateur
<i> <%=Html.Encode(Model.UITheme)%> </i>
</legend>
<span>
<%= Html.LabelFor(model => model.UITheme) %> :
<%= Html.TextBox("UITheme") %>
<%= Html.ValidationMessage("UITheme", "*") %>
<%= Html.ValidationMessage("UITheme", "*") %></span>
</fieldset>
<input type="submit"/>
<% } %>

@ -531,6 +531,7 @@
<Content Include="App_Themes\images\p8-av4.l.jpg" />
<Content Include="Views\Home\Activity.ascx" />
<Content Include="Views\FrontOffice\Performers.aspx" />
<Content Include="Scripts\yavsc.hidefieldset.js" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

@ -1,3 +1,10 @@
2015-12-01 Paul Schneider <paul@pschneider.fr>
* LocalizedText.resx:
* LocalizedText.fr.resx:
* LocalizedText.Designer.cs:
* LocalizedText.fr.Designer.cs: traductions
2015-11-30 Paul Schneider <paul@pschneider.fr>
* BlogProvider.cs: doc xml

@ -364,9 +364,9 @@ namespace Yavsc.Model {
}
}
public static string Google_registration_id {
public static string hidden {
get {
return ResourceManager.GetString("Google_registration_id", resourceCulture);
return ResourceManager.GetString("hidden", resourceCulture);
}
}
@ -424,6 +424,12 @@ namespace Yavsc.Model {
}
}
public static string Google_registration_id {
get {
return ResourceManager.GetString("Google_registration_id", resourceCulture);
}
}
public static string Bill_removal {
get {
return ResourceManager.GetString("Bill_removal", resourceCulture);

@ -358,9 +358,9 @@ namespace Yavsc.Model {
}
}
public static string Google_registration_id {
public static string hidden {
get {
return ResourceManager.GetString("Google_registration_id", resourceCulture);
return ResourceManager.GetString("hidden", resourceCulture);
}
}
@ -418,6 +418,12 @@ namespace Yavsc.Model {
}
}
public static string Google_registration_id {
get {
return ResourceManager.GetString("Google_registration_id", resourceCulture);
}
}
public static string Bill_removal {
get {
return ResourceManager.GetString("Bill_removal", resourceCulture);
@ -496,9 +502,9 @@ namespace Yavsc.Model {
}
}
public static string My_Estimates {
public static string Non_existent_user {
get {
return ResourceManager.GetString("My_Estimates", resourceCulture);
return ResourceManager.GetString("Non_existent_user", resourceCulture);
}
}
@ -724,9 +730,9 @@ namespace Yavsc.Model {
}
}
public static string Non_existent_user {
public static string My_Estimates {
get {
return ResourceManager.GetString("Non_existent_user", resourceCulture);
return ResourceManager.GetString("My_Estimates", resourceCulture);
}
}

@ -56,6 +56,7 @@
<data name="Hide_source"><value>Cacher le texte source du billet</value></data>
<data name="Home"><value>Accueil</value></data>
<data name="Hide"><value>Cacher</value></data>
<data name="hidden"><value>caché</value></data>
<data name="I_understood"><value>J'ai compris</value></data>
<data name="ImgLocator"><value>URI de l'image</value></data>
<data name="ImportException"><value>Exception à l'import</value></data>

@ -54,6 +54,7 @@
<data name="FillInAFutureDate"><value>Please, use a date in the future as starting date.</value></data>
<data name="Home"><value>Home</value></data>
<data name="Hide"><value>Hide</value></data>
<data name="hidden"><value>hidden</value></data>
<data name="Hide_source"><value>Hide the bill source text</value></data>
<data name="entries"><value>entries</value></data>
<data name="Google_calendar"><value>Google calendar</value></data>

Loading…