Miscellaneous tweaks, refactorings and renames.

This commit is contained in:
Daniel Stolt
2014-07-05 19:08:40 +02:00
parent f96e73fc4c
commit f66affe98c
49 changed files with 186 additions and 185 deletions

View File

@@ -27,7 +27,6 @@ namespace Orchard.AuditTrail.Controllers {
public dynamic New { get; private set; } public dynamic New { get; private set; }
public ActionResult Index(PagerParameters pagerParameters, AuditTrailOrderBy? orderBy = null) { public ActionResult Index(PagerParameters pagerParameters, AuditTrailOrderBy? orderBy = null) {
if(!_authorizer.Authorize(Permissions.ViewAuditTrail)) if(!_authorizer.Authorize(Permissions.ViewAuditTrail))
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();

View File

@@ -78,11 +78,12 @@
<None Include="Placement.info" /> <None Include="Placement.info" />
<Content Include="Lib\XmlDiffPatch\xmldiffpatch.dll" /> <Content Include="Lib\XmlDiffPatch\xmldiffpatch.dll" />
<Content Include="Recipes\audit-trail.recipe.xml" /> <Content Include="Recipes\audit-trail.recipe.xml" />
<Content Include="Scripts\audittrail-admin.js" /> <Content Include="Scripts\audittrail-expando.js" />
<Content Include="Scripts\audittrail-checkall.js" /> <Content Include="Scripts\audittrail-checkall.js" />
<Content Include="Scripts\audittrail-disabledcontent.js" /> <Content Include="Scripts\audittrail-disabledcontent.js" />
<Content Include="Styles\audittrail-admin.css" /> <Content Include="Styles\audittrail-display.css" />
<Content Include="Styles\audittrail-disabledcontent.css" /> <Content Include="Styles\audittrail-disabledcontent.css" />
<Content Include="Styles\audittrail-part.css" />
<Content Include="Styles\audittrail-settings.css" /> <Content Include="Styles\audittrail-settings.css" />
<Content Include="Styles\audittrail-grid.css" /> <Content Include="Styles\audittrail-grid.css" />
<Content Include="Styles\menu.audit-trail-admin.css" /> <Content Include="Styles\menu.audit-trail-admin.css" />

View File

@@ -24,12 +24,12 @@ namespace Orchard.AuditTrail.Providers.ContentDefinition {
public override void Describe(DescribeContext context) { public override void Describe(DescribeContext context) {
context.For("ContentType", T("Content Type")) context.For("ContentType", T("Content Type"))
.Event(this, Created, T("Created"), T("Content Type was created."), enableByDefault: true) .Event(this, Created, T("Created"), T("A content type was created."), enableByDefault: true)
.Event(this, Removed, T("Removed"), T("Content Type was removed."), enableByDefault: true) .Event(this, Removed, T("Removed"), T("A content type was removed."), enableByDefault: true)
.Event(this, PartAdded, T("Part added"), T("Content Part was added."), enableByDefault: true) .Event(this, PartAdded, T("Part added"), T("A content part was added to a content type."), enableByDefault: true)
.Event(this, PartRemoved, T("Part removed"), T("Content Part was removed."), enableByDefault: true) .Event(this, PartRemoved, T("Part removed"), T("A content part was removed from a content type."), enableByDefault: true)
.Event(this, TypeSettingsUpdated, T("Type Settings updated"), T("Content Type settings were updated."), enableByDefault: true) .Event(this, TypeSettingsUpdated, T("Type settings updated"), T("The settings of a content type were updated."), enableByDefault: true)
.Event(this, PartSettingsUpdated, T("Part Settings updated"), T("Content Part settings were updated."), enableByDefault: true); .Event(this, PartSettingsUpdated, T("Part settings updated"), T("The settings of a content part were updated."), enableByDefault: true);
context.QueryFilter(QueryFilter); context.QueryFilter(QueryFilter);
context.DisplayFilter(DisplayFilter); context.DisplayFilter(DisplayFilter);

View File

@@ -1,17 +0,0 @@
(function($) {
var initExpandoControl = function() {
$(".expando-wrapper legend").expandoControl(
function(controller) {
return controller.nextAll(".expando");
}, {
collapse: true,
remember: true
});
};
$(function() {
initExpandoControl();
});
})(jQuery);

View File

@@ -0,0 +1,11 @@
$(function() {
$(".expando-wrapper > legend").expandoControl(
function(controller) {
return controller.nextAll(".expando");
},
{
collapse: true,
remember: true
}
);
});

View File

@@ -1,20 +0,0 @@
.audit-trail-filter {
margin-bottom: 1em;
}
.audit-trail-filter fieldset label {
display: inline-block;
width: 10em;
}
.audit-trail-filter fieldset label.inline {
display: inline;
}
.audit-trail-list .info {
line-height: 25px;
}
.audit-trail-list .event-content .version {
font-size: 0.8em;
}

View File

@@ -0,0 +1,20 @@
.audittrail-filter {
margin-bottom: 1em;
}
.audittrail-filter fieldset label {
display: inline-block;
width: 10em;
}
.audittrail-filter fieldset label.inline {
display: inline;
}
.audittrail-event-metadata-section {
margin-bottom: 1em;
}
.audittrail-event-metadata-section strong {
font-weight: bold;
}

View File

@@ -0,0 +1,7 @@
.audittrail-list-wrapper {
padding-top: 1em !important;
}
.audittrail-list {
width: auto !important;
}

View File

@@ -1,22 +1,18 @@
@model Orchard.AuditTrail.ViewModels.AuditTrailDetailsViewModel @model Orchard.AuditTrail.ViewModels.AuditTrailDetailsViewModel
@{ @{
Style.Include("audittrail-admin.css"); Style.Include("audittrail-display.css");
}
@{
var record = Model.Record; var record = Model.Record;
var descriptor = Model.Descriptor; var descriptor = Model.Descriptor;
Layout.Title = T("Audit Trail Event");
} }
<section class="audit-trail-event"> <section class="audittrail-event-metadata-section">
<fieldset> @T("Event:") <strong>@descriptor.Name</strong><br />
<legend>@descriptor.Name - <span>@descriptor.CategoryDescriptor.Name</span></legend> @T("Category:") <strong>@descriptor.CategoryDescriptor.Name</strong><br />
<div> @T("Timestamp:") <strong>@Display.DateTime(DateTimeUtc: record.CreatedUtc, CustomFormat: T("g"))</strong><br />
<span>@T("On: <strong>{0}</strong>", Display.DateTime(DateTimeUtc: record.CreatedUtc, CustomFormat: T("g")))</span> @T("Username:") <strong>@record.UserName</strong>
@if (!String.IsNullOrWhiteSpace(record.UserName)) {
@T(" | ")<span>@T("By: <strong>{0}</strong>", record.UserName)</span>
}
</div>
</fieldset>
</section> </section>
<section class="audit-trail-event-details"> <section class="audittrail-event-details-section">
@Display(Model.DetailsShape) @Display(Model.DetailsShape)
</section> </section>

View File

@@ -1,18 +1,18 @@
@using Orchard.AuditTrail.Services.Models @using Orchard.AuditTrail.Services.Models
@model Orchard.AuditTrail.ViewModels.AuditTrailViewModel @model Orchard.AuditTrail.ViewModels.AuditTrailViewModel
@{ @{
Style.Include("audittrail-admin.css"); Style.Include("audittrail-display.css");
Style.Include("audittrail-grid.css"); Style.Include("audittrail-grid.css");
var orderBy = Model.OrderBy; var orderBy = Model.OrderBy;
var orderByItems = new List<SelectListItem> { var orderByItems = new List<SelectListItem> {
new SelectListItem {Text = T("Date (desc)").Text, Value = AuditTrailOrderBy.DateDescending.ToString(), Selected = Model.OrderBy == AuditTrailOrderBy.DateDescending}, new SelectListItem {Text = T("Date (newest first)").Text, Value = AuditTrailOrderBy.DateDescending.ToString(), Selected = Model.OrderBy == AuditTrailOrderBy.DateDescending},
new SelectListItem {Text = T("Category (asc)").Text, Value = AuditTrailOrderBy.CategoryAscending.ToString(), Selected = Model.OrderBy == AuditTrailOrderBy.CategoryAscending}, new SelectListItem {Text = T("Category (alphabetical)").Text, Value = AuditTrailOrderBy.CategoryAscending.ToString(), Selected = Model.OrderBy == AuditTrailOrderBy.CategoryAscending},
new SelectListItem {Text = T("Event (asc)").Text, Value = AuditTrailOrderBy.EventAscending.ToString(), Selected = Model.OrderBy == AuditTrailOrderBy.EventAscending}, new SelectListItem {Text = T("Event name (alphabetical)").Text, Value = AuditTrailOrderBy.EventAscending.ToString(), Selected = Model.OrderBy == AuditTrailOrderBy.EventAscending},
}; };
Layout.Title = T("Audit Trail"); Layout.Title = T("Audit Trail");
} }
<section class="audit-trail-filter"> <section class="audittrail-filter">
@using (Html.BeginForm("Index", "Admin", new { area = "Orchard.AuditTrail" }, FormMethod.Get)) { @using (Html.BeginForm("Index", "Admin", new { area = "Orchard.AuditTrail" }, FormMethod.Get)) {
<div class="table"> <div class="table">
<div class="row"> <div class="row">
@@ -24,7 +24,7 @@
<div class="cell span-4"> <div class="cell span-4">
@Display(Model.FilterLayout.TripleFirst) @Display(Model.FilterLayout.TripleFirst)
<fieldset> <fieldset>
@Html.LabelFor(m => orderBy, T("Ordered by:")) @Html.LabelFor(m => orderBy, T("Sort by:"))
@Html.DropDownListFor(m => orderBy, orderByItems) @Html.DropDownListFor(m => orderBy, orderByItems)
</fieldset> </fieldset>
</div> </div>
@@ -43,7 +43,7 @@
</div> </div>
} }
</section> </section>
<section class="audit-trail-list"> <section class="audittrail-list">
@if (!Model.Records.Any()) { @if (!Model.Records.Any()) {
<p class="info">@T("There are no records to display.")</p> <p class="info">@T("There are no records to display.")</p>
} }
@@ -56,7 +56,7 @@
<th>@T("User")</th> <th>@T("User")</th>
<th>@T("Timestamp")</th> <th>@T("Timestamp")</th>
<th>@T("Comment")</th> <th>@T("Comment")</th>
<th>@T("Event Data")</th> <th>@T("Summary")</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>

View File

@@ -5,6 +5,6 @@
var newRetentionPeriod = eventData.Get<int>("NewRetentionPeriod"); var newRetentionPeriod = eventData.Get<int>("NewRetentionPeriod");
} }
<fieldset> <section class="audittrail-settings-summary">
@T("Trimming retention period changed from <strong>{0}</strong> to <strong>{1}</strong>", oldRetentionPeriod, newRetentionPeriod) @T("Trimming retention period changed from <strong>{0}</strong> to <strong>{1}</strong>", oldRetentionPeriod, newRetentionPeriod)
</fieldset> </section>

View File

@@ -6,7 +6,8 @@
var contentItemVersionNumber = eventData.Get<int>("VersionNumber"); var contentItemVersionNumber = eventData.Get<int>("VersionNumber");
} }
<section class="event-content"> <section class="audittrail-content-summary">
<span class="version">@T("version {0}", contentItemVersionNumber)</span>@T(" - ") @T("Version {0}", contentItemVersionNumber)
<a href="@Url.Action("Detail", "Content", new { area = "Orchard.AuditTrail", id = contentItemId, version = contentItemVersionNumber })" class="event-contentitem">@title</a> @T(" - ")
<a href="@Url.Action("Detail", "Content", new { area = "Orchard.AuditTrail", id = contentItemId, version = contentItemVersionNumber })">@T("View")</a>
</section> </section>

View File

@@ -3,45 +3,50 @@
@using Orchard.ContentManagement @using Orchard.ContentManagement
@{ @{
var record = (AuditTrailEventRecord)Model.Record; var record = (AuditTrailEventRecord)Model.Record;
var contentItem = (ContentItem) Model.ContentItem; var contentItem = (ContentItem)Model.ContentItem;
var previousVersion = (ContentItem) Model.PreviousVersion; var previousVersion = (ContentItem)Model.PreviousVersion;
var diffNodes = (IEnumerable<DiffNode>) Model.DiffNodes; var diffNodes = (IEnumerable<DiffNode>)Model.DiffNodes;
} }
<fieldset> <section class="audittrail-event-metadata-section">
<strong>@Html.ItemDisplayText(contentItem)</strong>@T(" - ")@contentItem.ContentType @T("ID:") <strong>@contentItem.Id</strong><br />
<span class="hint">@T("Version {0}", contentItem.Version)</span> @contentItem.ContentType: <strong>@Html.ItemDisplayText(contentItem)</strong><br />
@T("Version:") <strong>@contentItem.Version</strong>
@if (!String.IsNullOrWhiteSpace(record.Comment)) { @if (!String.IsNullOrWhiteSpace(record.Comment)) {
<text>&quot;@record.Comment&quot;</text> <br />
@T("Comment:")<br />
@record.Comment
} }
</fieldset> </section>
@if (previousVersion != null) {
<table class="items"> <section class="audittrail-event-changes-section">
<thead> @if (previousVersion != null) {
<tr> <table class="items">
<th>@T("Diff Type")</th> <thead>
<th>@T("Context")</th>
<th>@T("Before")</th>
<th>@T("After")</th>
</tr>
</thead>
<tbody>
@if (!diffNodes.Any()) {
<tr> <tr>
<td colspan="4">@T("")</td> <th>@T("Action")</th>
<th>@T("Context")</th>
<th>@T("Before")</th>
<th>@T("After")</th>
</tr> </tr>
} </thead>
else { <tbody>
foreach (var node in diffNodes) { @if (!diffNodes.Any()) {
<tr> <tr>
<td>@T(node.Type.ToString())</td> <td colspan="4">@T("")</td>
<td>@node.Context</td>
<td>@node.Previous</td>
<td>@node.Current</td>
</tr> </tr>
} }
} else {
</tbody> foreach (var node in diffNodes) {
</table> <tr>
<td>@T(node.Type.ToString())</td>
} <td>@node.Context</td>
<td>@node.Previous</td>
<td>@node.Current</td>
</tr>
}
}
</tbody>
</table>
}
</section>

View File

@@ -4,6 +4,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Created the <strong>{0}</strong> content part.", contentPartName) @T("Created the <strong>{0}</strong> content part.", contentPartName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Created the <strong>{0}</strong> content part.", contentPartName) @T("Created the <strong>{0}</strong> content part.", contentPartName)
</section> </section>

View File

@@ -7,6 +7,6 @@
var contentDisplayName = eventData.Get<string>("ContentDisplayName"); var contentDisplayName = eventData.Get<string>("ContentDisplayName");
} }
<section class="event-content-part"> <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("Added the <strong>{0}</strong> content field of type <strong>{1}</strong> to the <strong>{2}</strong> content part.", contentFieldName, contentFieldTypeName, contentPartName)
</section> </section>

