en preparant le badge "activité à configurer!"
This commit is contained in:
@ -78,16 +78,16 @@ namespace Yavsc.Controllers
|
|||||||
public async Task<IActionResult> Index(ManageMessageId? message = null)
|
public async Task<IActionResult> Index(ManageMessageId? message = null)
|
||||||
{
|
{
|
||||||
ViewData["StatusMessage"] =
|
ViewData["StatusMessage"] =
|
||||||
message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed."
|
message == ManageMessageId.ChangePasswordSuccess ? _SR["Your password has been changed."]
|
||||||
: message == ManageMessageId.SetPasswordSuccess ? "Your password has been set."
|
: message == ManageMessageId.SetPasswordSuccess ? _SR["Your password has been set."]
|
||||||
: message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set."
|
: message == ManageMessageId.SetTwoFactorSuccess ? _SR["Your two-factor authentication provider has been set."]
|
||||||
: message == ManageMessageId.Error ? "An error has occurred."
|
: message == ManageMessageId.Error ? _SR["An error has occurred."]
|
||||||
: message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added."
|
: message == ManageMessageId.AddPhoneSuccess ? _SR["Your phone number was added."]
|
||||||
: message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed."
|
: message == ManageMessageId.RemovePhoneSuccess ? _SR["Your phone number was removed."]
|
||||||
: message == ManageMessageId.ChangeNameSuccess ? "Your name was updated."
|
: message == ManageMessageId.ChangeNameSuccess ? _SR["Your name was updated."]
|
||||||
: message == ManageMessageId.SetActivitySuccess ? "Your activity was set."
|
: message == ManageMessageId.SetActivitySuccess ? _SR["Your activity was set."]
|
||||||
: message == ManageMessageId.AvatarUpdateSuccess ? "Your avatar was updated."
|
: message == ManageMessageId.AvatarUpdateSuccess ? _SR["Your avatar was updated."]
|
||||||
: message == ManageMessageId.IdentityUpdateSuccess ? "Your identity was updated."
|
: message == ManageMessageId.IdentityUpdateSuccess ? _SR["Your identity was updated."]
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
var user = await GetCurrentUserAsync();
|
var user = await GetCurrentUserAsync();
|
||||||
@ -114,6 +114,13 @@ namespace Yavsc.Controllers
|
|||||||
DiskQuota = user.DiskQuota
|
DiskQuota = user.DiskQuota
|
||||||
};
|
};
|
||||||
model.HaveProfessionalSettings = _dbContext.Performers.Any(x => x.PerformerId == user.Id);
|
model.HaveProfessionalSettings = _dbContext.Performers.Any(x => x.PerformerId == user.Id);
|
||||||
|
var usrActs = _dbContext.UserActivities.Include(a=>a.Does).Where(a=> a.UserId == user.Id);
|
||||||
|
|
||||||
|
await usrActs.Where(u=>u.Does.SettingsClassName!=null).ForEachAsync(
|
||||||
|
a=>{ a.Settings = a.Does.CreateSettings(User.GetUserId()); }
|
||||||
|
);
|
||||||
|
|
||||||
|
model.HaveActivityToConfigure = usrActs.Any( a=> a.Settings == null && a.Does.SettingsClassName!=null );
|
||||||
model.Activity = _dbContext.UserActivities.Include(a=>a.Does).Where(u=>u.UserId == user.Id)
|
model.Activity = _dbContext.UserActivities.Include(a=>a.Does).Where(u=>u.UserId == user.Id)
|
||||||
.ToList();
|
.ToList();
|
||||||
return View(model);
|
return View(model);
|
||||||
|
@ -10,13 +10,18 @@ namespace Yavsc.Helpers
|
|||||||
using YavscLib;
|
using YavscLib;
|
||||||
public static class WorkflowHelpers
|
public static class WorkflowHelpers
|
||||||
{
|
{
|
||||||
public static ISpecializationSettings CreateSettings (this Activity activity) {
|
public static ISpecializationSettings CreateSettings (this Activity activity, string userId) {
|
||||||
if (activity.SettingsClassName==null) return null;
|
if (activity.SettingsClassName==null) return null;
|
||||||
var ctor = Startup.ProfileTypes[activity.SettingsClassName].GetConstructor(System.Type.EmptyTypes);
|
var ctor = Startup.ProfileTypes[activity.SettingsClassName].GetConstructor(System.Type.EmptyTypes);
|
||||||
if (ctor==null) return null;
|
if (ctor==null) return null;
|
||||||
return (ISpecializationSettings) ctor.Invoke(null);
|
ISpecializationSettings result = (ISpecializationSettings) ctor.Invoke(null);
|
||||||
|
result.UserId = userId;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
public static bool HasSettings (this UserActivity useract, ApplicationDbContext dbContext) {
|
||||||
|
ISpecializationSettings candidate = CreateSettings(useract.Does,useract.UserId);
|
||||||
|
return candidate.ExistsInDb(dbContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<PerformerProfile> ListPerformers(this ApplicationDbContext context, string actCode)
|
public static List<PerformerProfile> ListPerformers(this ApplicationDbContext context, string actCode)
|
||||||
{
|
{
|
||||||
return context.Performers
|
return context.Performers
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
using YavscLib;
|
using YavscLib;
|
||||||
|
|
||||||
namespace Yavsc.Models.Haircut
|
namespace Yavsc.Models.Haircut
|
||||||
@ -135,5 +136,10 @@ namespace Yavsc.Models.Haircut
|
|||||||
[Display(Name="Remise au forfait coupe+technique"),DisplayFormat(DataFormatString="{0:C}")]
|
[Display(Name="Remise au forfait coupe+technique"),DisplayFormat(DataFormatString="{0:C}")]
|
||||||
|
|
||||||
public decimal FlatFeeDiscount { get; set; }
|
public decimal FlatFeeDiscount { get; set; }
|
||||||
|
|
||||||
|
public bool ExistsInDb(object dbContext)
|
||||||
|
{
|
||||||
|
return ((ApplicationDbContext)dbContext).BrusherProfile.Any(p=>p.UserId==UserId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
using YavscLib;
|
using YavscLib;
|
||||||
|
|
||||||
namespace Yavsc.Models.Musical.Profiles
|
namespace Yavsc.Models.Musical.Profiles
|
||||||
@ -17,5 +18,9 @@ namespace Yavsc.Models.Musical.Profiles
|
|||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ExistsInDb(object dbContext)
|
||||||
|
{
|
||||||
|
return ((ApplicationDbContext)dbContext).DjSettings.Any(p=>p.UserId==UserId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Linq;
|
||||||
using YavscLib;
|
using YavscLib;
|
||||||
|
|
||||||
namespace Yavsc.Models.Musical.Profiles
|
namespace Yavsc.Models.Musical.Profiles
|
||||||
@ -12,5 +13,10 @@ namespace Yavsc.Models.Musical.Profiles
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ExistsInDb(object dbContext)
|
||||||
|
{
|
||||||
|
return ((ApplicationDbContext)dbContext).GeneralSettings.Any(p=>p.UserId==UserId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,5 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
using Yavsc.Models.Workflow;
|
using Yavsc.Models.Workflow;
|
||||||
using YavscLib;
|
using YavscLib;
|
||||||
|
|
||||||
@ -17,6 +18,10 @@ namespace Yavsc.Models.Musical.Profiles
|
|||||||
|
|
||||||
[ForeignKeyAttribute("InstrumentId")]
|
[ForeignKeyAttribute("InstrumentId")]
|
||||||
public virtual Instrument Tool { get; set; }
|
public virtual Instrument Tool { get; set; }
|
||||||
|
|
||||||
|
public bool ExistsInDb(object dbContext)
|
||||||
|
{
|
||||||
|
return ((ApplicationDbContext)dbContext).Instrumentation.Any(p=>p.UserId==UserId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
|
|
||||||
namespace Yavsc.Models.Workflow.Profiles
|
namespace Yavsc.Models.Workflow.Profiles
|
||||||
{
|
{
|
||||||
|
using System.Linq;
|
||||||
using Models.Workflow;
|
using Models.Workflow;
|
||||||
using YavscLib;
|
using YavscLib;
|
||||||
public class FormationSettings : ISpecializationSettings
|
public class FormationSettings : ISpecializationSettings
|
||||||
@ -14,5 +15,10 @@ namespace Yavsc.Models.Workflow.Profiles
|
|||||||
{
|
{
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ExistsInDb(object dbContext)
|
||||||
|
{
|
||||||
|
return ((ApplicationDbContext)dbContext).FormationSettings.Any(p=>p.UserId==UserId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Yavsc.Models.Workflow
|
namespace Yavsc.Models.Workflow
|
||||||
{
|
{
|
||||||
@ -19,5 +20,8 @@ namespace Yavsc.Models.Workflow
|
|||||||
|
|
||||||
[Range(0,100)]
|
[Range(0,100)]
|
||||||
public int Weight { get; set; }
|
public int Weight { get; set; }
|
||||||
|
|
||||||
|
[NotMapped,JsonIgnore]
|
||||||
|
public object Settings { get; internal set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -25,6 +25,7 @@ namespace Yavsc.ViewModels.Manage
|
|||||||
public List<UserActivity> Activity { get; set; }
|
public List<UserActivity> Activity { get; set; }
|
||||||
|
|
||||||
public bool HaveProfessionalSettings { get; set; }
|
public bool HaveProfessionalSettings { get; set; }
|
||||||
|
public bool HaveActivityToConfigure { get; set; }
|
||||||
|
|
||||||
public long PostsCounter { get; set; }
|
public long PostsCounter { get; set; }
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<input type="hidden" asp-for="DoesCode" />
|
<input type="hidden" asp-for="DoesCode" />
|
||||||
<div class="form-actions no-color">
|
<div class="form-actions no-color">
|
||||||
<input type="submit" value="Delete" class="btn btn-success" />
|
<input type="submit" value="Delete" class="btn btn-success" />
|
||||||
<a asp-action="Index" class="btn btn-default">Back to List</a>
|
<a asp-action="Index" class="btn btn-link">Back to List</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -114,8 +114,20 @@ Paul,
|
|||||||
</environment>
|
</environment>
|
||||||
|
|
||||||
|
|
||||||
<environment names="Dev">
|
<environment names="Development">
|
||||||
<markdown>
|
<markdown>
|
||||||
Site du développeur
|
## Ceci est un site de développement.
|
||||||
|
|
||||||
|
Cette présente ressource ne concerne que le développement du logiciel qui la met en oeuvre.
|
||||||
|
Elle est éphémère, et pratiquement en permanence force de codes 500.
|
||||||
|
|
||||||
|
Veuillez excuser l'équipe de développement pour vous avoir fait part de cette adresse et pour la gêne occasionnnée.
|
||||||
|
|
||||||
|
La "pré-production" affiche les sites suivants:
|
||||||
|
|
||||||
|
* [ZicMoove](http://zicmoove.pschneider.fr)
|
||||||
|
* [Yavsc](http://yavsc.pschneider.fr)
|
||||||
|
* [Lua (le site perso de l'auteur de ce truc)](http://lua.pschneider.fr)
|
||||||
|
|
||||||
</markdown>
|
</markdown>
|
||||||
</environment>
|
</environment>
|
||||||
|
@ -104,7 +104,7 @@ nav {
|
|||||||
data-ref="ZicMoove"
|
data-ref="ZicMoove"
|
||||||
class="fb-like"
|
class="fb-like"
|
||||||
data-share="true"
|
data-share="true"
|
||||||
data-width="200"
|
data-width="300"
|
||||||
data-show-faces="true"
|
data-show-faces="true"
|
||||||
data-colorscheme="dark">
|
data-colorscheme="dark">
|
||||||
</div>
|
</div>
|
||||||
|
4
Yavsc/wwwroot/css/site.min.css
vendored
4
Yavsc/wwwroot/css/site.min.css
vendored
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
BIN
Yavsc/wwwroot/images/it/floss-license-dark-v.png
Normal file
BIN
Yavsc/wwwroot/images/it/floss-license-dark-v.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 108 KiB |
@ -3,5 +3,6 @@ namespace YavscLib
|
|||||||
public interface ISpecializationSettings
|
public interface ISpecializationSettings
|
||||||
{
|
{
|
||||||
string UserId { get ; set ; }
|
string UserId { get ; set ; }
|
||||||
|
bool ExistsInDb(object dbContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user