Avatar
This commit is contained in:
@ -138,40 +138,34 @@ namespace Yavsc.WebApi.Controllers
|
|||||||
return Ok(user);
|
return Ok(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Actually only updates the user's name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="me">MyUpdate containing the new user name </param>
|
||||||
|
/// <returns>Ok when all is ok.</returns>
|
||||||
[HttpPut("~/api/me")]
|
[HttpPut("~/api/me")]
|
||||||
public async Task<IActionResult> UpdateMe(MyUpdate me)
|
public async Task<IActionResult> UpdateMe(MyUpdate me)
|
||||||
{
|
{
|
||||||
var ko = new BadRequestObjectResult(
|
if (!ModelState.IsValid) return new BadRequestObjectResult(
|
||||||
new { error = "Specify some valid update request." });
|
new { error = "Specify some valid user update request." });
|
||||||
if (me==null) return ko;
|
|
||||||
if (me.Avatar==null && me.UserName == null) return ko;
|
|
||||||
var user = await _userManager.FindByIdAsync(User.GetUserId());
|
var user = await _userManager.FindByIdAsync(User.GetUserId());
|
||||||
|
var result = await _userManager.SetUserNameAsync(user, me.UserName);
|
||||||
if (me.UserName !=null) {
|
if (result.Succeeded)
|
||||||
var result = await _userManager.SetUserNameAsync(user, me.UserName);
|
return Ok();
|
||||||
}
|
else return new BadRequestObjectResult(result);
|
||||||
if (me.Avatar!=null) {
|
|
||||||
user.Avatar = me.Avatar;
|
|
||||||
var result = await _userManager.UpdateAsync(user);
|
|
||||||
if (!result.Succeeded)
|
|
||||||
{
|
|
||||||
AddErrors("Avatar", result);
|
|
||||||
return new BadRequestObjectResult(ModelState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Ok();
|
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the avatar
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
[HttpPost("~/api/setavatar")]
|
[HttpPost("~/api/setavatar")]
|
||||||
public async Task<IActionResult> SetAvatar()
|
public async Task<IActionResult> SetAvatar()
|
||||||
{
|
{
|
||||||
var root = User.InitPostToFileSystem(null);
|
var root = User.InitPostToFileSystem(null);
|
||||||
var user = await _userManager.FindByIdAsync(User.GetUserId());
|
var user = await _userManager.FindByIdAsync(User.GetUserId());
|
||||||
long usage = user.DiskUsage;
|
|
||||||
if (Request.Form.Files.Count!=1)
|
if (Request.Form.Files.Count!=1)
|
||||||
return new BadRequestResult();
|
return new BadRequestResult();
|
||||||
var info = user.ReceiveUserFile(root, user.DiskQuota, ref usage, Request.Form.Files[0]);
|
var info = user.ReceiveAvatar(Request.Form.Files[0]);
|
||||||
user.DiskUsage = usage;
|
|
||||||
await _userManager.UpdateAsync(user);
|
await _userManager.UpdateAsync(user);
|
||||||
return Ok(info);
|
return Ok(info);
|
||||||
}
|
}
|
||||||
|
@ -53,13 +53,10 @@ namespace Yavsc.ApiControllers
|
|||||||
var user = dbContext.Users.Single(
|
var user = dbContext.Users.Single(
|
||||||
u => u.Id == User.GetUserId()
|
u => u.Id == User.GetUserId()
|
||||||
);
|
);
|
||||||
var quota = user.DiskQuota;
|
|
||||||
var usage = user.DiskUsage;
|
|
||||||
|
|
||||||
foreach (var f in Request.Form.Files)
|
foreach (var f in Request.Form.Files)
|
||||||
{
|
{
|
||||||
var item = user.ReceiveUserFile(root,quota,ref usage,f);
|
var item = user.ReceiveUserFile(root, f);
|
||||||
user.DiskUsage = usage;
|
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
yield return item;
|
yield return item;
|
||||||
};
|
};
|
||||||
|
BIN
Yavsc/Avatars/Paul.png
Normal file
BIN
Yavsc/Avatars/Paul.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
BIN
Yavsc/Avatars/Paul.s.png
Normal file
BIN
Yavsc/Avatars/Paul.s.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
Yavsc/Avatars/Paul.xs.png
Normal file
BIN
Yavsc/Avatars/Paul.xs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@ -23,10 +23,10 @@ namespace Yavsc
|
|||||||
StarHunterGroupName = "StarHunter",
|
StarHunterGroupName = "StarHunter",
|
||||||
BlogModeratorGroupName = "Moderator",
|
BlogModeratorGroupName = "Moderator",
|
||||||
FrontOfficeGroupName = "FrontOffice",
|
FrontOfficeGroupName = "FrontOffice",
|
||||||
UserBillsFilesDir= "Bills",
|
|
||||||
UserFilesDir = "UserFiles",
|
|
||||||
GCMNotificationUrl = "https://gcm-http.googleapis.com/gcm/send",
|
GCMNotificationUrl = "https://gcm-http.googleapis.com/gcm/send",
|
||||||
KeyProtectorPurpose = "OAuth.AspNet.AuthServer";
|
KeyProtectorPurpose = "OAuth.AspNet.AuthServer",
|
||||||
|
UserFilesPath = "/UserFiles",
|
||||||
|
AvatarsPath = "/Avatars" ;
|
||||||
public static readonly Scope[] SiteScopes = {
|
public static readonly Scope[] SiteScopes = {
|
||||||
new Scope { Id = "profile", Description = "Your profile informations" },
|
new Scope { Id = "profile", Description = "Your profile informations" },
|
||||||
new Scope { Id = "book" , Description ="Your booking interface"},
|
new Scope { Id = "book" , Description ="Your booking interface"},
|
||||||
|
@ -183,6 +183,7 @@ namespace Yavsc.Controllers
|
|||||||
var result = await _userManager.CreateAsync(user, model.Password);
|
var result = await _userManager.CreateAsync(user, model.Password);
|
||||||
if (result.Succeeded)
|
if (result.Succeeded)
|
||||||
{
|
{
|
||||||
|
user.DiskQuota = Startup.SiteSetup.UserFiles.Quota;
|
||||||
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713
|
// For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713
|
||||||
// Send an email with this link
|
// Send an email with this link
|
||||||
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
|
var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Mime;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using Microsoft.AspNet.Authorization;
|
using Microsoft.AspNet.Authorization;
|
||||||
using Microsoft.AspNet.FileProviders;
|
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNet.Http;
|
||||||
using Microsoft.AspNet.Mvc;
|
using Microsoft.AspNet.Mvc;
|
||||||
using Microsoft.Data.Entity;
|
using Microsoft.Data.Entity;
|
||||||
@ -62,9 +62,6 @@ namespace Yavsc.Controllers
|
|||||||
{
|
{
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
}
|
}
|
||||||
DirectoryInfo di = new DirectoryInfo(_site.UserFiles.DirName);
|
|
||||||
|
|
||||||
|
|
||||||
return View(estimate);
|
return View(estimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,21 +103,26 @@ namespace Yavsc.Controllers
|
|||||||
cmd => cmd.Id == estimate.CommandId
|
cmd => cmd.Id == estimate.CommandId
|
||||||
);
|
);
|
||||||
|
|
||||||
var userdir = Path.Combine(
|
var billsdir = Path.Combine(
|
||||||
_site.UserFiles.DirName,
|
_site.UserFiles.Bills,
|
||||||
perfomerProfile.Performer.UserName
|
perfomerProfile.Performer.UserName
|
||||||
);
|
);
|
||||||
|
|
||||||
var fsp = new PhysicalFileProvider(userdir);
|
|
||||||
var billsdir = Path.Combine(userdir,
|
|
||||||
Constants.UserBillsFilesDir);
|
|
||||||
|
|
||||||
foreach (var gr in newGraphics)
|
foreach (var gr in newGraphics)
|
||||||
{
|
{
|
||||||
|
ContentDisposition contentDisposition = new ContentDisposition(gr.ContentDisposition);
|
||||||
gr.SaveAs(
|
gr.SaveAs(
|
||||||
Path.Combine(
|
Path.Combine(
|
||||||
Path.Combine(billsdir, estimate.Id.ToString()),
|
Path.Combine(billsdir, estimate.Id.ToString()),
|
||||||
gr.ContentDisposition));
|
contentDisposition.FileName));
|
||||||
|
}
|
||||||
|
foreach (var formFile in newFiles)
|
||||||
|
{
|
||||||
|
ContentDisposition contentDisposition = new ContentDisposition(formFile.ContentDisposition);
|
||||||
|
formFile.SaveAs(
|
||||||
|
Path.Combine(
|
||||||
|
Path.Combine(billsdir, estimate.Id.ToString()),
|
||||||
|
contentDisposition.FileName));
|
||||||
}
|
}
|
||||||
return RedirectToAction("Index");
|
return RedirectToAction("Index");
|
||||||
}
|
}
|
||||||
|
@ -483,7 +483,7 @@ namespace Yavsc.Controllers
|
|||||||
[HttpGet, Authorize]
|
[HttpGet, Authorize]
|
||||||
public IActionResult SetAvatar()
|
public IActionResult SetAvatar()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet, Authorize]
|
[HttpGet, Authorize]
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Drawing.Imaging;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Mime;
|
using System.Net.Mime;
|
||||||
@ -59,8 +62,10 @@ namespace Yavsc.Helpers
|
|||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FileRecievedInfo ReceiveUserFile(this ApplicationUser user, string root, long quota, ref long usage, IFormFile f)
|
public static FileRecievedInfo ReceiveUserFile(this ApplicationUser user, string root, IFormFile f)
|
||||||
{
|
{
|
||||||
|
long usage = user.DiskUsage;
|
||||||
|
|
||||||
var item = new FileRecievedInfo();
|
var item = new FileRecievedInfo();
|
||||||
// form-data; name="file"; filename="capt0008.jpg"
|
// form-data; name="file"; filename="capt0008.jpg"
|
||||||
ContentDisposition contentDisposition = new ContentDisposition(f.ContentDisposition);
|
ContentDisposition contentDisposition = new ContentDisposition(f.ContentDisposition);
|
||||||
@ -73,8 +78,8 @@ namespace Yavsc.Helpers
|
|||||||
{
|
{
|
||||||
byte[] buffer = new byte[1024];
|
byte[] buffer = new byte[1024];
|
||||||
long len = org.Length;
|
long len = org.Length;
|
||||||
user.DiskUsage += len;
|
if (len > (user.DiskQuota - usage)) throw new FSQuotaException();
|
||||||
if (len > (quota - usage)) throw new FSQuotaException();
|
usage += len;
|
||||||
|
|
||||||
while (len > 0)
|
while (len > 0)
|
||||||
{
|
{
|
||||||
@ -87,8 +92,79 @@ namespace Yavsc.Helpers
|
|||||||
org.Close();
|
org.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
user.DiskUsage = usage;
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
}
|
public static FileRecievedInfo ReceiveAvatar(this ApplicationUser user, IFormFile formFile)
|
||||||
|
{
|
||||||
|
var item = new FileRecievedInfo();
|
||||||
|
item.FileName = user.UserName + ".png";
|
||||||
|
var destFileName = Path.Combine(Startup.SiteSetup.UserFiles.Avatars, item.FileName);
|
||||||
|
|
||||||
|
ImageProcessor.ImageFactory f = new ImageProcessor.ImageFactory();
|
||||||
|
|
||||||
|
ImageProcessor.Web.Processors.Resize r = new ImageProcessor.Web.Processors.Resize();
|
||||||
|
|
||||||
|
var fi = new FileInfo(destFileName);
|
||||||
|
if (fi.Exists) item.Overriden = true;
|
||||||
|
Rectangle cropRect = new Rectangle();
|
||||||
|
|
||||||
|
using (var org = formFile.OpenReadStream())
|
||||||
|
{
|
||||||
|
Image i = Image.FromStream(org);
|
||||||
|
using (Bitmap source = new Bitmap(i))
|
||||||
|
{
|
||||||
|
if (i.Width != i.Height)
|
||||||
|
{
|
||||||
|
if (i.Width > i.Height)
|
||||||
|
{
|
||||||
|
cropRect.X = (i.Width - i.Height) / 2;
|
||||||
|
cropRect.Y = 0;
|
||||||
|
cropRect.Width = i.Height;
|
||||||
|
cropRect.Height = i.Height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cropRect.X = 0;
|
||||||
|
cropRect.Y = (i.Height - i.Width) / 2;
|
||||||
|
cropRect.Width = i.Width;
|
||||||
|
cropRect.Height = i.Width;
|
||||||
|
}
|
||||||
|
using (var cropped = source.Clone(cropRect, source.PixelFormat))
|
||||||
|
{
|
||||||
|
CreateAvatars(user,cropped);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
item.DestDir = "/Avatars";
|
||||||
|
user.Avatar = item.FileName;
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CreateAvatars(this ApplicationUser user, Bitmap source)
|
||||||
|
{
|
||||||
|
var dir = Startup.SiteSetup.UserFiles.Avatars;
|
||||||
|
var name = user.UserName + ".png";
|
||||||
|
var smallname = user.UserName + ".s.png";
|
||||||
|
var xsmallname = user.UserName + ".xs.png";
|
||||||
|
using (Bitmap newBMP = new Bitmap(source, 128, 128))
|
||||||
|
{
|
||||||
|
newBMP.Save(Path.Combine(
|
||||||
|
dir, name), ImageFormat.Png);
|
||||||
|
}
|
||||||
|
using (Bitmap newBMP = new Bitmap(source, 64, 64))
|
||||||
|
{
|
||||||
|
newBMP.Save(Path.Combine(
|
||||||
|
dir, smallname), ImageFormat.Png);
|
||||||
|
}
|
||||||
|
using (Bitmap newBMP = new Bitmap(source, 32, 32))
|
||||||
|
{
|
||||||
|
newBMP.Save(Path.Combine(
|
||||||
|
dir, xsmallname), ImageFormat.Png);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ namespace Yavsc
|
|||||||
{
|
{
|
||||||
|
|
||||||
public class ThirdPartyFiles {
|
public class ThirdPartyFiles {
|
||||||
public string DirName { get; set; }
|
public string Avatars { get; set; }
|
||||||
public string Quota { get; set; }
|
public long Quota { get; set; }
|
||||||
public string Blog { get; set; }
|
public string Blog { get; set; }
|
||||||
public string Bills { get; set; }
|
public string Bills { get; set; }
|
||||||
|
|
||||||
|
@ -13,10 +13,11 @@ namespace Yavsc
|
|||||||
public static string UserFilesDirName { get; private set; }
|
public static string UserFilesDirName { get; private set; }
|
||||||
public static FileServerOptions UserFilesOptions { get; private set; }
|
public static FileServerOptions UserFilesOptions { get; private set; }
|
||||||
|
|
||||||
|
public static FileServerOptions AvatarsOptions { get; set; }
|
||||||
public void ConfigureFileServerApp(IApplicationBuilder app,
|
public void ConfigureFileServerApp(IApplicationBuilder app,
|
||||||
SiteSettings siteSettings, IHostingEnvironment env)
|
SiteSettings siteSettings, IHostingEnvironment env)
|
||||||
{
|
{
|
||||||
var userFilesDirInfo = new DirectoryInfo( siteSettings.UserFiles.DirName );
|
var userFilesDirInfo = new DirectoryInfo( siteSettings.UserFiles.Blog );
|
||||||
UserFilesDirName = userFilesDirInfo.FullName;
|
UserFilesDirName = userFilesDirInfo.FullName;
|
||||||
|
|
||||||
if (!userFilesDirInfo.Exists) userFilesDirInfo.Create();
|
if (!userFilesDirInfo.Exists) userFilesDirInfo.Create();
|
||||||
@ -24,10 +25,24 @@ namespace Yavsc
|
|||||||
UserFilesOptions = new FileServerOptions()
|
UserFilesOptions = new FileServerOptions()
|
||||||
{
|
{
|
||||||
FileProvider = new PhysicalFileProvider(UserFilesDirName),
|
FileProvider = new PhysicalFileProvider(UserFilesDirName),
|
||||||
RequestPath = new PathString("/" + siteSettings.UserFiles.DirName),
|
RequestPath = new PathString(Constants.UserFilesPath),
|
||||||
EnableDirectoryBrowsing = env.IsDevelopment()
|
EnableDirectoryBrowsing = env.IsDevelopment()
|
||||||
};
|
};
|
||||||
|
var avatarsDirInfo = new DirectoryInfo(Startup.SiteSetup.UserFiles.Avatars);
|
||||||
|
if (!avatarsDirInfo.Exists) avatarsDirInfo.Create();
|
||||||
|
AvatarsDirName = avatarsDirInfo.FullName;
|
||||||
|
|
||||||
|
AvatarsOptions = new FileServerOptions()
|
||||||
|
{
|
||||||
|
FileProvider = new PhysicalFileProvider(AvatarsDirName),
|
||||||
|
RequestPath = new PathString(Constants.AvatarsPath),
|
||||||
|
EnableDirectoryBrowsing = env.IsDevelopment()
|
||||||
|
};
|
||||||
|
|
||||||
app.UseFileServer(UserFilesOptions);
|
app.UseFileServer(UserFilesOptions);
|
||||||
|
|
||||||
|
app.UseFileServer(AvatarsOptions);
|
||||||
|
|
||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ namespace Yavsc
|
|||||||
{
|
{
|
||||||
public static string ConnectionString { get; private set; }
|
public static string ConnectionString { get; private set; }
|
||||||
public static string UserBillsDirName { private set; get; }
|
public static string UserBillsDirName { private set; get; }
|
||||||
|
public static string AvatarsDirName { private set; get; }
|
||||||
public static string Authority { get; private set; }
|
public static string Authority { get; private set; }
|
||||||
public static string Audience { get; private set; }
|
public static string Audience { get; private set; }
|
||||||
public static SiteSettings SiteSetup { get; private set; }
|
public static SiteSettings SiteSetup { get; private set; }
|
||||||
@ -229,8 +230,8 @@ namespace Yavsc
|
|||||||
ILoggerFactory loggerFactory)
|
ILoggerFactory loggerFactory)
|
||||||
{
|
{
|
||||||
SiteSetup = siteSettings.Value;
|
SiteSetup = siteSettings.Value;
|
||||||
Startup.UserFilesDirName = siteSettings.Value.UserFiles.DirName;
|
Startup.UserFilesDirName = new DirectoryInfo(siteSettings.Value.UserFiles.Blog).FullName;
|
||||||
Startup.UserBillsDirName = siteSettings.Value.UserFiles.Bills;
|
Startup.UserBillsDirName = new DirectoryInfo(siteSettings.Value.UserFiles.Bills).FullName;
|
||||||
|
|
||||||
// TODO implement an installation & upgrade procedure
|
// TODO implement an installation & upgrade procedure
|
||||||
// Create required directories
|
// Create required directories
|
||||||
|
@ -31,6 +31,7 @@ namespace Yavsc.Models.Auth
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class MyUpdate {
|
public class MyUpdate {
|
||||||
|
|
||||||
public string UserName { get; set; }
|
public string UserName { get; set; }
|
||||||
public string Avatar { get; set; }
|
public string Avatar { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
[<a asp-controller="Manage"
|
[<a asp-controller="Manage"
|
||||||
asp-action="CHUN">@SR["Change"]</a>]
|
asp-action="CHUN">@SR["Change"]</a>]
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
@if (Model.Roles.Count()>0) {
|
@if (Model.Roles.Count()>0) {
|
||||||
<dt>@SR["Roles"]:</dt>
|
<dt>@SR["Roles"]:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@ -45,7 +46,9 @@
|
|||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt>@SR["Avatar"]:</dt>
|
<dt>@SR["Avatar"]:</dt>
|
||||||
<dd>@Model.Avatar
|
<dd>
|
||||||
|
<img src="~/Avatars/@(User.Identity.Name).png">
|
||||||
|
@Model.Avatar
|
||||||
[<a asp-controller="Manage" asp-action="SetAvatar"
|
[<a asp-controller="Manage" asp-action="SetAvatar"
|
||||||
>@SR[@Model.Avatar==null?"Set":"Modify"]</a>]
|
>@SR[@Model.Avatar==null?"Set":"Modify"]</a>]
|
||||||
</dd>
|
</dd>
|
||||||
|
32
Yavsc/Views/Manage/SetAvatar.cshtml
Normal file
32
Yavsc/Views/Manage/SetAvatar.cshtml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
@model PerformerProfile
|
||||||
|
@{ ViewData["Title"] = SR["Edit your avatar"]; }
|
||||||
|
@section header{
|
||||||
|
<link href="~/css/dropzone.css" rel="stylesheet">
|
||||||
|
}
|
||||||
|
@section scripts{
|
||||||
|
<script src="~/js/dropzone.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
Dropzone.options.postavatar= {
|
||||||
|
maxFilesize: 2, // MB
|
||||||
|
autoProcessQueue: true,
|
||||||
|
accept: function(file, done) {
|
||||||
|
if (file.name == "justinbieber.jpg") {
|
||||||
|
done("Naha, you don't.");
|
||||||
|
}
|
||||||
|
else { done(); }
|
||||||
|
},
|
||||||
|
url: "/api/setavatar"
|
||||||
|
};
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
<img src="~/Avatars/@(User.Identity.Name).png">
|
||||||
|
|
||||||
|
<form id="postavatar" class="dropzone" method="post" enctype="multipart/form-data">
|
||||||
|
<div class="fallback">
|
||||||
|
<input name="Avatar" type="file" id="Avatar" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@Html.AntiForgeryToken()
|
||||||
|
</form>
|
@ -5,7 +5,9 @@
|
|||||||
<form asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="navbar-right">
|
<form asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="navbar-right">
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<li>
|
<li>
|
||||||
<a asp-controller="Manage" class="navbar-link" asp-action="Index" title="Manage">@SR["Hello"] @User.GetUserName()!</a>
|
<a asp-controller="Manage" class="navbar-link" asp-action="Index" title="Manage">
|
||||||
|
<img src="~/Avatars/@(User.Identity.Name).xs.png" />
|
||||||
|
@SR["Hello"] @User.GetUserName()!</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button type="submit" class="btn btn-link navbar-btn navbar-link" >@SR["Logout"]</button>
|
<button type="submit" class="btn btn-link navbar-btn navbar-link" >@SR["Logout"]</button>
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
"Address": "contact@company.com"
|
"Address": "contact@company.com"
|
||||||
},
|
},
|
||||||
"UserFiles": {
|
"UserFiles": {
|
||||||
"DirName": "UserFiles",
|
"Avatars": "Avatars",
|
||||||
"Quota": "200M",
|
"Quota": 200000000,
|
||||||
"Bills":"Bills",
|
"Bills":"Bills",
|
||||||
"Blog":"Blog"
|
"Blog":"Blog"
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user