View File

@@ -7,6 +7,6 @@
var contentDisplayName = eventData.Get<string>("ContentDisplayName"); var contentDisplayName = eventData.Get<string>("ContentDisplayName");
} }
<section class="event-content-part"> <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("Added the <strong>{0}</strong> content field of type <strong>{1}</strong> to the <strong>{2}</strong> content part.", contentFieldName, contentFieldTypeName, contentPartName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentFieldName = eventData.Get<string>("ContentFieldName"); var contentFieldName = eventData.Get<string>("ContentFieldName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Removed the <strong>{0}</strong> content field from the <strong>{1}</strong> content part.", contentFieldName, contentPartName) @T("Removed the <strong>{0}</strong> content field from the <strong>{1}</strong> content part.", contentFieldName, contentPartName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentFieldName = eventData.Get<string>("ContentFieldName"); var contentFieldName = eventData.Get<string>("ContentFieldName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Removed the <strong>{0}</strong> content field from the <strong>{1}</strong> content part.", contentFieldName, contentPartName) @T("Removed the <strong>{0}</strong> content field from the <strong>{1}</strong> content part.", contentFieldName, contentPartName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentFieldName = eventData.Get<string>("ContentFieldName"); var contentFieldName = eventData.Get<string>("ContentFieldName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Settings for the <strong>{0}</strong> content field of the <strong>{1}</strong> content part were updated.", contentFieldName, contentPartName) @T("Settings for the <strong>{0}</strong> content field of the <strong>{1}</strong> content part were updated.", contentFieldName, contentPartName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentFieldName = eventData.Get<string>("ContentFieldName"); var contentFieldName = eventData.Get<string>("ContentFieldName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Settings for the <strong>{0}</strong> content field of the <strong>{1}</strong> content part were updated.", contentFieldName, contentPartName) @T("Settings for the <strong>{0}</strong> content field of the <strong>{1}</strong> content part were updated.", contentFieldName, contentPartName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Settings for the <strong>{0}</strong> content part were updated.", contentPartName) @T("Settings for the <strong>{0}</strong> content part were updated.", contentPartName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Settings for the <strong>{0}</strong> content part were updated.", contentPartName) @T("Settings for the <strong>{0}</strong> content part were updated.", contentPartName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Removed the <strong>{0}</strong> content part.", contentPartName) @T("Removed the <strong>{0}</strong> content part.", contentPartName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-part"> <section class="audittrail-contentpart-summary">
@T("Removed the <strong>{0}</strong> content part.", contentPartName) @T("Removed the <strong>{0}</strong> content part.", contentPartName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentTypeDisplayName = eventData.Get<string>("ContentTypeDisplayName"); var contentTypeDisplayName = eventData.Get<string>("ContentTypeDisplayName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Created the <strong>{0}</strong> content type.", contentTypeName) @T("Created the <strong>{0}</strong> content type.", contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentTypeDisplayName = eventData.Get<string>("ContentTypeDisplayName"); var contentTypeDisplayName = eventData.Get<string>("ContentTypeDisplayName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Created the <strong>{0}</strong> content type.", contentTypeName) @T("Created the <strong>{0}</strong> content type.", contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Added the <strong>{0}</strong> content part to the <strong>{1}</strong> content type.", contentPartName, contentTypeName) @T("Added the <strong>{0}</strong> content part to the <strong>{1}</strong> content type.", contentPartName, contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Added the <strong>{0}</strong> content part to the <strong>{1}</strong> content type.", contentPartName, contentTypeName) @T("Added the <strong>{0}</strong> content part to the <strong>{1}</strong> content type.", contentPartName, contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Removed the <strong>{0}</strong> content part from the <strong>{1}</strong> content type.", contentPartName, contentTypeName) @T("Removed the <strong>{0}</strong> content part from the <strong>{1}</strong> content type.", contentPartName, contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Removed the <strong>{0}</strong> content part from the <strong>{1}</strong> content type.", contentPartName, contentTypeName) @T("Removed the <strong>{0}</strong> content part from the <strong>{1}</strong> content type.", contentPartName, contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Settings for the <strong>{0}</strong> content part attached to the <strong>{1}</strong> content type were updated.", contentPartName, contentTypeName) @T("Settings for the <strong>{0}</strong> content part attached to the <strong>{1}</strong> content type were updated.", contentPartName, contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentPartName = eventData.Get<string>("ContentPartName"); var contentPartName = eventData.Get<string>("ContentPartName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Settings for the <strong>{0}</strong> content part attached to the <strong>{1}</strong> content type were updated.", contentPartName, contentTypeName) @T("Settings for the <strong>{0}</strong> content part attached to the <strong>{1}</strong> content type were updated.", contentPartName, contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentTypeDisplayName = eventData.Get<string>("ContentTypeDisplayName"); var contentTypeDisplayName = eventData.Get<string>("ContentTypeDisplayName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Removed the <strong>{0}</strong> content type.", contentTypeName) @T("Removed the <strong>{0}</strong> content type.", contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var contentTypeDisplayName = eventData.Get<string>("ContentTypeDisplayName"); var contentTypeDisplayName = eventData.Get<string>("ContentTypeDisplayName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Removed the <strong>{0}</strong> content type.", contentTypeName) @T("Removed the <strong>{0}</strong> content type.", contentTypeName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var contentTypeName = eventData.Get<string>("ContentTypeName"); var contentTypeName = eventData.Get<string>("ContentTypeName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Settings for the <strong>{0}</strong> content type were updated.", contentTypeName) @T("Settings for the <strong>{0}</strong> content type were updated.", contentTypeName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var contentTypeName = eventData.Get<string>("ContentTypeName"); var contentTypeName = eventData.Get<string>("ContentTypeName");
} }
<section class="event-content-type"> <section class="audittrail-contenttype-summary">
@T("Settings for the <strong>{0}</strong> content type were updated.", contentTypeName) @T("Settings for the <strong>{0}</strong> content type were updated.", contentTypeName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var permissionName = eventData.Get<string>("PermissionName"); var permissionName = eventData.Get<string>("PermissionName");
} }
<section class="event-role"> <section class="audittrail-role-summary">
@T("Added the <strong>{0}</strong> permission to the <strong>{1}</strong> role.", permissionName, roleName) @T("Added the <strong>{0}</strong> permission to the <strong>{1}</strong> role.", permissionName, roleName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var permissionName = eventData.Get<string>("PermissionName"); var permissionName = eventData.Get<string>("PermissionName");
} }
<section class="event-role"> <section class="audittrail-role-summary">
@T("Added the <strong>{0}</strong> permission to the <strong>{1}</strong> role.", permissionName, roleName) @T("Added the <strong>{0}</strong> permission to the <strong>{1}</strong> role.", permissionName, roleName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var permissionName = eventData.Get<string>("PermissionName"); var permissionName = eventData.Get<string>("PermissionName");
} }
<section class="event-role"> <section class="audittrail-role-summary">
@T("Removed the <strong>{0}</strong> permission from the <strong>{1}</strong> role.", permissionName, roleName) @T("Removed the <strong>{0}</strong> permission from the <strong>{1}</strong> role.", permissionName, roleName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var permissionName = eventData.Get<string>("PermissionName"); var permissionName = eventData.Get<string>("PermissionName");
} }
<section class="event-role"> <section class="audittrail-role-summary">
@T("Removed the <strong>{0}</strong> permission from the <strong>{1}</strong> role.", permissionName, roleName) @T("Removed the <strong>{0}</strong> permission from the <strong>{1}</strong> role.", permissionName, roleName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var roleName = eventData.Get<string>("RoleName"); var roleName = eventData.Get<string>("RoleName");
} }
<section class="event-role"> <section class="audittrail-role-summary">
@T("Created <strong>{0}</strong> role.", roleName) @T("Created <strong>{0}</strong> role.", roleName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var roleName = eventData.Get<string>("RoleName"); var roleName = eventData.Get<string>("RoleName");
} }
<section class="event-role"> <section class="audittrail-role-summary">
@T("Created <strong>{0}</strong> role.", roleName) @T("Created <strong>{0}</strong> role.", roleName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var newRoleName = eventData.Get<string>("NewRoleName"); var newRoleName = eventData.Get<string>("NewRoleName");
} }
<section class="event-role"> <section class="audittrail-role-summary">
@T("Renamed <strong>{0}</strong> to <strong>{1}</strong>.", previousRoleName, newRoleName) @T("Renamed <strong>{0}</strong> to <strong>{1}</strong>.", previousRoleName, newRoleName)
</section> </section>

