simpler, better

This commit is contained in:
2018-06-10 20:40:11 +02:00
parent b14ad5242b
commit 78c89b32b4
27 changed files with 3323 additions and 50 deletions

View File

@ -27,6 +27,7 @@ namespace Yavsc
GCMNotificationUrl = "https://gcm-http.googleapis.com/gcm/send",
UserFilesPath = "/files",
AvatarsPath = "/avatars",
GitPath = "/git",
DefaultAvatar = "/images/Users/icon_user.png",
AnonAvatar = "/images/Users/icon_anon_user.png";

View File

@ -3,3 +3,5 @@ include ../dnx.mk
all: $(BINTARGETPATH)
bin/$(CONFIGURATION)/Yavsc.Server.dll: ../OAuth.AspNet.AuthServer/bin/$(CONFIGURATION)/OAuth.AspNet.AuthServer.dll

View File

@ -1,9 +1,18 @@
using System.ComponentModel.DataAnnotations.Schema;
using Yavsc.Models;
namespace Yavsc.Server.Models.IT.SourceCode
{
public class GitRepositoryReference
{
public string Url { get; set; }
public string Path { get; set; }
public string Branch { get; set; }
public string OwnerId { get; set; }
[ForeignKey("OwnerId")]
public virtual ApplicationUser Owner { get; set; }
}
}

View File

@ -8,7 +8,6 @@ namespace Yavsc.ViewModels.Account
// ErrorMessage = "",
[Display(ResourceType = typeof(RegisterViewModel), Name = "UserName")]
[StringLength(102)]
[YaRegularExpression(@"[a-zA-Z0-9 .'_-]+", ErrorMessageResourceName="InvalidUserName", ErrorMessageResourceType = typeof(RegisterViewModel))]
public string UserName { get; set; }
@ -23,11 +22,9 @@ namespace Yavsc.ViewModels.Account
// ErrorMessage = "Les mots de passe doivent contenir au moins un caractère spécial, qui ne soit ni une lettre ni un chiffre.")]
[Display(ResourceType = typeof(RegisterViewModel), Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(ResourceType = typeof(RegisterViewModel), Name = "PasswordConfirm")]
[Compare("Password", ErrorMessageResourceName = "PassAndConfirmDontMach", ErrorMessageResourceType = typeof(RegisterViewModel) )]
public string ConfirmPassword { get; set; }

View File

@ -45,6 +45,7 @@
"defaultNamespace": "Yavsc"
},
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-*",
"Microsoft.Extensions.Configuration.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
@ -64,7 +65,9 @@
"PayPalMerchant-net451": "2.7.109",
"MailKit": "1.12.0",
"Microsoft.CodeAnalysis.CSharp": "1.1.0-rc1-20151109-01",
"Yavsc.Abstract": {}
"Yavsc.Abstract": {
"type": "build"
}
},
"frameworks": {
"dnx451": {
@ -102,4 +105,4 @@
"ef": "EntityFramework.Commands",
"gen": "Microsoft.Extensions.CodeGeneration"
}
}
}

View File

