Query Builder - Fix Date sort fields and format returned query to be on new lines and tabbed

This commit is contained in:
Jeavon Leopold
2014-06-10 16:43:28 +01:00
parent b170053e87
commit 29533820ab
2 changed files with 8 additions and 7 deletions

View File

@@ -79,7 +79,9 @@
template: "views/common/dialogs/template/queryBuilder.html",
callback: function (data) {
var code = "\n@{\n" + "\tvar selection = " + data + ";\n}\n";
var dataFormatted = data.replace(new RegExp('[' + "." + ']', 'g'), "\n\t\t\t\t\t.");
var code = "\n@{\n" + "\tvar selection = " + dataFormatted + ";\n}\n";
code += "<ul>\n" +
"\t@foreach(var item in selection){\n" +
"\t\t<li>\n" +

View File

@@ -59,11 +59,11 @@ namespace Umbraco.Web.Editors
private static readonly IEnumerable<PropertyModel> _properties = new List<PropertyModel>()
{
new PropertyModel() { Name = "Id", Alias = "id", Type = "int" },
new PropertyModel() { Name = "Name", Alias = "name", Type = "string" },
new PropertyModel() { Name = "Id", Alias = "Id", Type = "int" },
new PropertyModel() { Name = "Name", Alias = "Name", Type = "string" },
//new PropertyModel() { Name = "Url", Alias = "url", Type = "string" },
new PropertyModel() { Name = "Creation Date", Alias = "createDate", Type = "datetime" },
new PropertyModel() { Name = "Publishing Date", Alias = "publishDate", Type = "datetime" }
new PropertyModel() { Name = "Created Date", Alias = "CreateDate", Type = "datetime" },
new PropertyModel() { Name = "Last Updated Date", Alias = "UpdateDate", Type = "datetime" }
};
@@ -82,7 +82,6 @@ namespace Umbraco.Web.Editors
timer.Start();
var currentPage = umbraco.TypedContentAtRoot().FirstOrDefault();
timer.Stop();
@@ -201,7 +200,7 @@ namespace Umbraco.Web.Editors
var direction = model.Sort.Direction == "ascending" ? string.Empty : " desc";
sb.AppendFormat(".OrderBy(\"{0}{1}\")", model.Sort.Property.Name, direction);
sb.AppendFormat(".OrderBy(\"{0}{1}\")", model.Sort.Property.Alias, direction);
}
if (model.Take > 0)