View File

@@ -5,6 +5,6 @@
var newRoleName = eventData.Get<string>("NewRoleName"); var newRoleName = eventData.Get<string>("NewRoleName");
} }
<section class="event-role"> <section class="audittrail-role-summary">
@T("Renamed <strong>{0}</strong> to <strong>{1}</strong>.", previousRoleName, newRoleName) @T("Renamed <strong>{0}</strong> to <strong>{1}</strong>.", previousRoleName, newRoleName)
</section> </section>

View File

@@ -4,6 +4,6 @@
var userName = eventData.Get<string>("UserName"); var userName = eventData.Get<string>("UserName");
} }
<section class="event-user"> <section class="audittrail-user-summary">
<span>@T("Attempted user name: {0}", userName)</span> <span>@T("Attempted user name: {0}", userName)</span>
</section> </section>

View File

@@ -4,6 +4,6 @@
var userName = eventData.Get<string>("UserName"); var userName = eventData.Get<string>("UserName");
} }
<section class="event-user"> <section class="audittrail-user-summary">
<span>@T("User: {0}", userName)</span> <span>@T("User: {0}", userName)</span>
</section> </section>

View File

@@ -4,6 +4,6 @@
var userName = eventData.Get<string>("UserName"); var userName = eventData.Get<string>("UserName");
} }
<section class="event-user"> <section class="audittrail-user-summary">
<span>@T("User: {0}", userName)</span> <span>@T("User: {0}", userName)</span>
</section> </section>

