Merge remote-tracking branch 'origin/7.2.0' into 7.2.0

Conflicts:

	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html
This commit is contained in:
per ploug
2014-11-12 15:44:11 +01:00
15 changed files with 355 additions and 353 deletions

View File

@@ -33,8 +33,9 @@
<dependency id="AutoMapper" version="[3.0.0, 4.0.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.5, 7.0.0)" />
<dependency id="Examine" version="[0.1.57, 1.0.0)" />
<dependency id="ImageProcessor" version="[1.9.5, 2.0.0)" />
<dependency id="ImageProcessor.Web" version="[3.3.1, 4.0.0)" />
<dependency id="ImageProcessor" version="[1.9.5, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[3.3.1, 5.0.0)" />
<dependency id="dotless" version="[1.4.1, 2.0.0)" />
</dependencies>
</metadata>
<files>

View File

@@ -11,6 +11,7 @@
// Sortabel
// -------------------------
.usky-grid .ui-sortable-helper {
position:absolute;
border: dashed 1px #000 !important;
background: #ccc;
opacity: 0.4;
@@ -162,13 +163,17 @@
bottom: 0px;
left: 0;
right: 0;
margin: 0 45px 1px 0;
&.emptyArea{
margin: 0 0 1px 0;
}
}
.usky-grid .usky-control:hover .cell-tools-add{
opacity: 1;
}
.usky-grid .cell-tools-remove {
display:inline-block;
position: absolute;
@@ -186,7 +191,7 @@
.usky-grid .cell-tools-move {
display:inline-block;
position: absolute;
top: 40px;
top: 33px;
right: 5px;
z-index: 500;
cursor: move
@@ -194,7 +199,7 @@
.usky-grid .cell-tools-edit{
position: absolute;
top: 80px;
top: 66px;
right: 5px;
}
@@ -229,11 +234,11 @@
/*border-bottom:1px solid rgba(182, 182, 182, 0.0) !important;*/
}
.usky-grid .warnhighlight{
.usky-grid .warnhighlight, .usky-grid .td.last.warnhighlight{
border: 1px dashed @red !important;
}
.usky-grid .infohighlight{
.usky-grid .infohighlight, .usky-grid .td.last.infohighlight{
border: 1px dashed @blue !important;
}
@@ -327,7 +332,7 @@
// ICONS
// -------------------------
.usky-grid .iconBox {
padding: 4px 7px 4px 7px;
padding: 4px 6px 4px 6px;
display: inline-block;
cursor: pointer;
border-radius: 200px;
@@ -339,6 +344,7 @@
background: @blue !important;
color: white !important;
border-color: @blue !important;
text-decoration:none;
}
.usky-grid .iconBox a:hover {
@@ -370,12 +376,10 @@
.usky-grid .iconBox i {
font-size:16px !important;
color: #5F5F5F;
display:block;
}
.usky-grid ul {
display:inline-block;
list-style:none;
@@ -479,22 +483,19 @@
/**************************************************************************************************/
.usky-grid .usky-cell{
padding-bottom: 20px;
}
.usky-grid .usky-row{
padding-bottom: 15px;
}
.usky-grid .usky-control{
margin: 10px 0 0 0;
padding: 5px;
border: 1px dashed transparent;
}
.usky-grid .usky-templates-columns{
margin-top: 30px;
}
.usky-grid .usky-row-inner{
margin-right: 45px;
border: 1px dashed transparent;
@@ -503,7 +504,7 @@
.usky-grid .usky-control-inner{
padding: 5px;
margin-right: 45px;
margin-bottom: 10px;
margin-bottom: 15px;
border: 1px dashed transparent;
}
@@ -563,57 +564,6 @@
/* template column */
/**************************************************************************************************/
.usky-grid .usky-templates-columns .td{
border: none !important;
vertical-align: middle;
}
.usky-grid .usky-templates-columns .td i{
color: @gray;
opacity: 0.8
}
.usky-grid .mainTbpt:hover {
border-color:@blue;
}
.usky-grid .mainTbpt {
cursor:pointer;
border-collapse: separate;
min-height: 35px;
border: 2px solid @grayLight;
margin:0px;
padding: 1px;
}
.usky-grid .mainTdpt {
padding: 1px;
}
.usky-grid .mainTbpt {
height: auto;
}
.usky-grid .mainTdpt {
height: 11px;
margin: 0;
overflow: hidden;
border: 1px dashed #d9d9d9;
display: block;
float: left;
}
.mainTdpt span{
width: 100%;
display: block;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0 1px;
height: 10px;
background: @grayLight
}
/* New template preview */
.usky-grid {
@@ -636,6 +586,7 @@
}
.preview-rows {
display: inline-block;
position: relative;
-webkit-box-sizing: border-box;
@@ -646,6 +597,18 @@
border: 2px solid @grayLight; /* @grayLight */
transition: border 200ms linear;
&.prevalues-rows {
margin: 0px 20px 20px 0px;
width: 80px;
float:left;
}
&.prevalues-templates {
margin: 0px 20px 20px 0px;
float:left;
}
&:hover {
border-color: @blue;
cursor: pointer;
@@ -683,28 +646,43 @@
min-height: 18px;
line-height: 11px;
padding: 1px;
&.prevalues-rows {
min-height: 30px;
}
}
.preview-col {
display: block;
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 33.3%; /* temp value */
height: 10px;
margin: 0;
border: 1px solid @white; /* @white */
.preview-rows {
.preview-col {
display: block;
float: left;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 33.3%; /* temp value */
height: 10px;
margin: 0;
border: 1px solid @white; /* @white */
.preview-cell {
display: block;
width: 100%;
height: 100%;
background-color: @grayLight; /* @grayLight */
margin: 0 1px 1px 0;
}
}
&.prevalues-templates {
.preview-col {
height: 80px;
}
}
}
.preview-cell {
display: block;
width: 100%;
height: 100%;
background-color: @grayLight; /* @grayLight */
margin: 0 1px 1px 0;
}
}
.preview-overlay {
display: block;
width: 100%;
@@ -797,12 +775,6 @@
text-align: left;
}
.usky-grid-configuration .uSky-templates .uSky-templates-template{
margin: 0px 20px 20px 0px;
width: 80px;
}
.usky-grid-configuration .uSky-templates .uSky-templates-template .tb{
max-height: 50px;
border-width: 2px !important;

View File

@@ -58,7 +58,7 @@ function mediaPickerController($scope, dialogService, entityResource, $log, icon
//load media data
var modelIds = $scope.model.value ? $scope.model.value.split(',') : [];
entityResource.getByIds(modelIds, $scope.cfg.entityType).then(function (data) {
entityResource.getByIds(modelIds, dialogOptions.entityType).then(function (data) {
_.each(data, function (item, i) {
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
$scope.renderModel.push({ name: item.name, id: item.id, icon: item.icon });

View File

@@ -8,7 +8,7 @@ angular.module('umbraco')
$scope.ids = [];
$scope.cfg = {
var config = {
multiPicker: false,
entityType: "Document",
type: "content",
@@ -17,7 +17,7 @@ angular.module('umbraco')
if($scope.model.value){
$scope.ids = $scope.model.value.split(',');
entityResource.getByIds($scope.ids, $scope.cfg.entityType).then(function(data){
entityResource.getByIds($scope.ids, config.entityType).then(function (data) {
_.each(data, function (item, i) {
item.icon = iconHelper.convertFromLegacyIcon(item.icon);
$scope.renderModel.push({name: item.name, id: item.id, icon: item.icon});
@@ -26,12 +26,13 @@ angular.module('umbraco')
}
$scope.openContentPicker =function(){
var d = dialogService.treePicker({
section: $scope.cfg.type,
treeAlias: $scope.cfg.type,
multiPicker: $scope.cfg.multiPicker,
callback: populate});
$scope.openContentPicker =function() {
var d = dialogService.treePicker({
section: config.type,
treeAlias: config.type,
multiPicker: config.multiPicker,
callback: populate
});
};
$scope.remove =function(index){

View File

@@ -152,8 +152,8 @@ angular.module("umbraco")
$scope.overlayMenu.show = true;
};
$scope.closeItemOverlay = function(){
$scope.currentControl = undefined;
$scope.closeItemOverlay = function () {
$scope.currentControl = null;
$scope.overlayMenu.show = false;
$scope.overlayMenu.key = undefined;
};
@@ -184,20 +184,20 @@ angular.module("umbraco")
$scope.currentRow = null;
};
$scope.setCurrentRemoveRow = function (Row) {
$scope.currentRemoveRow = Row;
$scope.setWarnighlightRow = function (row) {
$scope.currentWarnhighlightRow = row;
};
$scope.disableCurrentRemoveRow = function (Row) {
$scope.currentRemoveRow = null;
$scope.disableWarnhighlightRow = function () {
$scope.currentWarnhighlightRow = null;
};
$scope.setCurrentMovedRow = function (Row) {
$scope.currentMovedRow = Row;
$scope.setInfohighlightRow = function (row) {
$scope.currentInfohighlightRow = row;
};
$scope.disableCurrentMovedRow = function (Row) {
$scope.currentMovedRow = null;
$scope.disableInfohighlightRow = function () {
$scope.currentInfohighlightRow = null;
};
$scope.getAllowedLayouts = function(column){
@@ -229,6 +229,7 @@ angular.module("umbraco")
$scope.removeRow = function (section, $index) {
if (section.rows.length > 0) {
section.rows.splice($index, 1);
$scope.currentRow = null;
$scope.openRTEToolbarId = null;
$scope.initContent();
}
@@ -252,14 +253,14 @@ angular.module("umbraco")
};
// *********************************************
// Cell management functions
// Area management functions
// *********************************************
$scope.setCurrentCell = function (cell) {
$scope.currentCell = cell;
};
$scope.disableCurrentCell = function (cell) {
$scope.disableCurrentCell = function () {
$scope.currentCell = null;
};
@@ -272,7 +273,13 @@ angular.module("umbraco")
}
};
$scope.setInfohighlightArea = function (cell) {
$scope.currentInfohighlightArea = cell;
};
$scope.disableInfohighlightArea = function () {
$scope.currentInfohighlightArea = null;
};
// *********************************************
@@ -294,22 +301,20 @@ angular.module("umbraco")
$scope.currentToolsControl = null;
};
$scope.setCurrentRemoveControl = function (Control) {
$scope.currentRemoveControl = Control;
$scope.setWarnhighlightControl = function (Control) {
$scope.currentWarnhighlightControl = Control;
};
$scope.disableCurrentRemoveControl = function (Control) {
$scope.currentRemoveControl = null;
$scope.disableWarnhighlightControl = function (Control) {
$scope.currentWarnhighlightControl = null;
};
$scope.setCurrentMovedControl = function (Control) {
$scope.currentRow = null;
$scope.currentRemoveControl = null;
$scope.currentMovedControl = Control;
$scope.setInfohighlightControl = function (Control) {
$scope.currentInfohighlightControl = Control;
};
$scope.disableCurrentMovedControl = function (Control) {
$scope.currentMovedControl = null;
$scope.disableInfohighlightControl = function (Control) {
$scope.currentInfohighlightControl = null;
};
$scope.setUniqueId = function (cell, index) {
@@ -356,6 +361,7 @@ angular.module("umbraco")
};
$scope.removeControl = function (cell, $index) {
$scope.currentControl = null;
cell.controls.splice($index, 1);
};

View File

@@ -1,246 +1,253 @@
<div ng-controller="Umbraco.PropertyEditors.GridController" class="usky-grid">
<div ng-controller="Umbraco.PropertyEditors.GridController" class="usky-grid" id="usky-grid">
<div ng-if="contentReady">
<!-- Template picker -->
<div ng-if="contentReady">
<div class="templates-preview"
ng-show="!model.value || model.value == ''">
<div class="preview-rows layout"
ng-repeat="template in model.config.items.templates"
ng-click="addTemplate(template)">
<div class="preview-row">
<div class="preview-col"
ng-class="{last:$last}"
ng-repeat="section in template.sections"
ng-style="{width: percentage(section.grid) + '%'}">
<div class="preview-cell">
</div>
</div>
</div>
<!-- Template picker -->
<div class="preview-overlay">
</div>
<div class="templates-preview"
ng-show="!model.value || model.value == ''">
<small>{{layout.name}}</small>
<div class="preview-rows layout"
ng-repeat="template in model.config.items.templates"
ng-click="addTemplate(template)">
</div> <!-- .templates-preview-rows -->
<div class="preview-row">
<p><span class="help-text">Add rows to your layout</span></p>
</div> <!-- .templates-preview -->
<!-- template picker end -->
<!-- Grids -->
<div class="usky-grid-width">
<div class="tb" >
<!-- for each column in model -->
<div class="usky-column td"
ng-class="{last:$last}"
ng-repeat="section in model.value.sections"
ng-init="initSection(section)"
ng-style="{width: section.$percentage + '%'}">
<div ui-sortable="sortableOptions" ng-model="section.rows">
<!-- for each row in template section -->
<div ng-repeat="row in section.rows"
class="usky-row"
ng-mouseenter="setCurrentRow(row)"
ng-mouseleave="disableCurrentRow()">
<!-- Row tool -->
<div class="row-tools" ng-animate="'fade'" ng-if="currentRow == row && currentControl === null">
<!-- delete row -->
<div class="cell-tools-remove">
<div class="iconBox"
ng-click="deletePrompt = true"
ng-mouseenter="setCurrentRemoveControl(row)"
ng-mouseleave="disableCurrentRemoveControl(row)">
<span ng-if="deletePrompt">
Are you sure?
<a href style="text-decoration: underline" ng-click="removeRow(section, $index)">Yes</a>
</span>
<i ng-if="!deletePrompt" class="icon icon-trash"></i>
</div>
</div>
<div class="cell-tools-move">
<a class="iconBox"
href>
<i class="icon icon-navigation"></i>
</a>
</div>
<div class="cell-tools-edit" ng-if="hasSettings">
<a href class="iconBox" ng-click="editGridItemSettings(row)">
<i class="icon icon-settings"></i>
</a>
</div>
<div class="preview-col"
ng-class="{last:$last}"
ng-repeat="section in template.sections"
ng-style="{width: percentage(section.grid) + '%'}">
<div class="preview-cell">
</div>
<!-- row container -->
<div class="{{row.cssClass}} mainContainer usky-row-inner"
ng-class="{last:$last,first:$first,warnhighlight:currentRemoveRow == row, infohighlight:currentMovedRow == row}">
</div>
<div class="mainTb">
<div class="tb">
<div class="tr">
</div>
<!-- cells in row -->
<div ng-style="{width: area.$percentage + '%'}"
ng-class="{last:$last,first:$first}"
class="td mainTd usky-cell"
ng-repeat="area in row.areas" ui-sortable="sortableOptionsCell" ng-model="area.controls">
<div class="preview-overlay">
</div>
<!-- Controls in cell -->
<div ng-repeat="control in area.controls"
ng-mouseover="setCurrentControl(control)"
ng-mouseleave="disableCurrentControl(control)"
ng-animate="'fade'"
class="usky-control">
<small>{{layout.name}}</small>
<!-- Filled cell tools -->
<div class="cell-tools"
</div> <!-- .templates-preview-rows -->
<p><span class="help-text">Add rows to your layout</span></p>
</div> <!-- .templates-preview -->
<!-- template picker end -->
<!-- Grids -->
<div class="usky-grid-width">
<div class="tb">
<!-- for each column in model -->
<div class="usky-column td"
ng-class="{last:$last}"
ng-repeat="section in model.value.sections"
ng-init="initSection(section)"
ng-style="{width: section.$percentage + '%'}">
<div ui-sortable="sortableOptions" ng-model="section.rows">
<!-- for each row in template section -->
<div ng-repeat="row in section.rows"
class="usky-row"
ng-mouseenter="setCurrentRow(row)"
ng-mouseleave="disableCurrentRow()">
<!-- Row tool -->
<div class="row-tools" ng-animate="'fade'" ng-if="currentRow === row && currentControl === null">
<!-- delete row -->
<div class="cell-tools-remove">
<div class="iconBox"
ng-click="deletePrompt = true"
ng-mouseover="setWarnighlightRow(row)"
ng-mouseleave="disableWarnhighlightRow(row)">
<span ng-if="deletePrompt">
Are you sure?
<a href style="text-decoration: underline" ng-click="removeRow(section, $index)">Yes</a>
</span>
<i ng-if="!deletePrompt" class="icon icon-trash"></i>
</div>
</div>
<div class="cell-tools-move">
<a class="iconBox"
ng-mouseover="setInfohighlightRow(row)"
ng-mouseleave="disableInfohighlightRow(row)"
href>
<i class="icon icon-navigation"></i>
</a>
</div>
<div class="cell-tools-edit" ng-if="hasSettings">
<a class="iconBox"
ng-mouseover="setInfohighlightRow(row)"
ng-mouseleave="disableInfohighlightRow(row)"
ng-click="editGridItemSettings(row)"
href>
<i class="icon icon-settings"></i>
</a>
</div>
</div>
<!-- row container -->
<div class="{{row.cssClass}} mainContainer usky-row-inner"
ng-class="{last:$last,first:$first,warnhighlight:currentWarnhighlightRow == row, infohighlight:currentInfohighlightRow == row}">
<div class="mainTb">
<div class="tb">
<div class="tr">
<!-- Areas in row -->
<div ng-style="{width: area.$percentage + '%'}"
class="td mainTd usky-cell"
ng-class="{last:$last,first:$first, infohighlight:currentInfohighlightArea == area,
warnhighlight:currentWarnhighlightArea == area}"
ng-repeat="area in row.areas" ui-sortable="sortableOptionsCell" ng-model="area.controls">
<!-- Controls in areas -->
<div ng-repeat="control in area.controls"
ng-mouseover="setCurrentControl(control)"
ng-mouseleave="disableCurrentControl(control)"
ng-animate="'fade'"
ng-show="control && (currentControl == control)">
class="usky-control">
<!-- delete cell -->
<div class="cell-tools-remove">
<div class="iconBox"
ng-click="deletePrompt = true"
ng-mouseover="setCurrentRemoveControl(control)"
ng-mouseleave="disableCurrentRemoveControl(control)">
<!-- Filled cell tools -->
<div class="cell-tools"
ng-animate="'fade'"
ng-show="control && (currentControl == control)">
<span ng-show="deletePrompt">
Are you sure?
<a href style="text-decoration: underline" ng-click="removeControl(area, $index)">Yes</a>
</span>
<!-- delete control -->
<div class="cell-tools-remove">
<div class="iconBox"
ng-click="deletePrompt = true"
ng-mouseover="setWarnhighlightControl(control)"
ng-mouseleave="disableWarnhighlightControl(control)">
<i ng-show="!deletePrompt" class="icon icon-trash"></i>
<span ng-show="deletePrompt">
Are you sure?
<a href style="text-decoration: underline" ng-click="removeControl(area, $index)">Yes</a>
</span>
<i ng-show="!deletePrompt" class="icon icon-trash"></i>
</div>
</div>
</div>
<!-- move cell -->
<div class="cell-tools-move">
<div class="iconBox"
ng-mouseover="setCurrentMovedControl(control)"
ng-mouseleave="disableCurrentMovedControl(control)">
<i class="icon icon-navigation"></i>
<!-- move control -->
<div class="cell-tools-move">
<a class="iconBox"
ng-mouseover="setInfohighlightControl(control)"
ng-mouseleave="disableInfohighlightControl(control)"
href>
<i class="icon icon-navigation"></i>
</a>
</div>
<!-- setting area -->
<div class="cell-tools-edit" ng-if="hasSettings && $first">
<a class="iconBox"
ng-mouseover="setInfohighlightArea(area)"
ng-mouseleave="disableInfohighlightArea(area)"
ng-click="editGridItemSettings(area)"
href>
<i class="icon icon-settings"></i>
</a>
</div>
</div>
<div class="cell-tools-edit" ng-if="hasSettings && $first">
<a href class="iconBox" ng-click="editGridItemSettings(area)">
<i class="icon icon-settings"></i>
</a>
</div>
</div>
<div class="usky-control-inner" ng-class="{last:$last,
infohighlight:currentMovedControl == control,
warnhighlight:currentRemoveControl == control,
<div class="usky-control-inner" ng-class="{last:$last,
infohighlight:currentInfohighlightControl == control,
warnhighlight:currentWarnhighlightControl == control,
selectedControl:currentControl == control}">
<!-- Redering the editor for specific control -->
<div ng-if="control && control.$editorPath"
ng-include="control.$editorPath"
class="usky-cell usky-cell-{{control.editor.view}}">
<!-- Redering the editor for specific control -->
<div ng-if="control && control.$editorPath"
ng-include="control.$editorPath"
class="usky-cell-{{control.editor.view}}">
</div>
</div>
</div>
</div>
<!-- Controls repeat end -->
<!-- if area is empty tools -->
<div class="usky-control usky-control-placeholder"
ng-if="area.controls.length == 0">
<!-- Controls repeat end -->
<!-- if area is empty tools -->
<div class="usky-control usky-control-placeholder"
ng-if="area.controls.length == 0">
<div class="help-text" style="margin-bottom: 15px">
To start, click the <i class=" icon icon-add blue">
</i> below and add your first element
</div><br />
</div>
<div class="cell-tools-add"
ng-if="!currentToolsControl"
ng-animate="'fade'">
<div class="iconBox">
<a href ng-click="addItemOverlay($event, area, 0, area.$uniqueId);">
<i class=" icon icon-add"></i>
</a>
</div>
<div ng-if="overlayMenu.show && overlayMenu.key == area.$uniqueId" ng-include="'views/propertyeditors/grid/dialogs/additem.html'"></div>
<div class="cell-tools-add"
ng-class="{emptyArea:area.controls.length == 0}"
ng-if="!currentToolsControl"
ng-animate="'fade'">
<a class="iconBox" href ng-click="addItemOverlay($event, area, 0, area.$uniqueId);">
<i class=" icon icon-add"></i>
</a>
<div ng-if="overlayMenu.show && overlayMenu.key == area.$uniqueId" ng-include="'views/propertyeditors/grid/dialogs/additem.html'"></div>
</div>
</div>
<!-- cells repeat end -->
</div>
<!-- cells repeat end -->
</div>
</div>
</div>
<!-- row container end -->
</div>
<!-- row container end -->
<!-- row repeat -->
</div>
<!-- row repeat -->
<!-- row sortable end -->
<!-- column tools -->
<div class="templates-preview">
<div class="preview-rows columns"
ng-repeat="layout in section.$allowedLayouts"
ng-show="layout.areas.length > 0"
ng-click="addRow(section, layout)">
<div class="preview-row">
<div class="preview-col" ng-style="{width: percentage(area.grid) + '%'}" ng-repeat="area in layout.areas">
<div class="preview-cell">
</div>
</div>
</div>
<div class="preview-overlay">
</div>
<small>{{layout.name}}</small>
</div> <!-- .templates-preview-rows -->
<p>
<span class="help-text">Add rows to your layout</span>
</p>
</div> <!-- .templates-preview -->
<!-- column tools end -->
</div>
<!-- row sortable end -->
<!-- column tools -->
<div class="templates-preview">
<div class="preview-rows columns"
ng-repeat="layout in section.$allowedLayouts"
ng-show="layout.areas.length > 0"
ng-click="addRow(section, layout)">
<div class="preview-row">
<div class="preview-col" ng-style="{width: percentage(area.grid) + '%'}" ng-repeat="area in layout.areas">
<div class="preview-cell">
</div>
</div>
</div>
<div class="preview-overlay">
</div>
<small>{{layout.name}}</small>
</div> <!-- .templates-preview-rows -->
<p>
<span class="help-text">Add rows to your layout</span>
</p>
</div> <!-- .templates-preview -->
<!-- column tools end -->
<!-- column repeat end -->
</div>
<!-- column repeat end -->
</div>
</div>
</div>
</div>

View File

@@ -2,7 +2,8 @@
<input type="text" name="textbox" ng-model="model.value" id="{{model.alias}}"
class="umb-editor umb-textstring textstring"
val-server="value"
ng-required="model.validation.mandatory" />
ng-required="model.validation.mandatory"
ng-trim="false" />
<span class="help-inline" val-msg-for="textbox" val-toggle-msg="required">Required</span>
<span class="help-inline" val-msg-for="textbox" val-toggle-msg="valServer"></span>

View File

@@ -123,6 +123,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
</Reference>
<Reference Include="dotless.Core, Version=1.4.1.0, Culture=neutral, PublicKeyToken=96b446c9e63eae34, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\dotless.1.4.1.0\lib\dotless.Core.dll</HintPath>
</Reference>
<Reference Include="Examine, Version=0.1.57.2941, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Examine.0.1.57.2941\lib\Examine.dll</HintPath>
@@ -132,10 +136,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ImageProcessor.1.9.5.0\lib\ImageProcessor.dll</HintPath>
</Reference>
<Reference Include="ImageProcessor.Web, Version=3.2.2.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="ImageProcessor.Web, Version=3.3.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ImageProcessor.Web.3.3.0.0\lib\net45\ImageProcessor.Web.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\ImageProcessor.Web.3.3.1.0\lib\net45\ImageProcessor.Web.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -199,6 +202,7 @@
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.4.0.30506.0\lib\net40\System.Net.Http.Formatting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -223,9 +227,11 @@
</Reference>
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.4.0.30506.0\lib\net40\System.Web.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>

View File

@@ -6,7 +6,7 @@
<command>
<umbracoAlias>code</umbracoAlias>
<icon>images/editor/code.gif</icon>
<tinyMceCommand value="" userInterface="false" frontendCommand="codemirror">code</tinyMceCommand>
<tinyMceCommand value="" userInterface="false" frontendCommand="code">code</tinyMceCommand>
<priority>1</priority>
</command>
<command>
@@ -199,7 +199,7 @@
</commands>
<plugins>
<plugin loadOnFrontend="true">codemirror</plugin>
<plugin loadOnFrontend="true">code</plugin>
<plugin loadOnFrontend="true">paste</plugin>
<plugin loadOnFrontend="true">umbracolink</plugin>
<plugin loadOnFrontend="true">anchor</plugin>

View File

@@ -3,9 +3,10 @@
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
<package id="ClientDependency" version="1.7.1.2" targetFramework="net40" />
<package id="ClientDependency-Mvc" version="1.7.0.4" targetFramework="net40" />
<package id="dotless" version="1.4.1.0" targetFramework="net45" />
<package id="Examine" version="0.1.57.2941" targetFramework="net40" />
<package id="ImageProcessor" version="1.9.5.0" targetFramework="net45" />
<package id="ImageProcessor.Web" version="3.3.0.0" targetFramework="net45" />
<package id="ImageProcessor.Web" version="3.3.1.0" targetFramework="net45" />
<package id="log4net-mediumtrust" version="2.0.0" targetFramework="net40" />
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net40" />
<package id="Microsoft.AspNet.Mvc" version="4.0.40804.0" targetFramework="net45" />

View File

@@ -17,7 +17,7 @@ namespace Umbraco.Web
public static MvcHtmlString GetGridHtml(this IPublishedProperty property, string framework = "bootstrap3")
{
var view = "Grid/" + framework;
return new MvcHtmlString(renderPartialViewToString(view, property.Value));
return new MvcHtmlString(RenderPartialViewToString(view, property.Value));
}
public static MvcHtmlString GetGridHtml(this IPublishedContent contentItem)
@@ -33,20 +33,22 @@ namespace Umbraco.Web
public static MvcHtmlString GetGridHtml(this IPublishedContent contentItem, string propertyAlias, string framework)
{
var view = "Grid/" + framework;
var model = contentItem.GetProperty(propertyAlias).Value;
var model = contentItem.GetProperty(propertyAlias).Value;
return new MvcHtmlString(renderPartialViewToString(view, model));
return new MvcHtmlString(RenderPartialViewToString(view, model));
}
private static string renderPartialViewToString(string viewName, object model)
private static string RenderPartialViewToString(string viewName, object model)
{
using (var sw = new StringWriter())
{
var cc = new ControllerContext();
cc.RequestContext = new RequestContext(UmbracoContext.Current.HttpContext, new RouteData()
{
Route = RouteTable.Routes["Umbraco_default"]
});
var cc = new ControllerContext
{
RequestContext =
new RequestContext(
UmbracoContext.Current.HttpContext,
new RouteData() { Route = RouteTable.Routes["Umbraco_default"] })
};
var routeHandler = new RenderRouteHandler(ControllerBuilder.Current.GetControllerFactory(), UmbracoContext.Current);
var routeDef = routeHandler.GetUmbracoRouteDefinition(cc.RequestContext, UmbracoContext.Current.PublishedContentRequest);
@@ -66,6 +68,5 @@ namespace Umbraco.Web
return sw.GetStringBuilder().ToString();
}
}
}
}

View File

@@ -211,7 +211,7 @@ namespace Umbraco.Web.Models.Mapping
}
//then we'll just use the root group's data to make the composite tab
var rootGroup = propertyGroups.Single(x => x.ParentId == null);
var rootGroup = propertyGroups.First(x => x.ParentId == null);
aggregateTabs.Add(new Tab<ContentPropertyDisplay>
{
Id = rootGroup.Id,

View File

@@ -1,3 +1,5 @@
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Web.Mvc;
using System.Web.Mvc.Async;
@@ -10,6 +12,8 @@ namespace Umbraco.Web.Mvc
public class RenderActionInvoker : AsyncControllerActionInvoker
{
private static readonly ConcurrentDictionary<Type, ReflectedActionDescriptor> IndexDescriptors = new ConcurrentDictionary<Type, ReflectedActionDescriptor>();
/// <summary>
/// Ensures that if an action for the Template name is not explicitly defined by a user, that the 'Index' action will execute
/// </summary>
@@ -27,12 +31,15 @@ namespace Umbraco.Web.Mvc
//check if the controller is an instance of IRenderMvcController
if (controllerContext.Controller is IRenderMvcController)
{
return new ReflectedActionDescriptor(
controllerContext.Controller.GetType().GetMethods()
.First(x => x.Name == "Index" &&
x.GetCustomAttributes(typeof (NonActionAttribute), false).Any() == false),
"Index",
controllerDescriptor);
return IndexDescriptors.GetOrAdd(controllerContext.Controller.GetType(),
type => new ReflectedActionDescriptor(
controllerContext.Controller.GetType().GetMethods()
.First(x => x.Name == "Index" &&
x.GetCustomAttributes(typeof (NonActionAttribute), false).Any() == false),
"Index",
controllerDescriptor));
}
}

View File

@@ -23,12 +23,11 @@ namespace Umbraco.Web.PropertyEditors
protected override PreValueEditor CreatePreValueEditor()
{
return new gridPreValueEditor();
return new GridPreValueEditor();
}
}
internal class gridPreValueEditor : PreValueEditor
internal class GridPreValueEditor : PreValueEditor
{
[PreValueField("items", "Grid", "views/propertyeditors/grid/grid.prevalues.html", Description = "Grid configuration")]
public string Items { get; set; }

View File

@@ -2,7 +2,7 @@
<packages>
<package id="AutoMapper" version="3.0.0" targetFramework="net45" />
<package id="ClientDependency" version="1.7.1.2" targetFramework="net40" />
<package id="dotless" version="1.4.0.0" targetFramework="net45" />
<package id="dotless" version="1.4.1.0" targetFramework="net45" />
<package id="Examine" version="0.1.57.2941" targetFramework="net40" />
<package id="HtmlAgilityPack" version="1.4.6" targetFramework="net40" />
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net40" />