yalook
* totem-banner.png: * totem-banner.xs.jpg: * totem-banner.xxs.jpg: totem custo * Makefile: reloads config after each rsync call * NpgsqlBlogProvider.cs: - Fixes access on bills - Fixes usage of bill without photo * style.css: yastyle * AccountController.cs: - Fixes route usage with n ovalue for `id` - better code at getting the avatar url * BlogsController.cs: Fixes a Post request without user name in the route * YavscHelpers.cs: Implements a file list html rendering * App.master: * UserPost.aspx: * Profile.aspx: * AssemblyInfo.aspx: yahtmlstructure * Edit.aspx: Displays a list a attached files * UserPosts.aspx: yahtmlstrucure * Web.csproj: new images * instdbws.sql: returns to the flat list of properies (groups are not working) * LocalizedText.resx: * LocalizedText.fr.resx: * LocalizedText.Designer.cs: * LocalizedText.fr.Designer.cs: a new translation
This commit is contained in:
parent
c79921ea58
commit
30cebd7751
25 changed files with 349 additions and 165 deletions
|
|
@ -290,6 +290,8 @@ namespace Yavsc.Controllers
|
|||
// ASSERT("Membership.GetUser ().UserName is made of simple characters, no slash nor backslash"
|
||||
|
||||
string logdu = Membership.GetUser ().UserName;
|
||||
if (string.IsNullOrWhiteSpace (id))
|
||||
id = logdu;
|
||||
ViewData ["UserName"] = id;
|
||||
bool editsMyName = (string.Compare(id,logdu)==0);
|
||||
if (!editsMyName)
|
||||
|
|
@ -297,15 +299,17 @@ namespace Yavsc.Controllers
|
|||
if (!Roles.IsUserInRole ("FrontOffice"))
|
||||
throw new UnauthorizedAccessException ("Your are not authorized to modify this profile");
|
||||
|
||||
|
||||
if (AvatarFile != null) {
|
||||
// if said valid, move as avatar file
|
||||
// else invalidate the model
|
||||
if (AvatarFile.ContentType == "image/png") {
|
||||
string avdir = Server.MapPath (AvatarDir);
|
||||
var di = new DirectoryInfo (avdir);
|
||||
if (!di.Exists)
|
||||
di.Create ();
|
||||
string avpath = Path.Combine (avdir, id + ".png");
|
||||
AvatarFile.SaveAs (avpath);
|
||||
model.avatar = Request.Url.Scheme + "://" + Request.Url.Authority + AvatarDir.Substring (1) + "/" + id + ".png";
|
||||
model.avatar = Url.Content( AvatarDir + "/" + id + ".png");
|
||||
} else
|
||||
ModelState.AddModelError ("Avatar",
|
||||
string.Format ("Image type {0} is not supported (suported formats : {1})",
|
||||
|
|
@ -323,7 +327,9 @@ namespace Yavsc.Controllers
|
|||
if (AvatarFile != null) {
|
||||
prf.SetPropertyValue ("Avatar", model.avatar);
|
||||
} else {
|
||||
model.avatar = (string) prf.GetPropertyValue ("Avatar");
|
||||
var av = prf.GetPropertyValue ("Avatar");
|
||||
if (av != null)
|
||||
model.avatar = av as string;
|
||||
}
|
||||
prf.SetPropertyValue ("Address", model.Address);
|
||||
prf.SetPropertyValue ("CityAndState", model.CityAndState);
|
||||
|
|
|
|||
|
|
@ -230,28 +230,24 @@ namespace Yavsc.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Post the specified user and title.
|
||||
/// Post the specified title.
|
||||
/// </summary>
|
||||
/// <param name="user">User.</param>
|
||||
/// <param name="title">Title.</param>
|
||||
[Authorize]
|
||||
public ActionResult Post (string user, string title)
|
||||
public ActionResult Post ( string title)
|
||||
{
|
||||
ViewData ["BlogUser"] = user;
|
||||
ViewData ["PostTitle"] = title;
|
||||
ViewData ["SiteName"] = sitename;
|
||||
string un = Membership.GetUser ().UserName;
|
||||
if (String.IsNullOrEmpty (user))
|
||||
user = un;
|
||||
if (String.IsNullOrEmpty (title))
|
||||
title = "";
|
||||
ViewData ["SiteName"] = sitename;
|
||||
ViewData ["Author"] = un;
|
||||
ViewData ["AllowedCircles"] = CircleManager.DefaultProvider.List (Membership.GetUser ().UserName).Select (x => new SelectListItem {
|
||||
ViewData ["AllowedCircles"] = CircleManager.DefaultProvider.List (un)
|
||||
.Select (x => new SelectListItem {
|
||||
Value = x.Id.ToString(),
|
||||
Text = x.Title
|
||||
});
|
||||
|
||||
return View ("Edit", new BlogEntry { Title = title });
|
||||
return View ("Edit", new BlogEntry { Title = title, Author = un });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue