Add WebCms

This commit is contained in:
2016-11-07 12:56:17 -05:00
parent dfe92218f4
commit 15911f33c0
2750 changed files with 365672 additions and 133 deletions
+28
View File
@@ -0,0 +1,28 @@
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "Master.cshtml";
}
<div role="content">
<section class="light blogarchive equalizer">
<div class="container">
<div class="row">
@foreach(var post in CurrentPage.Children)
{
<div class="col-sm-6">
<div class="content equal">
<a href="@post.Url">
<div class="date">@post.CreateDate.ToLongDateString()</div>
<h2>@post.Name</h2>
<p>@Umbraco.Truncate(post.Introduction, 240, true)</p>
</a>
</div>
</div>
}
</div>
</div>
</section>
</div>
+6
View File
@@ -0,0 +1,6 @@
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "Master.cshtml";
}
@CurrentPage.GetGridHtml("content", "fanoe")
+6
View File
@@ -0,0 +1,6 @@
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "Master.cshtml";
}
@CurrentPage.GetGridHtml("content", "fanoe")
+9
View File
@@ -0,0 +1,9 @@
@inherits UmbracoTemplatePage
@{
Layout = "Master.cshtml";
}
@CurrentPage.GetGridHtml("content", "fanoe")
@section Form{
@Html.Action("Index", "LeafInput")
}
+125
View File
@@ -0,0 +1,125 @@
@inherits UmbracoViewPage<WebCms.Models.LeafInputCreate>
<div class="container">
<div class="row">
<div class="col-md-7 well">
@Html.Partial("_ValidationSummary")
<!-- The file upload form used as target for the file upload widget -->
<form id="fileupload" action="/Backload/FileHandler" method="POST" enctype="multipart/form-data">
<label class="control-label">Files</label>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="col-lg-5">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-default fileinput-button">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple>
</span>
<button type="button" class="btn btn-default delete">
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</button>
<input type="checkbox" class="toggle">
<!-- The global file processing state -->
<span class="fileupload-process"></span>
</div>
<!-- The global progress state -->
<div class="col-lg-7 fileupload-progress fade">
<!-- The global progress bar -->
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-success" style="width: 0%;"></div>
</div>
<!-- The extended global progress state -->
@*<div class="progress-extended">&nbsp;</div>*@
</div>
</div>
@Html.Partial("_ValidationField", "Files")
<!-- The table listing the files available for upload/download -->
<table role="presentation" class="table table-striped panel panel-default"><tbody class="files"></tbody></table>
</form>
@using (Html.BeginForm("Index", "LeafInput", FormMethod.Post))
{
//@Html.EditorFor(m => m.PhotosynthesisType)
@Html.EditorFor(m => m.Identifier)
@Html.EditorFor(m => m.SiteId)
@Html.EditorFor(m => m.Name)
@Html.EditorFor(m => m.Email)
@Html.EditorFor(m => m.EmailConfirm)
<input type="submit" id="submit-form" class="hidden" />}
<label for="submit-form" class="btn btn-primary pull-right">Submit...</label>
</div>
</div>
</div>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td>
<p class="name">{%=file.name%}</p>
<strong class="error text-danger"></strong>
</td>
<td>
<p class="size">Processing...</p>
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
<div class="progress-bar progress-bar-success" style="width:0%;"></div>
</div>
</td>
<td>
{% if (!i && !o.options.autoUpload) { %}
<button class="btn btn-xs btn-primary start" disabled>
<i class="glyphicon glyphicon-upload"></i>
<span>Start</span>
</button>
{% } %}
{% if (!i) { %}
<button class="btn btn-xs btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade">
<td>
<p class="name">
{% if (file.url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}">{%=file.name%}</a>
{% } else { %}
<span>{%=file.name%}</span>
{% } %}
</p>
{% if (file.error) { %}
<div><span class="label label-danger">Error</span> {%=file.error%}</div>
{% } %}
</td>
<td>
<span class="size">{%=o.formatFileSize(file.size)%}</span>
</td>
<td>
{% if (file.deleteUrl) { %}
<button class="btn btn-xs btn-default delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}" {% if (file.deletewithcredentials) { %} data-xhr-fields='{"withCredentials":true}' {% } %}>
<i class="glyphicon glyphicon-trash"></i>
<span>Delete</span>
</button>
<input type="checkbox" name="delete" value="1" class="toggle">
{% } else { %}
<button class="btn btn-xs btn-warning cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>Cancel</span>
</button>
{% } %}
</td>
</tr>
{% } %}
</script>
+78
View File
@@ -0,0 +1,78 @@
@inherits UmbracoTemplatePage
@{
Layout = null;
var home = @CurrentPage.Site();
}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta tags -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="@CurrentPage.siteDescription">
<title>@CurrentPage.Name | @CurrentPage._siteTitle</title>
<!-- Fonts -->
<link href="//fonts.googleapis.com/css?family=Merriweather:400,700,300,900" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet" type="text/css">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/css/site.css">
<link rel="stylesheet" type="text/css" href="/css/style.css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="//oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<div class="container">
<div class="row">
<div class="col-xs-8 col-sm-12 col-md-4">
<a href="@home.Url">
<div class="brand" style="background-image:url('@(home.SiteLogo)?height=65&width=205&bgcolor=000')"></div>
</a>
</div>
<div class="col-sm-12 col-md-8">
<nav>
@{ Html.RenderPartial("MainNavigation"); }
</nav>
</div>
</div>
</div>
<div id="toggle" class="toggle">
<a href="#" class="cross"><span></span></a>
</div>
</header>
@RenderBody()
@RenderSection("Form", false)
<footer class="field dark">
<div class="container">
<div class="row">
@*@{ Html.RenderPartial("BottomNavigation"); }*@
</div>
</div>
</footer>
<!-- Javascripts -->
<script src="/js/jquery.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/scripts/site.js"></script>
</body>
</html>
@@ -0,0 +1,50 @@
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
var home = CurrentPage.Site();
}
@if (home.Children.Where("Visible").Any())
{
@* For each child page under the home node, where the property umbracoNaviHide is not True *@
foreach (var childPage in home.Children.Where("Visible"))
{
<div class="col-xs-6 col-sm-3">
@if (childPage.Children.Where("Visible").Any())
{
<strong>@childPage.Name</strong>
@childPages(childPage.Children)
}
</div>
}
}
<div class="col-xs-6 col-sm-3">
<strong>Find us</strong>
<ul>
<li>
<a href="https://twitter.com/umbracoproject" target="_blank">Twitter</a>
</li>
<li>
<a href="https://www.facebook.com/Umbraco" target="_blank">Facebook</a>
</li>
<li>
<a href="http://umbraco.com/?utm_source=core&utm_medium=starterkit&utm_content=topic-link&utm_campaign=fanoe" target="_blank">Umbraco.com</a>
</li>
</ul>
</div>
@helper childPages(dynamic pages)
{
@* Ensure that we have a collection of pages *@
if (pages.Any())
{
<ul>
@foreach (var page in pages.Where("Visible"))
{
<li>
<a href="@page.Url">@page.Name</a>
</li>
}
</ul>
}
}
@@ -0,0 +1,80 @@
@inherits UmbracoViewPage<dynamic>
@using Umbraco.Web.Templates
@using Newtonsoft.Json.Linq
@if (Model != null && Model.sections != null)
{
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
<div class="umb-grid">
@if (oneColumn)
{
foreach (var section in Model.sections) {
<div class="grid-section">
@foreach (var row in section.rows) {
@renderRow(row, true);
}
</div>
}
}else {
<div class="container">
<div class="row clearfix">
@foreach (var s in Model.sections) {
<div class="grid-section">
<div class="@("span" + s.grid) column">
@foreach (var row in s.rows) {
@renderRow(row, false);
}
</div>
</div>
}
</div>
</div>
}
</div>
}
@helper renderRow(dynamic row, bool singleColumn){
<div @RenderElementAttributes(row)>
@Umbraco.If(singleColumn, "<div class='container'>")
<div class="row clearfix">
@foreach ( var area in row.areas ) {
<div class="@("span" + area.grid) column">
<div @RenderElementAttributes(area)>
@foreach (var control in area.controls) {
if (control !=null && control.editor != null && control.editor.view != null ) {
<text>@Html.Partial("grid/editors/base", (object)control)</text>
}
}
</div>
</div>}
</div>
@Umbraco.If(singleColumn, "</div>")
</div>
}
@functions {
public static MvcHtmlString RenderElementAttributes(dynamic contentItem)
{
var attrs = new List<string>();
JObject cfg = contentItem.config;
if(cfg != null)
foreach (JProperty property in cfg.Properties()) {
attrs.Add(property.Name + "='" + property.Value.ToString() + "'");
}
JObject style = contentItem.styles;
if (style != null) {
var cssVals = new List<string>();
foreach (JProperty property in style.Properties())
cssVals.Add(property.Name + ":" + property.Value.ToString() + ";");
if (cssVals.Any())
attrs.Add("style='" + string.Join(" ", cssVals) + "'");
}
return new MvcHtmlString(string.Join(" ", attrs));
}
}
@@ -0,0 +1,80 @@
@inherits UmbracoViewPage<dynamic>
@using Umbraco.Web.Templates
@using Newtonsoft.Json.Linq
@if (Model != null && Model.sections != null)
{
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
<div class="umb-grid">
@if (oneColumn)
{
foreach (var section in Model.sections) {
<div class="grid-section">
@foreach (var row in section.rows) {
@renderRow(row, true);
}
</div>
}
}else {
<div class="container">
<div class="row clearfix">
@foreach (var s in Model.sections) {
<div class="grid-section">
<div class="col-md-@s.grid column">
@foreach (var row in s.rows) {
@renderRow(row, false);
}
</div>
</div>
}
</div>
</div>
}
</div>
}
@helper renderRow(dynamic row, bool singleColumn){
<div @RenderElementAttributes(row)>
@Umbraco.If(singleColumn, "<div class='container'>")
<div class="row clearfix">
@foreach ( var area in row.areas ) {
<div class="col-md-@area.grid column">
<div @RenderElementAttributes(area)>
@foreach (var control in area.controls) {
if (control !=null && control.editor != null && control.editor.view != null ) {
<text>@Html.Partial("grid/editors/base", (object)control)</text>
}
}
</div>
</div>}
</div>
@Umbraco.If(singleColumn, "</div>")
</div>
}
@functions {
public static MvcHtmlString RenderElementAttributes(dynamic contentItem)
{
var attrs = new List<string>();
JObject cfg = contentItem.config;
if(cfg != null)
foreach (JProperty property in cfg.Properties()) {
attrs.Add(property.Name + "='" + property.Value.ToString() + "'");
}
JObject style = contentItem.styles;
if (style != null) {
var cssVals = new List<string>();
foreach (JProperty property in style.Properties())
cssVals.Add(property.Name + ":" + property.Value.ToString() + ";");
if (cssVals.Any())
attrs.Add("style='" + string.Join(" ", cssVals) + "'");
}
return new MvcHtmlString(string.Join(" ", attrs));
}
}
@@ -0,0 +1,24 @@
@model dynamic
@using Umbraco.Web.Templates
@functions {
public static string EditorView(dynamic contentItem)
{
string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString();
view = view.ToLower().Replace(".html", ".cshtml");
if (!view.Contains("/")) {
view = "grid/editors/" + view;
}
return view;
}
}
@try
{
string editor = EditorView(Model);
<text>@Html.Partial(editor, (object)Model)</text>
}
catch (Exception ex) {
<pre>@ex.ToString()</pre>
}
@@ -0,0 +1,7 @@
@model dynamic
@using Umbraco.Web.Templates
<div class="video-wrapper">
@Html.Raw(Model.value)
</div>
@@ -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,23 @@
@model dynamic
@using Umbraco.Web.Templates
@if (Model.value != null)
{
var url = Model.value.image;
if(Model.editor.config != null && Model.editor.config.size != null){
url += "?width=" + Model.editor.config.size.width;
url += "&height=" + Model.editor.config.size.height;
if(Model.value.focalPoint != null){
url += "&center=" + Model.value.focalPoint.top +"," + Model.value.focalPoint.left;
url += "&mode=crop";
}
}
<img src="@url" alt="@Model.value.caption">
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>
}
+96
View File
@@ -0,0 +1,96 @@
@inherits UmbracoViewPage<dynamic>
@using Umbraco.Web.Templates
@using Newtonsoft.Json.Linq
@if (Model != null && Model.sections != null)
{
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
<div class="umb-grid">
@if (oneColumn)
{
foreach (var section in Model.sections)
{
<div class="grid-section">
@foreach (var row in section.rows)
{
@renderRow(row, true);
}
</div>
}
}
else
{
<div class="container">
<div class="row clearfix">
@foreach (var s in Model.sections)
{
<div class="grid-section">
<div class="col-md-@s.grid column">
@foreach (var row in s.rows)
{
@renderRow(row, false);
}
</div>
</div>
}
</div>
</div>
}
</div>
}
@helper renderRow(dynamic row, bool singleColumn)
{
<div @RenderElementAttributes(row)>
@Umbraco.If(singleColumn, "<div class='container'>")
<div class="row clearfix">
@foreach ( var area in row.areas ) {
<div class="col-md-@area.grid column">
<div @RenderElementAttributes(area)>
@foreach (var control in area.controls) {
if (control !=null && control.editor != null && control.editor.view != null ) {
<text>@Html.Partial("grid/editors/base", (object)control)</text>
}
}
</div>
</div>}
</div>
@Umbraco.If(singleColumn, "</div>")
</div>
}
@functions
{
public static MvcHtmlString RenderElementAttributes(dynamic contentItem)
{
var attrs = new List<string>();
JObject cfg = contentItem.config;
if(cfg != null)
{
foreach (JProperty property in cfg.Properties())
{
attrs.Add(property.Name + "='" + property.Value.ToString() + "'");
}
}
JObject style = contentItem.styles;
if (style != null)
{
var cssVals = new List<string>();
foreach (JProperty property in style.Properties())
{
cssVals.Add(property.Name + ":" + property.Value.ToString() + ";");
}
if (cssVals.Any())
{
attrs.Add("style='" + string.Join(" ", cssVals) + "'");
}
}
return new MvcHtmlString(string.Join(" ", attrs));
}
}
@@ -0,0 +1,61 @@
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{ var home = CurrentPage.Site(); }
@if (home.Children.Any())
{
@* Get the first page in the children *@
var naviLevel = home.Children.First().Level;
@* Add in level for a CSS hook *@
<ul class="level-@naviLevel">
@* For each child page under the home node *@
@foreach (var childPage in home.Children)
{
if (childPage.Children.Any())
{
<li class="has-child @(childPage.IsAncestorOrSelf(CurrentPage) ? "selected" : null)">
@if(childPage.DocumentTypeAlias == "LandingPage")
{
<span>@childPage.Name</span>
@childPages(childPage.Children)
} else {
<a href="@childPage.Url">@childPage.Name</a>
}
</li>
}
else
{
<li class="@(childPage.IsAncestorOrSelf(CurrentPage) ? "selected" : null)">
<a href="@childPage.Url">@childPage.Name</a>
</li>
}
}
</ul>
}
@helper childPages(dynamic pages)
{
@* Ensure that we have a collection of pages *@
if (pages.Any())
{
@* Get the first page in pages and get the level *@
var naviLevel = pages.First().Level;
@* Add in level for a CSS hook *@
<ul class="sublevel level-@(naviLevel)">
@foreach (var page in pages)
{
<li>
<a href="@page.Url">@page.Name</a>
@* if the current page has any children *@
@if (page.Children.Any())
{
@* Call our helper to display the children *@
@childPages(page.Children)
}
</li>
}
</ul>
}
}
@@ -0,0 +1,21 @@
@using WebCms.Utility
@model Boolean?
@{
var htmlAttributes = new RouteValueDictionary();
if (ViewBag.@class != null)
{
htmlAttributes.Add("class", ViewBag.@class);
}
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "" })
<div class="controls">
@Html.CheckBox(
"",
Model.HasValue && Model.Value,
htmlAttributes)
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
</div>
@@ -0,0 +1,20 @@
@using WebCms.Utility
@model DateTime?
@{
DateTime dt;
if (Model.HasValue)
{
dt = (DateTime)Model;
}
else
{
dt = DateTime.Now;
}
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " error has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.TextBoxFor(m => m, new { @class="form-control datepicker", data_provide="datepicker", data_date_language="globalize", data_date=dt, data_date_format=System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.ShortDatePattern.Replace("M", "m"), data_date_today_highlight="true", data_date_today_btn="false" })
@Html.ValidationMessageFor(m => m, null, new { @class="help-block" })
</div>
@@ -0,0 +1,13 @@
@using WebCms.Utility
@model decimal?
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
<div class="input-group">
<span class="input-group-addon">&euro;</span>@Html.TextBox(
"",
Model == null ? "" : String.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:F2}", ViewData.ModelMetadata.Model),
ViewBag.ClearTextField == true ? new { @class = "form-control clear-text-field input-block-level" } : new { @class = "form-control input-block-level" })</span>
</div>
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
@@ -0,0 +1,29 @@
@model object
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
@{
var htmlAttributes = new RouteValueDictionary();
if (ViewBag.@class != null)
{
htmlAttributes.Add("class", "form-control " + ViewBag.@class);
}
else
{
htmlAttributes.Add("class", "form-control");
}
if (ViewBag.@type != null)
{
htmlAttributes.Add("type", ViewBag.@type);
}
else
{
htmlAttributes.Add("type", "email");
}
if (ViewBag.placeholder != null)
{
htmlAttributes.Add("placeholder", ViewBag.placeholder);
}
}
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
@@ -0,0 +1,9 @@
@using WebCms.Utility
@model object
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
@Html.EnumDropDownListFor(m => m, new { @class = "form-control" })
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
@@ -0,0 +1,8 @@
@model HttpPostedFileBase
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
<span class="btn btn-default btn-file">
Browse <input type="file" name="@ViewData.ModelMetadata.PropertyName" class="btn-default btn-file" />
</span>
@@ -0,0 +1,30 @@
@using WebCms.Utility
@model int?
@{
var htmlAttributes = new RouteValueDictionary();
if (ViewBag.@class != null)
{
htmlAttributes.Add("class", "form-control " + ViewBag.@class);
}
else
{
htmlAttributes.Add("class", "form-control");
}
if (ViewBag.placeholder != null)
{
htmlAttributes.Add("placeholder", ViewBag.placeholder);
}
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
<div class="controls">
@Html.TextBox(
"",
ViewData.TemplateInfo.FormattedModelValue,
htmlAttributes)
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
</div>
@@ -0,0 +1,22 @@
@using WebCms.Utility
@model object
@{
string guidID = Guid.NewGuid().ToString();
}
<link rel="stylesheet" type="text/css" href="/Scripts/mdd_styles.css" />
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
<div class="mdd_toolbar"></div>
@Html.TextAreaFor(
m => m,
8, 15,
ViewBag.ClearTextField == true ? new { @class = "form-control mdd_editor clear-text-field", data_mdd_preview = "#" + guidID } : new { @class = "form-control mdd_editor", data_mdd_preview = "#" + guidID })
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
<br />
<label>Preview</label>
<hr />
<div class="mdd_preview" id="@guidID"></div>
<hr />
</div>
@@ -0,0 +1,13 @@
@using WebCms.Utility
@model object
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
<div class="controls">
@Html.TextAreaFor(
m => m,
8, 8,
ViewBag.ClearTextField == true ? new { @class = "form-control input-block-level clear-text-field" } : new { @class = "form-control input-block-level" } )
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
</div>
@@ -0,0 +1,26 @@
@using WebCms.Utility
@model object
@{
var htmlAttributes = new RouteValueDictionary();
if (ViewBag.@class != null)
{
htmlAttributes.Add("class", "form-control " + ViewBag.@class);
}
else
{
htmlAttributes.Add("class", "form-control");
}
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
<div class="controls">
@Html.Password(
"",
ViewData.TemplateInfo.FormattedModelValue,
htmlAttributes)
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
</div>
@@ -0,0 +1,18 @@
@model WebCms.Models.SelectListViewModel
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
@{
var prefix = ViewData.TemplateInfo.HtmlFieldPrefix;
ViewData.TemplateInfo.HtmlFieldPrefix = string.Empty;
foreach (var li in Model.ListItems)
{
<div class="radio">
<label class="radio">
@Html.RadioButton(prefix + ".Selected", li.Value, li.Selected) @li.Text
</label>
</div>
}
ViewData.TemplateInfo.HtmlFieldPrefix = prefix;
}
@@ -0,0 +1,17 @@
@using WebCms.Utility
@model float?
@{
float f;
f = !Model.HasValue ? 0.0f : Model.Value;
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
<div class="input-group">
@Html.TextBox(
"", f,
ViewBag.ClearTextField == true ? new { @class = "form-control clear-text-field input-block-level" } : new { @class = "form-control input-block-level" })<span class="input-group-addon">0,00</span>
</div>
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
@@ -0,0 +1,25 @@
@model object
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
@{
var htmlAttributes = new RouteValueDictionary();
if (ViewBag.@class != null)
{
htmlAttributes.Add("class", "form-control " + ViewBag.@class);
}
else
{
htmlAttributes.Add("class", "form-control");
}
if (ViewBag.@type != null)
{
htmlAttributes.Add("type", ViewBag.@type);
}
if (ViewBag.placeholder != null)
{
htmlAttributes.Add("placeholder", ViewBag.placeholder);
}
}
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
@@ -0,0 +1,13 @@
@using WebCms.Utility
@model object
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
<div class="controls">
@Html.TextBox(
"",
ViewData.TemplateInfo.FormattedModelValue,
ViewBag.ClearTextField == true ? new { @class = "form-control clear-text-field input-block-level" } : new { @class = "form-control input-block-level" } )
@Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
</div>
</div>
@@ -0,0 +1,23 @@
@using WebCms.Utility
@model TimeSpan?
@{
TimeSpan ts;
if (Model == null)
{
ts = TimeSpan.FromMinutes(10);
}
else
{
ts = Model.Value;
}
}
<div class="form-group@(Html.ValidationErrorFor(m => m, " has-error"))">
@Html.LabelFor(m => m, new { @class = "control-label" })
<div class="controls">
@Html.TextBoxFor(m => m, "hh\\:mm", new { @Value = ts.ToString("hh\\:mm"), @class="form-control timepicker", data_provide="timepicker", data_minute_step="5", data_show_meridian="false", data_disable_focus="true", data_template = "dropdown", data_default_time="value" })
@Html.ValidationMessageFor(m => m, null, new { @class="help-block" })
</div>
</div>
@@ -0,0 +1,51 @@
@model object
@{
Layout = null;
var propertyName = ViewData.ModelMetadata.PropertyName;
var lowerPropertyName = @LeafWeb.Core.Utility.StringExtensions.LowercaseFirst(propertyName);
var values = ViewData.ModelMetadata.AdditionalValues;
var units = values.ContainsKey("Units") ? (string)values["Units"] : null;
var currency = values.ContainsKey("Currency") ? (string)values["Currency"] : null;
var formatHint = values.ContainsKey("FormatHint") ? (string)values["FormatHint"] : null;
var editLabel = values.ContainsKey("EditLabel") ? (bool)values["EditLabel"] : true;
var hasError = ViewData.ModelState[propertyName] != null && ViewData.ModelState[propertyName].Errors.Any();
var hasErrorClass = hasError ? "has-error" : string.Empty;
}
<div class="form-group @lowerPropertyName @hasErrorClass">
@Html.LabelForModel(new { @class = "control-label" })
@RenderBody()
@Html.ValidationMessage("", new { @class = "help-block"})
</div>
@*<div class="form-group @lowerPropertyName">
@if (editLabel)
{
@Html.LabelForModel()
}
<div class="input-group">
@if (!string.IsNullOrEmpty(units))
{
<div class="input-append">
@RenderBody()
<span class="add-on">@units</span>
</div>
}
else if (!string.IsNullOrEmpty(currency))
{
<div class="input-prepend">
<span class="add-on">@currency</span>
@RenderBody()
</div>
}
else
{
@RenderBody()
}
@if (!string.IsNullOrEmpty(formatHint))
{
<div><small><em>@formatHint</em></small></div>
}
<span class="help-block">@Html.ValidationMessage("")</span>
</div>
</div>*@
+14
View File
@@ -0,0 +1,14 @@
@if (TempData.ContainsKey("StatusMessage"))
{
<p class="center-content alert @Html.Raw(TempData["StatusMessage-Type"])">
<button type="button" class="close" data-dismiss="alert">&times;</button>
@Html.Raw(TempData["StatusMessage"])
</p>
}
else if (ViewBag.StatusMessage != null)
{
<p class="center-content alert">
<button type="button" class="close" data-dismiss="alert">&times;</button>
@ViewBag.StatusMessage
</p>
}
@@ -0,0 +1,13 @@
@model string
@{
var fieldName = Model;
}
@if (ViewData.ModelState[fieldName] != null && ViewData.ModelState[fieldName].Errors.Any())
{
<span class="help-block field-validation-error">
@foreach (var error in ViewData.ModelState[fieldName].Errors)
{
<span id="@fieldName-error" class="text-danger">@error.ErrorMessage</span>
}
</span>
}
@@ -0,0 +1,7 @@
@if (ViewData.ModelState[""] != null && ViewData.ModelState[""].Errors.Any())
{
<div class="alert bg-danger">
<a class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></a>
@Html.ValidationSummary(true)
</div>
}
+6
View File
@@ -0,0 +1,6 @@
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "Master.cshtml";
}
@CurrentPage.GetGridHtml("content", "fanoe")
+56
View File
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="Umbraco.Web" />
<add namespace="Umbraco.Core" />
<add namespace="Umbraco.Core.Models" />
<add namespace="Umbraco.Web.Mvc" />
<add namespace="umbraco" />
<add namespace="Examine" />
<add namespace="Umbraco.Web.PublishedContentModels" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler" />
</httpHandlers>
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<pages validateRequest="false" pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="BlockViewHandler" />
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>