* Makefile: target set clarified

* Profile.aspx:
* AccountController.cs: Fixes the avatar display at edition time.

* style.css:
* UserPost.aspx: the users avatar as the page logo, floating at left

* Web.config:
* Global.asax.cs: Uses a new application parameter named
  "DefaultController", usage defaulting to "Blogs".

* Web.csproj:
* web.config: 

* Profile.cs: Fixes a default blog title using a null user's full name
This commit is contained in:
Paul Schneider 2015-04-23 04:39:34 +02:00
commit b918d9ff03
10 changed files with 62 additions and 27 deletions

View file

@ -261,7 +261,11 @@ namespace Yavsc.Controllers
ProfileBase prf = ProfileBase .Create (model.UserName);
prf.SetPropertyValue ("BlogVisible", model.BlogVisible);
prf.SetPropertyValue ("BlogTitle", model.BlogTitle);
prf.SetPropertyValue ("avatar", model.avatar);
if (AvatarFile != null) {
prf.SetPropertyValue ("avatar", model.avatar);
} else {
model.avatar = (string) prf.GetPropertyValue ("avatar");
}
prf.SetPropertyValue ("Address", model.Address);
prf.SetPropertyValue ("CityAndState", model.CityAndState);
prf.SetPropertyValue ("Country", model.Country);

View file

@ -12,6 +12,7 @@ using System.Web.Mvc;
using System.Web.Http;
using System.Web.WebPages.Scope;
using System.Reflection;
using System.Web.Configuration;
namespace Yavsc
{
@ -21,13 +22,19 @@ namespace Yavsc
/// </summary>
public class MvcApplication : System.Web.HttpApplication
{
/// <summary>
/// Registers the routes.
/// </summary>
/// <param name="routes">Routes.</param>
public static void RegisterRoutes (RouteCollection routes)
{
// Should be FrontOffice
string defaultController = WebConfigurationManager.AppSettings ["DefaultController"];
if (defaultController == null)
{
defaultController = "Admin";
}
routes.IgnoreRoute ("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute ("Scripts/{*pathInfo}");
routes.IgnoreRoute ("Theme/{*pathInfo}");
@ -58,7 +65,10 @@ namespace Yavsc
routes.MapRoute (
"Default",
"{controller}/{action}/{user}/{title}",
new { controller = "Blogs", action = "Index", user=UrlParameter.Optional, title = UrlParameter.Optional }
new { controller = defaultController,
action = "Index",
user=UrlParameter.Optional,
title = UrlParameter.Optional }
);
}

View file

@ -27,6 +27,10 @@ fieldset {
border-radius:5px; border: solid 1px #000060;
float:left;
}
#logo {
float: left;
}
.panel,.bshpanel,aside {
background-color: rgba(32,16,16,0.8);

View file

@ -29,7 +29,7 @@ table.layout TR TD { max-width:40%; }
<%= Html.ValidationMessage("WebSite", "*") %></td></tr>
<tr><td align="right">
Avatar </td><td> <img class="avatar" src="<%=Model.avatar%>" alt=""/>
Avatar </td><td> <img class="avatar" src="<%=Model.avatar%>?version=<%=Html.Encode(DateTime.Now.ToString())%>" alt=""/>
<input type="file" id="AvatarFile" name="AvatarFile"/>
<%= Html.ValidationMessage("AvatarFile", "*") %></td></tr>

View file

@ -7,7 +7,7 @@
<%= Html.ActionLink(Model.Title,"UserPost",new{user=Model.UserName,title=Model.Title}) %> -
<a href="/Blog/<%=Model.UserName%>">
<% if (ViewData["Avatar"]!=null) { %>
<img class="avatar" src="<%=ViewData["Avatar"]%>" alt=""/>
<img class="avatar" src="<%=ViewData["Avatar"]%>" alt="" id="logo"/>
<% } %>
<%=Html.Encode(ViewData["BlogTitle"])%>
</a> -

View file

@ -269,9 +269,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
<add key="AdminEMail" value="paulschneider@free.fr" />
<add key="OwnerEMail" value="paulschneider@free.fr" />
<add key="Name" value="Psc" />
<!-- do not point "/Home/index" with the value for the "StartPage",
it would result in a redirection infinite loop -->
<!-- <add key="StartPage" value="/Blog" /> -->
<add key="DefaultController" value="Blogs" />
<add key="DefaultAvatar" value="/images/noavatar.png;image/png" />
<add key="RegistrationMessage" value="/RegistrationMail.txt" />
<add key="ClientValidationEnabled" value="true" />

View file

@ -120,6 +120,8 @@
<Folder Include="Views\PayPal\" />
<Folder Include="ApiControllers\" />
<Folder Include="Views\Modules\" />
<Folder Include="ApiControllers\NightFlash\" />
<Folder Include="ApiControllers\NightFlash\Model\" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\HomeController.cs" />
@ -177,6 +179,18 @@
<Compile Include="TemplateException.cs" />
<Compile Include="IValueProvider.cs" />
<Compile Include="Formatters\EstimToPdfFormatter.MSAN.cs" />
<Compile Include="ApiControllers\NightFlash\Model\NFEvent.cs" />
<Compile Include="ApiControllers\NightFlash\Model\OpenDay.cs" />
<Compile Include="ApiControllers\NightFlash\Model\Period.cs" />
<Compile Include="ApiControllers\NightFlash\Model\Periodicity.cs" />
<Compile Include="ApiControllers\NightFlash\Model\Position.cs" />
<Compile Include="ApiControllers\NightFlash\Model\PositionAndKeyphrase.cs" />
<Compile Include="ApiControllers\NightFlash\Model\ProvidedEvent.cs" />
<Compile Include="ApiControllers\NightFlash\Model\Publishing.cs" />
<Compile Include="ApiControllers\NightFlash\Model\Schedule.cs" />
<Compile Include="ApiControllers\NightFlash\Model\ProviderPublicInfo.cs" />
<Compile Include="ApiControllers\NightFlash\Model\WeekDay.cs" />
<Compile Include="ApiControllers\NightFlash\NightFlashController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\Web.config" />
@ -665,7 +679,6 @@
<Content Include="Views\FrontOffice\Estimate.aspx" />
<Content Include="Theme\dark\croix.png" />
<Content Include="Views\Admin\RemoveRole..aspx" />
<Content Include="web.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

View file

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
</configuration>