mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Improved ordering and added a part setting.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user