Skip to content

Commit

Permalink
Pull widget title from the model
Browse files Browse the repository at this point in the history
  • Loading branch information
rxtur committed Feb 8, 2016
1 parent e44a1b3 commit 4dcef22
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion BlogEngine/BlogEngine.NET/AppCode/Controls/WidgetZone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected override void OnLoad(EventArgs e)
widget.InnerText);
try
{
var model = new { Id = widget.Attributes["id"].Value, Title = widget.Attributes["title"].Value };
var model = new { Id = widget.Attributes["id"].Value, Name = widget.InnerText, Title = widget.Attributes["title"].Value };
var lit = new Literal { Text = RazorHelpers.ParseRazor(fileName, model) };
Controls.Add(lit);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using BlogEngine.Core
@{
var title = "Administration";
var title = Model.Title;
var dashboardUrl = Utils.RelativeWebRoot + "admin/index.cshtml";
var contentUrl = Utils.RelativeWebRoot + "admin/#/content/posts";
var customUrl = Utils.RelativeWebRoot + "admin/#/custom/themes";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using BlogEngine.Core
@using BlogEngine.Core.Data.Services
@{
var title = "Author List";
var title = Model.Title;
var authorUrl = Utils.RelativeWebRoot + "author";
var authorRss = Utils.RelativeWebRoot + "syndication.axd";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using BlogEngine.Core
@{
var title = "Blog List";
var title = Model.Title;
var blogs = Blog.Blogs.Where(b => b.IsActive).ToList();
}
<div class="widget bloglist">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using BlogEngine.Core
@{
var title = "Category list";
var title = Model.Title;
var dic = BlogEngine.Core.Helpers.CategoryHelper.SortCategories();
}
<div class="widget categorylist">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using BlogEngine.Core
@{
var title = "Page List";
var title = Model.Title;
}
<div class="widget pagelist">
<h4 class="widget-header">@title</h4>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using BlogEngine.Core.Helpers
@using BlogEngine.Core
@{
var title = "Post List";
var title = Model.Title;
var id = Model.Id;
var settings = WidgetHelper.GetSettings(id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@using BlogEngine.Core.Helpers
@using System.Text.RegularExpressions
@{
var title = Model.Title;
var numberOfComments = 10;
var settings = WidgetHelper.GetSettings(Model.Id);
if (settings != null && settings.Count > 0)
Expand All @@ -24,7 +25,7 @@
}
</style>
<div class="widget recentcomments">
<h4 class="widget-header">Recent comments</h4>
<h4 class="widget-header">@title</h4>
<div class="widget-content">
<ul id="recentComments" class="recentcomments">
@if (list.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
var title = "Tag cloud";
var title = Model.Title;
var cloud = new BlogEngine.Core.Data.Services.TagCloud();
var tags = cloud.Links();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
var customSrc = SiteVars.ApplicationRelativeWebRoot + "Custom/Widgets/" + name + "/edit.cshtml";
$scope.editId = id;
$scope.editTitle = title;
$("#txtWidgetTitle").val(title);
$.ajax({
type: 'HEAD',
url: customSrc,
Expand Down

0 comments on commit 4dcef22

Please sign in to comment.