mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
committed by
Sébastien Ros
parent
ed94ba11e7
commit
37e8696fe0
@@ -1,5 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Orchard.ContentManagement.MetaData;
|
using Orchard.ContentManagement.MetaData;
|
||||||
|
|
||||||
namespace Orchard.ContentTypes.ViewModels {
|
namespace Orchard.ContentTypes.ViewModels {
|
||||||
@@ -11,19 +10,16 @@ namespace Orchard.ContentTypes.ViewModels {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The technical name of the field
|
/// The technical name of the field
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The display name of the field
|
/// The display name of the field
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
|
||||||
public string DisplayName { get; set; }
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The selected field type
|
/// The selected field type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
|
||||||
public string FieldTypeName { get; set; }
|
public string FieldTypeName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Orchard.ContentManagement.MetaData;
|
using Orchard.ContentManagement.MetaData;
|
||||||
|
|
||||||
namespace Orchard.ContentTypes.ViewModels {
|
namespace Orchard.ContentTypes.ViewModels {
|
||||||
@@ -12,7 +11,6 @@ namespace Orchard.ContentTypes.ViewModels {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The display name of the field
|
/// The display name of the field
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
|
||||||
public string DisplayName { get; set; }
|
public string DisplayName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,17 +4,19 @@
|
|||||||
Style.Require("ContentTypesAdmin");
|
Style.Require("ContentTypesAdmin");
|
||||||
|
|
||||||
Layout.Title = T("Add New Field To \"{0}\"", Model.Part.DisplayName).ToString();
|
Layout.Title = T("Add New Field To \"{0}\"", Model.Part.DisplayName).ToString();
|
||||||
|
|
||||||
|
var returnUrl = Request.QueryString["returnUrl"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@using (Html.BeginFormAntiForgeryPost()) {
|
@using (Html.BeginFormAntiForgeryPost()) {
|
||||||
@Html.ValidationSummary()
|
@Html.ValidationSummary()
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="DisplayName">@T("Display Name")</label>
|
<label for="DisplayName" class="required">@T("Display Name")</label>
|
||||||
@Html.TextBoxFor(m => m.DisplayName, new {@class = "text medium", autofocus = "autofocus"})
|
@Html.TextBoxFor(m => m.DisplayName, new {@class = "text medium", autofocus = "autofocus"})
|
||||||
<span class="hint">@T("Name of the field as it will be displayed in screens.")</span>
|
<span class="hint">@T("Name of the field as it will be displayed in screens.")</span>
|
||||||
<label for="Name">@T("Technical Name")</label>
|
<label for="Name" class="required">@T("Technical Name")</label>
|
||||||
@Html.TextBoxFor(m => m.Name, new {@class = "text"})
|
@Html.TextBoxFor(m => m.Name, new {@class = "text"})
|
||||||
<span class="hint">@T("Technical name of the field.")</span>
|
<span class="hint">@T("Technical name of the field.")</span>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="FieldTypeName">@T("Field Type")</label>
|
<label for="FieldTypeName">@T("Field Type")</label>
|
||||||
@@ -22,6 +24,9 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<button class="primaryAction" type="submit">@T("Save")</button>
|
<button class="primaryAction" type="submit">@T("Save")</button>
|
||||||
|
@if (!String.IsNullOrWhiteSpace(returnUrl) && Request.IsLocalUrl(returnUrl)) {
|
||||||
|
<a id="button-cancel" href="@returnUrl" class="button">@T("Cancel")</a>
|
||||||
|
}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
@using Orchard.Utility.Extensions;
|
||||||
@model Orchard.ContentTypes.ViewModels.EditTypeViewModel
|
@model Orchard.ContentTypes.ViewModels.EditTypeViewModel
|
||||||
@{
|
@{
|
||||||
Style.Require("ContentTypesAdmin");
|
Style.Require("ContentTypesAdmin");
|
||||||
Script.Require("jQuery");
|
Script.Require("jQuery");
|
||||||
Layout.Title = T("Edit Content Type - {0}", Html.Raw(Model.DisplayName)).Text;
|
Layout.Title = T("Edit Content Type - {0}", Html.Raw(Model.DisplayName)).Text;
|
||||||
|
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="manage">
|
<div class="manage">
|
||||||
@@ -27,7 +29,7 @@
|
|||||||
<div class="manage-type">
|
<div class="manage-type">
|
||||||
<h2>@T("Fields")</h2>
|
<h2>@T("Fields")</h2>
|
||||||
<div class="manage add-to-type">
|
<div class="manage add-to-type">
|
||||||
@Html.ActionLink(T("Add Field").Text, "AddFieldTo", new { area = "Orchard.ContentTypes", id = Model.Name }, new { @class = "button" })
|
@Html.ActionLink(T("Add Field").Text, "AddFieldTo", new { area = "Orchard.ContentTypes", id = Model.Name, returnUrl }, new { @class = "button" })
|
||||||
</div>
|
</div>
|
||||||
@Html.EditorFor(m => m.Fields, "Fields", "")
|
@Html.EditorFor(m => m.Fields, "Fields", "")
|
||||||
<h2>@T("Parts")</h2>
|
<h2>@T("Parts")</h2>
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
Style.Require("ContentTypesAdmin");
|
Style.Require("ContentTypesAdmin");
|
||||||
|
|
||||||
Layout.Title = T("Edit Field \"{0}\"", Html.Raw(Model.DisplayName)).ToString();
|
Layout.Title = T("Edit Field \"{0}\"", Html.Raw(Model.DisplayName)).ToString();
|
||||||
|
|
||||||
|
var returnUrl = Request.QueryString["returnUrl"];
|
||||||
}
|
}
|
||||||
|
|
||||||
@using (Html.BeginFormAntiForgeryPost()) {
|
@using (Html.BeginFormAntiForgeryPost()) {
|
||||||
@Html.ValidationSummary()
|
@Html.ValidationSummary()
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="DisplayName">@T("Display Name")</label>
|
<label for="DisplayName" class="required">@T("Display Name")</label>
|
||||||
@Html.TextBoxFor(m => m.DisplayName, new {@class = "text medium", autofocus = "autofocus"})
|
@Html.TextBoxFor(m => m.DisplayName, new {@class = "text medium", autofocus = "autofocus"})
|
||||||
<span class="hint">@T("Name of the field as it will be displayed in screens.")</span>
|
<span class="hint">@T("Name of the field as it will be displayed in screens.")</span>
|
||||||
|
|
||||||
@@ -17,5 +19,8 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<button class="primaryAction" type="submit" name="submit.Save" value="Save">@T("Save")</button>
|
<button class="primaryAction" type="submit" name="submit.Save" value="Save">@T("Save")</button>
|
||||||
|
@if (!String.IsNullOrWhiteSpace(returnUrl) && Request.IsLocalUrl(returnUrl)) {
|
||||||
|
<a id="button-cancel" href="@returnUrl" class="button">@T("Cancel")</a>
|
||||||
|
}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
@using Orchard.Utility.Extensions
|
@using Orchard.Utility.Extensions
|
||||||
@model Orchard.ContentTypes.ViewModels.EditPartFieldViewModel
|
@model Orchard.ContentTypes.ViewModels.EditPartFieldViewModel
|
||||||
<fieldset class="manage-field">
|
@{
|
||||||
<h3>@Model.DisplayName <span>(@Model.FieldDefinition.Name.CamelFriendly())</span></h3>
|
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
|
||||||
<div class="manage">
|
}
|
||||||
@Html.ActionLink(T("Edit").Text, "EditField", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name }) |
|
<fieldset class="manage-field">
|
||||||
@Html.ActionLink(T("Remove").Text, "RemoveFieldFrom", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name }, new { itemprop = "RemoveUrl UnsafeUrl" })
|
<h3>@Model.DisplayName <span>(@Model.FieldDefinition.Name.CamelFriendly())</span></h3>
|
||||||
</div>
|
<div class="manage">
|
||||||
<div class="details">
|
@Html.ActionLink(T("Edit").Text, "EditField", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name, returnUrl }) |
|
||||||
@{Html.RenderTemplates(Model.Templates);}
|
@Html.ActionLink(T("Remove").Text, "RemoveFieldFrom", new { area = "Orchard.ContentTypes", id = Model.Part.Name, Model.Name }, new { itemprop = "RemoveUrl UnsafeUrl" })
|
||||||
@Html.HiddenFor(m => m.Name)@Html.HiddenFor(m => m.FieldDefinition.Name)@Html.HiddenFor(m => m.Index)
|
</div>
|
||||||
</div>
|
<div class="details">
|
||||||
</fieldset>
|
@{Html.RenderTemplates(Model.Templates);}
|
||||||
|
@Html.HiddenFor(m => m.Name)@Html.HiddenFor(m => m.FieldDefinition.Name)@Html.HiddenFor(m => m.Index)
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
Reference in New Issue
Block a user