Updating code style, removes obsolete files, now we can move the tree to the Translation section
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
/// <summary>
|
||||
/// The dictionary display model
|
||||
/// </summary>
|
||||
@@ -19,6 +19,7 @@
|
||||
this.Translations = new List<DictionaryTranslationDisplay>();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
/// <summary>
|
||||
/// The dictionary overview display.
|
||||
/// </summary>
|
||||
@@ -14,7 +14,7 @@
|
||||
/// </summary>
|
||||
public DictionaryOverviewDisplay()
|
||||
{
|
||||
this.Translations = new List<DictionaryOverviewTranslationDisplay>();
|
||||
Translations = new List<DictionaryOverviewTranslationDisplay>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
/// <summary>
|
||||
/// The dictionary translation overview display.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
/// <summary>
|
||||
/// Dictionary Save model
|
||||
/// </summary>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// The dictionary translation display model
|
||||
/// </summary>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// The dictionary translation save model
|
||||
/// </summary>
|
||||
@@ -26,4 +26,4 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
[DataMember(Name = "languageId")]
|
||||
public int LanguageId { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
namespace Umbraco.Web.Models.Mapping
|
||||
using AutoMapper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using AutoMapper;
|
||||
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// The dictionary model mapper.
|
||||
/// </summary>
|
||||
@@ -42,9 +41,8 @@
|
||||
// TODO check if there is a better way
|
||||
if (src.ParentId.HasValue)
|
||||
{
|
||||
var ids = new List<int>();
|
||||
var ids = new List<int> { -1 };
|
||||
|
||||
ids.Add(-1);
|
||||
|
||||
var parentIds = new List<int>();
|
||||
|
||||
@@ -95,7 +93,7 @@
|
||||
var translation = src.Translations.FirstOrDefault(x => x.LanguageId == langId);
|
||||
|
||||
dest.Translations.Add(
|
||||
new DictionaryOverviewTranslationDisplay()
|
||||
new DictionaryOverviewTranslationDisplay
|
||||
{
|
||||
DisplayName = lang.CultureInfo.DisplayName,
|
||||
HasTranslation = translation != null && string.IsNullOrEmpty(translation.Value) == false
|
||||
@@ -104,8 +102,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Goes up the dictoinary tree to get all parent ids
|
||||
/// </summary>
|
||||
@@ -122,15 +118,13 @@
|
||||
{
|
||||
var dictionary = localizationService.GetDictionaryItemById(parentId);
|
||||
|
||||
if (dictionary != null)
|
||||
{
|
||||
ids.Add(dictionary.Id);
|
||||
if (dictionary == null)
|
||||
return;
|
||||
|
||||
if (dictionary.ParentId.HasValue)
|
||||
{
|
||||
this.GetParentId(dictionary.ParentId.Value, localizationService, ids);
|
||||
}
|
||||
}
|
||||
ids.Add(dictionary.Id);
|
||||
|
||||
if (dictionary.ParentId.HasValue)
|
||||
GetParentId(dictionary.ParentId.Value, localizationService, ids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user