diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js index 59a00a5797..b99dd289b1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.controller.js @@ -1,16 +1,16 @@ (function () { "use strict"; - function InsertOverlayController($scope) { + function InsertOverlayController($scope, localizationService) { var vm = this; if(!$scope.model.title) { - $scope.model.title = "Insert"; + $scope.model.title = localizationService.localize("template_insert"); } if(!$scope.model.subtitle) { - $scope.model.subtitle = "Choose what to insert into your template"; + $scope.model.subtitle = localizationService.localize("template_insertDesc"); } vm.openMacroPicker = openMacroPicker; @@ -22,7 +22,7 @@ vm.macroPickerOverlay = { view: "macropicker", - title: "Insert macro", + title: localizationService.localize("template_insertMacro"), dialogData: {}, show: true, submit: function(model) { @@ -45,8 +45,8 @@ function openPageFieldOverlay() { vm.pageFieldOverlay = { - title: "Insert value", - description: "Select a value from the currentpage", + title: localizationService.localize("template_insertPageField"), + description: localizationService.localize("template_insertPageFieldDesc"), submitButtonLabel: "Insert", closeButtonlabel: "Cancel", view: "insertfield", @@ -78,7 +78,8 @@ treeAlias: "dictionary", entityType: "dictionary", multiPicker: false, - title: "Insert dictionary item", + title: localizationService.localize("template_insertDictionaryItem"), + description: localizationService.localize("template_insertDictionaryItemDesc"), show: true, select: function(node){ @@ -108,7 +109,7 @@ entityType: "partialView", multiPicker: false, show: true, - title: "Insert partial view", + title: localizationService.localize("template_insertPartialView"), select: function(node){ diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html index 4b92ea86ad..c2926f6acc 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/insert/insert.html @@ -24,7 +24,7 @@
-
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/macropicker/macropicker.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/macropicker/macropicker.html index 418e6b5ca6..6bcbaad50c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/macropicker/macropicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/macropicker/macropicker.html @@ -27,12 +27,12 @@ - - + + There are no macros available to insert - diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js index 3939882969..3c0199d7bd 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.controller.js @@ -1,8 +1,14 @@ (function () { "use strict"; - function QueryBuilderOverlayController($scope, templateQueryResource) { + function QueryBuilderOverlayController($scope, templateQueryResource, localizationService) { + var everything = localizationService.localize("template_allContent"); + var myWebsite = localizationService.localize("template_websiteRoot"); + + var ascendingTranslation = localizationService.localize("template_ascending"); + var descendingTranslation = localizationService.localize("template_descending"); + var vm = this; vm.properties = []; @@ -17,10 +23,10 @@ vm.query = { contentType: { - name: "Everything" + name: everything }, source: { - name: "My website" + name: myWebsite }, filters: [ { @@ -33,7 +39,13 @@ alias: "", name: "", }, - direction: "ascending" + direction: "ascending", //This is the value for sorting sent to server + translation: { + currentLabel: ascendingTranslation, //This is the localized UI value in the the dialog + ascending: ascendingTranslation, + descending: descendingTranslation + } + } }; @@ -74,7 +86,6 @@ vm.contentPickerOverlay = { view: "contentpicker", show: true, - submitButtonLabel: "Insert", submit: function(model) { var selectedNodeId = model.selection[0].id; @@ -83,7 +94,7 @@ if (selectedNodeId > 0) { query.source = { id: selectedNodeId, name: selectedNodeName }; } else { - query.source.name = "My website"; + query.source.name = myWebsite; delete query.source.id; } @@ -113,13 +124,21 @@ function trashFilter(query) { query.filters.splice(query, 1); + + //if we remove the last one, add a new one to generate ui for it. + if (query.filters.length == 0) { + query.filters.push({}); + } + } function changeSortOrder(query) { if (query.sort.direction === "ascending") { query.sort.direction = "descending"; + query.sort.translation.currentLabel = query.sort.translation.descending; } else { query.sort.direction = "ascending"; + query.sort.translation.currentLabel = query.sort.translation.ascending; } throttledFunc(); } @@ -128,8 +147,10 @@ query.sort.property = property; if (property.type === "datetime") { query.sort.direction = "descending"; + query.sort.translation.currentLabel = query.sort.translation.descending; } else { query.sort.direction = "ascending"; + query.sort.translation.currentLabel = query.sort.translation.ascending; } throttledFunc(); } diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html index e9be97b7df..d3a4835470 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/querybuilder/querybuilder.html @@ -5,7 +5,7 @@
- I Want + I want
@@ -22,7 +22,7 @@
- from + from {{vm.query.source.name}} @@ -91,7 +91,7 @@ - + @@ -100,7 +100,7 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/templatesections/templatesections.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/templatesections/templatesections.html index 1a11d6a46e..ee62c3426d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/templatesections/templatesections.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/templatesections/templatesections.html @@ -1,71 +1,59 @@
-
+
-
Render child template
+
- Renders the contents of a child template, by inserting a - @RenderBody() placeholder. +
-
+
-
Render a named section
+
- Renders a named area of a child template, by insert a @RenderSection(name) placeholder. - This renders an area of a child template which is wrapped in a corresponding @section [name]{ ... } definition. +
- + -
- Set the name of the section to render in this area of the template -
+
- If mandatory, the child template must contain a @section definition, otherwise an error is shown. +
-
+
-
Define a named section
+
- Defines a part of your template as a named section by wrapping it in - a @section { ... }. This can be rendered in a - specific area of the master of this template, by using @RenderSection. +
- + -
- Give the section a name -
- -
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js index 8e2b8337ad..4cf55f4768 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js @@ -220,7 +220,7 @@ view: "macropicker", dialogData: {}, show: true, - title: "Insert macro", + title: localizationService.localize("template_insertMacro"), submit: function (model) { var macroObject = macroService.collectValueData(model.selectedMacro, model.macroParams, "Mvc"); @@ -247,6 +247,7 @@ closeButtonlabel: "Cancel", view: "insertfield", show: true, + title: localizationService.localize("template_insertPageField"), submit: function (model) { insert(model.umbracoField); vm.pageFieldOverlay.show = false; @@ -271,7 +272,7 @@ entityType: "dictionary", multiPicker: false, show: true, - title: "Insert dictionary item", + title: localizationService.localize("template_insertDictionaryItem"), select: function(node){ //crappy hack due to dictionary items not in umbracoNode table var code = "@Umbraco.GetDictionaryValue(\"" + node.name + "\")"; @@ -298,7 +299,7 @@ entityType: "partialView", multiPicker: false, show: true, - title: "Insert Partial view", + title: localizationService.localize("template_insertPartialView"), select: function(node){ //crappy hack due to dictionary items not in umbracoNode table var nodeNameWithPath = node.id.replace(".cshtml", ""); @@ -322,7 +323,7 @@ vm.queryBuilderOverlay = { view: "querybuilder", show: true, - title: "Query for content", + title: localizationService.localize("template_queryBuilder"), submit: function (model) { @@ -356,7 +357,7 @@ vm.sectionsOverlay = { view: "templatesections", - hasMaster: vm.template.masterTemplateAlias, + isMaster: vm.template.isMasterTemplate, submitButtonLabel: "Insert", show: true, submit: function(model) { @@ -401,7 +402,7 @@ vm.masterTemplateOverlay = { view: "itempicker", - title: "Choose master template", + title: localizationService.localize("template_mastertemplate"), availableItems: availableMasterTemplates, show: true, submit: function(model) { @@ -443,23 +444,15 @@ } function getMasterTemplateName(masterTemplateAlias, templates) { - if(masterTemplateAlias) { - var templateName = ""; - angular.forEach(templates, function(template){ if(template.alias === masterTemplateAlias) { templateName = template.name; } }); - return templateName; - - } else { - return "No master"; } - } function removeMasterTemplate() { diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html index 81dc9042b3..e747a56138 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html @@ -33,7 +33,11 @@ class="umb-era-button umb-button--s" ng-click="vm.openMasterTemplateOverlay()"> - Master template: {{ vm.getMasterTemplateName(vm.template.masterTemplateAlias, vm.templates) }} + Master template: + + {{ vm.getMasterTemplateName(vm.template.masterTemplateAlias, vm.templates) }} + No master + @@ -62,7 +66,7 @@
  • Value
  • Partial view
  • Dictionary
  • -
  • Macro
  • +
  • Macro
  • diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml index b0452fb631..9ee79ce8d8 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml @@ -291,6 +291,7 @@ Vælg medlem Vælg medlemsgruppe Der er ingen parametre for denne makro + Der er ikke tilføjet nogen makroer Link dit Fjern link fra dit konto @@ -1004,17 +1005,117 @@ Mange hilsner fra Umbraco robotten Vis prøve Styles + Rediger skabelon + + Sektioner Indsæt indholdsområde - Indsæt indholdsområdemarkering - Indsæt ordbogselement - Indsæt makro - Indsæt Umbraco sidefelt + Indsæt pladsholder for indholdsområde + + Indsæt + Hvad vil du indsætte ? + + Oversættelse + Indsætter en oversætbar tekst, som skifter efter det sprog, som websitet vises i. + + Makro + + En makro er et element, som kan have forskellige indstillinger, når det indsættes. + Brug det som en genbrugelig del af dit design såsom gallerier, formularer og lister. + + + Sideværdi + + Viser værdien af et felt fra den nuværende side. Kan indstilles til at bruge rekursive værdier eller + vise en standardværdi i tilfælde af, at feltet er tomt. + + + Partial view + + Et Partial View er et skabelonelement, som kan indsættes i andre skabeloner og derved + genbruges og deles på tværs af sideskabelonerne. + + Master skabelon - Lynguide til Umbracos skabelontags + Ingen masterskabelon + Ingen master + + Indsæt en underliggende skabelon + + @RenderBody() element. + ]]> + + + + Definer en sektion + + @section { ... }. Herefter kan denne sektion flettes ind i + overliggende skabelon ved at indsætte et @RenderSection element. + ]]> + + + Indsæt en sektion + + @RenderSection(name) element. Den underliggende skabelon skal have + defineret en sektion via et @section [name]{ ... } element. + ]]> + + + Sektionsnavn + Sektionen er obligatorisk + + + Hvis obligatorisk, skal underskabelonen indeholde en @section -definition. + + + + Query builder + sider returneret, på + + Returner + alt indhold + indhold af typen "%0%" + + fra + mit website + filtre + og + + is + is not + before + before (including selected date) + after + after (including selected date) + equals + does not equal + contains + does not contain + greater than + greater than or equal to + less than + less than or equal to + + Id + Name + Created Date + Last Updated Date + + order by + ascending + descending + Skabelon + + Alternativt felt Alternativ tekst diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 2021be1d9d..444ecc2e3d 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -305,6 +305,7 @@ Select member group No icons were found There are no parameters for this macro + There are no macros available to insert External login providers Exception Details Stacktrace @@ -1032,6 +1033,9 @@ To manage your website, simply open the Umbraco back office and start adding con Sections Insert content area Insert content area placeholder + + Insert + Choose what to insert into your template Dictionary item A dictionary item is a placeholder for a translatable piece of text, which makes it easy to create designs for multilingual websites. @@ -1053,18 +1057,79 @@ To manage your website, simply open the Umbraco back office and start adding con Master template + No master template + No master + + Render child template + + @RenderBody() placeholder. + ]]> + + + + Define a named section + + @section { ... }. This can be rendered in a + specific area of the parent of this template, by using @RenderSection. + ]]> + + + Render a named section + + @RenderSection(name) placeholder. + This renders an area of a child template which is wrapped in a corresponding @section [name]{ ... } definition. + ]]> + + + Section Name + Section is mandatory + + If mandatory, the child template must contain a @section definition, otherwise an error is shown. + + Query builder items returned, in - I want + I want + all content + content of type "%0%" from + my website where and - everything + is + is not + before + before (including selected date) + after + after (including selected date) + equals + does not equal + contains + does not contain + greater than + greater than or equal to + less than + less than or equal to + + Id + Name + Created Date + Last Updated Date + + order by + ascending + descending Template + diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml index f68359b0af..aa9f33695d 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -1027,13 +1027,105 @@ To manage your website, simply open the Umbraco back office and start adding con Edit template + + Sections Insert content area Insert content area placeholder - Insert dictionary item - Insert Macro - Insert Umbraco page field + + Insert + Choose what to insert into your template + + Dictionary item + A dictionary item is a placeholder for a translatable piece of text, which makes it easy to create designs for multilingual websites. + + Macro + + A Macro is a configurable component which is great for + reusable parts of your design, where you need the option to provide parameters, + such as galleries, forms and lists. + + + Value + Displays the value of a named field from the current page, with options to modify the value or fallback to alternative values. + + Partial view + + A partial view is a separate template file which can be rendered inside another + template, it's great for reusing markup or for separating complex templates into separate files. + + Master template - Quick Guide to Umbraco template tags + No master template + No master + + Render child template + + @RenderBody() placeholder. + ]]> + + + + Define a named section + + @section { ... }. This can be rendered in a + specific area of the parent of this template, by using @RenderSection. + ]]> + + + Render a named section + + @RenderSection(name) placeholder. + This renders an area of a child template which is wrapped in a corresponding @section [name]{ ... } definition. + ]]> + + + Section Name + Section is mandatory + + If mandatory, the child template must contain a @section definition, otherwise an error is shown. + + + + Query builder + items returned, in + + I want + all content + content of type "%0%" + from + my website + where + and + + is + is not + before + before (including selected date) + after + after (including selected date) + equals + does not equal + contains + does not contain + greater than + greater than or equal to + less than + less than or equal to + + Id + Name + Created Date + Last Updated Date + + order by + ascending + descending + Template diff --git a/src/Umbraco.Web/Editors/TemplateQueryController.cs b/src/Umbraco.Web/Editors/TemplateQueryController.cs index e3c63dd22e..cd004fe926 100644 --- a/src/Umbraco.Web/Editors/TemplateQueryController.cs +++ b/src/Umbraco.Web/Editors/TemplateQueryController.cs @@ -9,6 +9,7 @@ using System; using System.Diagnostics; using Umbraco.Web.Dynamics; using Umbraco.Web.Models.TemplateQuery; +using Umbraco.Core.Services; namespace Umbraco.Web.Editors { @@ -29,33 +30,44 @@ namespace Umbraco.Web.Editors { } - private static readonly IEnumerable Terms = new List() + private IEnumerable Terms + { + get { - new OperathorTerm("is", Operathor.Equals, new [] {"string"}), - new OperathorTerm("is not", Operathor.NotEquals, new [] {"string"}), - new OperathorTerm("before", Operathor.LessThan, new [] {"datetime"}), - new OperathorTerm("before (including selected date)", Operathor.LessThanEqualTo, new [] {"datetime"}), - new OperathorTerm("after", Operathor.GreaterThan, new [] {"datetime"}), - new OperathorTerm("after (including selected date)", Operathor.GreaterThanEqualTo, new [] {"datetime"}), - new OperathorTerm("equals", Operathor.Equals, new [] {"int"}), - new OperathorTerm("does not equal", Operathor.NotEquals, new [] {"int"}), - new OperathorTerm("contains", Operathor.Contains, new [] {"string"}), - new OperathorTerm("does not contain", Operathor.NotContains, new [] {"string"}), - new OperathorTerm("greater than", Operathor.GreaterThan, new [] {"int"}), - new OperathorTerm("greater than or equal to", Operathor.GreaterThanEqualTo, new [] {"int"}), - new OperathorTerm("less than", Operathor.LessThan, new [] {"int"}), - new OperathorTerm("less than or equal to", Operathor.LessThanEqualTo, new [] {"int"}) - }; + return new List() + { + new OperathorTerm(Services.TextService.Localize("template/is"), Operathor.Equals, new [] {"string"}), + new OperathorTerm(Services.TextService.Localize("template/isNot"), Operathor.NotEquals, new [] {"string"}), + new OperathorTerm(Services.TextService.Localize("template/before"), Operathor.LessThan, new [] {"datetime"}), + new OperathorTerm(Services.TextService.Localize("template/beforeIncDate"), Operathor.LessThanEqualTo, new [] {"datetime"}), + new OperathorTerm(Services.TextService.Localize("template/after"), Operathor.GreaterThan, new [] {"datetime"}), + new OperathorTerm(Services.TextService.Localize("template/afterIncDate"), Operathor.GreaterThanEqualTo, new [] {"datetime"}), + new OperathorTerm(Services.TextService.Localize("template/equals"), Operathor.Equals, new [] {"int"}), + new OperathorTerm(Services.TextService.Localize("template/doesNotEqual"), Operathor.NotEquals, new [] {"int"}), + new OperathorTerm(Services.TextService.Localize("template/contains"), Operathor.Contains, new [] {"string"}), + new OperathorTerm(Services.TextService.Localize("template/doesNotContain"), Operathor.NotContains, new [] {"string"}), + new OperathorTerm(Services.TextService.Localize("template/greaterThan"), Operathor.GreaterThan, new [] {"int"}), + new OperathorTerm(Services.TextService.Localize("template/greaterThanEqual"), Operathor.GreaterThanEqualTo, new [] {"int"}), + new OperathorTerm(Services.TextService.Localize("template/lessThan"), Operathor.LessThan, new [] {"int"}), + new OperathorTerm(Services.TextService.Localize("template/lessThanEqual"), Operathor.LessThanEqualTo, new [] {"int"}) + }; + } + } - private static readonly IEnumerable Properties = new List() + private IEnumerable Properties + { + get { - 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 = "Created Date", Alias = "CreateDate", Type = "datetime" }, - new PropertyModel() { Name = "Last Updated Date", Alias = "UpdateDate", Type = "datetime" } - - }; + return new List() + { + new PropertyModel() {Name = Services.TextService.Localize("template/id"), Alias = "Id", Type = "int"}, + new PropertyModel() {Name = Services.TextService.Localize("template/name"), Alias = "Name", Type = "string"}, + //new PropertyModel() { Name = "Url", Alias = "url", Type = "string" }, + new PropertyModel() {Name = Services.TextService.Localize("template/createdDate"), Alias = "CreateDate", Type = "datetime"}, + new PropertyModel() {Name = Services.TextService.Localize("template/lastUpdatedDate"), Alias = "UpdateDate", Type = "datetime"} + }; + } + } public QueryResultModel PostTemplateQuery(QueryModel model) { @@ -297,9 +309,10 @@ namespace Umbraco.Web.Editors { var contentTypes = ApplicationContext.Services.ContentTypeService.GetAllContentTypes() - .Select(x => new ContentTypeModel() { Alias = x.Alias, Name = x.Name }) + .Select(x => new ContentTypeModel() { Alias = x.Alias, Name = Services.TextService.Localize("template/contentOfType", tokens: new string[] { x.Name } ) }) .OrderBy(x => x.Name).ToList(); - contentTypes.Insert(0, new ContentTypeModel() { Alias = string.Empty, Name = "Everything" }); + + contentTypes.Insert(0, new ContentTypeModel() { Alias = string.Empty, Name = Services.TextService.Localize("template/allContent") }); return contentTypes; } diff --git a/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs b/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs index 8e813bd3d3..91c1aefdb0 100644 --- a/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs +++ b/src/Umbraco.Web/Models/ContentEditing/TemplateDisplay.cs @@ -36,6 +36,9 @@ namespace Umbraco.Web.Models.ContentEditing [DataMember(Name = "masterTemplateAlias")] public string MasterTemplateAlias { get; set; } + [DataMember(Name = "isMasterTemplate")] + public bool IsMasterTemplate { get; set; } + /// /// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes. ///