Merge branch 'temp-template-editor' into dev-v7.6

This commit is contained in:
Sebastiaan Janssen
2017-01-26 18:27:10 +01:00
13 changed files with 384 additions and 103 deletions

View File

@@ -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){

View File

@@ -24,7 +24,7 @@
<div class="umb-insert-code-box" ng-click="vm.openDictionaryItemOverlay()">
<div class="umb-insert-code-box__title"><localize key="template_insertDictionaryItem" /></div>
<div class="umb-insert-code-box__description"><localize key="template_insertDictionaryItem" /></div>
<div class="umb-insert-code-box__description"><localize key="template_insertDictionaryItemDesc" /></div>
</div>
</div>

View File

@@ -27,12 +27,12 @@
</li>
</ul>
<umb-empty-state ng-if="nomacros"
position="center">
<localize key="defaultdialogs_nomacros">
<umb-empty-state
ng-if="nomacros"
position="center">
<localize key="defaultdialogs_noMacros">
There are no macros available to insert
</localize>
</umb-empty-state>
</div>

View File

@@ -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();
}

View File

@@ -5,7 +5,7 @@
<div class="row">
<div class="query-items">
<span><localize key="template_iWant">I Want</localize></span>
<span><localize key="template_iWant">I want</localize></span>
<div class="btn-group">
@@ -22,7 +22,7 @@
</div>
<span><localize key="template_fromt">from</localize></span>
<span><localize key="template_from">from</localize></span>
<a href class="btn btn-link" ng-click="vm.chooseSource(vm.query)">
{{vm.query.source.name}}
@@ -91,7 +91,7 @@
<i class="icon-add"></i>
</a>
<a href ng-if="vm.query.filters.length > 1" ng-click="vm.trashFilter(vm.query)">
<a href ng-click="vm.trashFilter(vm.query)">
<i class="icon-trash"></i>
</a>
@@ -100,7 +100,7 @@
<div class="query-items">
<span<localize key="template_orderBy">order by</localize></span>
<span><localize key="template_orderBy">order by</localize></span>
<div class="btn-group">
<a class="btn btn-link dropdown-toggle" data-toggle="dropdown" href="#">
@@ -119,7 +119,7 @@
</div>
<a href class="btn" ng-click="vm.changeSortOrder(vm.query)">
{{vm.query.sort.direction}}
{{vm.query.sort.translation.currentLabel}}
</a>
</div>

View File

