Canvas views
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
@model dynamic
|
||||
@using Umbraco.Web.Templates
|
||||
@Html.Raw(Model.value)
|
||||
@@ -0,0 +1,17 @@
|
||||
@inherits UmbracoViewPage<dynamic>
|
||||
@using Umbraco.Web.Templates
|
||||
|
||||
|
||||
@if (Model.value != null)
|
||||
{
|
||||
string macroAlias = Model.value.macroAlias.ToString();
|
||||
ViewDataDictionary parameters = new ViewDataDictionary();
|
||||
foreach (dynamic mpd in Model.value.macroParamsDictionary)
|
||||
{
|
||||
parameters.Add(mpd.Name, mpd.Value);
|
||||
}
|
||||
|
||||
<text>
|
||||
@Umbraco.RenderMacro(macroAlias, parameters)
|
||||
</text>
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
@model dynamic
|
||||
@using Umbraco.Web.Templates
|
||||
|
||||
@if (Model.value != null)
|
||||
{
|
||||
<div class="thumbnail">
|
||||
<img src="@Model.value.image" alt="@Model.value.caption">
|
||||
</div>
|
||||
if (Model.value.caption != null)
|
||||
{
|
||||
<p class="caption">@Model.value.caption</p>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@model dynamic
|
||||
@using Umbraco.Web.Templates
|
||||
|
||||
@Html.Raw(TemplateUtilities.ParseInternalLinks(Model.value.ToString()))
|
||||
@@ -0,0 +1,20 @@
|
||||
@model dynamic
|
||||
@using Umbraco.Web.Templates
|
||||
|
||||
@if (Model.editor.config.markup != null)
|
||||
{
|
||||
string markup = Model.editor.config.markup.ToString();
|
||||
|
||||
markup = markup.Replace("#value#", Model.value.ToString());
|
||||
markup = markup.Replace("#style#", Model.editor.config.style.ToString());
|
||||
|
||||
<text>
|
||||
@Html.Raw(markup)
|
||||
</text>
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>
|
||||
<div style="@Model.editor.config.style">@Model.value</div>
|
||||
</text>
|
||||
}
|
||||
47
src/Umbraco.Web.UI/Views/Partials/Canvas/bootstrap2.cshtml
Normal file
47
src/Umbraco.Web.UI/Views/Partials/Canvas/bootstrap2.cshtml
Normal file
@@ -0,0 +1,47 @@
|
||||
@inherits UmbracoViewPage<dynamic>
|
||||
@using Umbraco.Web.Templates
|
||||
@using Newtonsoft.Json.Linq;
|
||||
|
||||
|
||||
@if (Model != null && !string.IsNullOrEmpty(Model.ToString()))
|
||||
{
|
||||
var onlyOneColumn = Model.sections != null ? ((System.Collections.ICollection)Model.sections).Count : 0;
|
||||
|
||||
<div class="uSky-grid @(onlyOneColumn > 1 ? "container-fluid" : "")">
|
||||
<div class="row-fluid clearfix">
|
||||
@foreach (var s in Model.sections)
|
||||
{
|
||||
<div class="@("span" + s.grid)">
|
||||
@foreach (var row in s.rows)
|
||||
{
|
||||
<div class="gridrow_@row.uniqueId" >
|
||||
<div>
|
||||
<div class="row-fluid clearfix">
|
||||
|
||||
@foreach (var area in row.areas)
|
||||
{
|
||||
<div class="@("span" + area.grid)">
|
||||
|
||||
@foreach (var control in area.controls)
|
||||
{
|
||||
if (control != null && control.editor != null && control.editor.view != null)
|
||||
{
|
||||
|
||||
string editor = "canvas/editors/" + control.editor.view.ToString();
|
||||
<text>
|
||||
@Html.Partial(editor, (object)control)
|
||||
</text>
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
45
src/Umbraco.Web.UI/Views/Partials/Canvas/bootstrap3.cshtml
Normal file
45
src/Umbraco.Web.UI/Views/Partials/Canvas/bootstrap3.cshtml
Normal file
@@ -0,0 +1,45 @@
|
||||
@inherits UmbracoViewPage<dynamic>
|
||||
@using Umbraco.Web.Templates
|
||||
|
||||
|
||||
@if (Model != null && !string.IsNullOrEmpty(Model.ToString()))
|
||||
{
|
||||
var onlyOneColumn = Model.sections != null ? ((System.Collections.ICollection)Model.sections).Count : 0;
|
||||
|
||||
<div class="uSky-grid @(onlyOneColumn > 1 ? "container" : "")">
|
||||
<div class="row clearfix">
|
||||
@foreach (var s in Model.sections)
|
||||
{
|
||||
<div class="col-md-@s.grid column">
|
||||
@foreach (var row in s.rows)
|
||||
{
|
||||
<div class="gridrow_@row.uniqueId" >
|
||||
<div class="container">
|
||||
<div class="row clearfix">
|
||||
|
||||
@foreach (var area in row.areas)
|
||||
{
|
||||
<div class="col-md-@area.grid column">
|
||||
|
||||
@foreach (var control in area.controls)
|
||||
{
|
||||
if (control != null && control.editor != null && control.editor.view != null)
|
||||
{
|
||||
|
||||
string editor = "canvas/editors/" + control.editor.view.ToString();
|
||||
<text>
|
||||
@Html.Partial(editor, (object)control)
|
||||
</text>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
Reference in New Issue
Block a user