Cleaning up the MenuPart editor template and MenuPart a little

- changing MenuPart's AddToMainMenu property to OnMainMenu (action vs. state)
- shuffling elements around in the editor template and changing some fo the text

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-02-12 02:04:51 -08:00
parent f63f3ee501
commit f1e5f0f179
4 changed files with 9 additions and 9 deletions

View File

@@ -7,9 +7,9 @@ namespace Orchard.Core.Navigation.Models {
[HiddenInput(DisplayValue = false)]
public int Id { get { return ContentItem.Id; } }
public bool AddToMainMenu {
get { return Record.AddToMainMenu; }
set { Record.AddToMainMenu = value; }
public bool OnMainMenu {
get { return Record.OnMainMenu; }
set { Record.OnMainMenu = value; }
}
public string MenuText {

View File

@@ -14,7 +14,7 @@ namespace Orchard.Core.Navigation.Models {
Filters.Add(StorageFilter.For(menuPartRepository));
OnActivated<MenuPart>((ctx, x) => {
x.AddToMainMenu = false;
x.OnMainMenu = false;
x.MenuText = String.Empty;
});
}

View File

@@ -4,6 +4,6 @@ namespace Orchard.Core.Navigation.Records {
public class MenuPartRecord : ContentPartRecord {
public virtual string MenuText { get; set; }
public virtual string MenuPosition { get; set; }
public virtual bool AddToMainMenu { get; set; }
public virtual bool OnMainMenu { get; set; }
}
}

View File

@@ -1,9 +1,9 @@
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MenuPart>" %>
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<MenuPart>" %>
<%@ Import Namespace="Orchard.Core.Navigation.Models"%>
<%@ Import Namespace="Orchard.Core.Navigation.ViewModels"%>
<fieldset>
<%=Html.LabelFor(m => m.AddToMainMenu) %>
<%=Html.EditorFor(m => m.AddToMainMenu) %>
<%=Html.LabelFor(m => m.MenuText) %>
<%=Html.EditorFor(m => m.OnMainMenu) %>
<label for="OnMainMenu" class="forcheckbox"><%=_Encoded("Add to the main menu") %></label>
<label for="MenuText"><%=_Encoded("Menu text") %></label>
<%=Html.TextBoxFor(m => m.MenuText, new { @class = "large text" })%>
</fieldset>