strong ressources and interface

vnext
Paul Schneider 5 years ago
parent 0e6efa4272
commit 883a6e2bd9
44 changed files with 2456 additions and 414 deletions

@ -39,7 +39,7 @@ namespace Yavsc.ApiControllers
public BillingController(
IAuthorizationService authorizationService,
ILoggerFactory loggerFactory,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> SR,
IStringLocalizer<Yavsc.YavscLocalisation> SR,
ApplicationDbContext context,
IOptions<GoogleAuthSettings> googleSettings,
IYavscMessageSender GCMSender,

@ -14,7 +14,6 @@ namespace Yavsc.ApiControllers
using Models;
using Services;
using Models.Haircut;
using Resources;
using System.Threading.Tasks;
using Helpers;
using Microsoft.Data.Entity;
@ -42,7 +41,7 @@ namespace Yavsc.ApiControllers
IOptions<GoogleAuthSettings> googleSettings,
IYavscMessageSender GCMSender,
UserManager<ApplicationUser> userManager,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
IStringLocalizer<Yavsc.YavscLocalisation> localizer,
IEmailSender emailSender,
IOptions<SmtpSettings> smtpSettings,
IOptions<SiteSettings> siteSettings,

@ -45,7 +45,7 @@ namespace Yavsc.Controllers
IEmailSender emailSender,
IOptions<SiteSettings> siteSettings,
ILoggerFactory loggerFactory, IOptions<TwilioSettings> twilioSettings,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
IStringLocalizer<Yavsc.YavscLocalisation> localizer,
ApplicationDbContext dbContext)
{
_userManager = userManager;

@ -55,7 +55,7 @@ namespace Yavsc.Controllers
IOptions<GoogleAuthSettings> googleSettings,
IOptions<PayPalSettings> paypalSettings,
IOptions<CompanyInfoSettings> cinfoSettings,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> SR,
IStringLocalizer<Yavsc.YavscLocalisation> SR,
ICalendarManager calendarManager,
ILoggerFactory loggerFactory)
{

@ -17,11 +17,11 @@ namespace Yavsc.Controllers
public class ActivityController : Controller
{
private ApplicationDbContext _context;
IStringLocalizer<Yavsc.Resources.YavscLocalisation> SR;
IStringLocalizer<Yavsc.YavscLocalisation> SR;
ILogger logger;
public ActivityController(ApplicationDbContext context,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> SR,
IStringLocalizer<Yavsc.YavscLocalisation> SR,
ILoggerFactory loggerFactory)
{
_context = context;

@ -36,7 +36,7 @@ namespace Yavsc.Controllers
IYavscMessageSender messageSender,
UserManager<ApplicationUser> userManager,
ICalendarManager calendarManager,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
IStringLocalizer<Yavsc.YavscLocalisation> localizer,
IEmailSender emailSender,
IOptions<SmtpSettings> smtpSettings,
IOptions<SiteSettings> siteSettings,

@ -30,7 +30,7 @@ namespace Yavsc.Controllers
UserManager<ApplicationUser> userManager,
IBillingService billing,
ILoggerFactory loggerFactory,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> SR)
IStringLocalizer<Yavsc.YavscLocalisation> SR)
{
_context = context;
_userManager = userManager;

@ -34,7 +34,7 @@ namespace Yavsc.Controllers
IOptions<GoogleAuthSettings> googleSettings,
IYavscMessageSender GCMSender,
UserManager<ApplicationUser> userManager,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
IStringLocalizer<Yavsc.YavscLocalisation> localizer,
IEmailSender emailSender,
IOptions<SmtpSettings> smtpSettings,
IOptions<SiteSettings> siteSettings,

@ -19,11 +19,11 @@ namespace Yavsc.Controllers
{
private ApplicationDbContext _context;
ILogger _logger;
IStringLocalizer<Yavsc.Resources.YavscLocalisation> _localizer;
IStringLocalizer<Yavsc.YavscLocalisation> _localizer;
public ProjectController(ApplicationDbContext context,
ILoggerFactory loggerFactory,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer
IStringLocalizer<Yavsc.YavscLocalisation> localizer
)
{
_context = context;

@ -36,12 +36,11 @@ namespace Yavsc
using Models;
using Models.Chat;
using Yavsc.Abstract.Chat;
using Yavsc.Attributes.Validation;
using Yavsc.Services;
public partial class ChatHub : Hub, IDisposable
{
// TODO externalize connexion and room presence management
ApplicationDbContext _dbContext;
private IConnexionManager _cxManager;
private IStringLocalizer _localizer;
@ -60,9 +59,10 @@ namespace Yavsc
_cxManager = scope.ServiceProvider.GetService<IConnexionManager>();
_cxManager.SetErrorHandler ((context, error) =>
{
Clients.Caller.notifyUser(NotificationTypes.Error, context, error);
NotifyUser(NotificationTypes.Error, context, error);
});
_logger = loggerFactory.CreateLogger<ChatHub>();
}
void SetUserName(string cxId, string userName)
@ -105,7 +105,7 @@ namespace Yavsc
Connected = true
});
_dbContext.SaveChanges();
Clients.Group(ChatHubConstants.HubGroupFollowingPrefix + userId).notifyuser(NotificationTypes.Connected, userName, null);
Clients.Group(ChatHubConstants.HubGroupFollowingPrefix + userId).notifyUser(NotificationTypes.Connected, userName, null);
isCop = Context.User.IsInRole(Constants.AdminGroupName) ;
if (isCop)
{
@ -156,7 +156,7 @@ namespace Yavsc
{
var user = _dbContext.Users.FirstOrDefault(u => u.UserName == userName);
var userId = user.Id;
Clients.Group(ChatHubConstants.HubGroupFollowingPrefix + userId).notifyuser(NotificationTypes.DisConnected, userName, null);
Clients.Group(ChatHubConstants.HubGroupFollowingPrefix + userId).notifyUser(NotificationTypes.DisConnected, userName, null);
var cx = _dbContext.ChatConnection.SingleOrDefault(c => c.ConnectionId == Context.ConnectionId);
if (cx != null)
@ -201,10 +201,15 @@ namespace Yavsc
public void Nick(string nickName)
{
if (!ValidateStringLength(nickName, 1,12))
{
NotifyUser(NotificationTypes.Error, "user", InvalidUserName);
}
var candidate = "?" + nickName;
if (_cxManager.IsConnected(candidate))
{
Clients.Caller.notifyUser(NotificationTypes.ExistingUserName, nickName, "aborting");
NotifyUser(NotificationTypes.ExistingUserName, nickName, "aborting");
return;
}
_cxManager.SetUserName( Context.ConnectionId, candidate);
@ -215,8 +220,28 @@ namespace Yavsc
return _cxManager.IsPresent(roomName, userName);
}
bool ValidateStringLength(string str, int minLen, int maxLen)
{
if (string.IsNullOrEmpty(str))
{
if (minLen<=0) {
return true;
} else {
return false;
}
}
if (str.Length>maxLen||str.Length<minLen) return false;
return true;
}
public ChatRoomInfo Join(string roomName)
{
if (!ValidateStringLength(roomName,1,25))
{
NotifyUser(NotificationTypes.Error, "room", InvalidRoomName);
return null;
}
var roomGroupName = ChatHubConstants.HubGroupRomsPrefix + roomName;
var user = _cxManager.GetUserName(Context.ConnectionId);
Groups.Add(Context.ConnectionId, roomGroupName);
@ -241,7 +266,7 @@ namespace Yavsc
var existent = _dbContext.ChatRoom.Any(r => r.Name == room);
if (existent)
{
Clients.Caller.notifyUser(NotificationTypes.Error, room, "already registered.");
NotifyUserInRoom(NotificationTypes.Error, room, "already registered.");
return;
}
string userName = Context.User.Identity.Name;
@ -296,7 +321,6 @@ namespace Yavsc
throw new NotImplementedException();
}
public void Part([Required] string roomName, [Required] string reason)
{
if (_cxManager.Part(Context.ConnectionId, roomName, reason))
@ -314,7 +338,7 @@ namespace Yavsc
void NotifyErrorToCallerInRoom(string room, string reason)
{
Clients.Caller.notifyUser(NotificationTypes.Error, room, reason);
NotifyUserInRoom(NotificationTypes.Error, room, reason);
_logger.LogError($"NotifyErrorToCallerInRoom: {room}, {reason}");
}
@ -325,25 +349,33 @@ namespace Yavsc
if (!_cxManager.TryGetChanInfo(roomName, out chanInfo))
{
var noChanMsg = _localizer.GetString(ChatHubConstants.LabNoSuchChan).ToString();
Clients.Caller.notifyUser(NotificationTypes.Error, roomName, noChanMsg);
NotifyUserInRoom(NotificationTypes.Error, roomName, noChanMsg);
return;
}
var userName = _cxManager.GetUserName(Context.ConnectionId);
if (!_cxManager.IsPresent(roomName, userName))
{
var notSentMsg = _localizer.GetString(ChatHubConstants.LabnoJoinNoSend).ToString();
Clients.Caller.notifyUser(NotificationTypes.Error, roomName, notSentMsg);
NotifyUserInRoom(NotificationTypes.Error, roomName, notSentMsg);
return;
}
Clients.Group(groupname).addMessage(userName, roomName, message);
}
void NotifyUser(string type, string targetId, string message)
{
Clients.Caller.notifyUser(type, targetId, message);
}
void NotifyUserInRoom(string type, string room, string message)
{
Clients.Caller.notifyUserInRoom(type, room, message);
}
[Authorize]
public void SendPV([Required] string userName, [Required] string message)
{
if (string.IsNullOrWhiteSpace(userName))
{
Clients.Caller.notifyUser(NotificationTypes.Error, "none!", "specify an user.");
NotifyUser(NotificationTypes.Error, "none!", "specify an user.");
return;
}
@ -358,7 +390,7 @@ namespace Yavsc
if (bl.Count() > 0)
{
Clients.Caller.notifyUser(NotificationTypes.PrivateMessageDenied, userName, "you are black listed.");
NotifyUser(NotificationTypes.PrivateMessageDenied, userName, "you are black listed.");
return;
}
}

@ -5,7 +5,7 @@ HOSTADMIN=root
ASPNET_LOG_LEVEL=debug
SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make
BASERESXGEN=Resources/Yavsc.Resources.ChatHub.Designer.cs Resources/Yavsc.ViewComponents.CommentViewComponent.Designer.cs
BASERESXGEN=Resources/Yavsc.ChatHub.Designer.cs Resources/Yavsc.ViewComponents.CommentViewComponent.Designer.cs Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.Designer.cs Resources/Yavsc.YavscLocalisation.Designer.cs
include $(MAKEFILE_DIR)/versioning.mk
include $(MAKEFILE_DIR)/dnx.mk
@ -57,7 +57,7 @@ endif
jsmin < $^ > $@
%.Designer.cs: %.resx
strotygen -p -t -r "Yavsc.Resources." $^
strotygen -l -p -t -r "Yavsc.Resources." $^
prepare_code: $(BASERESXGEN)

@ -0,0 +1,70 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Yavsc {
using System;
using System.Reflection;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public partial class ChatHub {
private static System.Resources.ResourceManager resourceMan;
private static System.Globalization.CultureInfo resourceCulture;
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.Resources.ResourceManager ResourceManager {
get {
if (object.Equals(null, resourceMan)) {
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Resources." + "Yavsc.ChatHub"), typeof(ChatHub).GetTypeInfo().Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
public static string Authenticated_chat_user {
get {
return ResourceManager.GetString("Authenticated chat user", resourceCulture);
}
}
public static string LabnoJoinNoSend {
get {
return ResourceManager.GetString("LabnoJoinNoSend", resourceCulture);
}
}
public static string InvalidRoomName {
get {
return ResourceManager.GetString("InvalidRoomName", resourceCulture);
}
}
public static string InvalidUserName {
get {
return ResourceManager.GetString("InvalidUserName", resourceCulture);
}
}
}
}

@ -63,4 +63,6 @@
-->
<data name="Authenticated chat user"><value>Authenticated chat user</value></data>
<data name="LabnoJoinNoSend"><value>could not send to channel (not joint)</value></data>
<data name="InvalidRoomName"><value>Invalid room name</value></data>
<data name="InvalidUserName"><value>Invalid user name</value></data>
</root>

@ -63,4 +63,7 @@
-->
<data name="Authenticated chat user"><value>Utilisateur de chat authentifié</value></data>
<data name="LabnoJoinNoSend"><value>Envoi impossible: vous devez joindre le canal pour y contribuer.</value></data>
<data name="InvalidRoomName"><value>Nom de salon invalide</value></data>
<data name="InvalidUserName"><value>Nom d'utilisateur invalide</value></data>
</root>

@ -1,66 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<!--
route name for the api controller used to tag the 'BlogPost' entity
-->
<data name="Authenticated chat user"><value>Utilisateur de chat authentifié</value></data>
<data name="LabnoJoinNoSend"><value>Envoi impossible: vous devez joindre le canal pour y contribuer.</value></data>
</root>

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<!--
route name for the api controller used to tag the 'BlogPost' entity
-->
<data name="TitleTooLong"><value>Le titre est trop long</value></data>
</root>

@ -0,0 +1,94 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Yavsc.ViewComponents {
using System;
using System.Reflection;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public partial class CommentViewComponent {
private static System.Resources.ResourceManager resourceMan;
private static System.Globalization.CultureInfo resourceCulture;
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.Resources.ResourceManager ResourceManager {
get {
if (object.Equals(null, resourceMan)) {
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Resources." + "Yavsc.ViewComponents.CommentViewComponent"), typeof(CommentViewComponent).GetTypeInfo().Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
public static string apiRouteCommentBlogPost {
get {
return ResourceManager.GetString("apiRouteCommentBlogPost", resourceCulture);
}
}
public static string CommmentId {
get {
return ResourceManager.GetString("CommmentId", resourceCulture);
}
}
public static string Comment {
get {
return ResourceManager.GetString("Comment", resourceCulture);
}
}
public static string LastModificationDate {
get {
return ResourceManager.GetString("LastModificationDate", resourceCulture);
}
}
public static string CreationDate {
get {
return ResourceManager.GetString("CreationDate", resourceCulture);
}
}
public static string PostId {
get {
return ResourceManager.GetString("PostId", resourceCulture);
}
}
public static string UserCreated {
get {
return ResourceManager.GetString("UserCreated", resourceCulture);
}
}
public static string UserModified {
get {
return ResourceManager.GetString("UserModified", resourceCulture);
}
}
}
}

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CommmentId"><value>Identifiant du commentaire</value></data>
<data name="Comment"><value>Commentaire</value></data>
<data name="Content"><value>Commentaire</value></data>
<data name="LastModificationDate"><value>Date de dernière modification</value></data>
<data name="CreationDate"><value>Date de création</value></data>
<data name="PostId"><value>Identifiant du billet</value></data>
<data name="UserCreated"><value>Auteur</value></data>
<data name="UserModified"><value>Auteur de la dernière modification</value></data>
</root>

@ -58,5 +58,15 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="apiRouteCommentBlogPost"><value>blogcomments</value></data>
<data name="apiRouteCommentBlogPost" comment="don't localize it!"><value>blogcomments</value></data>
<data name="CommmentId"><value>Identifiant du commentaire</value></data>
<data name="Comment"><value>Commentaire</value></data>
<data name="LastModificationDate"><value>Date de dernière modification</value></data>
<data name="CreationDate"><value>Date de création</value></data>
<data name="PostId"><value>Identifiant du billet</value></data>
<data name="UserCreated"><value>Auteur</value></data>
<data name="UserModified"><value>Auteur de la dernière modification</value></data>
</root>

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="at"><value>un test</value></data>
</root>

@ -59,7 +59,8 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<!--
route name for the api controller used to tag the 'BlogPost' entity
route name for the api controller used to tag the 'BlogPost' entity,
don't localize it.
-->
<data name="apiRouteTagBlogPost"><value>blogtags</value></data>
<data name="apiRouteTagBlogPost" comment="don't localize it!" ><value>blogtags</value></data>
</root>

@ -8,29 +8,25 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace Yavsc.Resources {
namespace Yavsc.ViewModels.FrontOffice {
using System;
using System.Reflection;
using System.Resources;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class ChatHub {
public partial class PerformerProfileViewModel {
private static System.Resources.ResourceManager resourceMan;
private static System.Globalization.CultureInfo resourceCulture;
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal ChatHub() {
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
public static System.Resources.ResourceManager ResourceManager {
get {
if (object.Equals(null, resourceMan)) {
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Yavsc.ChatHub", typeof(ChatHub).GetTypeInfo().Assembly);
System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Resources." + "Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel"), typeof(PerformerProfileViewModel).GetTypeInfo().Assembly);
resourceMan = temp;
}
return resourceMan;
@ -47,15 +43,9 @@ namespace Yavsc.Resources {
}
}
public static string Authenticated_chat_user {
get {
return ResourceManager.GetString("Authenticated chat user", resourceCulture);
}
}
public static string LabnoJoinNoSend {
public static string PerformerIdLabel {
get {
return ResourceManager.GetString("LabnoJoinNoSend", resourceCulture);
return ResourceManager.GetString("PerformerIdLabel", resourceCulture);
}
}
}

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<!--
route name for the api controller used to tag the 'BlogPost' entity
-->
<data name="PerformerId"><value>Identifiant prestataire</value></data>
</root>

@ -58,5 +58,5 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="at"><value>a test</value></data>
<data name="PerformerIdLabel"><value>Identifiant prestataire</value></data>
</root>

File diff suppressed because it is too large Load Diff

@ -1,20 +0,0 @@
using System.IO;
using System.Resources;
namespace Yavsc.Resources
{
///<summary>
/// Makes possible the code injection
///</summary>
public class YavscLocalisation : ResourceSet
{
public YavscLocalisation(string path) : base(path)
{
}
public YavscLocalisation(Stream stream) : base(stream)
{
}
}
}

@ -47,8 +47,8 @@ namespace Yavsc.Services
static ConcurrentDictionary<string, bool> _isCop = new ConcurrentDictionary<string, bool>();
public static ConcurrentDictionary<string, ChatRoomInfo> Channels = new ConcurrentDictionary<string, ChatRoomInfo>();
private ApplicationDbContext _dbContext;
private IStringLocalizer _localizer;
ApplicationDbContext _dbContext;
IStringLocalizer _localizer;
public HubConnectionManager()
{

@ -301,7 +301,7 @@ namespace Yavsc
IAuthorizationService authorizationService,
IOptions<PayPalSettings> payPalSettings,
IOptions<GoogleAuthSettings> googleSettings,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
IStringLocalizer<Yavsc.YavscLocalisation> localizer,
UserManager<ApplicationUser> usermanager,
ILoggerFactory loggerFactory)
{

@ -18,11 +18,11 @@ namespace Yavsc.ViewComponents
{
ApplicationDbContext dbContext;
IBillingService billing;
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer;
IStringLocalizer<Yavsc.YavscLocalisation> localizer;
ILogger logger ;
public BillViewComponent(ApplicationDbContext dbContext,
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
IStringLocalizer<Yavsc.YavscLocalisation> localizer,
IBillingService billing,
ILoggerFactory loggerFactory)
{

@ -4,15 +4,17 @@ using Yavsc.Models.Blog;
namespace Yavsc.ViewComponents
{
public class CommentViewComponent : ViewComponent
public partial class CommentViewComponent : ViewComponent
{
IStringLocalizer<CommentViewComponent> localizer;
public CommentViewComponent(IStringLocalizer<CommentViewComponent> localizer)
{
this.localizer = localizer;
}
public IViewComponentResult Invoke(IIdentified<long> longCommentable)
{
// for a BlogPost, it results in the localization 'apiRouteCommentBlogPost': blogcomments
ViewData["apictlr"] = "/api/"+localizer["apiRouteComment"+longCommentable.GetType().Name];
return View(longCommentable.GetType().Name, new Comment{ PostId = longCommentable.Id });
}

@ -3,7 +3,7 @@ using Yavsc.Models.Workflow;
namespace Yavsc.ViewModels.FrontOffice
{
public class PerformerProfileViewModel
public partial class PerformerProfileViewModel
{
public string UserName { get; set; }
public string PerformerId { get; set; }

@ -52,7 +52,7 @@
@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
@addTagHelper "*, Yavsc"
@inject IStringLocalizer<Yavsc.Resources.YavscLocalisation> SR
@inject IStringLocalizer<Yavsc.YavscLocalisation> SR
@inject IAuthorizationService AuthorizationService
@inject IOptions<GoogleAuthSettings> GoogleSettings
@inject IOptions<SiteSettings> SiteSettings

@ -428,3 +428,7 @@ div.chatlist {
border-bottom-width: 1pt;
}
img.ptcroix {
margin: .4em;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg8"
inkscape:version="0.92.1 r15371"
sodipodi:docname="ptcroix.svg">
<defs
id="defs2">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="163.9529 : 280.82037 : 1"
inkscape:vp_y="0 : 1630.016 : 0"
inkscape:vp_z="615.75414 : 280.82037 : 1"
inkscape:persp3d-origin="389.85352 : 200.13457 : 1"
id="perspective4547" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="-8.315476 : 602.45924 : 1"
inkscape:vp_y="0 : 3779.5275 : 0"
inkscape:vp_z="785.38533 : 602.45924 : 1"
inkscape:persp3d-origin="388.53492 : 415.37263 : 1"
id="perspective4545" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="34.395833 : 513.25685 : 1"
inkscape:vp_y="0 : 3779.5275 : 0"
inkscape:vp_z="828.09664 : 513.25685 : 1"
inkscape:persp3d-origin="431.24623 : 326.17024 : 1"
id="perspective4543" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 148.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="210 : 148.5 : 1"
inkscape:persp3d-origin="105 : 99 : 1"
id="perspective4485" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="212.20691"
inkscape:cy="643.8578"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1594"
inkscape:window-height="914"
inkscape:window-x="117"
inkscape:window-y="78"
inkscape:window-maximized="0" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="g4583"
transform="rotate(44.793158,96.005951,140.70684)"
inkscape:export-xdpi="3.4402087"
inkscape:export-ydpi="3.4402087">
<rect
y="72.860115"
x="80.508926"
height="135.69345"
width="30.994047"
id="rect4549"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.12928867;stroke-miterlimit:4;stroke-dasharray:none" />
<rect
transform="rotate(90)"
y="-163.85268"
x="125.20982"
height="135.69345"
width="30.994049"
id="rect4549-6"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.12928867;stroke-miterlimit:4;stroke-dasharray:none" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -30,6 +30,7 @@ window.ChatHubHandler = (function ($) {
$.fn.filterByData = function (prop, val) {
return this.filter(function () { return $(this).data(prop) == val; });
};
var ChatView = function ($view, full) {
if (!full) throw new Error('not implemented');
@ -89,7 +90,7 @@ window.ChatHubHandler = (function ($) {
}
// eslint-disable-next-line no-warning-comments
// TODO reconnected userpart userjoin deniedpv
$('<li></li>').addClass(tag).append(tag + ': ' + targetid + ' ').append(message).addClass(tag).appendTo($('#room_' + targetid));
$('<li></li>').addClass(tag).append(tag + ': ').append(message).addClass(tag).appendTo($('#room_' + targetid));
};
chat.client.notifyUser = function (tag, targetid, message) {
@ -101,11 +102,13 @@ window.ChatHubHandler = (function ($) {
onUserDisconnected(targetid, message);
return;
}
// eslint-disable-next-line no-warning-comments
// TODO userpart userjoin deniedpv
$('<li></li>').append(tag + ': ' + targetid + ': ').append(message).addClass(tag).appendTo(notifications);
};
chat.client.notifyUserInRoom = function (tag, room, message) {
$('<li></li>').append(tag + ': ' ).append(message).addClass(tag).appendTo($('#room_' + room));
};
var setChanInfo = function (chanInfo) {
var chanId = 'r' + chanInfo.Name;
$('#tv_' + chanId).replaceWith(chanInfo.Topic);
@ -132,16 +135,19 @@ window.ChatHubHandler = (function ($) {
});
}
var chatbar = $('<div class="chatbar"></div>');
var chatbar = $('<div class="chatbar form-group"></div>');
var roomjoin = $('<div class="chatctl" class="form-control"></div>');
var roomjoin = $('<div class="chatctl" ></div>');
var roomlist = $('<div class="roomlist"></div>');
roomlist.appendTo(chatbar);
var ptc = $('<img src="/images/ptcroix.png" >').addClass('ptcroix');
$('<label for="channame">Join&nbsp;:</label>')
.appendTo(roomjoin);
var chanName = $('<input id="channame" title="channel name" hint="yavsc" >');
chanName.appendTo(roomjoin);
ptc.appendTo(roomjoin);
roomjoin.appendTo(chatbar);
chatbar.appendTo($view);
@ -182,15 +188,25 @@ window.ChatHubHandler = (function ($) {
else if (chanType == 'u' || chanType == 'a') userlist.push(chanName);
setActiveChan(chanId);
};
var buildRoom = function (roomName) {
if (chans.some(function(cname) { return cname == roomName; })) setActiveChan('r' + roomName);
else buildChan('#', 'r', roomName, chat.server.send);
if (!chans.some(function(cname) { return cname == roomName; }))
buildChan('#', 'r', roomName, chat.server.send);
};
var DestroyRoom = function () {
if (frontChanId) {
$('#v' + frontChanId).remove();
$('#sel_' + frontChanId).remove();
frontChanId=null;
}
}
var buildPv = function (userName) {
if (userlist.some(function(uname) { return uname == userName; })) setActiveChan('u' + userName);
else
if (!userlist.some(function(uname) { return uname == userName; })) {
if (userName[0] == '?') buildChan('@?', 'a', userName.slice(1), chat.server.sendPV);
else buildChan('@', 'u', userName, chat.server.sendPV);
}
};
/*var getUsers = function () {
@ -242,6 +258,11 @@ window.ChatHubHandler = (function ($) {
}
// else TODO showRoomInfo(this.value);
});
ptc.click(function(){
DestroyRoom();
});
// eslint-disable-next-line no-warning-comments
// TODO get this data from the chatview element
var audio = new Audio('/sounds/bell.mp3');

Loading…