forked from Sitefinity/mvc-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Sitefinity#36 from Sitefinity/view-precompilation
View precompilation
- Loading branch information
Showing
85 changed files
with
4,247 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
6 changes: 6 additions & 0 deletions
6
Precompilation/BootstrapPackage/BootstrapPackage.sln.GhostDoc.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
371 changes: 371 additions & 0 deletions
371
Precompilation/BootstrapPackage/BootstrapPackage/BootstrapPackage.csproj
Large diffs are not rendered by default.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...e/BootstrapPackage/MVC/Views/AccountActivation/AccountActivation.AccountActivation.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
24 changes: 24 additions & 0 deletions
24
Precompilation/BootstrapPackage/BootstrapPackage/MVC/Views/Blog/Detail.DetailPage.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
49 changes: 49 additions & 0 deletions
49
Precompilation/BootstrapPackage/BootstrapPackage/MVC/Views/Blog/List.BlogList.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
29 changes: 29 additions & 0 deletions
29
Precompilation/BootstrapPackage/BootstrapPackage/MVC/Views/BlogPost/Detail.DetailPage.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
46 changes: 46 additions & 0 deletions
46
Precompilation/BootstrapPackage/BootstrapPackage/MVC/Views/BlogPost/List.BlogPostList.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
17 changes: 17 additions & 0 deletions
17
Precompilation/BootstrapPackage/BootstrapPackage/MVC/Views/Breadcrumb/Breadcrumb.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
54 changes: 54 additions & 0 deletions
54
...rapPackage/BootstrapPackage/MVC/Views/ChangePassword/ChangePassword.ChangePassword.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
6 changes: 6 additions & 0 deletions
6
...mpilation/BootstrapPackage/BootstrapPackage/MVC/Views/CheckboxesField/Read.Default.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
46 changes: 46 additions & 0 deletions
46
...pilation/BootstrapPackage/BootstrapPackage/MVC/Views/CheckboxesField/Write.Default.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
42 changes: 42 additions & 0 deletions
42
...n/BootstrapPackage/BootstrapPackage/MVC/Views/CheckboxesField/Write.Default_Inline.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.