Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a5a42854ef | |||
| 784c84a166 | |||
| f5d78a4d04 | |||
| b334e0ccb2 | |||
| 0a2e5badd0 | |||
| 90b0bf9d82 | |||
| 6bcd1e44f9 | |||
| 4c06ead056 | |||
| 031340a2ac | |||
| c1fcb37642 | |||
| 0bba68a7f5 | |||
| 47e4c12395 | |||
| 25822a7564 | |||
| 072f0d1520 | |||
| b8734e5eea | |||
| eefd13547c | |||
| 86ffd66c8a | |||
| 01f50a243b | |||
| 7a0ac625ff | |||
| 99f66fe6a3 | |||
| b413a6eeae | |||
| 9b9db23461 | |||
| b40a1fa613 |
@@ -1,3 +1,3 @@
|
||||
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
|
||||
7.6.0
|
||||
alpha054
|
||||
alpha055
|
||||
+1
-1
@@ -12,4 +12,4 @@ using System.Resources;
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyFileVersion("7.6.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.6.0-alpha054")]
|
||||
[assembly: AssemblyInformationalVersion("7.6.0-alpha055")]
|
||||
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration
|
||||
/// Gets the version comment (like beta or RC).
|
||||
/// </summary>
|
||||
/// <value>The version comment.</value>
|
||||
public static string CurrentComment { get { return "alpha054"; } }
|
||||
public static string CurrentComment { get { return "alpha055"; } }
|
||||
|
||||
// Get the version of the umbraco.dll by looking at a class in that dll
|
||||
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
|
||||
|
||||
@@ -294,6 +294,9 @@ namespace Umbraco.Core
|
||||
var relationType = entity as IRelationType;
|
||||
if (relationType != null) return relationType.GetUdi();
|
||||
|
||||
var dictionaryItem = entity as IDictionaryItem;
|
||||
if (dictionaryItem != null) return dictionaryItem.GetUdi();
|
||||
|
||||
throw new NotSupportedException(string.Format("Entity type {0} is not supported.", entity.GetType().FullName));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,5 +367,17 @@ namespace Umbraco.Tests.PropertyEditors
|
||||
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, height: 200);
|
||||
Assert.AreEqual(mediaPath + "?anchor=center&mode=crop&height=200", urlString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test to check result when using a background color with padding
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void GetCropUrl_BackgroundColorParameter()
|
||||
{
|
||||
var cropperJson = "{\"focalPoint\": {\"left\": 0.5,\"top\": 0.5},\"src\": \"" + mediaPath + "\",\"crops\": [{\"alias\": \"home\",\"width\": 270,\"height\": 161}]}";
|
||||
|
||||
var urlString = mediaPath.GetCropUrl(400, 400, cropperJson, imageCropMode: ImageCropMode.Pad, backgroundColor: "fff");
|
||||
Assert.AreEqual(mediaPath + "?mode=pad&width=400&height=400&bgcolor=fff", urlString);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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){
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
+27
-6
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
+14
-26
@@ -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>
|
||||
+13
-7
@@ -259,18 +259,24 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
|
||||
});
|
||||
|
||||
function setEntityUrl(entity) {
|
||||
|
||||
// get url for content and media items
|
||||
if(entityType !== "Member") {
|
||||
entityResource.getUrl(entity.id, entityType).then(function(data){
|
||||
// update url
|
||||
entity.url = data;
|
||||
|
||||
// push item to render model
|
||||
addSelectedItem(entity);
|
||||
// update url
|
||||
angular.forEach($scope.renderModel, function(item){
|
||||
if(item.id === entity.id) {
|
||||
item.url = data;
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
addSelectedItem(entity);
|
||||
}
|
||||
|
||||
// add the selected item to the renderModel
|
||||
// if it needs to show a url the item will get
|
||||
// updated when the url comes back from server
|
||||
addSelectedItem(entity);
|
||||
|
||||
}
|
||||
|
||||
function addSelectedItem(item) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 "%0%"</key>
|
||||
|
||||
<key alias="from">fra</key>
|
||||
<key alias="websiteRoot">mit website</key>
|
||||
<key alias="where">hvor</key>
|
||||
<key alias="and">og</key>
|
||||
|
||||
<key alias="is">er</key>
|
||||
<key alias="isNot">ikke er</key>
|
||||
<key alias="before">er før</key>
|
||||
<key alias="beforeIncDate">er før (inkl. valgte dato)</key>
|
||||
<key alias="after">er efter</key>
|
||||
<key alias="afterIncDate">er efter (inkl. valgte dato)</key>
|
||||
<key alias="equals">er</key>
|
||||
<key alias="doesNotEqual">ikke er</key>
|
||||
<key alias="contains">indeholder</key>
|
||||
<key alias="doesNotContain">ikke indeholder</key>
|
||||
<key alias="greaterThan">er større end</key>
|
||||
<key alias="greaterThanEqual">er større end eller det samme som</key>
|
||||
<key alias="lessThan">er mindre end</key>
|
||||
<key alias="lessThanEqual">er mindre end eller det samme som</key>
|
||||
|
||||
<key alias="id">Id</key>
|
||||
<key alias="name">Navn</key>
|
||||
<key alias="createdDate">Oprettelsesdato</key>
|
||||
<key alias="lastUpdatedDate">Sidste opdatering</key>
|
||||
|
||||
<key alias="orderBy">Sortér efter</key>
|
||||
<key alias="ascending">stigende rækkefølge</key>
|
||||
<key alias="descending">faldende rækkefølge</key>
|
||||
|
||||
<key alias="template">Skabelon</key>
|
||||
</area>
|
||||
|
||||
|
||||
<area alias="templateEditor">
|
||||
<key alias="alternativeField">Alternativt felt</key>
|
||||
<key alias="alternativeText">Alternativ tekst</key>
|
||||
|
||||
@@ -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 "%0%"</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">
|
||||
|
||||
@@ -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 "%0%"</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">
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -228,12 +228,13 @@ namespace Umbraco.Web
|
||||
bool cacheBuster = true,
|
||||
string furtherOptions = null,
|
||||
ImageCropRatioMode? ratioMode = null,
|
||||
bool upScale = true)
|
||||
bool upScale = true,
|
||||
string backgroundColor = null)
|
||||
{
|
||||
return
|
||||
new HtmlString(mediaItem.GetCropUrl(width, height, propertyAlias, cropAlias, quality, imageCropMode,
|
||||
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBuster, furtherOptions, ratioMode,
|
||||
upScale));
|
||||
upScale, backgroundColor));
|
||||
}
|
||||
|
||||
[Obsolete("Use the UrlHelper.GetCropUrl extension instead")]
|
||||
@@ -252,12 +253,13 @@ namespace Umbraco.Web
|
||||
string cacheBusterValue = null,
|
||||
string furtherOptions = null,
|
||||
ImageCropRatioMode? ratioMode = null,
|
||||
bool upScale = true)
|
||||
bool upScale = true,
|
||||
string backgroundColor = null)
|
||||
{
|
||||
return
|
||||
new HtmlString(imageUrl.GetCropUrl(width, height, imageCropperValue, cropAlias, quality, imageCropMode,
|
||||
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode,
|
||||
upScale));
|
||||
upScale, backgroundColor));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -91,10 +91,13 @@ namespace Umbraco.Web
|
||||
/// </param>
|
||||
/// <param name="ratioMode">
|
||||
/// Use a dimension as a ratio
|
||||
/// </param>
|
||||
/// </param>
|
||||
/// <param name="upScale">
|
||||
/// If the image should be upscaled to requested dimensions
|
||||
/// </param>
|
||||
/// </param>
|
||||
/// <param name="backgroundColor">
|
||||
/// Changes the background color of the image. Used when adding a background when resizing image formats without an alpha channel.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The <see cref="string"/>.
|
||||
/// </returns>
|
||||
@@ -112,7 +115,8 @@ namespace Umbraco.Web
|
||||
bool cacheBuster = true,
|
||||
string furtherOptions = null,
|
||||
ImageCropRatioMode? ratioMode = null,
|
||||
bool upScale = true)
|
||||
bool upScale = true,
|
||||
string backgroundColor = null)
|
||||
{
|
||||
if (mediaItem == null) throw new ArgumentNullException("mediaItem");
|
||||
|
||||
@@ -132,7 +136,7 @@ namespace Umbraco.Web
|
||||
mediaItemUrl = stronglyTyped.Src;
|
||||
return GetCropUrl(
|
||||
mediaItemUrl, stronglyTyped, width, height, cropAlias, quality, imageCropMode, imageCropAnchor, preferFocalPoint, useCropDimensions,
|
||||
cacheBusterValue, furtherOptions, ratioMode, upScale);
|
||||
cacheBusterValue, furtherOptions, ratioMode, upScale, backgroundColor);
|
||||
}
|
||||
|
||||
//this shouldn't be the case but we'll check
|
||||
@@ -143,14 +147,14 @@ namespace Umbraco.Web
|
||||
mediaItemUrl = stronglyTyped.Src;
|
||||
return GetCropUrl(
|
||||
mediaItemUrl, stronglyTyped, width, height, cropAlias, quality, imageCropMode, imageCropAnchor, preferFocalPoint, useCropDimensions,
|
||||
cacheBusterValue, furtherOptions, ratioMode, upScale);
|
||||
cacheBusterValue, furtherOptions, ratioMode, upScale, backgroundColor);
|
||||
}
|
||||
|
||||
//it's a single string
|
||||
mediaItemUrl = cropperValue.ToString();
|
||||
return GetCropUrl(
|
||||
mediaItemUrl, width, height, mediaItemUrl, cropAlias, quality, imageCropMode, imageCropAnchor, preferFocalPoint, useCropDimensions,
|
||||
cacheBusterValue, furtherOptions, ratioMode, upScale);
|
||||
cacheBusterValue, furtherOptions, ratioMode, upScale, backgroundColor);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -198,6 +202,9 @@ namespace Umbraco.Web
|
||||
/// <param name="upScale">
|
||||
/// If the image should be upscaled to requested dimensions
|
||||
/// </param>
|
||||
/// <param name="backgroundColor">
|
||||
/// Changes the background color of the image. Used when adding a background when resizing image formats without an alpha channel.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The <see cref="string"/>.
|
||||
/// </returns>
|
||||
@@ -215,7 +222,8 @@ namespace Umbraco.Web
|
||||
string cacheBusterValue = null,
|
||||
string furtherOptions = null,
|
||||
ImageCropRatioMode? ratioMode = null,
|
||||
bool upScale = true)
|
||||
bool upScale = true,
|
||||
string backgroundColor = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(imageUrl)) return string.Empty;
|
||||
|
||||
@@ -226,7 +234,7 @@ namespace Umbraco.Web
|
||||
}
|
||||
return GetCropUrl(
|
||||
imageUrl, cropDataSet, width, height, cropAlias, quality, imageCropMode,
|
||||
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode, upScale);
|
||||
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode, upScale, backgroundColor);
|
||||
}
|
||||
|
||||
public static string GetCropUrl(
|
||||
@@ -243,7 +251,8 @@ namespace Umbraco.Web
|
||||
string cacheBusterValue = null,
|
||||
string furtherOptions = null,
|
||||
ImageCropRatioMode? ratioMode = null,
|
||||
bool upScale = true)
|
||||
bool upScale = true,
|
||||
string backgroundColor = null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(imageUrl) == false)
|
||||
{
|
||||
@@ -350,6 +359,11 @@ namespace Umbraco.Web
|
||||
imageProcessorUrl.Append("&upscale=false");
|
||||
}
|
||||
|
||||
if (backgroundColor != null)
|
||||
{
|
||||
imageProcessorUrl.Append("&bgcolor=" + backgroundColor);
|
||||
}
|
||||
|
||||
if (furtherOptions != null)
|
||||
{
|
||||
imageProcessorUrl.Append(furtherOptions);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -114,6 +114,9 @@ namespace Umbraco.Web
|
||||
/// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be
|
||||
/// set to false if using the result of this method for CSS.
|
||||
/// </param>
|
||||
/// <param name="backgroundColor">
|
||||
/// Changes the background color of the image. Used when adding a background when resizing image formats without an alpha channel.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The <see cref="string"/>.
|
||||
/// </returns>
|
||||
@@ -132,11 +135,12 @@ namespace Umbraco.Web
|
||||
string furtherOptions = null,
|
||||
ImageCropRatioMode? ratioMode = null,
|
||||
bool upScale = true,
|
||||
bool htmlEncode = true)
|
||||
bool htmlEncode = true,
|
||||
string backgroundColor = null)
|
||||
{
|
||||
var url = mediaItem.GetCropUrl(width, height, propertyAlias, cropAlias, quality, imageCropMode,
|
||||
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBuster, furtherOptions, ratioMode,
|
||||
upScale);
|
||||
upScale, backgroundColor);
|
||||
return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
|
||||
}
|
||||
|
||||
@@ -190,6 +194,9 @@ namespace Umbraco.Web
|
||||
/// Whether to HTML encode this URL - default is true - w3c standards require html attributes to be html encoded but this can be
|
||||
/// set to false if using the result of this method for CSS.
|
||||
/// </param>
|
||||
/// <param name="backgroundColor">
|
||||
/// Changes the background color of the image. Used when adding a background when resizing image formats without an alpha channel.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The <see cref="string"/>.
|
||||
/// </returns>
|
||||
@@ -208,11 +215,12 @@ namespace Umbraco.Web
|
||||
string furtherOptions = null,
|
||||
ImageCropRatioMode? ratioMode = null,
|
||||
bool upScale = true,
|
||||
bool htmlEncode = true)
|
||||
bool htmlEncode = true,
|
||||
string backgroundColor = null)
|
||||
{
|
||||
var url = imageUrl.GetCropUrl(width, height, imageCropperValue, cropAlias, quality, imageCropMode,
|
||||
imageCropAnchor, preferFocalPoint, useCropDimensions, cacheBusterValue, furtherOptions, ratioMode,
|
||||
upScale);
|
||||
upScale, backgroundColor);
|
||||
return htmlEncode ? new HtmlString(HttpUtility.HtmlEncode(url)) : new HtmlString(url);
|
||||
}
|
||||
|
||||
@@ -333,7 +341,5 @@ namespace Umbraco.Web
|
||||
{
|
||||
return url.SurfaceAction(action, typeof (T), additionalRouteVals);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user