2020-11-19 14:57:00 +01:00
|
|
|
using Raven.Client.Documents.Linq;
|
2020-11-19 00:14:52 +01:00
|
|
|
using zero.Core.Collections;
|
2020-04-17 12:28:03 +02:00
|
|
|
using zero.Core.Entities;
|
2020-11-18 12:00:51 +01:00
|
|
|
using zero.Core.Extensions;
|
2020-04-16 00:56:22 +02:00
|
|
|
using zero.Core.Identity;
|
2020-04-13 12:41:22 +02:00
|
|
|
|
|
|
|
|
namespace zero.Web.Controllers
|
|
|
|
|
{
|
2020-04-16 00:56:22 +02:00
|
|
|
[ZeroAuthorize(Permissions.Settings.Countries, PermissionsValue.Read)]
|
2020-11-19 14:57:00 +01:00
|
|
|
public class CountriesController : BackofficeCollectionController<ICountry, ICountriesCollection>
|
2020-04-13 12:41:22 +02:00
|
|
|
{
|
2020-11-19 14:57:00 +01:00
|
|
|
public CountriesController(ICountriesCollection collection) : base(collection)
|
2020-04-13 12:41:22 +02:00
|
|
|
{
|
2020-11-19 14:57:00 +01:00
|
|
|
DefaultQuery = q => q.OrderByDescending(x => x.IsPreferred).ThenBy(x => x.Name);
|
|
|
|
|
PreviewTransform = (item, model) => model.Icon = "flag flag-" + item.Code.ToLowerInvariant();
|
2020-04-13 12:41:22 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|