@@ -1,71 +1,59 @@
<div ng-controller="Umbraco.Overlays.TemplateSectionsOverlay as vm">
<div ng-if="!model.hasMaster" class="umb-insert-code-box" ng-click="vm.select('renderBody')">
<div class="umb-insert-code-box" ng-click="vm.select('renderBody')">
<div class="umb-insert-code-box__check" ng-class="{'umb-insert-code-box__check--checked': model.insertType === 'renderBody' }"><i class="icon icon-check"></i></div>
<div class="umb-insert-code-box__title">Render child template</div>
<div class="umb-insert-code-box__title"><localize key="template_renderBody" /></div>
<div class="umb-insert-code-box__description">
Renders the contents of a child template, by inserting a
<code>@RenderBody()</code> placeholder.
<localize key="template_renderBodyDesc" />
</div>
</div>
<div ng-if="!model.hasMaster" class="umb-insert-code-box" ng-click="vm.select('renderSection')">
<div class="umb-insert-code-box" ng-click="vm.select('renderSection')">
<div class="umb-insert-code-box__check" ng-class="{'umb-insert-code-box__check--checked': model.insertType === 'renderSection' }"><i class="icon icon-check"></i></div>
<div class="umb-insert-code-box__title">Render a named section</div>
<div class="umb-insert-code-box__title"><localize key="template_renderSection" /></div>
<div class="umb-insert-code-box__description">
Renders a named area of a child template, by insert a <code>@RenderSection(name)</code> placeholder.
This renders an area of a child template which is wrapped in a corresponding <code>@section [name]{ ... }</code> definition.
<localize key="template_renderSectionDesc" />
</div>
<div ng-if="model.insertType === 'renderSection'" style="margin-top: 20px;">
<div style="margin-bottom: 20px;">
<label class="bold">Section name <span class="red">*</span></label>
<label class="bold"><localize key="template_sectionName" /> <span class="red">*</span></label>
<input type="text" name="renderSectionName" class="-full-width-input" ng-model="model.renderSectionName" required umb-auto-focus />
<small class="red" val-msg-for="renderSectionName" val-toggle-msg="required"><localize key="required" /></small>
<div class="umb-insert-code-box__description">
Set the name of the section to render in this area of the template
</div>
</div>
<div>
<label>
<input type="checkbox" ng-model="model.mandatoryRenderSection" />
Make section mandatory
<input type="checkbox" ng-model="model.mandatoryRenderSection" /> <localize key="template_sectionMandatory" />
</label>
<div class="umb-insert-code-box__description">
If mandatory, the child template must contain a <code>@section</code> definition, otherwise an error is shown.
<localize key="template_sectionMandatoryDesc" />
</div>
</div>
</div>
</div>
<div ng-if="model.hasMaster" class="umb-insert-code-box" ng-click="vm.select('addSection')">
<div class="umb-insert-code-box" ng-click="vm.select('addSection')">
<div class="umb-insert-code-box__check" ng-class="{'umb-insert-code-box__check--checked': model.insertType === 'addSection' }"><i class="icon icon-check"></i></div>
<div class="umb-insert-code-box__title">Define a named section</div>
<div class="umb-insert-code-box__title"><localize key="template_defineSection" /></div>
<div class="umb-insert-code-box__description">
Defines a part of your template as a named section by wrapping it in
a <code>@section { ... }</code>. This can be rendered in a
specific area of the master of this template, by using <code>@RenderSection</code>.
<localize key="template_defineSectionDesc" />
</div>
<div ng-if="model.insertType === 'addSection'" style="margin-top: 20px;">
<div>
<label class="bold">Section name <span class="red">*</span></label>
<label class="bold"><localize key="template_sectionName" /> <span class="red">*</span></label>
<input type="text" name="sectionName" class="-full-width-input" ng-model="model.sectionName" required umb-auto-focus />
<small class="red" val-msg-for="sectionName" val-toggle-msg="required"><localize key="required" /></small>
<div class="umb-insert-code-box__description">
Give the section a name
</div>
</div>
</div>
</div>
</div>

View File

