Adding missing display of client IP address on inline audit trail, and removing conditional display of historically logged client IP addresses. Improving some UI language.

This commit is contained in:
Daniel Stolt
2014-08-20 01:53:11 +02:00
parent 4b0c05c73d
commit 6bdf4a0348
7 changed files with 13 additions and 21 deletions

View File

@@ -22,7 +22,7 @@ namespace Orchard.AuditTrail {
ContentDefinitionManager.AlterPartDefinition("AuditTrailPart", part => part
.Attachable()
.WithDescription("Enables the user to enter a comment about the change when saving a content item."));
.WithDescription("Adds an inline audit trail to content items, and allows editors to enter a comment when saving content items."));
return 2;
}

View File

@@ -37,6 +37,7 @@
.audittrail-list-section table .category-column,
.audittrail-list-section table .event-column,
.audittrail-list-section table .user-column,
.audittrail-list-section table .client-ip-address-column,
.audittrail-list-section table .timestamp-column {
white-space: nowrap;
}

View File

@@ -6,7 +6,6 @@
var record = Model.Record;
var descriptor = Model.Descriptor;
var enablieClientIpAddressLogging = WorkContext.CurrentSite.As<AuditTrailSettingsPart>().EnableClientIpAddressLogging;
Layout.Title = T("Audit Trail Event");
}
@@ -14,11 +13,8 @@
@T("Event:") <strong>@descriptor.Name</strong><br />
@T("Category:") <strong>@descriptor.CategoryDescriptor.Name</strong><br />
@T("Timestamp:") <strong>@Display.DateTime(DateTimeUtc: record.CreatedUtc)</strong><br />
@T("Username:") <strong>@record.UserName</strong>
@if (enablieClientIpAddressLogging) {
<br/>
@T("Client IP Address:") <strong>@record.ClientIpAddress</strong>
}
@T("Username:") <strong>@record.UserName</strong><br />
@T("Client IP address:") <strong>@record.ClientIpAddress</strong>
</section>
<section class="audittrail-event-details-section">
@Display(Model.DetailsShape)

View File

@@ -12,7 +12,6 @@
new SelectListItem {Text = T("Category (alphabetical)").Text, Value = AuditTrailOrderBy.CategoryAscending.ToString(), Selected = Model.OrderBy == AuditTrailOrderBy.CategoryAscending},
new SelectListItem {Text = T("Event name (alphabetical)").Text, Value = AuditTrailOrderBy.EventAscending.ToString(), Selected = Model.OrderBy == AuditTrailOrderBy.EventAscending},
};
var enablieClientIpAddressLogging = WorkContext.CurrentSite.As<AuditTrailSettingsPart>().EnableClientIpAddressLogging;
Layout.Title = T("Audit Trail");
}
@@ -41,9 +40,7 @@
<th class="category-column">@T("Category")</th>
<th class="event-column">@T("Event")</th>
<th class="user-column">@T("User")</th>
@if (enablieClientIpAddressLogging) {
<th class="client-ip-address-column">@T("Client IP Address")</th>
}
<th class="client-ip-address-column">@T("Client IP")</th>
<th class="timestamp-column">@T("Timestamp")</th>
<th class="summary-column">@T("Summary")</th>
<th class="comment-column">@T("Comment")</th>
@@ -56,9 +53,7 @@
<td class="category-column">@record.CategoryDescriptor.Name</td>
<td class="event-column">@record.EventDescriptor.Name</td>
<td class="user-column">@record.Record.UserName</td>
@if (enablieClientIpAddressLogging) {
<td class="client-ip-address-column">@record.Record.ClientIpAddress</td>
}
<td class="client-ip-address-column">@record.Record.ClientIpAddress</td>
<td class="timestamp-column">@Display.DateTime(DateTimeUtc: record.Record.CreatedUtc)</td>
<td class="summary-column">@Display(record.SummaryShape)</td>
<td class="comment-column">@Html.Raw(record.Record.Comment.NewlinesToHtml())</td>

View File

@@ -49,12 +49,10 @@
i++;
}
</table>
</section>
<section>
<h2>@T("Client IP address logging")</h2>
<div>
@Html.CheckBoxFor(m => m.EnableClientIpAddressLogging)
@Html.LabelFor(m => m.EnableClientIpAddressLogging, T("Enable client IP address logging").Text, new { @class = "forcheckbox" })
<span class="hint">@T("When enabled, the client IP address will be recorded as part of an audit trail event.")</span>
<span class="hint">@T("When enabled, the client IP address will be recorded in audit trail event records.")</span>
</div>
</section>

View File

@@ -5,12 +5,12 @@
<section class="clientipaddress-settings-section">
<fieldset>
@Html.CheckBoxFor(m => m.EnableClientIpAddressHeader)
@Html.LabelFor(m => m.EnableClientIpAddressHeader, T("Enable client IP address header").Text, new { @class = "forcheckbox" })
<span class="hint">@T("Enable this when running behind a reverse proxy server.")</span>
@Html.LabelFor(m => m.EnableClientIpAddressHeader, T("Read client IP address from HTTP header instead of network source IP").Text, new { @class = "forcheckbox" })
<span class="hint">@T("This can be useful when the site is behind a reverse proxy server.")</span>
</fieldset>
<fieldset data-controllerid="@Html.FieldIdFor(m => m.EnableClientIpAddressHeader)">
@Html.LabelFor(m => m.ClientIpAddressHeaderName, T("Client IP address header name"))
@Html.LabelFor(m => m.ClientIpAddressHeaderName, T("Client IP address HTTP header name"))
@Html.TextBoxFor(m => m.ClientIpAddressHeaderName, new { @class = "text medium" })
<span class="hint">@T("The client IP address header name to check for. Ususally this is the <em>X-Forwarded-For</em> header.")</span>
<span class="hint">@T("The name of the HTTP header from which to read the client IP address. For most reverse proxy servers this should be <strong>X-Forwarded-For</strong>.")</span>
</fieldset>
</section>

View File

@@ -26,6 +26,7 @@
<th class="category-column">@T("Category")</th>
<th class="event-column">@T("Event")</th>
<th class="user-column">@T("User")</th>
<th class="client-ip-address-column">@T("Client IP")</th>
<th class="timestamp-column">@T("Timestamp")</th>
<th class="summary-column">@T("Summary")</th>
<th class="comment-column">@T("Comment")</th>
@@ -38,6 +39,7 @@
<td class="category-column">@record.CategoryDescriptor.Name</td>
<td class="event-column">@record.EventDescriptor.Name</td>
<td class="user-column">@record.Record.UserName</td>
<td class="client-ip-address-column">@record.Record.ClientIpAddress</td>
<td class="timestamp-column">@Display.DateTime(DateTimeUtc: record.Record.CreatedUtc)</td>
<td class="summary-column">@Display(record.SummaryShape)</td>
<td class="comment-column">@Html.Raw(StringExtensions.NewlinesToHtml(record.Record.Comment))</td>