@ -12,6 +12,26 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final",
"Microsoft.AspNet.Hosting.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/dnx451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -75,6 +95,28 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core",
"System.IO",
"System.Text.Encoding",
"System.Threading.Tasks"
],
"compile": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -1190,6 +1232,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -1239,6 +1299,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -2354,6 +2433,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -2403,6 +2500,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -3518,6 +3634,26 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final",
"Microsoft.AspNet.Hosting.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/dnx451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -3581,6 +3717,28 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core",
"System.IO",
"System.Text.Encoding",
"System.Threading.Tasks"
],
"compile": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -4696,6 +4854,26 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final",
"Microsoft.AspNet.Hosting.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/dnx451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -4759,6 +4937,28 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core",
"System.IO",
"System.Text.Encoding",
"System.Threading.Tasks"
],
"compile": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/dnx451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -5874,6 +6074,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -5923,6 +6141,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -7038,6 +7275,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -7087,6 +7342,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -8202,6 +8476,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -8251,6 +8543,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -9366,6 +9677,24 @@
"lib/BouncyCastle.Crypto.dll": {}
}
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational.Design": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Commands.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Commands.dll": {}
}
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
@ -9415,6 +9744,25 @@
"lib/net451/EntityFramework.Relational.dll": {}
}
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"dependencies": {
"EntityFramework.Relational": "7.0.0-rc1-final"
},
"frameworkAssemblies": [
"Microsoft.CSharp",
"mscorlib",
"System",
"System.ComponentModel.DataAnnotations",
"System.Core"
],
"compile": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
},
"runtime": {
"lib/net451/EntityFramework.Relational.Design.dll": {}
}
},
"Gapi.net45/1.0.0": {
"type": "package",
"compile": {
@ -10537,6 +10885,33 @@
"Readme.txt"
]
},
"EntityFramework.Commands/7.0.0-rc1-final": {
"type": "package",
"serviceable": true,
"sha512": "+wa2VWX3/vDkOpeCeIotMevqpIISimGqeYNTGYRLRhv+8HzsCLeymLzmmYpjav6zYQVvuJiJodapQvijAIfRrA==",
"files": [
"app/ef",
"app/ef.cmd",
"app/project.json",
"build/netcore50/EntityFramework.Commands.props",
"EntityFramework.Commands.7.0.0-rc1-final.nupkg",
"EntityFramework.Commands.7.0.0-rc1-final.nupkg.sha512",
"EntityFramework.Commands.nuspec",
"lib/dnx451/EntityFramework.Commands.dll",
"lib/dnx451/EntityFramework.Commands.xml",
"lib/dnxcore50/EntityFramework.Commands.dll",
"lib/dnxcore50/EntityFramework.Commands.xml",
"lib/net451/EntityFramework.Commands.dll",
"lib/net451/EntityFramework.Commands.xml",
"lib/netcore50/_._",
"tools/about_EntityFramework.help.txt",
"tools/EntityFramework.psd1",
"tools/EntityFramework.psm1",
"tools/init.ps1",
"tools/install.ps1",
"tools/OperationHandlers.cs"
]
},
"EntityFramework.Core/7.0.0-rc1-final": {
"type": "package",
"serviceable": true,
@ -10571,6 +10946,24 @@
"lib/netcore50/EntityFramework.Relational.xml"
]
},
"EntityFramework.Relational.Design/7.0.0-rc1-final": {
"type": "package",
"serviceable": true,
"sha512": "sXAqOxpHmbqOELC21vAzKlsjqgNCrk3jEjyJxjGnn1+j4hazxiqgSBTl8ZofqYzLO6ias9WfeXJy8HcXOl7waw==",
"files": [
"build/netcore50/EntityFramework.Relational.Design.props",
"EntityFramework.Relational.Design.7.0.0-rc1-final.nupkg",
"EntityFramework.Relational.Design.7.0.0-rc1-final.nupkg.sha512",
"EntityFramework.Relational.Design.nuspec",
"lib/dnx451/EntityFramework.Relational.Design.dll",
"lib/dnx451/EntityFramework.Relational.Design.xml",
"lib/dnxcore50/EntityFramework.Relational.Design.dll",
"lib/dnxcore50/EntityFramework.Relational.Design.xml",
"lib/net451/EntityFramework.Relational.Design.dll",
"lib/net451/EntityFramework.Relational.Design.xml",
"lib/netcore50/_._"
]
},
"Gapi.net45/1.0.0": {
"type": "package",
"sha512": "ZA31xhTPss1akMMgT3PvDNkqI46t9dvkxgyKVnjXKP9OFSNSSxvSomev5Srvq1tXyadCP0cFBM1GkS0qLwTtUg==",
@ -12133,6 +12526,7 @@
},
"projectFileDependencyGroups": {
"": [
"EntityFramework.Commands >= 7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework >= 3.0.0-rc1-*",
"Microsoft.Extensions.Configuration.Abstractions >= 1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions >= 1.0.0-rc1-final",

View File

@ -411,9 +411,9 @@ namespace Yavsc.Controllers
{
// Renames the blog files
var userdirinfo = new DirectoryInfo(
Path.Combine(_siteSettings.UserFiles.Blog,
Path.Combine(_siteSettings.Blog,
oldUserName));
var newdir = Path.Combine(_siteSettings.UserFiles.Blog,
var newdir = Path.Combine(_siteSettings.Blog,
model.NewUserName);
if (userdirinfo.Exists)
userdirinfo.MoveTo(newdir);
@ -421,10 +421,10 @@ namespace Yavsc.Controllers
foreach (string s in new string [] { ".png", ".s.png", ".xs.png" })
{
FileInfo fi = new FileInfo(
Path.Combine(_siteSettings.UserFiles.Avatars,
Path.Combine(_siteSettings.Avatars,
oldUserName+s));
if (fi.Exists)
fi.MoveTo(Path.Combine(_siteSettings.UserFiles.Avatars,
fi.MoveTo(Path.Combine(_siteSettings.Avatars,
model.NewUserName+s));
}
await _signInManager.SignInAsync(user, isPersistent: false);

View File

@ -118,7 +118,7 @@ namespace Yavsc.Controllers
);
var billsdir = Path.Combine(
_site.UserFiles.Bills,
_site.Bills,
perfomerProfile.Performer.UserName
);

View File

@ -0,0 +1,127 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.Data.Entity;
using Yavsc.Models;
using Yavsc.Server.Models.IT.SourceCode;
namespace Yavsc.Controllers
{
public class GitController : Controller
{
private ApplicationDbContext _context;
public GitController(ApplicationDbContext context)
{
_context = context;
}
// GET: Git
public async Task<IActionResult> Index()
{
var applicationDbContext = _context.GitRepositoryReference.Include(g => g.Owner);
return View(await applicationDbContext.ToListAsync());
}
// GET: Git/Details/5
public async Task<IActionResult> Details(string id)
{
if (id == null)
{
return HttpNotFound();
}
GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Path == id);
if (gitRepositoryReference == null)
{
return HttpNotFound();
}
return View(gitRepositoryReference);
}
// GET: Git/Create
public IActionResult Create()
{
ViewData["OwnerId"] = new SelectList(_context.ApplicationUser, "Id", "Owner");
return View();
}
// POST: Git/Create
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Create(GitRepositoryReference gitRepositoryReference)
{
if (ModelState.IsValid)
{
_context.GitRepositoryReference.Add(gitRepositoryReference);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
ViewData["OwnerId"] = new SelectList(_context.ApplicationUser, "Id", "Owner", gitRepositoryReference.OwnerId);
return View(gitRepositoryReference);
}
// GET: Git/Edit/5
public async Task<IActionResult> Edit(string id)
{
if (id == null)
{
return HttpNotFound();
}
GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Path == id);
if (gitRepositoryReference == null)
{
return HttpNotFound();
}
ViewData["OwnerId"] = new SelectList(_context.ApplicationUser, "Id", "Owner", gitRepositoryReference.OwnerId);
return View(gitRepositoryReference);
}
// POST: Git/Edit/5
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(GitRepositoryReference gitRepositoryReference)
{
if (ModelState.IsValid)
{
_context.Update(gitRepositoryReference);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
ViewData["OwnerId"] = new SelectList(_context.ApplicationUser, "Id", "Owner", gitRepositoryReference.OwnerId);
return View(gitRepositoryReference);
}
// GET: Git/Delete/5
[ActionName("Delete")]
public async Task<IActionResult> Delete(string id)
{
if (id == null)
{
return HttpNotFound();
}
GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Path == id);
if (gitRepositoryReference == null)
{
return HttpNotFound();
}
return View(gitRepositoryReference);
}
// POST: Git/Delete/5
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(string id)
{
GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Path == id);
_context.GitRepositoryReference.Remove(gitRepositoryReference);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
}
}

View File

@ -29,7 +29,7 @@ public static FileRecievedInfo ReceiveProSignature(this ClaimsPrincipal user, st
item.FileName = SignFileNameFormat("pro",billingCode,estimateId);
item.MimeType = formFile.ContentDisposition;
var destFileName = Path.Combine(Startup.SiteSetup.UserFiles.Bills, item.FileName);
var destFileName = Path.Combine(Startup.SiteSetup.Bills, item.FileName);
var fi = new FileInfo(destFileName);
if (fi.Exists) item.Overriden = true;
@ -47,7 +47,7 @@ public static FileRecievedInfo ReceiveProSignature(this ClaimsPrincipal user, st
private static void CreateAvatars(this ApplicationUser user, Bitmap source)
{
var dir = Startup.SiteSetup.UserFiles.Avatars;
var dir = Startup.SiteSetup.Avatars;
var name = user.UserName + ".png";
var smallname = user.UserName + ".s.png";
var xsmallname = user.UserName + ".xs.png";
@ -147,7 +147,7 @@ public static FileRecievedInfo ReceiveProSignature(this ClaimsPrincipal user, st
var item = new FileRecievedInfo();
item.FileName = user.UserName + ".png";
var destFileName = Path.Combine(Startup.SiteSetup.UserFiles.Avatars, item.FileName);
var destFileName = Path.Combine(Startup.SiteSetup.Avatars, item.FileName);
var fi = new FileInfo(destFileName);
if (fi.Exists) item.Overriden = true;

View File

@ -23,6 +23,11 @@ default: pushInPre
deploy: pushInPre pushInProd
../Yavsc.Server/bin/$(CONFIGURATION)/Yavsc.Server.dll:
make -C ../Yavsc.Server CONFIGURATION=$(CONFIGURATION)
project.json: ../Yavsc.Server/bin/$(CONFIGURATION)/Yavsc.Server.dll
pushInPre: cleanoutput bin/output/wwwroot/version
ssh $(HOSTADMIN)@$(HOSTING) sudo service kestrel-pre stop
ssh $(HOSTADMIN)@$(HOSTING) sudo rm -rf $(DESTDIR)/approot

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,750 @@
using System;
using System.Collections.Generic;
using Microsoft.Data.Entity.Migrations;
namespace Yavsc.Migrations
{
public partial class gitRefOwner : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_BlogPost_BlogPostId", table: "CircleAuthorizationToBlogPost");
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
migrationBuilder.DropForeignKey(name: "FK_Estimate_ApplicationUser_ClientId", table: "Estimate");
migrationBuilder.DropForeignKey(name: "FK_BlogTag_BlogPost_PostId", table: "BlogTag");
migrationBuilder.DropForeignKey(name: "FK_BlogTag_Tag_TagId", table: "BlogTag");
migrationBuilder.DropForeignKey(name: "FK_Comment_ApplicationUser_AuthorId", table: "Comment");
migrationBuilder.DropForeignKey(name: "FK_Comment_BlogPost_PostId", table: "Comment");
migrationBuilder.DropForeignKey(name: "FK_Schedule_ApplicationUser_OwnerId", table: "Schedule");
migrationBuilder.DropForeignKey(name: "FK_ChatConnection_ApplicationUser_ApplicationUserId", table: "ChatConnection");
migrationBuilder.DropForeignKey(name: "FK_BrusherProfile_PerformerProfile_UserId", table: "BrusherProfile");
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_HairPrestation_PrestationId", table: "HairCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId", table: "HairPrestationCollectionItem");
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId", table: "HairPrestationCollectionItem");
migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint");
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairPrestation_PrestationId", table: "HairTaintInstance");
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairTaint_TaintId", table: "HairTaintInstance");
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked");
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_ApplicationUser_UserId", table: "DimissClicked");
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
migrationBuilder.DropForeignKey(name: "FK_PayPalPayment_ApplicationUser_ExecutorId", table: "PayPalPayment");
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm");
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery");
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery");
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
migrationBuilder.AddColumn<string>(
name: "OwnerId",
table: "GitRepositoryReference",
nullable: true);
migrationBuilder.AddForeignKey(
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
table: "AspNetRoleClaims",
column: "RoleId",
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
table: "AspNetUserClaims",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
table: "AspNetUserLogins",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
table: "AspNetUserRoles",
column: "RoleId",
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
table: "AspNetUserRoles",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_BlackListed_ApplicationUser_OwnerId",
table: "BlackListed",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CircleAuthorizationToBlogPost_BlogPost_BlogPostId",
table: "CircleAuthorizationToBlogPost",
column: "BlogPostId",
principalTable: "BlogPost",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
table: "CircleAuthorizationToBlogPost",
column: "CircleId",
principalTable: "Circle",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_AccountBalance_ApplicationUser_UserId",
table: "AccountBalance",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_BalanceImpact_AccountBalance_BalanceId",
table: "BalanceImpact",
column: "BalanceId",
principalTable: "AccountBalance",
principalColumn: "UserId",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CommandLine_Estimate_EstimateId",
table: "CommandLine",
column: "EstimateId",
principalTable: "Estimate",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Estimate_ApplicationUser_ClientId",
table: "Estimate",
column: "ClientId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_BlogTag_BlogPost_PostId",
table: "BlogTag",
column: "PostId",
principalTable: "BlogPost",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_BlogTag_Tag_TagId",
table: "BlogTag",
column: "TagId",
principalTable: "Tag",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Comment_ApplicationUser_AuthorId",
table: "Comment",
column: "AuthorId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Comment_BlogPost_PostId",
table: "Comment",
column: "PostId",
principalTable: "BlogPost",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Schedule_ApplicationUser_OwnerId",
table: "Schedule",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ChatConnection_ApplicationUser_ApplicationUserId",
table: "ChatConnection",
column: "ApplicationUserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_BrusherProfile_PerformerProfile_UserId",
table: "BrusherProfile",
column: "UserId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQuery_Activity_ActivityCode",
table: "HairCutQuery",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQuery_ApplicationUser_ClientId",
table: "HairCutQuery",
column: "ClientId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQuery_PerformerProfile_PerformerId",
table: "HairCutQuery",
column: "PerformerId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQuery_HairPrestation_PrestationId",
table: "HairCutQuery",
column: "PrestationId",
principalTable: "HairPrestation",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQuery_Activity_ActivityCode",
table: "HairMultiCutQuery",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQuery_ApplicationUser_ClientId",
table: "HairMultiCutQuery",
column: "ClientId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId",
table: "HairMultiCutQuery",
column: "PerformerId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId",
table: "HairPrestationCollectionItem",
column: "PrestationId",
principalTable: "HairPrestation",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId",
table: "HairPrestationCollectionItem",
column: "QueryId",
principalTable: "HairMultiCutQuery",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairTaint_Color_ColorId",
table: "HairTaint",
column: "ColorId",
principalTable: "Color",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairTaintInstance_HairPrestation_PrestationId",
table: "HairTaintInstance",
column: "PrestationId",
principalTable: "HairPrestation",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairTaintInstance_HairTaint_TaintId",
table: "HairTaintInstance",
column: "TaintId",
principalTable: "HairTaint",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DimissClicked_Notification_NotificationId",
table: "DimissClicked",
column: "NotificationId",
principalTable: "Notification",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_DimissClicked_ApplicationUser_UserId",
table: "DimissClicked",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Instrumentation_Instrument_InstrumentId",
table: "Instrumentation",
column: "InstrumentId",
principalTable: "Instrument",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_PayPalPayment_ApplicationUser_ExecutorId",
table: "PayPalPayment",
column: "ExecutorId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CircleMember_Circle_CircleId",
table: "CircleMember",
column: "CircleId",
principalTable: "Circle",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CircleMember_ApplicationUser_MemberId",
table: "CircleMember",
column: "MemberId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CommandForm_Activity_ActivityCode",
table: "CommandForm",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_PerformerProfile_Location_OrganizationAddressId",
table: "PerformerProfile",
column: "OrganizationAddressId",
principalTable: "Location",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
table: "PerformerProfile",
column: "PerformerId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_RdvQuery_Activity_ActivityCode",
table: "RdvQuery",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_RdvQuery_ApplicationUser_ClientId",
table: "RdvQuery",
column: "ClientId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_RdvQuery_PerformerProfile_PerformerId",
table: "RdvQuery",
column: "PerformerId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_UserActivity_Activity_DoesCode",
table: "UserActivity",
column: "DoesCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_UserActivity_PerformerProfile_UserId",
table: "UserActivity",
column: "UserId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_GitRepositoryReference_ApplicationUser_OwnerId",
table: "GitRepositoryReference",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_BlogPost_BlogPostId", table: "CircleAuthorizationToBlogPost");
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
migrationBuilder.DropForeignKey(name: "FK_Estimate_ApplicationUser_ClientId", table: "Estimate");
migrationBuilder.DropForeignKey(name: "FK_BlogTag_BlogPost_PostId", table: "BlogTag");
migrationBuilder.DropForeignKey(name: "FK_BlogTag_Tag_TagId", table: "BlogTag");
migrationBuilder.DropForeignKey(name: "FK_Comment_ApplicationUser_AuthorId", table: "Comment");
migrationBuilder.DropForeignKey(name: "FK_Comment_BlogPost_PostId", table: "Comment");
migrationBuilder.DropForeignKey(name: "FK_Schedule_ApplicationUser_OwnerId", table: "Schedule");
migrationBuilder.DropForeignKey(name: "FK_ChatConnection_ApplicationUser_ApplicationUserId", table: "ChatConnection");
migrationBuilder.DropForeignKey(name: "FK_BrusherProfile_PerformerProfile_UserId", table: "BrusherProfile");
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_HairPrestation_PrestationId", table: "HairCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery");
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId", table: "HairPrestationCollectionItem");
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId", table: "HairPrestationCollectionItem");
migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint");
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairPrestation_PrestationId", table: "HairTaintInstance");
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairTaint_TaintId", table: "HairTaintInstance");
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked");
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_ApplicationUser_UserId", table: "DimissClicked");
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
migrationBuilder.DropForeignKey(name: "FK_PayPalPayment_ApplicationUser_ExecutorId", table: "PayPalPayment");
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm");
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery");
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery");
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
migrationBuilder.DropForeignKey(name: "FK_GitRepositoryReference_ApplicationUser_OwnerId", table: "GitRepositoryReference");
migrationBuilder.DropColumn(name: "OwnerId", table: "GitRepositoryReference");
migrationBuilder.AddForeignKey(
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
table: "AspNetRoleClaims",
column: "RoleId",
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
table: "AspNetUserClaims",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
table: "AspNetUserLogins",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
table: "AspNetUserRoles",
column: "RoleId",
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
table: "AspNetUserRoles",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_BlackListed_ApplicationUser_OwnerId",
table: "BlackListed",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_CircleAuthorizationToBlogPost_BlogPost_BlogPostId",
table: "CircleAuthorizationToBlogPost",
column: "BlogPostId",
principalTable: "BlogPost",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
table: "CircleAuthorizationToBlogPost",
column: "CircleId",
principalTable: "Circle",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_AccountBalance_ApplicationUser_UserId",
table: "AccountBalance",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_BalanceImpact_AccountBalance_BalanceId",
table: "BalanceImpact",
column: "BalanceId",
principalTable: "AccountBalance",
principalColumn: "UserId",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_CommandLine_Estimate_EstimateId",
table: "CommandLine",
column: "EstimateId",
principalTable: "Estimate",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Estimate_ApplicationUser_ClientId",
table: "Estimate",
column: "ClientId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_BlogTag_BlogPost_PostId",
table: "BlogTag",
column: "PostId",
principalTable: "BlogPost",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_BlogTag_Tag_TagId",
table: "BlogTag",
column: "TagId",
principalTable: "Tag",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Comment_ApplicationUser_AuthorId",
table: "Comment",
column: "AuthorId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Comment_BlogPost_PostId",
table: "Comment",
column: "PostId",
principalTable: "BlogPost",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Schedule_ApplicationUser_OwnerId",
table: "Schedule",
column: "OwnerId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_ChatConnection_ApplicationUser_ApplicationUserId",
table: "ChatConnection",
column: "ApplicationUserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_BrusherProfile_PerformerProfile_UserId",
table: "BrusherProfile",
column: "UserId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQuery_Activity_ActivityCode",
table: "HairCutQuery",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQuery_ApplicationUser_ClientId",
table: "HairCutQuery",
column: "ClientId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQuery_PerformerProfile_PerformerId",
table: "HairCutQuery",
column: "PerformerId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQuery_HairPrestation_PrestationId",
table: "HairCutQuery",
column: "PrestationId",
principalTable: "HairPrestation",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQuery_Activity_ActivityCode",
table: "HairMultiCutQuery",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQuery_ApplicationUser_ClientId",
table: "HairMultiCutQuery",
column: "ClientId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId",
table: "HairMultiCutQuery",
column: "PerformerId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId",
table: "HairPrestationCollectionItem",
column: "PrestationId",
principalTable: "HairPrestation",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId",
table: "HairPrestationCollectionItem",
column: "QueryId",
principalTable: "HairMultiCutQuery",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairTaint_Color_ColorId",
table: "HairTaint",
column: "ColorId",
principalTable: "Color",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairTaintInstance_HairPrestation_PrestationId",
table: "HairTaintInstance",
column: "PrestationId",
principalTable: "HairPrestation",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_HairTaintInstance_HairTaint_TaintId",
table: "HairTaintInstance",
column: "TaintId",
principalTable: "HairTaint",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_DimissClicked_Notification_NotificationId",
table: "DimissClicked",
column: "NotificationId",
principalTable: "Notification",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_DimissClicked_ApplicationUser_UserId",
table: "DimissClicked",
column: "UserId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Instrumentation_Instrument_InstrumentId",
table: "Instrumentation",
column: "InstrumentId",
principalTable: "Instrument",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_PayPalPayment_ApplicationUser_ExecutorId",
table: "PayPalPayment",
column: "ExecutorId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_CircleMember_Circle_CircleId",
table: "CircleMember",
column: "CircleId",
principalTable: "Circle",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_CircleMember_ApplicationUser_MemberId",
table: "CircleMember",
column: "MemberId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_CommandForm_Activity_ActivityCode",
table: "CommandForm",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_PerformerProfile_Location_OrganizationAddressId",
table: "PerformerProfile",
column: "OrganizationAddressId",
principalTable: "Location",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
table: "PerformerProfile",
column: "PerformerId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_RdvQuery_Activity_ActivityCode",
table: "RdvQuery",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_RdvQuery_ApplicationUser_ClientId",
table: "RdvQuery",
column: "ClientId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_RdvQuery_PerformerProfile_PerformerId",
table: "RdvQuery",
column: "PerformerId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_UserActivity_Activity_DoesCode",
table: "UserActivity",
column: "DoesCode",
principalTable: "Activity",
principalColumn: "Code",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_UserActivity_PerformerProfile_UserId",
table: "UserActivity",
column: "UserId",
principalTable: "PerformerProfile",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@ -1345,6 +1345,8 @@ namespace Yavsc.Migrations
b.Property<string>("Branch");
b.Property<string>("OwnerId");
b.HasKey("Path", "Url", "Branch");
});
@ -1803,6 +1805,13 @@ namespace Yavsc.Migrations
.WithMany()
.HasForeignKey("ManagerId");
});
modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b =>
{
b.HasOne("Yavsc.Models.ApplicationUser")
.WithMany()
.HasForeignKey("OwnerId");
});
}
}
}

View File

@ -2,7 +2,6 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Authentication.OAuth;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Data.Entity;
using System.Threading;
@ -36,6 +35,7 @@ namespace Yavsc.Models
using Yavsc.Models.Calendar;
using Blog;
using Yavsc.Server.Helpers;
using Newtonsoft.Json.Linq;
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
@ -69,11 +69,6 @@ namespace Yavsc.Models
builder.Entity<GitRepositoryReference>().HasKey(r => new { r.Path, r.Url, r.Branch });
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql(DbHelpers.ConnectionString);
}
public DbSet<Client> Applications { get; set; }
public DbSet<RefreshToken> RefreshTokens { get; set; }
@ -150,7 +145,9 @@ namespace Yavsc.Models
}
}
public Task StoreTokenAsync(string googleUserId, OAuthTokenResponse value)
public Task StoreTokenAsync(string googleUserId, JObject response, string accessToken,
string tokenType, string refreshToken, string expiresIn
)
{
if (string.IsNullOrEmpty(googleUserId))
{
@ -163,18 +160,18 @@ namespace Yavsc.Models
Tokens.Add(new OAuth2Tokens
{
TokenType = "Bearer", // FIXME why value.TokenType would be null?
AccessToken = value.AccessToken,
RefreshToken = value.RefreshToken,
Expiration = DateTime.Now.AddSeconds(int.Parse(value.ExpiresIn)),
AccessToken = accessToken,
RefreshToken = refreshToken,
Expiration = DateTime.Now.AddSeconds(int.Parse(expiresIn)),
UserId = googleUserId
});
}
else
{
item.AccessToken = value.AccessToken;
item.Expiration = DateTime.Now.AddMinutes(int.Parse(value.ExpiresIn));
if (value.RefreshToken != null)
item.RefreshToken = value.RefreshToken;
item.AccessToken = accessToken;
item.Expiration = DateTime.Now.AddMinutes(int.Parse(expiresIn));
if (refreshToken != null)
item.RefreshToken = refreshToken;
Tokens.Update(item);
}
SaveChanges(googleUserId);

View File

@ -32,11 +32,11 @@ namespace Yavsc
public Contact Admin { get; set; }
public string DataDir { get; set; }
/// <summary>
/// User's files directory
/// </summary>
/// <returns></returns>
public ThirdPartyFiles UserFiles { get; set; }
public string Avatars { get; set; }
public long Quota { get; set; }
public string Blog { get; set; }
public string Bills { get; set; }
public string GitRepository { get; set; }
public string BusinessName { get; set; }
public string Street { get; set; }

View File

@ -2,10 +2,6 @@ namespace Yavsc
{
public class ThirdPartyFiles {
public string Avatars { get; set; }
public long Quota { get; set; }
public string Blog { get; set; }
public string Bills { get; set; }
}
}

View File

@ -14,12 +14,13 @@ namespace Yavsc
public partial class Startup
{
public static FileServerOptions UserFilesOptions { get; private set; }
public static FileServerOptions GitOptions { get; private set; }
public static FileServerOptions AvatarsOptions { get; set; }
public void ConfigureFileServerApp(IApplicationBuilder app,
SiteSettings siteSettings, IHostingEnvironment env, IAuthorizationService authorizationService)
{
var userFilesDirInfo = new DirectoryInfo( siteSettings.UserFiles.Blog );
var userFilesDirInfo = new DirectoryInfo( siteSettings.Blog );
AbstractFileSystemHelpers.UserFilesDirName = userFilesDirInfo.FullName;
if (!userFilesDirInfo.Exists) userFilesDirInfo.Create();
@ -42,7 +43,7 @@ namespace Yavsc
var result = await authorizationService.AuthorizeAsync(context.Context.User, new ViewFileContext
{ UserName = uname, File = context.File, Path = path } , new ViewRequirement());
};
var avatarsDirInfo = new DirectoryInfo(Startup.SiteSetup.UserFiles.Avatars);
var avatarsDirInfo = new DirectoryInfo(Startup.SiteSetup.Avatars);
if (!avatarsDirInfo.Exists) avatarsDirInfo.Create();
AvatarsDirName = avatarsDirInfo.FullName;
@ -52,6 +53,14 @@ namespace Yavsc
RequestPath = new PathString(Constants.AvatarsPath),
EnableDirectoryBrowsing = env.IsDevelopment()
};
var gitdirinfo = new DirectoryInfo(Startup.SiteSetup.GitRepository);
GitOptions = new FileServerOptions()
{
FileProvider = new PhysicalFileProvider(GitDirName),
RequestPath = new PathString(Constants.GitPath),
EnableDirectoryBrowsing = env.IsDevelopment()
};
app.UseFileServer(UserFilesOptions);

View File

@ -150,16 +150,21 @@ namespace Yavsc
var gcontext = context as GoogleOAuthCreatingTicketContext;
context.Identity.AddClaim(new Claim(YavscClaimTypes.GoogleUserId, gcontext.GoogleUserId));
var dbContext = serviceScope.ServiceProvider.GetService<ApplicationDbContext>();
await dbContext.StoreTokenAsync(gcontext.GoogleUserId, context.TokenResponse);
var store = serviceScope.ServiceProvider.GetService<IDataStore>();
await store.StoreAsync(gcontext.GoogleUserId, new TokenResponse {
await store.StoreAsync(gcontext.GoogleUserId, new TokenResponse {
AccessToken = gcontext.TokenResponse.AccessToken,
RefreshToken = gcontext.TokenResponse.RefreshToken,
TokenType = gcontext.TokenResponse.TokenType,
ExpiresInSeconds = int.Parse(gcontext.TokenResponse.ExpiresIn),
IssuedUtc = DateTime.Now
});
await dbContext.StoreTokenAsync (gcontext.GoogleUserId,
gcontext.TokenResponse.Response,
gcontext.TokenResponse.AccessToken,
gcontext.TokenResponse.TokenType,
gcontext.TokenResponse.RefreshToken,
gcontext.TokenResponse.ExpiresIn);
}
}

View File

@ -41,6 +41,7 @@ namespace Yavsc
public partial class Startup
{
public static string AvatarsDirName { private set; get; }
public static string GitDirName { private set; get; }
public static string Authority { get; private set; }
public static string Temp { get; set; }
public static SiteSettings SiteSetup { get; private set; }
@ -155,10 +156,11 @@ namespace Yavsc
// Add framework services.
services.AddEntityFramework()
.AddNpgsql()
.AddDbContext<ApplicationDbContext>()
;
.AddNpgsql()
.AddDbContext<ApplicationDbContext>(
db => db.UseNpgsql(DbHelpers.ConnectionString)
);
ConfigureOAuthServices(services);
services.AddCors(
@ -270,9 +272,9 @@ namespace Yavsc
ResourcesHelpers.GlobalLocalizer = localizer;
SiteSetup = siteSettings.Value;
Authority = siteSettings.Value.Authority;
var blogsDir = siteSettings.Value.UserFiles.Blog;
var blogsDir = siteSettings.Value.Blog;
if (blogsDir==null) throw new Exception ("blogsDir==null");
var billsDir = siteSettings.Value.UserFiles.Bills;
var billsDir = siteSettings.Value.Bills;
if (billsDir==null) throw new Exception ("billsDir==null");
AbstractFileSystemHelpers.UserFilesDirName = new DirectoryInfo(blogsDir).FullName;
@ -354,7 +356,6 @@ namespace Yavsc
else throw ex;
}
}
// before fixing the security protocol, let beleive our lib it's done with it.
var cxmgr = ConnectionManager.Instance;
// then, fix it.

View File

@ -34,8 +34,8 @@ namespace Yavsc.ViewComponents
public async Task<IViewComponentResult> InvokeAsync(string code, IBillable billable, OutputFormat format, bool asBill)
{
var di = new DirectoryInfo(Startup.SiteSetup.UserFiles.Bills);
var dia = new DirectoryInfo(Startup.SiteSetup.UserFiles.Avatars);
var di = new DirectoryInfo(Startup.SiteSetup.Bills);
var dia = new DirectoryInfo(Startup.SiteSetup.Avatars);
ViewBag.BillsDir = di.FullName;
ViewBag.AvatarsDir = dia.FullName;
ViewBag.AsBill = asBill; // vrai pour une facture, sinon, c'est un devis

View File

@ -0,0 +1,49 @@
@model Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference
@{
ViewData["Title"] = "Create";
}
<h2>Create</h2>
<form asp-action="Create">
<div class="form-horizontal">
<h4>GitRepositoryReference</h4>
<hr />
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Url" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Url" class ="form-control"></input>
</div>
</div>
<div class="form-group">
<label asp-for="Path" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Path" class ="form-control"></input>
</div>
</div>
<div class="form-group">
<label asp-for="Branch" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Branch" class ="form-control"></input>
</div>
</div>
<div class="form-group">
<label asp-for="OwnerId" class="col-md-2 control-label"></label>
<div class="col-md-10">
<select asp-for="OwnerId" class ="form-control"></select>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Create" class="btn btn-default" />
</div>
</div>
</div>
</form>
<div>
<a asp-action="Index">Back to List</a>
</div>

View File

@ -0,0 +1,22 @@
@model Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference
@{
ViewData["Title"] = "Delete";
}
<h2>Delete</h2>
<h3>Are you sure you want to delete this?</h3>
<div>
<h4>GitRepositoryReference</h4>
<hr />
<dl class="dl-horizontal">
</dl>
<form asp-action="Delete">
<div class="form-actions no-color">
<input type="submit" value="Delete" class="btn btn-default" /> |
<a asp-action="Index">Back to List</a>
</div>
</form>
</div>

View File

@ -0,0 +1,18 @@
@model Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference
@{
ViewData["Title"] = "Details";
}
<h2>Details</h2>
<div>
<h4>GitRepositoryReference</h4>
<hr />
<dl class="dl-horizontal">
</dl>
</div>
<p>
@Html.ActionLink("Edit", "Edit", new { /* id = Model.PrimaryKey */ }) |
<a asp-action="Index">Back to List</a>
</p>

View File

@ -0,0 +1,35 @@
@model Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference
@{
ViewData["Title"] = "Edit";
}
<h2>Edit</h2>
<form asp-action="Edit">
<div class="form-horizontal">
<h4>GitRepositoryReference</h4>
<hr />
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Path" />
<input type="hidden" asp-for="Url" />
<input type="hidden" asp-for="Branch" />
<div class="form-group">
<label asp-for="OwnerId" class="control-label col-md-2">OwnerId</label>
<div class="col-md-10">
<select asp-for="OwnerId" class="form-control" />
<span asp-validation-for="OwnerId" class="text-danger" />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Save" class="btn btn-default" />
</div>
</div>
</div>
</form>
<div>
<a asp-action="Index">Back to List</a>
</div>

View File

@ -0,0 +1,26 @@
@model IEnumerable<Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference>
@{
ViewData["Title"] = "Index";
}
<h2>Index</h2>
<p>
<a asp-action="Create">Create New</a>
</p>
<table class="table">
<tr>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
</td>
</tr>
}
</table>