@@ -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() {

View File

@@ -33,7 +33,11 @@
class="umb-era-button umb-button--s"
ng-click="vm.openMasterTemplateOverlay()">
<i class="icon icon-layout"></i>
<span class="bold">Master template:</span> <span style="margin-left: 5px;">{{ vm.getMasterTemplateName(vm.template.masterTemplateAlias, vm.templates) }}</span>
<span class="bold"><localize key="template_mastertemplate">Master template</localize>:</span>
<span style="margin-left: 5px;">
<span ng-if="vm.template.masterTemplateAlias">{{ vm.getMasterTemplateName(vm.template.masterTemplateAlias, vm.templates) }}</span>
<span ng-if="!vm.template.masterTemplateAlias"><localize key="template_noMaster">No master</localize></span>
</span>
</button>
<a ng-if="vm.template.masterTemplateAlias" ng-click="vm.removeMasterTemplate()" class="umb-era-button umb-button--s dropdown-toggle umb-button-group__toggle">
@@ -62,7 +66,7 @@
<li><a href="" ng-click="vm.openPageFieldOverlay()"><localize key="template_insertPageField">Value</localize></a></li>
<li><a href="" ng-click="vm.openPartialOverlay()"><localize key="template_insertPartialView">Partial view</localize></a></li>
<li><a href="" ng-click="vm.openDictionaryItemOverlay()"><localize key="template_insertDictionaryItem">Dictionary</localize></a></li>
<li><a href="" ng-click="vm.openMacroOverlay()"><localize key="general_insertMacro">Macro</localize></a></li>
<li><a href="" ng-click="vm.openMacroOverlay()"><localize key="template_insertMacro">Macro</localize></a></li>
</ul>
</div>

View File

@@ -291,6 +291,7 @@
<key alias="selectMember">Vælg medlem</key>
<key alias="selectMemberGroup">Vælg medlemsgruppe</key>
<key alias="noMacroParams">Der er ingen parametre for denne makro</key>
<key alias="noMacros">Der er ikke tilføjet nogen makroer</key>
<key alias="linkYour">Link dit</key>
<key alias="unLinkYour">Fjern link fra dit</key>
<key alias="account">konto</key>
@@ -1004,17 +1005,117 @@ Mange hilsner fra Umbraco robotten
<key alias="preview">Vis prøve</key>
<key alias="styles">Styles</key>
</area>
<area alias="template">
<key alias="edittemplate">Rediger skabelon</key>
<key alias="insertSections">Sektioner</key>
<key alias="insertContentArea">Indsæt indholdsområde</key>
<key alias="insertContentAreaPlaceHolder">Indsæt indholdsområdemarkering</key>
<key alias="insertDictionaryItem">Indsæt ordbogselement</key>
<key alias="insertMacro">Indsæt makro</key>
<key alias="insertPageField">Indsæt Umbraco sidefelt</key>
<key alias="insertContentAreaPlaceHolder">Indsæt pladsholder for indholdsområde</key>
<key alias="insert">Indsæt</key>
<key alias="insertDesc">Hvad vil du indsætte ?</key>
<key alias="insertDictionaryItem">Oversættelse</key>
<key alias="insertDictionaryItemDesc">Indsætter en oversætbar tekst, som skifter efter det sprog, som websitet vises i.</key>
<key alias="insertMacro">Makro</key>
<key alias="insertMacroDesc">
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.
</key>
<key alias="insertPageField">Sideværdi</key>
<key alias="insertPageFieldDesc">
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.
</key>
<key alias="insertPartialView">Partial view</key>
<key alias="insertPartialViewDesc">
Et Partial View er et skabelonelement, som kan indsættes i andre skabeloner og derved
genbruges og deles på tværs af sideskabelonerne.
</key>
<key alias="mastertemplate">Master skabelon</key>
<key alias="quickGuide">Lynguide til Umbracos skabelontags</key>
<key alias="noMastertemplate">Ingen masterskabelon</key>
<key alias="noMaster">Ingen master</key>
<key alias="renderBody">Indsæt en underliggende skabelon</key>
<key alias="renderBodyDesc">
<![CDATA[
Henter indholdet af en underliggende skabelon ind, ved at
indsætte et <code>@RenderBody()</code> element.
]]>
</key>
<key alias="defineSection">Definer en sektion</key>
<key alias="defineSectionDesc">
<![CDATA[
Definerer en del af din skabelon som en navngivet sektion, ved at
omkranse den i <code>@section { ... }</code>. Herefter kan denne sektion flettes ind i
overliggende skabelon ved at indsætte et <code>@RenderSection</code> element.
]]>
</key>
<key alias="renderSection">Indsæt en sektion</key>
<key alias="renderSectionDesc">
<![CDATA[
Henter indholdet af en sektion fra den underliggende skabelon ind, ved at indsætte et
<code>@RenderSection(name)</code> element. Den underliggende skabelon skal have
defineret en sektion via et <code>@section [name]{ ... }</code> element.
]]>
</key>
<key alias="sectionName">Sektionsnavn</key>
<key alias="sectionMandatory">Sektionen er obligatorisk</key>
<key alias="sectionMandatoryDesc">
Hvis obligatorisk, skal underskabelonen indeholde en <code>@section</code> -definition.
</key>
<key alias="queryBuilder">Query builder</key>
<key alias="itemsReturned">sider returneret, på</key>
<key alias="iWant">Returner</key>
<key alias="allContent">alt indhold</key>
<key alias="contentOfType">indhold af typen &quot;%0%&quot;</key>
<key alias="from">fra</key>
<key alias="websiteRoot">mit website</key>
<key alias="where">filtre</key>
<key alias="and">og</key>
<key alias="is">is</key>
<key alias="isNot">is not</key>
<key alias="before">before</key>
<key alias="beforeIncDate">before (including selected date)</key>
<key alias="after">after</key>
<key alias="afterIncDate">after (including selected date)</key>
<key alias="equals">equals</key>
<key alias="doesNotEqual">does not equal</key>
<key alias="contains">contains</key>
<key alias="doesNotContain">does not contain</key>
<key alias="greaterThan">greater than</key>
<key alias="greaterThanEqual">greater than or equal to</key>
<key alias="lessThan">less than</key>
<key alias="lessThanEqual">less than or equal to</key>
<key alias="id">Id</key>
<key alias="name">Name</key>
<key alias="createdDate">Created Date</key>
<key alias="lastUpdatedDate">Last Updated Date</key>
<key alias="orderBy">order by</key>
<key alias="ascending">ascending</key>
<key alias="descending">descending</key>
<key alias="template">Skabelon</key>
</area>
<area alias="templateEditor">
<key alias="alternativeField">Alternativt felt</key>
<key alias="alternativeText">Alternativ tekst</key>

View File

@@ -305,6 +305,7 @@
<key alias="selectMemberGroup">Select member group</key>
<key alias="noIconsFound">No icons were found</key>
<key alias="noMacroParams">There are no parameters for this macro</key>
<key alias="noMacros">There are no macros available to insert</key>
<key alias="externalLoginProviders">External login providers</key>
<key alias="exceptionDetail">Exception Details</key>
<key alias="stacktrace">Stacktrace</key>
@@ -1032,6 +1033,9 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="insertSections">Sections</key>
<key alias="insertContentArea">Insert content area</key>
<key alias="insertContentAreaPlaceHolder">Insert content area placeholder</key>
<key alias="insert">Insert</key>
<key alias="insertDesc">Choose what to insert into your template</key>
<key alias="insertDictionaryItem">Dictionary item</key>
<key alias="insertDictionaryItemDesc">A dictionary item is a placeholder for a translatable piece of text, which makes it easy to create designs for multilingual websites.</key>
@@ -1053,18 +1057,79 @@ To manage your website, simply open the Umbraco back office and start adding con
</key>
<key alias="mastertemplate">Master template</key>
<key alias="noMastertemplate">No master template</key>
<key alias="noMaster">No master</key>
<key alias="renderBody">Render child template</key>
<key alias="renderBodyDesc">
<![CDATA[
Renders the contents of a child template, by inserting a
<code>@RenderBody()</code> placeholder.
]]>
</key>
<key alias="defineSection">Define a named section</key>
<key alias="defineSectionDesc">
<![CDATA[
Defines a part of your template as a named section by wrapping it in
<code>@section { ... }</code>. This can be rendered in a
specific area of the parent of this template, by using <code>@RenderSection</code>.
]]>
</key>
<key alias="renderSection">Render a named section</key>
<key alias="renderSectionDesc">
<![CDATA[
Renders a named area of a child template, by inserting a <code>@RenderSection(name)</code> placeholder.
This renders an area of a child template which is wrapped in a corresponding <code>@section [name]{ ... }</code> definition.
]]>
</key>
<key alias="sectionName">Section Name</key>
<key alias="sectionMandatory">Section is mandatory</key>
<key alias="sectionMandatoryDesc">
If mandatory, the child template must contain a <code>@section</code> definition, otherwise an error is shown.
</key>
<key alias="queryBuilder">Query builder</key>
<key alias="itemsReturned">items returned, in</key>
<key alias="iWant">I want</key>
<key alias="iWant">I want</key>
<key alias="allContent">all content</key>
<key alias="contentOfType">content of type &quot;%0%&quot;</key>
<key alias="from">from</key>
<key alias="websiteRoot">my website</key>
<key alias="where">where</key>
<key alias="and">and</key>
<key alias="everything">everything</key>
<key alias="is">is</key>
<key alias="isNot">is not</key>
<key alias="before">before</key>
<key alias="beforeIncDate">before (including selected date)</key>
<key alias="after">after</key>
<key alias="afterIncDate">after (including selected date)</key>
<key alias="equals">equals</key>
<key alias="doesNotEqual">does not equal</key>
<key alias="contains">contains</key>
<key alias="doesNotContain">does not contain</key>
<key alias="greaterThan">greater than</key>
<key alias="greaterThanEqual">greater than or equal to</key>
<key alias="lessThan">less than</key>
<key alias="lessThanEqual">less than or equal to</key>
<key alias="id">Id</key>
<key alias="name">Name</key>
<key alias="createdDate">Created Date</key>
<key alias="lastUpdatedDate">Last Updated Date</key>
<key alias="orderBy">order by</key>
<key alias="ascending">ascending</key>
<key alias="descending">descending</key>
<key alias="template">Template</key>
</area>
<area alias="grid">

View File

@@ -1027,13 +1027,105 @@ To manage your website, simply open the Umbraco back office and start adding con
</area>
<area alias="template">
<key alias="edittemplate">Edit template</key>
<key alias="insertSections">Sections</key>
<key alias="insertContentArea">Insert content area</key>
<key alias="insertContentAreaPlaceHolder">Insert content area placeholder</key>
<key alias="insertDictionaryItem">Insert dictionary item</key>
<key alias="insertMacro">Insert Macro</key>
<key alias="insertPageField">Insert Umbraco page field</key>
<key alias="insert">Insert</key>
<key alias="insertDesc">Choose what to insert into your template</key>
<key alias="insertDictionaryItem">Dictionary item</key>
<key alias="insertDictionaryItemDesc">A dictionary item is a placeholder for a translatable piece of text, which makes it easy to create designs for multilingual websites.</key>
<key alias="insertMacro">Macro</key>
<key alias="insertMacroDesc">
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.
</key>
<key alias="insertPageField">Value</key>
<key alias="insertPageFieldDesc">Displays the value of a named field from the current page, with options to modify the value or fallback to alternative values.</key>
<key alias="insertPartialView">Partial view</key>
<key alias="insertPartialViewDesc">
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.
</key>
<key alias="mastertemplate">Master template</key>
<key alias="quickGuide">Quick Guide to Umbraco template tags</key>
<key alias="noMastertemplate">No master template</key>
<key alias="noMaster">No master</key>
<key alias="renderBody">Render child template</key>
<key alias="renderBodyDesc">
<![CDATA[
Renders the contents of a child template, by inserting a
<code>@RenderBody()</code> placeholder.
]]>
</key>
<key alias="defineSection">Define a named section</key>
<key alias="defineSectionDesc">
<![CDATA[
Defines a part of your template as a named section by wrapping it in
<code>@section { ... }</code>. This can be rendered in a
specific area of the parent of this template, by using <code>@RenderSection</code>.
]]>
</key>
<key alias="renderSection">Render a named section</key>
<key alias="renderSectionDesc">
<![CDATA[
Renders a named area of a child template, by inserting a <code>@RenderSection(name)</code> placeholder.
This renders an area of a child template which is wrapped in a corresponding <code>@section [name]{ ... }</code> definition.
]]>
</key>
<key alias="sectionName">Section Name</key>
<key alias="sectionMandatory">Section is mandatory</key>
<key alias="sectionMandatoryDesc">
If mandatory, the child template must contain a <code>@section</code> definition, otherwise an error is shown.
</key>
<key alias="queryBuilder">Query builder</key>
<key alias="itemsReturned">items returned, in</key>
<key alias="iWant">I want</key>
<key alias="allContent">all content</key>
<key alias="contentOfType">content of type &quot;%0%&quot;</key>
<key alias="from">from</key>
<key alias="websiteRoot">my website</key>
<key alias="where">where</key>
<key alias="and">and</key>
<key alias="is">is</key>
<key alias="isNot">is not</key>
<key alias="before">before</key>
<key alias="beforeIncDate">before (including selected date)</key>
<key alias="after">after</key>
<key alias="afterIncDate">after (including selected date)</key>
<key alias="equals">equals</key>
<key alias="doesNotEqual">does not equal</key>
<key alias="contains">contains</key>
<key alias="doesNotContain">does not contain</key>
<key alias="greaterThan">greater than</key>
<key alias="greaterThanEqual">greater than or equal to</key>
<key alias="lessThan">less than</key>
<key alias="lessThanEqual">less than or equal to</key>
<key alias="id">Id</key>
<key alias="name">Name</key>
<key alias="createdDate">Created Date</key>
<key alias="lastUpdatedDate">Last Updated Date</key>
<key alias="orderBy">order by</key>
<key alias="ascending">ascending</key>
<key alias="descending">descending</key>
<key alias="template">Template</key>
</area>
<area alias="grid">

View File

@@ -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<OperathorTerm> Terms = new List<OperathorTerm>()
private IEnumerable<OperathorTerm> 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<OperathorTerm>()
{
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<PropertyModel> Properties = new List<PropertyModel>()
private IEnumerable<PropertyModel> 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<PropertyModel>()
{
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;
}

View File

@@ -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; }
/// <summary>
/// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes.
/// </summary>