mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Unified wording of event summaries. Added missing permission names to role events.
This commit is contained in:
@@ -34,11 +34,11 @@ namespace Orchard.AuditTrail.Providers.Roles {
|
||||
}
|
||||
|
||||
public void PermissionAdded(PermissionAddedContext context) {
|
||||
RecordAuditTrailEvent(RoleAuditTrailEventProvider.PermissionAdded, context.Role.Name);
|
||||
RecordAuditTrailEvent(RoleAuditTrailEventProvider.PermissionAdded, context.Role.Name, context.Permission.Name);
|
||||
}
|
||||
|
||||
public void PermissionRemoved(PermissionRemovedContext context) {
|
||||
RecordAuditTrailEvent(RoleAuditTrailEventProvider.PermissionRemoved, context.Role.Name);
|
||||
RecordAuditTrailEvent(RoleAuditTrailEventProvider.PermissionRemoved, context.Role.Name, context.Permission.Name);
|
||||
}
|
||||
|
||||
public void UserAdded(UserAddedContext context) {
|
||||
@@ -57,6 +57,15 @@ namespace Orchard.AuditTrail.Providers.Roles {
|
||||
RecordAuditTrailEvent(eventName, roleName, properties: null, eventData: eventData);
|
||||
}
|
||||
|
||||
private void RecordAuditTrailEvent(string eventName, string roleName, string permissionName) {
|
||||
var eventData = new Dictionary<string, object> {
|
||||
{"RoleName", roleName},
|
||||
{"PermissionName", permissionName}
|
||||
};
|
||||
|
||||
RecordAuditTrailEvent(eventName, roleName, properties: null, eventData: eventData);
|
||||
}
|
||||
|
||||
private void RecordAuditTrailEvent(string eventName, string roleName, IUser user) {
|
||||
|
||||
var properties = new Dictionary<string, object> {
|
||||
|
@@ -5,5 +5,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contentpart-summary">
|
||||
@T("Created the <strong>{0}</strong> content part.", contentPartName)
|
||||
@T("The content part <strong>{0}</strong> was created.", contentPartName)
|
||||
</section>
|
@@ -8,5 +8,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contentpart-summary">
|
||||
@T("Added the <strong>{0}</strong> content field of type <strong>{1}</strong> to the <strong>{2}</strong> content part.", contentFieldName, contentFieldTypeName, contentPartName)
|
||||
@T("The content field <strong>{0}</strong> of type <strong>{1}</strong> was added to the content part <strong>{2}</strong>.", contentFieldName, contentFieldTypeName, contentPartName)
|
||||
</section>
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contentpart-summary">
|
||||
@T("Removed the <strong>{0}</strong> content field from the <strong>{1}</strong> content part.", contentFieldName, contentPartName)
|
||||
@T("The content field <strong>{0}</strong> was removed from the content part <strong>{1}</strong>.", contentFieldName, contentPartName)
|
||||
</section>
|
@@ -8,5 +8,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contentpart-summary">
|
||||
@T("The <strong>{0}</strong> content field of the <strong>{1}</strong> content part was renamed from <strong>{2}</strong> to <strong>{3}</strong>.", contentFieldName, contentPartName, oldDisplayName, newDisplayName)
|
||||
@T("The content field <strong>{0}</strong> of the content part <strong>{1}</strong> was renamed from <strong>{2}</strong> to <strong>{3}</strong>.", contentFieldName, contentPartName, oldDisplayName, newDisplayName)
|
||||
</section>
|
@@ -14,7 +14,7 @@
|
||||
var diff = (DiffDictionary<string, string>)Model.Diff;
|
||||
}
|
||||
<section class="audittrail-contenttype-event">
|
||||
<div>@T("Settings for <strong>{0}</strong> were updated:", contentPartName)</div>
|
||||
@T("Settings for the content part <strong>{0}</strong> were changed:", contentPartName)
|
||||
<ul>
|
||||
@foreach (var setting in diff) {
|
||||
<li>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
var diff = (DiffDictionary<string, string>)Model.Diff;
|
||||
}
|
||||
<section class="audittrail-contenttype-event">
|
||||
<h2>@T("Settings for <strong>{0}</strong> were updated:", contentPartName)</h2>
|
||||
@T("Settings for the content part <strong>{0}</strong> were changed:", contentPartName)
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@@ -5,5 +5,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contentpart-summary">
|
||||
@T("Removed the <strong>{0}</strong> content part.", contentPartName)
|
||||
@T("The content part <strong>{0}</strong> was removed.", contentPartName)
|
||||
</section>
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contenttype-summary">
|
||||
@T("Created the <strong>{0}</strong> content type.", contentTypeName)
|
||||
@T("The content type <strong>{0}</strong> was created.", contentTypeName)
|
||||
</section>
|
@@ -15,10 +15,10 @@
|
||||
var contentFieldName = eventData.Get<string>("ContentFieldName");
|
||||
var diff = (DiffDictionary<string, string>)Model.Diff;
|
||||
var isImplicitPart = contentTypeName == contentPartName;
|
||||
var captionTemplate = isImplicitPart ? "Settings for <strong>{0}</strong> attached the <strong>{1}</strong> content type were updated:" : "Settings for <strong>{0}</strong> attached to <strong>{1}</strong> of the <strong>{2}</strong> content type were updated:";
|
||||
var captionTemplate = isImplicitPart ? "Settings for the field <strong>{0}</strong> attached to the <strong>{1}</strong> content type were updated:" : "Settings for the field <strong>{0}</strong> attached to content part <strong>{1}</strong> of the content type <strong>{2}</strong> were updated:";
|
||||
}
|
||||
<section class="audittrail-contenttype-event">
|
||||
<div>@T(captionTemplate, contentFieldName, contentPartName, contentTypeName)</div>
|
||||
@T(captionTemplate, contentFieldName, contentPartName, contentTypeName)
|
||||
<ul>
|
||||
@foreach (var setting in diff) {
|
||||
<li>
|
||||
|
@@ -15,10 +15,10 @@
|
||||
var contentFieldName = eventData.Get<string>("ContentFieldName");
|
||||
var diff = (DiffDictionary<string, string>)Model.Diff;
|
||||
var isImplicitPart = contentTypeName == contentPartName;
|
||||
var captionTemplate = isImplicitPart ? "Settings for <strong>{0}</strong> attached the <strong>{1}</strong> content type were updated:" : "Settings for <strong>{0}</strong> attached to <strong>{1}</strong> of the <strong>{2}</strong> content type were updated:";
|
||||
var captionTemplate = isImplicitPart ? "Settings for the field <strong>{0}</strong> attached to the <strong>{1}</strong> content type were updated:" : "Settings for the field <strong>{0}</strong> attached to content part <strong>{1}</strong> of the content type <strong>{2}</strong> were updated:";
|
||||
}
|
||||
<section class="audittrail-contenttype-event">
|
||||
<h2>@T(captionTemplate, contentFieldName, contentPartName, contentTypeName)</h2>
|
||||
@T(captionTemplate, contentFieldName, contentPartName, contentTypeName)
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contenttype-summary">
|
||||
@T("Added the <strong>{0}</strong> content part to the <strong>{1}</strong> content type.", contentPartName, contentTypeName)
|
||||
@T("The content part <strong>{0}</strong> was added to the content type <strong>{1}</strong>.", contentPartName, contentTypeName)
|
||||
</section>
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contenttype-summary">
|
||||
@T("Removed the <strong>{0}</strong> content part from the <strong>{1}</strong> content type.", contentPartName, contentTypeName)
|
||||
@T("The content part <strong>{0}</strong> was removed from the content type <strong>{1}</strong>.", contentPartName, contentTypeName)
|
||||
</section>
|
@@ -15,7 +15,7 @@
|
||||
var diff = (DiffDictionary<string, string>)Model.Diff;
|
||||
}
|
||||
<section class="audittrail-contenttype-event">
|
||||
<div>@T("Settings for <strong>{0}</strong> attached to the <strong>{1}</strong> content type were updated:", contentPartName, contentTypeName)</div>
|
||||
@T("Settings for the content part <strong>{0}</strong> attached to the content type <strong>{1}</strong> were changed:", contentPartName, contentTypeName)
|
||||
<ul>
|
||||
@foreach (var setting in diff) {
|
||||
<li>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
var diff = (DiffDictionary<string, string>)Model.Diff;
|
||||
}
|
||||
<section class="audittrail-contenttype-event">
|
||||
<h2>@T("Settings for <strong>{0}</strong> attached to the <strong>{1}</strong> content type were updated:", contentPartName, contentTypeName)</h2>
|
||||
@T("Settings for the content part <strong>{0}</strong> attached to the content type <strong>{1}</strong> were changed:", contentPartName, contentTypeName)
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contenttype-summary">
|
||||
@T("Removed the <strong>{0}</strong> content type.", contentTypeName)
|
||||
@T("The content type <strong>{0}</strong> was removed.", contentTypeName)
|
||||
</section>
|
@@ -7,5 +7,5 @@
|
||||
}
|
||||
|
||||
<section>
|
||||
@T("The display name for the <strong>{0}</strong> content type was changed from <strong>{1}</strong> to <strong>{2}</strong>.", contentTypeName, oldDisplayName, newDisplayName)
|
||||
@T("The display name for the content type <strong>{0}</strong> was changed from <strong>{1}</strong> to <strong>{2}</strong>.", contentTypeName, oldDisplayName, newDisplayName)
|
||||
</section>
|
@@ -15,7 +15,7 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-contenttype-event">
|
||||
@T("The following <strong>{0}</strong> settings were changed:", contentTypeName)<br />
|
||||
@T("Settings for the content type <strong>{0}</strong> were changed:", contentTypeName)
|
||||
<ul>
|
||||
@foreach (var setting in diff) {
|
||||
<li>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
var diff = (DiffDictionary<string, string>) Model.Diff;
|
||||
}
|
||||
<section class="audittrail-contenttype-event">
|
||||
<h2>@T("The following <strong>{0}</strong> settings were changed", contentTypeName)</h2>
|
||||
@T("Settings for the content type <strong>{0}</strong> were changed:", contentTypeName)
|
||||
<table class="items">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@@ -5,5 +5,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-role-summary">
|
||||
@T("Created the role <strong>{0}</strong>.", roleName)
|
||||
@T("The role <strong>{0}</strong> was created.", roleName)
|
||||
</section>
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-role-summary">
|
||||
@T("Added the permission <strong>{0}</strong> to the role <strong>{1}</strong>.", permissionName, roleName)
|
||||
@T("The permission <strong>{0}</strong> was added to the role <strong>{1}</strong>.", permissionName, roleName)
|
||||
</section>
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-role-summary">
|
||||
@T("Removed the permission <strong>{0}</strong> from the role <strong>{1}</strong>.", permissionName, roleName)
|
||||
@T("The permission <strong>{0}</strong> was removed from the role <strong>{1}</strong>.", permissionName, roleName)
|
||||
</section>
|
@@ -5,5 +5,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-role-summary">
|
||||
@T("Removed the role <strong>{0}</strong>.", roleName)
|
||||
@T("The role <strong>{0}</strong> was removed.", roleName)
|
||||
</section>
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-role-summary">
|
||||
@T("Renamed the role <strong>{0}</strong> to <strong>{1}</strong>.", previousRoleName, newRoleName)
|
||||
@T("The role <strong>{0}</strong> was renamed to <strong>{1}</strong>.", previousRoleName, newRoleName)
|
||||
</section>
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-role-summary">
|
||||
@T("Added the user <strong>{0}</strong> to the role <strong>{1}</strong>.", userName, roleName)
|
||||
@T("The user <strong>{0}</strong> was added to the role <strong>{1}</strong>.", userName, roleName)
|
||||
</section>
|
@@ -6,5 +6,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-role-summary">
|
||||
@T("Removed the user <strong>{0}</strong> from the role <strong>{1}</strong>.", userName, roleName)
|
||||
@T("The user <strong>{0}</strong> was removed from the role <strong>{1}</strong>.", userName, roleName)
|
||||
</section>
|
@@ -5,5 +5,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-user-summary">
|
||||
<span>@T("Attempted user name: {0}", userName)</span>
|
||||
@T("Attempted user name: <strong>{0}</strong>", userName)
|
||||
</section>
|
@@ -5,5 +5,5 @@
|
||||
}
|
||||
|
||||
<section class="audittrail-user-summary">
|
||||
<span>@T("User: {0}", userName)</span>
|
||||
@T("User name: <strong>{0}</strong>", userName)
|
||||
</section>
|
Reference in New Issue
Block a user