mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -8,11 +8,6 @@ using Orchard.Security;
|
||||
|
||||
namespace Orchard.Blogs.Models {
|
||||
public class BlogPostPart : ContentPart {
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id {
|
||||
get { return ContentItem.Id; }
|
||||
}
|
||||
|
||||
public string Title {
|
||||
get { return this.As<RoutePart>().Title; }
|
||||
set { this.As<RoutePart>().Title = value; }
|
||||
|
@@ -17,7 +17,6 @@ namespace Orchard.Roles.Models {
|
||||
}
|
||||
|
||||
class SimulatedUser : ContentPart, IUser {
|
||||
public int Id { get { return ContentItem.Id; } }
|
||||
public string UserName { get { return null; } }
|
||||
public string Email { get { return null; } }
|
||||
}
|
||||
|
@@ -70,7 +70,7 @@ namespace Orchard.Widgets {
|
||||
.WithPart("WidgetPart")
|
||||
.WithPart("BodyPart")
|
||||
.WithPart("CommonPart")
|
||||
.WithSetting("stereotype", "widget")
|
||||
.WithSetting("Stereotype", "Widget")
|
||||
);
|
||||
|
||||
CreateDefaultLayers();
|
||||
|
@@ -5,14 +5,6 @@ using Orchard.ContentManagement;
|
||||
namespace Orchard.Widgets.Models {
|
||||
public class LayerPart : ContentPart<LayerPartRecord> {
|
||||
|
||||
/// <summary>
|
||||
/// The layer's identifier.
|
||||
/// </summary>
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id {
|
||||
get { return ContentItem.Id; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The layer's name.
|
||||
/// </summary>
|
||||
|
@@ -7,14 +7,6 @@ using Orchard.ContentManagement.Aspects;
|
||||
namespace Orchard.Widgets.Models {
|
||||
public class WidgetPart : ContentPart<WidgetPartRecord> {
|
||||
|
||||
/// <summary>
|
||||
/// The widget's identifier.
|
||||
/// </summary>
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id {
|
||||
get { return ContentItem.Id; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The widget's title.
|
||||
/// </summary>
|
||||
|
@@ -23,7 +23,7 @@ namespace Orchard.Widgets.Services {
|
||||
|
||||
public IEnumerable<string> GetWidgetTypes() {
|
||||
return _contentManager.GetContentTypeDefinitions()
|
||||
.Where(contentTypeDefinition => contentTypeDefinition.Settings.ContainsKey("stereotype") && contentTypeDefinition.Settings["stereotype"] == "widget")
|
||||
.Where(contentTypeDefinition => contentTypeDefinition.Settings.ContainsKey("Stereotype") && contentTypeDefinition.Settings["Stereotype"] == "Widget")
|
||||
.Select(contentTypeDefinition => contentTypeDefinition.Name);
|
||||
}
|
||||
|
||||
|
@@ -3,23 +3,23 @@
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.availableWidgets {
|
||||
.widgets-availableWidgets {
|
||||
float: left;
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.availableLayers {
|
||||
.widgets-availableLayers {
|
||||
float: left;
|
||||
margin: 0 0 0 2em;
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.layerZones {
|
||||
.widgets-layerZones {
|
||||
float: left;
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.layerZones .zone {
|
||||
.widgets-layerZones .widgets-zone {
|
||||
font-weight:700;
|
||||
background:#f5f5f5;
|
||||
border: 1px solid #f1f1f1;
|
||||
@@ -27,7 +27,7 @@
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
|
||||
.layerZones .zoneWidget {
|
||||
.widgets-layerZones .widgets-zoneWidget {
|
||||
margin: 0 0 1em 0;
|
||||
padding: 1em 2em 1em 3em;
|
||||
background:#ffffff;
|
||||
@@ -35,26 +35,26 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.layers {
|
||||
.widgets-layers {
|
||||
margin: 1em 0 0 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.layers ul {
|
||||
.widgets-layers ul {
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.layers .currentLayer {
|
||||
.widgets-layers .widgets-currentLayer {
|
||||
background: #c3d9ff;
|
||||
}
|
||||
|
||||
.layers .editLayer img {
|
||||
.widgets-layers .widgets-editLayer img {
|
||||
float: right;
|
||||
margin: 0 0 0 1em;
|
||||
}
|
||||
|
||||
.layerZones ul li ul {
|
||||
.widgets-layerZones ul li ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
@@ -10,9 +10,9 @@
|
||||
|
||||
<div class="manage">@Html.ActionLink(T("Add a layer").ToString(), "AddLayer", new { }, new { @class = "button primaryAction" })</div>
|
||||
|
||||
<div id="widgets" class="widgets">
|
||||
<div id="widgets">
|
||||
|
||||
<div class="availableWidgets">
|
||||
<div class="widgets-availableWidgets">
|
||||
<h2>Available Widgets</h2>
|
||||
|
||||
<fieldset>
|
||||
@@ -38,18 +38,18 @@
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="availableLayers">
|
||||
<div class="widgets-availableLayers">
|
||||
<h2>Widget Layers</h2>
|
||||
|
||||
<fieldset>
|
||||
<div class="layerZonesWidgets">
|
||||
<ul class="layerZones">
|
||||
<div>
|
||||
<ul class="widgets-layerZones">
|
||||
@foreach (string zone in Model.Zones) {
|
||||
<li>
|
||||
<div class="zone">@zone</div>
|
||||
<div class="widgets-zone">@zone</div>
|
||||
<ul>
|
||||
@foreach (WidgetPart widget in Model.CurrentLayerWidgets.Where(widgetPart => widgetPart.Zone == zone).OrderBy(widgetPart => widgetPart.Position)) {
|
||||
<li class="zoneWidget">
|
||||
<li class="widgets-zoneWidget">
|
||||
@if (widget.Position != "1") {
|
||||
<input type="image" name="submit.MoveUp.@widget.Id" src="@Url.Content("~/modules/orchard.widgets/Content/Admin/images/moveup.gif")" alt="Move up" value="@widget.Id" />
|
||||
}
|
||||
@@ -65,18 +65,18 @@
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="layers">
|
||||
<div class="widgets-layers">
|
||||
<ul>
|
||||
@foreach (var layer in Model.Layers) {
|
||||
if (layer.Id == Model.CurrentLayer.Id) {
|
||||
<li class="currentLayer editLayer">
|
||||
<li class="widgets-currentLayer widgets-editLayer">
|
||||
@Html.ActionLink(@layer.Name, "Index", new { @layer.Id })
|
||||
<a href="@Url.Action("EditLayer", new { @layer.Id })">
|
||||
<img width="15" height="15" src="@Url.Content("~/modules/orchard.widgets/Content/Admin/images/edit.gif")" />
|
||||
</a>
|
||||
</li>
|
||||
} else {
|
||||
<li class="editLayer">
|
||||
<li class="widgets-editLayer">
|
||||
@Html.ActionLink(@layer.Name, "Index", new { @layer.Id })
|
||||
<a href="@Url.Action("EditLayer", new { @layer.Id })">
|
||||
<img width="15" height="15" src="@Url.Content("~/modules/orchard.widgets/Content/Admin/images/edit.gif")" />
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement.MetaData.Models;
|
||||
using Orchard.ContentManagement.Utilities;
|
||||
using Orchard.UI;
|
||||
@@ -23,6 +24,14 @@ namespace Orchard.ContentManagement {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The ContentItem's identifier.
|
||||
/// </summary>
|
||||
[HiddenInput(DisplayValue = false)]
|
||||
public int Id {
|
||||
get { return ContentItem.Id; }
|
||||
}
|
||||
|
||||
public ContentTypeDefinition TypeDefinition { get { return ContentItem.TypeDefinition; } }
|
||||
public ContentTypePartDefinition TypePartDefinition { get; set; }
|
||||
public ContentPartDefinition PartDefinition { get { return TypePartDefinition.PartDefinition; } }
|
||||
|
@@ -3,5 +3,10 @@
|
||||
namespace Orchard.ContentManagement {
|
||||
public interface IContent {
|
||||
ContentItem ContentItem { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The ContentItem's identifier.
|
||||
/// </summary>
|
||||
int Id { get; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user