View File

@@ -1,61 +1,59 @@
@using Orchard.AuditTrail.Models @using Orchard.AuditTrail.Models
@using Orchard.AuditTrail.ViewModels @using Orchard.AuditTrail.ViewModels
@{ @{
Style.Include("audittrail-part.css");
Script.Require("ShapesBase"); Script.Require("ShapesBase");
Script.Include("~/Themes/TheAdmin/scripts/admin.js").AtFoot(); Script.Include("~/Themes/TheAdmin/scripts/admin.js").AtFoot();
Script.Include("audittrail-admin.js").AtFoot(); Script.Include("audittrail-expando.js").AtFoot();
} }
@{ @{
var records = (IEnumerable<AuditTrailEventSummaryViewModel>)Model.Records; var records = (IEnumerable<AuditTrailEventSummaryViewModel>)Model.Records;
var auditTrailPart = (AuditTrailPart)Model.ContentPart; var auditTrailPart = (AuditTrailPart)Model.ContentPart;
} }
@if (auditTrailPart.Id > 0) { @if (auditTrailPart.Id > 0) {
<fieldset class="audittrail-list-wrapper expando-wrapper">
<fieldset class="expando-wrapper audit-trail">
<legend>@T("Audit Trail")</legend> <legend>@T("Audit Trail")</legend>
<div class="expando"> <section class="audittrail-list-section expando">
<section class="audit-trail-list"> @if (!records.Any()) {
@if (!records.Any()) { <p class="info">@T("There are no audit trail events to display.")</p>
<p class="info">@T("There are no audit trail events to display.")</p> }
} else {
else { <table class="audittrail-list items">
<table class="items"> <thead>
<thead> <tr>
<th>@T("Event")</th>
<th>@T("Category")</th>
<th>@T("User")</th>
<th>@T("Timestamp")</th>
<th>@T("Comment")</th>
<th>@T("Summary")</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var record in records) {
<tr> <tr>
<th>@T("Event")</th> <td>@record.EventDescriptor.Name</td>
<th>@T("Category")</th> <td>@record.CategoryDescriptor.Name</td>
<th>@T("User")</th> <td>@record.Record.UserName</td>
<th>@T("Timestamp")</th> <td>@Display.DateTime(DateTimeUtc: record.Record.CreatedUtc, CustomFormat: T("g"))</td>
<th>@T("Comment")</th> <td>@record.Record.Comment</td>
<th>@T("Event Data")</th> <td>@Display(record.SummaryShape)</td>
<th></th> <td>@Html.ActionLink(T("Details").Text, "Detail", "Admin", new { id = record.Record.Id, area = "Orchard.AuditTrail" }, null)</td>
</tr> </tr>
</thead>
<tbody>
@foreach (var record in records) {
<tr>
<td>@record.EventDescriptor.Name</td>
<td>@record.CategoryDescriptor.Name</td>
<td>@record.Record.UserName</td>
<td>@Display.DateTime(DateTimeUtc: record.Record.CreatedUtc, CustomFormat: T("g"))</td>
<td>@record.Record.Comment</td>
<td>@Display(record.SummaryShape)</td>
<td>@Html.ActionLink(T("Details").Text, "Detail", "Admin", new { id = record.Record.Id, area = "Orchard.AuditTrail" }, null)</td>
</tr>
}
</tbody>
@if (Model.Pager.TotalItemCount > Model.Pager.PageSize) {
<tfoot>
<tr>
<td colspan="6">
@Html.ActionLink(T("Show more events").Text, "Index", "Admin", new { content = auditTrailPart.Id, page = 2, area = "Orchard.AuditTrail" }, null)
</td>
</tr>
</tfoot>
} }
</table> </tbody>
} @if (Model.Pager.TotalItemCount > Model.Pager.PageSize) {
</section> <tfoot>
</div> <tr>
<td colspan="6">
@Html.ActionLink(T("Show more events").Text, "Index", "Admin", new { content = auditTrailPart.Id, page = 2, area = "Orchard.AuditTrail" }, null)
</td>
</tr>
</tfoot>
}
</table>
}
</section>
</fieldset> </fieldset>
} }