Skip to content

Commit

Permalink
Merge pull request Sitefinity#36 from Sitefinity/view-precompilation
Browse files Browse the repository at this point in the history
View precompilation
  • Loading branch information
Tihomir-Petrov committed Jan 11, 2016
2 parents e27a212 + a3f7568 commit 318fa64
Show file tree
Hide file tree
Showing 85 changed files with 4,247 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Precompilation/BootstrapPackage/BootstrapPackage.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapPackage", "BootstrapPackage\BootstrapPackage.csproj", "{89D8452D-9CED-47D1-9674-4C5EEC5DF7F0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{89D8452D-9CED-47D1-9674-4C5EEC5DF7F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89D8452D-9CED-47D1-9674-4C5EEC5DF7F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89D8452D-9CED-47D1-9674-4C5EEC5DF7F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89D8452D-9CED-47D1-9674-4C5EEC5DF7F0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<GhostDoc>
<IgnoreFilePatterns>
<IgnoreFilePattern>*.min.js</IgnoreFilePattern>
<IgnoreFilePattern>jquery*.js</IgnoreFilePattern>
</IgnoreFilePatterns>
</GhostDoc>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@model Telerik.Sitefinity.Frontend.Identity.Mvc.Models.AccountActivation.AccountActivationViewModel

@using Telerik.Sitefinity.Frontend.Mvc.Helpers

<div class="@Model.CssClass">
@if (Model.Activated)
{
<h3>@Html.Resource("AccountActivationSuccess")</h3>

<a href="@Model.ProfilePageUrl">@Html.Resource("ProfilePageUrlTitle")</a>
}
else if (Model.AttemptedActivation)
{
<h3>@Html.Resource("AccountActivationFail")</h3>
}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@model Telerik.Sitefinity.Frontend.Blogs.Mvc.Models.Blog.BlogDetailsViewModel

@using Telerik.Sitefinity;
@using Telerik.Sitefinity.Frontend.Blogs.Mvc.Helpers;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Web.DataResolving;

<div class="@Model.CssClass" @Html.InlineEditingAttributes(Model.ProviderName, Model.ContentType.FullName, (Guid)Model.Item.Fields.Id)>
<h3>
<span @Html.InlineEditingFieldAttributes("Title", "ShortText")>@Model.Item.Fields.Title</span>
</h3>

<p class="text-muted">@string.Format(Html.Resource("PostsCount"), Model.PostsCount)</p>
@{
var lastPostDate = Model.Item.GetLastPostDate();
if (lastPostDate!=null && lastPostDate.HasValue)
{
<p class="text-muted">@Html.Resource("LastPost") : @lastPostDate.Value.ToShortDateString() </p>
}
}

<div @Html.InlineEditingFieldAttributes("Description", "LongText")>@Html.Raw(Model.Item.Fields.Description)</div>

</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@model Telerik.Sitefinity.Frontend.Mvc.Models.ContentListViewModel

@using Telerik.Sitefinity;
@using Telerik.Sitefinity.Frontend.Blogs.Mvc.Helpers;
@using Telerik.Sitefinity.Frontend.Blogs.Mvc.Models.Blog;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Modules.Pages;

@Html.Script(ScriptRef.JQuery, "top", false)

<div class="@Model.CssClass">

<ul class="list-unstyled">
@foreach (var item in Model.Items)
{
var detailPageUrl = DetailLocationHyperLinkHelper.GetDetailPageUrl(item, ViewBag.DetailsPageId, ViewBag.DetailPageMode);
<li @Html.InlineEditingAttributes(Model.ProviderName, Model.ContentType.FullName, (Guid)item.Fields.Id)>
<h3>
@if (!string.IsNullOrEmpty(detailPageUrl))
{
<a @Html.InlineEditingFieldAttributes("Title", "ShortText") href="@detailPageUrl">@item.Fields.Title</a>
}
else{
<span @Html.InlineEditingFieldAttributes("Title", "ShortText")>@item.Fields.Title</span>
}
</h3>

@{
var lastPostDate = item.GetLastPostDate();
if (lastPostDate != null && lastPostDate.HasValue)
{
<p class="text-muted">@Html.Resource("LastPost") : @lastPostDate.Value.ToShortDateString()</p>
}
}

</li>
}
</ul>

@if (Model.ShowPager)
{
@Html.Action("Index", "ContentPager", new
{
currentPage = Model.CurrentPage,
totalPagesCount = Model.TotalPagesCount.Value,
redirectUrlTemplate = ViewBag.RedirectPageUrlTemplate
})
}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@model Telerik.Sitefinity.Frontend.Mvc.Models.ContentDetailsViewModel

@using Telerik.Sitefinity;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Web.DataResolving;

<div class="@Model.CssClass" @Html.InlineEditingAttributes(Model.ProviderName, Model.ContentType.FullName, (Guid)Model.Item.Fields.Id)>
<h3>
<span @Html.InlineEditingFieldAttributes("Title", "ShortText")>@Model.Item.Fields.Title</span>
</h3>

<div class="text-muted">
@Model.Item.GetDateTime("PublicationDate", "MMM d, yyyy, HH:mm tt")
@Html.Resource("By")
@DataResolver.Resolve(@Model.Item.DataItem, "Author", null)
@Html.CommentsCount(string.Empty, @Model.Item.DataItem)
</div>

<div @Html.InlineEditingFieldAttributes("Summary", "LongText")>@Html.Raw(Model.Item.Fields.Summary)</div>

<div @Html.InlineEditingFieldAttributes("Content", "LongText")>@Html.Raw(Model.Item.Fields.Content)</div>

@if (Model.EnableSocialSharing)
{
@Html.SocialShareOptions()
}

@Html.CommentsList(@Model.Item.DataItem)
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@model Telerik.Sitefinity.Frontend.Mvc.Models.ContentListViewModel

@using Telerik.Sitefinity;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Modules.Pages;
@using Telerik.Sitefinity.Web.DataResolving;

@Html.Script(ScriptRef.JQuery, "top", false)

<div class="@Model.CssClass">
<ul class="list-unstyled">

@foreach (var item in Model.Items)
{
var navigateUrl = HyperLinkHelpers.GetDetailPageUrl(item, ViewBag.DetailsPageId, ViewBag.OpenInSamePage);

<li @Html.InlineEditingAttributes(Model.ProviderName, Model.ContentType.FullName, (Guid)item.Fields.Id)>
<h3>
<a @Html.InlineEditingFieldAttributes("Title", "ShortText") href="@navigateUrl">@item.Fields.Title</a>
</h3>


<div class="text-muted">
@item.GetDateTime("PublicationDate", "MMM d, yyyy, HH:mm tt")
@Html.Resource("By")
@DataResolver.Resolve(item.DataItem, "Author", null)
@Html.CommentsCount((string)navigateUrl, item.DataItem)
</div>

<div @Html.InlineEditingFieldAttributes("Summary", "ShortText")>@Html.Raw(item.Fields.Summary)</div>

<a href="@navigateUrl">@Html.Resource("FullStory")</a>
</li>
}
</ul>

@if (Model.ShowPager)
{
@Html.Action("Index", "ContentPager", new
{
currentPage = Model.CurrentPage,
totalPagesCount = Model.TotalPagesCount.Value,
redirectUrlTemplate = ViewBag.RedirectPageUrlTemplate
})
}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="@Model.CssClass">
<ul class="sf-breadscrumb breadcrumb">
@for (int i = 0; i < Model.SiteMapNodes.Count; i++)
{
var node = Model.SiteMapNodes[i];

if (i == Model.SiteMapNodes.Count - 1 && Model.ShowCurrentPageInTheEnd)
{
<li class="active">@node.Title</li>
}
else
{
<li><a href="@node.Url">@node.Title </a></li>
}
}
</ul>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
@model Telerik.Sitefinity.Frontend.Identity.Mvc.Models.ChangePassword.ChangePasswordViewModel

@using Telerik.Sitefinity.UI.MVC;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers

<div class="@Model.CssClass">
@if (Model.PasswordChanged)
{
<h3>@Html.Resource("ChangePasswordSuccess")</h3>
}
else
{
<h3>@Html.Resource("ChangePasswordHeader")</h3>

using (Html.BeginFormSitefinity("SetChangePassword", "ChangePassword"))
{
if (!string.IsNullOrEmpty(Model.Error))
{

<div class="alert alert-danger">
@Model.Error
</div>

}

<div class="form-group">
<label>
@Html.Resource("ChangePasswordOldPassword")
</label>
@Html.PasswordFor(u => u.OldPassword, new { @class = "form-control" })

</div>
<div class="form-group">
<label>
@Html.Resource("ChangePasswordNewPassword")
</label>

@Html.PasswordFor(u => u.NewPassword, new { @class = "form-control" })

</div>
<div class="form-group">
<label>
@Html.Resource("ChangePasswordRepeatPassword")
</label>

@Html.PasswordFor(u => u.RepeatPassword, new { @class = "form-control" })

</div>

<button type="submit" class="btn btn-default">@Html.Resource("ChangePasswordSaveButton")</button>
}
}
</div>

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@model Telerik.Sitefinity.Frontend.Forms.Mvc.Models.Fields.MultipleChoiceField.MultipleChoiceFieldViewModel

<div class="@Model.CssClass" data-sf-role="text-field-container">
<label>@Model.MetaField.Title</label>
<p class="text-muted">@Model.Value</p>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@model Telerik.Sitefinity.Frontend.Forms.Mvc.Models.Fields.CheckboxesField.CheckboxesFieldViewModel

@using Telerik.Sitefinity.UI.MVC;
@using Telerik.Sitefinity.Frontend.Forms.Mvc.Helpers;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Modules.Pages;

@Html.Script(ScriptRef.JQuery, "top", false)

@{
var fieldName = Model.MetaField.FieldName;
var requiredAttributes = MvcHtmlString.Create(Model.ValidationAttributes);
}

<div class="@Model.CssClass" data-sf-role="checkboxes-field-container">
<input type="hidden" data-sf-role="violation-messages" value='{ "required": "@Model.RequiredViolationMessage"}' />
<input type="hidden" data-sf-role="required-validator" value='@Model.IsRequired.ToString()' />

<strong>@Model.MetaField.Title</strong>
<p class="text-muted">@Model.MetaField.Description</p>

@foreach (var choice in Model.Choices)
{
var selctedAttributes = !Model.IsRequired && !string.IsNullOrEmpty(Model.MetaField.DefaultValue) && Model.MetaField.DefaultValue.Contains(choice as string) ? "checked" : string.Empty;
<div class="checkbox">
<label>
<input type="checkbox" name="@fieldName" value="@choice" data-sf-role="checkboxes-field-input" @selctedAttributes />
@choice
</label>
</div>
}

@if(Model.HasOtherChoice)
{
<div class="checkbox">
<label>
<input type="checkbox" name="@fieldName" data-sf-checkboxes-role="other-choice-checkbox" data-sf-role="checkboxes-field-input"/>
@Html.Resource("Other")
<input type="hidden" data-sf-checkboxes-role="other-choice-text" />
</label>
</div>
}

</div>

@Html.Script(Url.WidgetContent("Mvc/Scripts/CheckboxesField/checkboxes-field.js"), "bottom", false)
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
@model Telerik.Sitefinity.Frontend.Forms.Mvc.Models.Fields.CheckboxesField.CheckboxesFieldViewModel

@using Telerik.Sitefinity.UI.MVC;
@using Telerik.Sitefinity.Frontend.Forms.Mvc.Helpers;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Modules.Pages;

@Html.Script(ScriptRef.JQuery, "top", false)

@{
var fieldName = Model.MetaField.FieldName;
var requiredAttributes = MvcHtmlString.Create(Model.ValidationAttributes);
}

<div class="@Model.CssClass" data-sf-role="checkboxes-field-container">
<input type="hidden" data-sf-role="violation-messages" value='{ "required": "@Model.RequiredViolationMessage"}' />
<input type="hidden" data-sf-role="required-validator" value='@Model.IsRequired.ToString()' />

<strong> @Model.MetaField.Title</strong>
<p class="text-muted">@Model.MetaField.Description</p>

@foreach (var choice in Model.Choices)
{
var selctedAttributes = !Model.IsRequired && !string.IsNullOrEmpty(Model.MetaField.DefaultValue) && Model.MetaField.DefaultValue.Contains(choice as string) ? "checked" : string.Empty;
<label class="checkbox-inline">
<input type="checkbox" name="@fieldName" value="@choice" data-sf-role="checkboxes-field-input" @selctedAttributes />
@choice
</label>
}

@if(Model.HasOtherChoice)
{
<label class="checkbox-inline">
<input type="checkbox" name="@fieldName" data-sf-checkboxes-role="other-choice-checkbox" data-sf-role="checkboxes-field-input"/>
@Html.Resource("Other")
<input type="hidden" data-sf-checkboxes-role="other-choice-text" data-sf-role="checkboxes-field-input" />
</label>
}

</div>

@Html.Script(Url.WidgetContent("Mvc/Scripts/CheckboxesField/checkboxes-field.js"), "bottom", false)
Loading

0 comments on commit 318fa64

Please sign in to comment.