Improved ordering and added a part setting.

This commit is contained in:
sfmskywalker
2014-05-25 16:03:30 +02:00
parent 79bd863907
commit 5f63454cee
3 changed files with 11 additions and 2 deletions

View File

@@ -44,10 +44,10 @@ namespace Orchard.AuditTrail.Services {
switch (orderBy) {
default:
query = query.OrderByDescending(x => x.CreatedUtc);
query = query.OrderByDescending(x => x.CreatedUtc).ThenByDescending(x => x.Id);
break;
case AuditTrailOrderBy.EventAscending:
query = query.OrderBy(x => x.Event);
query = query.OrderBy(x => x.Event).ThenByDescending(x => x.Id);
break;
}

View File

@@ -5,10 +5,12 @@ namespace Orchard.AuditTrail.Settings {
public class AuditTrailPartSettings {
public bool ShowAuditTrailLink { get; set; }
public bool ShowAuditTrail { get; set; }
public bool ShowAuditTrailCommentInput { get; set; }
public void Build(ContentTypePartDefinitionBuilder builder) {
builder.WithSetting("AuditTrailPartSettings.ShowAuditTrailLink", ShowAuditTrailLink.ToString(CultureInfo.InvariantCulture));
builder.WithSetting("AuditTrailPartSettings.ShowAuditTrail", ShowAuditTrail.ToString(CultureInfo.InvariantCulture));
builder.WithSetting("AuditTrailPartSettings.ShowAuditTrailCommentInput", ShowAuditTrailCommentInput.ToString(CultureInfo.InvariantCulture));
}
}
}

View File

@@ -12,4 +12,11 @@
@Html.LabelFor(m => m.ShowAuditTrail, T("Show inline audit trail").Text, new { @class = "forcheckbox" })
<span class="hint">@T("Renders an inline view of the audit trail of the content item.")</span>
</div>
</fieldset>
<fieldset>
<div>
@Html.CheckBoxFor(m => m.ShowAuditTrailCommentInput)
@Html.LabelFor(m => m.ShowAuditTrailCommentInput, T("Show comment input").Text, new { @class = "forcheckbox" })
<span class="hint">@T("Renders a text field to allow the user to enter a comment about the changes she made.")</span>
</div>
</fieldset>