* IValueProvider.cs:

* TemplateException.cs:
* Login.aspx:
* Profile.aspx:
* WebApiConfig.cs:
* MyProfile.aspx:
* IValueProvider.cs:
* BlogsController.cs:
* BasketController.cs:
* ModuleController.cs:
* AccountController.cs:
* TemplateException.cs:
* WorkFlowController.cs:
* BlogsApiController.cs:
* PaypalApiController.cs:
* BasketController.cs:
* BlogsApiController.cs:
* WorkFlowController.cs:
* PaypalApiController.cs:
* FrontOfficeApiController.cs:
* FrontOfficeApiController.cs: refactoring

* jquery-ui.js: may be usefull at taking a date

* Web.csproj:
* WebApiConfig.cs: 

* App.master: added a spacer for a better rendering

* style.css: better style

* DateQuery.aspx: may use the jQuery "full calendar"

* FreeDate.cs: refactoring
main
Paul Schneider 11 years ago
parent b2fdbc8d2e
commit 944009936d
19 changed files with 16721 additions and 119 deletions

@ -43,35 +43,15 @@ namespace Yavsc.Controllers
{ {
return View (); return View ();
} }
/// <summary>
/// Login the specified returnUrl.
/// </summary>
/// <param name="returnUrl">Return URL.</param>
public ActionResult Login (string returnUrl)
{
ViewData ["returnUrl"] = returnUrl;
return View ();
}
/// <summary>
/// Gets the profile.
/// </summary>
/// <returns>The profile.</returns>
/// <param name="user">User.</param>
public static Profile GetProfile (string user)
{
return new Profile (ProfileBase.Create (user));
}
// TODO [ValidateAntiForgeryToken] // TODO [ValidateAntiForgeryToken]
/// <summary> /// <summary>
/// Dos the login. /// Does login.
/// </summary> /// </summary>
/// <returns>The login.</returns> /// <returns>The login.</returns>
/// <param name="model">Model.</param> /// <param name="model">Model.</param>
/// <param name="returnUrl">Return URL.</param> /// <param name="returnUrl">Return URL.</param>
public ActionResult DoLogin (LoginModel model, string returnUrl) public ActionResult Login (LoginModel model, string returnUrl)
{ {
if (ModelState.IsValid) { if (ModelState.IsValid) {
if (Membership.ValidateUser (model.UserName, model.Password)) { if (Membership.ValidateUser (model.UserName, model.Password)) {
@ -88,7 +68,7 @@ namespace Yavsc.Controllers
ViewData ["returnUrl"] = returnUrl; ViewData ["returnUrl"] = returnUrl;
// If we got this far, something failed, redisplay form // If we got this far, something failed, redisplay form
return View ("Login", model); return View (model);
} }
/// <summary> /// <summary>
/// Register the specified model and returnUrl. /// Register the specified model and returnUrl.
@ -255,11 +235,11 @@ namespace Yavsc.Controllers
/// <param name="model">Model.</param> /// <param name="model">Model.</param>
[Authorize] [Authorize]
[HttpGet] [HttpGet]
public ActionResult MyProfile (Profile model) public ActionResult Profile (Profile model)
{ {
string username = Membership.GetUser ().UserName; string username = Membership.GetUser ().UserName;
ViewData ["UserName"] = username; ViewData ["UserName"] = username;
model = GetProfile (username); model = new Profile (ProfileBase.Create (username));
model.RememberMe = FormsAuthentication.GetAuthCookie (username, true) == null; model.RememberMe = FormsAuthentication.GetAuthCookie (username, true) == null;
return View (model); return View (model);
} }
@ -272,7 +252,7 @@ namespace Yavsc.Controllers
[Authorize] [Authorize]
[HttpPost] [HttpPost]
// ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash" // ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash"
public ActionResult MyProfile (Profile model, HttpPostedFileBase AvatarFile) public ActionResult Profile (Profile model, HttpPostedFileBase AvatarFile)
{ {
string username = Membership.GetUser ().UserName; string username = Membership.GetUser ().UserName;
ViewData ["UserName"] = username; ViewData ["UserName"] = username;

@ -121,7 +121,7 @@ namespace Yavsc.Controllers
// find entries // find entries
BlogEntryCollection c = BlogManager.FindPost (user, sf, pageIndex, pageSize, out tr); BlogEntryCollection c = BlogManager.FindPost (user, sf, pageIndex, pageSize, out tr);
// Get author's meta data // Get author's meta data
Profile bupr = AccountController.GetProfile (user); Profile bupr = new Profile (ProfileBase.Create (user));
ViewData ["BlogUserProfile"] = bupr; ViewData ["BlogUserProfile"] = bupr;
// Inform of listing meta data // Inform of listing meta data
ViewData ["BlogTitle"] = bupr.BlogTitle; ViewData ["BlogTitle"] = bupr.BlogTitle;
@ -155,7 +155,7 @@ namespace Yavsc.Controllers
{ {
if (e == null) if (e == null)
return View ("TitleNotFound"); return View ("TitleNotFound");
Profile pr = AccountController.GetProfile (e.UserName); Profile pr = new Profile (ProfileBase.Create (e.UserName));
if (pr==null) if (pr==null)
return View ("TitleNotFound"); return View ("TitleNotFound");
ViewData ["BlogUserProfile"] = pr; ViewData ["BlogUserProfile"] = pr;

@ -48,12 +48,11 @@
</main> </main>
<aside> <aside>
<asp:ContentPlaceHolder ID="MASContent" runat="server"> <asp:ContentPlaceHolder ID="MASContent" runat="server">
</asp:ContentPlaceHolder> </asp:ContentPlaceHolder>
<div id="login"> <div id="login" >
<% if (Membership.GetUser()==null) { %> <% if (Membership.GetUser()==null) { %>
<%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" } ) %> <%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" } ) %>
<span class="hidcom"> Page d'accueil </span> <span class="hidcom"> Page d'accueil </span>
@ -64,7 +63,7 @@
</a> </a>
<span class="hidcom">S'authentifier avec son compte Google+</span> <span class="hidcom">S'authentifier avec son compte Google+</span>
<% } else { %> <% } else { %>
<%= Html.ActionLink(HttpContext.Current.User.Identity.Name, "MyProfile", "Account", null, new { @class="actionlink" }) %> <%= Html.ActionLink(HttpContext.Current.User.Identity.Name, "Profile", "Account", null, new { @class="actionlink" }) %>
<span class="hidcom"> &Eacute;dition de votre profile </span> <span class="hidcom"> &Eacute;dition de votre profile </span>
@ <%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" }) %> @ <%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" }) %>
<span class="hidcom"> Page d'accueil </span> <span class="hidcom"> Page d'accueil </span>
@ -72,9 +71,12 @@
<span class="hidcom"> &Eacute;dition d'un nouveau billet </span> <span class="hidcom"> &Eacute;dition d'un nouveau billet </span>
<%= Html.ActionLink( "Deconnexion", "Logout", "Account", new { returnUrl=Request.Url.PathAndQuery }, new { @class="actionlink" }) %> <%= Html.ActionLink( "Deconnexion", "Logout", "Account", new { returnUrl=Request.Url.PathAndQuery }, new { @class="actionlink" }) %>
<% } %> <% } %>
</div>
</div>
</aside> </aside>
<footer>
<div style="float:right; height:5em; z-index:-1;"></div>
<footer>
<%= Html.ActionLink("Contact","Contact","Home",null, new { @class="footerlink" }) %> <br/> <%= Html.ActionLink("Contact","Contact","Home",null, new { @class="footerlink" }) %> <br/>
<% foreach ( string link in Yavsc.ThanksHelper.Links()) { %> <% foreach ( string link in Yavsc.ThanksHelper.Links()) { %>
<%= link %> <%= link %>

File diff suppressed because it is too large Load Diff

@ -5,7 +5,6 @@ body {
background-repeat: no-repeat; background-repeat: no-repeat;
color: #D0FFD0; color: #D0FFD0;
font-family: 'Arial', cursive; font-family: 'Arial', cursive;
padding-bottom:2.5em;
} }
textarea { textarea {
@ -20,9 +19,10 @@ input, textarea, checkbox {
main { main {
background-color: rgba(17,0,23,0.65); background-color: rgba(17,0,23,0.65);
float:left; float:left;
margin-bottom:3em;
} }
footer:after {
content: '';
}
.panel,.bshpanel,aside { .panel,.bshpanel,aside {
background-color: rgba(32,16,16,0.8); background-color: rgba(32,16,16,0.8);
border-radius:5px; border: solid 1px #000060; border-radius:5px; border: solid 1px #000060;
@ -31,36 +31,43 @@ main {
.bsh { float: right; } .bsh { float: right; }
video,img { video,img {
max-width:100%; max-width:100%;
max-height:75%; max-height:75%;
position:relative; position:relative;
} }
footer { footer {
position:fixed; position:fixed;
bottom:0; bottom:0;
left:0; left:0;
right:0; right:0;
background-color:rgba(0,16,0,0.8); height:3em;
background-color:rgba(16,0,0,0.8);
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
z-index:-1; z-index:-1;
} }
#login { #login {
position:fixed;
width:7em;
top:0; top:0;
right:0; right:0;
background-color:rgba(0,16,0,0.8); background-color:rgba(16,16,0,0.8);
justify-content: space-around; justify-content: space-around;
padding:1em; text-align: center;
} }
header {
background-color:rgba(16,16,0,0.8);
top:0;
left:0;
right:0;
text-align: center;
text-transform: capitalize;
}
h1 img { vertical-align: text-top; }
footer img { max-height: 2em; } footer img { max-height: 2em; }
a { a {
@ -121,8 +128,7 @@ padding-left: 20px;
color: #B0B080; color: #B0B080;
border-radius:5px; border-radius:5px;
background-color:rgba(0,0,32,0.8); background-color:rgba(0,0,32,0.8);
font-size:x-small; font-size:large;
z-index:1;
cursor: pointer; cursor: pointer;
font-family: 'Arial', cursive; font-family: 'Arial', cursive;
} }
@ -206,19 +212,19 @@ padding-left: 20px;
display: none; display: none;
} }
footer img { footer img {
max-height: 1em; max-height: 1.2em;
} }
footer { footer {
font-size: small; font-size: small;
height: 1.5em;
} }
body { margin-bottom:1em; font-size: smaller; } body { font-size: smaller; }
} }
@media all and (max-width: 350px) { @media all and (max-width: 350px) {
footer img { max-height: 0.8em; } footer img { max-height: 0.8em; }
footer { font-size: x-small; } footer { font-size: x-small; height: 1em; }
} }
} }

@ -1,7 +1,7 @@
<%@ Page Title="Login" Language="C#" Inherits="System.Web.Mvc.ViewPage<LoginModel>" MasterPageFile="~/Models/App.master" %> <%@ Page Title="Login" Language="C#" Inherits="System.Web.Mvc.ViewPage<LoginModel>" MasterPageFile="~/Models/App.master" %>
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server"> <asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
<%= Html.ValidationSummary("Ouverture de session") %> <%= Html.ValidationSummary("Ouverture de session") %>
<% using(Html.BeginForm("DoLogin", "Account")) %> <% using(Html.BeginForm("Login", "Account")) %>
<% { %> <% { %>
<%= Html.LabelFor(model => model.UserName) %> <%= Html.LabelFor(model => model.UserName) %>
<%= Html.TextBox( "UserName" ) %> <%= Html.TextBox( "UserName" ) %>

@ -11,16 +11,45 @@ table.layout { border-width: 0; }
table.layout TR TD { max-width:40%; } table.layout TR TD { max-width:40%; }
</style> </style>
<%= Html.ValidationSummary() %> <%= Html.ValidationSummary() %>
<% using(Html.BeginForm("MyProfile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %> <% using(Html.BeginForm("Profile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" })) %>
<% { %> <% { %>
<fieldset><legend>Informations générales</legend> <fieldset><legend>Informations publiques</legend>
<table class="layout"> <table class="layout">
<tr><td align="right" style=""> <tr><td align="right" style="">
<%= Html.LabelFor(model => model.Name) %></td><td> <%= Html.LabelFor(model => model.Name) %></td><td>
<%= Html.TextBox("Name") %> <%= Html.TextBox("Name") %>
<%= Html.ValidationMessage("Name", "*") %></td></tr> <%= Html.ValidationMessage("Name", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.WebSite) %></td><td>
<%= Html.TextBox("WebSite") %>
<%= Html.ValidationMessage("WebSite", "*") %></td></tr>
<tr><td align="right"> <tr><td align="right">
Avatar </td><td> <img class="avatar" src="<%=Model.avatar%>" alt=""/>
<input type="file" id="AvatarFile" name="AvatarFile"/>
<%= Html.ValidationMessage("AvatarFile", "*") %></td></tr>
</table>
</fieldset>
<fieldset><legend>Blog</legend>
<table class="layout">
<tr><td align="right">
<%= Html.LabelFor(model => model.BlogVisible) %></td><td>
<%= Html.CheckBox("BlogVisible") %>
<%= Html.ValidationMessage("BlogVisible", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.BlogTitle) %></td><td>
<%= Html.TextBox("BlogTitle") %>
<%= Html.ValidationMessage("BlogTitle", "*") %></td></tr>
</table>
</fieldset>
<fieldset><legend>Contact</legend>
<table class="layout">
<tr><td align="right">
<%= Html.LabelFor(model => model.Phone) %></td><td> <%= Html.LabelFor(model => model.Phone) %></td><td>
<%= Html.TextBox("Phone") %> <%= Html.TextBox("Phone") %>
<%= Html.ValidationMessage("Phone", "*") %></td></tr> <%= Html.ValidationMessage("Phone", "*") %></td></tr>
@ -44,30 +73,23 @@ table.layout TR TD { max-width:40%; }
<%= Html.LabelFor(model => model.Country) %></td><td> <%= Html.LabelFor(model => model.Country) %></td><td>
<%= Html.TextBox("Country") %> <%= Html.TextBox("Country") %>
<%= Html.ValidationMessage("Country", "*") %></td></tr> <%= Html.ValidationMessage("Country", "*") %></td></tr>
<tr><td align="right"> </table>
<%= Html.LabelFor(model => model.WebSite) %></td><td> </fieldset>
<%= Html.TextBox("WebSite") %>
<%= Html.ValidationMessage("WebSite", "*") %></td></tr> <fieldset><legend>Disponibilité</legend>
<tr><td align="right">
<%= Html.LabelFor(model => model.BlogVisible) %></td><td> <table class="layout">
<%= Html.CheckBox("BlogVisible") %> <tr><td align="right">
<%= Html.ValidationMessage("BlogVisible", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.BlogTitle) %></td><td>
<%= Html.TextBox("BlogTitle") %>
<%= Html.ValidationMessage("BlogTitle", "*") %></td></tr>
<tr><td align="right">
Avatar </td><td> <img class="avatar" src="<%=Model.avatar%>" alt=""/>
<input type="file" id="AvatarFile" name="AvatarFile"/>
<%= Html.ValidationMessage("AvatarFile", "*") %></td></tr>
<tr><td align="right">
<%= Html.LabelFor(model => model.GoogleCalendar) %>: <%= Html.LabelFor(model => model.GoogleCalendar) %>:
</td> </td>
<td> <%= Html.Encode(Model.GoogleCalendar) %> <td> <%= Html.Encode(Model.GoogleCalendar) %>
<%= Html.ActionLink("Choisir l'agenda","ChooseCalendar","Google",new { returnUrl= Request.Url.AbsolutePath }, new { @class="actionlink" }) %> <%= Html.ActionLink("Choisir l'agenda","ChooseCalendar","Google",new { returnUrl= Request.Url.AbsolutePath }, new { @class="actionlink" }) %>
</td> </td>
</tr> </tr>
</table>
</table>
</fieldset> </fieldset>
<fieldset><legend>Informations de facturation</legend> <fieldset><legend>Informations de facturation</legend>

@ -2,8 +2,11 @@
<asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server"> <asp:Content ContentPlaceHolderID="head" ID="headContent" runat="server">
<link rel='stylesheet' href='/Scripts/fullcalendar/fullcalendar.css' />
<script type="text/javascript" src="/Scripts/jquery-2.1.3.min.js"></script> <script type="text/javascript" src="/Scripts/jquery-2.1.3.min.js"></script>
<script src='/Scripts/fullcalendar/lib/moment.min.js'></script>
<script src='/Scripts/fullcalendar/fullcalendar.js'></script>
<script type="text/javascript" src="/Scripts/jquery.mousewheel.js"></script> <script type="text/javascript" src="/Scripts/jquery.mousewheel.js"></script>
<script type="text/javascript" src="/Scripts/jquery-ui.js"></script> <script type="text/javascript" src="/Scripts/jquery-ui.js"></script>
<script type="text/javascript" src="/Scripts/jquery.timepicker.js"></script> <script type="text/javascript" src="/Scripts/jquery.timepicker.js"></script>

@ -135,6 +135,7 @@
<Folder Include="users\" /> <Folder Include="users\" />
<Folder Include="xmldoc\" /> <Folder Include="xmldoc\" />
<Folder Include="Views\PayPal\" /> <Folder Include="Views\PayPal\" />
<Folder Include="ApiControllers\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Controllers\HomeController.cs" /> <Compile Include="Controllers\HomeController.cs" />
@ -154,12 +155,8 @@
<Compile Include="Admin\TaskOutput.cs" /> <Compile Include="Admin\TaskOutput.cs" />
<Compile Include="Controllers\FileSystemController.cs" /> <Compile Include="Controllers\FileSystemController.cs" />
<Compile Include="CatExts\WebCatalogExtensions.cs" /> <Compile Include="CatExts\WebCatalogExtensions.cs" />
<Compile Include="Controllers\WorkFlowController.cs" />
<Compile Include="Controllers\FrontOfficeApiController.cs" />
<Compile Include="Helpers\YavscHelpers.cs" /> <Compile Include="Helpers\YavscHelpers.cs" />
<Compile Include="Controllers\BasketController.cs" />
<Compile Include="FileInfoCollection.cs" /> <Compile Include="FileInfoCollection.cs" />
<Compile Include="Controllers\BlogsApiController.cs" />
<Compile Include="Controllers\AdminController.cs" /> <Compile Include="Controllers\AdminController.cs" />
<Compile Include="Helpers\T.cs" /> <Compile Include="Helpers\T.cs" />
<Compile Include="templates\Estim.cs"> <Compile Include="templates\Estim.cs">
@ -169,7 +166,6 @@
<Compile Include="Formatters\EstimToPdfFormatter.cs" /> <Compile Include="Formatters\EstimToPdfFormatter.cs" />
<Compile Include="Formatters\SimpleFormatter.cs" /> <Compile Include="Formatters\SimpleFormatter.cs" />
<Compile Include="ValidateAjaxAttribute.cs" /> <Compile Include="ValidateAjaxAttribute.cs" />
<Compile Include="Controllers\IValueProvider.cs" />
<Compile Include="Controllers\GoogleController.cs" /> <Compile Include="Controllers\GoogleController.cs" />
<Compile Include="Controllers\ModuleController.cs" /> <Compile Include="Controllers\ModuleController.cs" />
<Compile Include="Settings\ThanksConfigurationSection.cs" /> <Compile Include="Settings\ThanksConfigurationSection.cs" />
@ -185,13 +181,18 @@
<Compile Include="Helpers\Google\OAuth2.cs" /> <Compile Include="Helpers\Google\OAuth2.cs" />
<Compile Include="Helpers\Google\EntityQuery.cs" /> <Compile Include="Helpers\Google\EntityQuery.cs" />
<Compile Include="Helpers\Google\ApiClient.cs" /> <Compile Include="Helpers\Google\ApiClient.cs" />
<Compile Include="Controllers\TemplateException.cs" />
<Compile Include="Helpers\Google\CalendarApi.cs" /> <Compile Include="Helpers\Google\CalendarApi.cs" />
<Compile Include="Formatters\ErrorHtmlFormatter.cs" /> <Compile Include="Formatters\ErrorHtmlFormatter.cs" />
<Compile Include="Formatters\RssFeedsFormatter.cs" /> <Compile Include="Formatters\RssFeedsFormatter.cs" />
<Compile Include="Controllers\PaypalApiController.cs" />
<Compile Include="Formatters\TexToPdfFormatter.cs" /> <Compile Include="Formatters\TexToPdfFormatter.cs" />
<Compile Include="Controllers\WebApiConfig.cs" /> <Compile Include="ApiControllers\BasketController.cs" />
<Compile Include="ApiControllers\BlogsApiController.cs" />
<Compile Include="ApiControllers\FrontOfficeApiController.cs" />
<Compile Include="ApiControllers\PaypalApiController.cs" />
<Compile Include="WebApiConfig.cs" />
<Compile Include="ApiControllers\WorkFlowController.cs" />
<Compile Include="TemplateException.cs" />
<Compile Include="IValueProvider.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
@ -670,11 +671,12 @@
<Content Include="Scripts\img\map-load.gif" /> <Content Include="Scripts\img\map-load.gif" />
<Content Include="Scripts\jquery.googlemaps.js" /> <Content Include="Scripts\jquery.googlemaps.js" />
<Content Include="Scripts\jquery.googlemaps.min.js" /> <Content Include="Scripts\jquery.googlemaps.min.js" />
<Content Include="Views\Account\MyProfile.aspx" />
<Content Include="Views\FrontOffice\Basket.aspx" /> <Content Include="Views\FrontOffice\Basket.aspx" />
<Content Include="Theme\dark\rect.png" /> <Content Include="Theme\dark\rect.png" />
<Content Include="Views\Google\ChooseADate.aspx" /> <Content Include="Views\Google\ChooseADate.aspx" />
<Content Include="Scripts\stupidtable.js" /> <Content Include="Scripts\stupidtable.js" />
<Content Include="Scripts\jquery-ui.js" />
<Content Include="Views\Account\Profile.aspx" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

@ -41,13 +41,18 @@ namespace Yavsc.Model.Google
/// Gets or sets the attendees. /// Gets or sets the attendees.
/// </summary> /// </summary>
/// <value>The attendees.</value> /// <value>The attendees.</value>
public string Attendees { get; set; } public string UserName { get; set; }
/// <summary> /// <summary>
/// Gets or sets the location. /// Gets or sets the location.
/// </summary> /// </summary>
/// <value>The location.</value> /// <value>The location.</value>
public string Location { get; set; } public string Location { get; set; }
static FreeDateSet CreateFromCalAndQuery(CalendarEventList cal, AskForADate query)
{
throw new NotImplementedException ();
}
} }
} }

Loading…