Variant names, availability, etc

This commit is contained in:
Stephan
2018-04-12 22:53:04 +02:00
parent 392965bb3a
commit 58e4e2398a
28 changed files with 555 additions and 87 deletions

View File

@@ -22,7 +22,7 @@ namespace Umbraco.Web.Models.Mapping
public IEnumerable<ContentVariation> Resolve(IContent source, ContentItemDisplay destination, IEnumerable<ContentVariation> destMember, ResolutionContext context)
{
var allLanguages = _localizationService.GetAllLanguages().OrderBy(x => x.Id).ToList();
if (allLanguages.Count == 0) return Enumerable.Empty<ContentVariation>();
if (allLanguages.Count == 0) return Enumerable.Empty<ContentVariation>();
var langs = context.Mapper.Map<IEnumerable<ILanguage>, IEnumerable<Language>>(allLanguages, null, context);
var variants = langs.Select(x => new ContentVariation
@@ -30,7 +30,7 @@ namespace Umbraco.Web.Models.Mapping
Language = x,
Mandatory = x.Mandatory,
//fixme these all need to the variant values but we need to wait for the db/service changes
Name = source.Name ,
Name = source.GetName(x.IsoCode),
Exists = source.HasVariation(x.Id), //TODO: This needs to be wired up with new APIs when they are ready
PublishedState = source.PublishedState.ToString(),
//Segment = ?? We'll need to populate this one day when we support segments