mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -20,57 +20,6 @@ namespace Orchard.Web.Tests.Routes {
|
||||
Assert.That(routeData.RouteHandler, Is.TypeOf<StopRoutingHandler>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RouteWithControllerNoActionNoId() {
|
||||
// Arrange
|
||||
var context = new StubContext("~/controller1");
|
||||
var routes = new RouteCollection();
|
||||
MvcApplication.RegisterRoutes(routes);
|
||||
|
||||
// Act
|
||||
var routeData = routes.GetRouteData(context);
|
||||
|
||||
// Assert
|
||||
Assert.That(routeData, Is.Not.Null);
|
||||
Assert.That(routeData.Values["controller"], Is.EqualTo("controller1"));
|
||||
Assert.That(routeData.Values["action"], Is.EqualTo("Index"));
|
||||
Assert.That(routeData.Values["id"], Is.EqualTo(""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RouteWithControllerWithActionNoId() {
|
||||
// Arrange
|
||||
var context = new StubContext("~/controller1/action2");
|
||||
var routes = new RouteCollection();
|
||||
MvcApplication.RegisterRoutes(routes);
|
||||
|
||||
// Act
|
||||
var routeData = routes.GetRouteData(context);
|
||||
|
||||
// Assert
|
||||
Assert.That(routeData, Is.Not.Null);
|
||||
Assert.That(routeData.Values["controller"], Is.EqualTo("controller1"));
|
||||
Assert.That(routeData.Values["action"], Is.EqualTo("action2"));
|
||||
Assert.That(routeData.Values["id"], Is.EqualTo(""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RouteWithControllerWithActionWithId() {
|
||||
// Arrange
|
||||
var context = new StubContext("~/controller1/action2/id3");
|
||||
var routes = new RouteCollection();
|
||||
MvcApplication.RegisterRoutes(routes);
|
||||
|
||||
// Act
|
||||
var routeData = routes.GetRouteData(context);
|
||||
|
||||
// Assert
|
||||
Assert.That(routeData, Is.Not.Null);
|
||||
Assert.That(routeData.Values["controller"], Is.EqualTo("controller1"));
|
||||
Assert.That(routeData.Values["action"], Is.EqualTo("action2"));
|
||||
Assert.That(routeData.Values["id"], Is.EqualTo("id3"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RouteWithTooManySegments() {
|
||||
// Arrange
|
||||
|
13
src/Orchard.Web/Core/Dashboard/AdminMenu.cs
Normal file
13
src/Orchard.Web/Core/Dashboard/AdminMenu.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
namespace Orchard.Core.Dashboard {
|
||||
public class AdminMenu : INavigationProvider {
|
||||
public string MenuName { get { return "admin"; } }
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
builder.Add("Dashboard", "0",
|
||||
menu => menu.Add("Manage Orchard", "0", item => item.Action("Index", "Admin", new { area = "Dashboard" }).Permission(StandardPermissions.AccessAdminPanel)));
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Core.Dashboard.Controllers {
|
||||
public class AdminController : Controller {
|
||||
public ActionResult Index() {
|
||||
return View(new AdminViewModel());
|
||||
}
|
||||
}
|
||||
}
|
1
src/Orchard.Web/Core/Dashboard/Module.txt
Normal file
1
src/Orchard.Web/Core/Dashboard/Module.txt
Normal file
@@ -0,0 +1 @@
|
||||
name: Dashboard
|
33
src/Orchard.Web/Core/Dashboard/Routes.cs
Normal file
33
src/Orchard.Web/Core/Dashboard/Routes.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Orchard.Mvc.Routes;
|
||||
|
||||
namespace Orchard.Core.Dashboard {
|
||||
public class Routes : IRouteProvider {
|
||||
public void GetRoutes(ICollection<RouteDescriptor> routes) {
|
||||
foreach (var routeDescriptor in GetRoutes())
|
||||
routes.Add(routeDescriptor);
|
||||
}
|
||||
|
||||
public IEnumerable<RouteDescriptor> GetRoutes() {
|
||||
return new[] {
|
||||
new RouteDescriptor {
|
||||
Priority = -5,
|
||||
Route = new Route(
|
||||
"Admin",
|
||||
new RouteValueDictionary {
|
||||
{"area", "Dashboard"},
|
||||
{"controller", "admin"},
|
||||
{"action", "index"}
|
||||
},
|
||||
new RouteValueDictionary(),
|
||||
new RouteValueDictionary {
|
||||
{"area", "Dashboard"}
|
||||
},
|
||||
new MvcRouteHandler())
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
4
src/Orchard.Web/Core/Dashboard/Views/Admin/Index.ascx
Normal file
4
src/Orchard.Web/Core/Dashboard/Views/Admin/Index.ascx
Normal file
@@ -0,0 +1,4 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<AdminViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<h1><%=Html.TitleForPage(T("Orchard Admin").ToString())%></h1>
|
||||
<p><%=T("Insert admin text here -> ·") %></p>
|
34
src/Orchard.Web/Core/Dashboard/Views/Web.config
Normal file
34
src/Orchard.Web/Core/Dashboard/Views/Web.config
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add path="*" verb="*"
|
||||
type="System.Web.HttpNotFoundHandler"/>
|
||||
</httpHandlers>
|
||||
|
||||
<!--
|
||||
Enabling request validation in view pages would cause validation to occur
|
||||
after the input has already been processed by the controller. By default
|
||||
MVC performs request validation before a controller processes the input.
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
@@ -108,8 +108,12 @@ namespace Orchard.Core.Navigation.Controllers {
|
||||
|
||||
MenuPart menuPart = _menuService.Get(id);
|
||||
|
||||
if (menuPart != null)
|
||||
if (menuPart != null) {
|
||||
if (menuPart.Is<MenuItem>())
|
||||
_menuService.Delete(menuPart);
|
||||
else
|
||||
menuPart.OnMainMenu = false;
|
||||
}
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
@@ -1,7 +1,9 @@
|
||||
using JetBrains.Annotations;
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.Navigation.Models;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Navigation;
|
||||
using Orchard.Utility;
|
||||
@@ -15,9 +17,11 @@ namespace Orchard.Core.Navigation.Drivers {
|
||||
public MenuPartDriver(IAuthorizationService authorizationService, INavigationManager navigationManager) {
|
||||
_authorizationService = authorizationService;
|
||||
_navigationManager = navigationManager;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public virtual IUser CurrentUser { get; set; }
|
||||
private Localizer T { get; set; }
|
||||
|
||||
protected override DriverResult Editor(MenuPart part) {
|
||||
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, CurrentUser, part))
|
||||
@@ -34,6 +38,9 @@ namespace Orchard.Core.Navigation.Drivers {
|
||||
part.MenuPosition = Position.GetNext(_navigationManager.BuildMenu("main"));
|
||||
|
||||
updater.TryUpdateModel(part, Prefix, null, null);
|
||||
if (part.OnMainMenu && String.IsNullOrEmpty(part.MenuText)) {
|
||||
updater.AddModelError("MenuText", T("The MenuText field is required"));
|
||||
}
|
||||
return ContentPartTemplate(part, "Parts/Navigation.EditMenuPart").Location("primary", "9");
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,6 @@ namespace Orchard.Core.Navigation.Models {
|
||||
set { Record.OnMainMenu = value; }
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string MenuText {
|
||||
get { return Record.MenuText; }
|
||||
set { Record.MenuText = value; }
|
||||
|
@@ -26,8 +26,8 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<tr>
|
||||
<td><input type="text" class="text-box" name="<%=Html.NameOf(m => m.MenuItemEntries[i].MenuItem.Text) %>" value="<%=menuPartEntry.MenuItem.Text %>" /></td>
|
||||
<td><input type="text" class="text-box" name="<%=Html.NameOf(m => m.MenuItemEntries[i].MenuItem.Position) %>" value="<%=menuPartEntry.MenuItem.Position %>" /></td>
|
||||
<td><% if (!menuPartEntry.IsMenuItem) { %><input type="text" class="text-box" disabled="disabled" value="<%=menuPartEntry.MenuItem.Url %>" /><% } else { %><input type="text" class="text-box" name="<%=Html.NameOf(m => m.MenuItemEntries[i].MenuItem.Url) %>" value="<%=menuPartEntry.MenuItem.Url %>" /><% } %></td>
|
||||
<td><input type="hidden" name="<%=Html.NameOf(m => m.MenuItemEntries[i].MenuItemId) %>" value="<%=menuPartEntry.MenuItemId %>" /><a href="<%=Url.Action("Delete", new {id = menuPartEntry.MenuItemId, __RequestVerificationToken = Html.AntiForgeryTokenValueOrchard()}) %>" class="remove button">delete</a></td>
|
||||
<td><% if (!menuPartEntry.IsMenuItem) { %><input type="text" class="text-box disabled" disabled="disabled" value="<%=menuPartEntry.MenuItem.Url %>" /><% } else { %><input type="text" class="text-box" name="<%=Html.NameOf(m => m.MenuItemEntries[i].MenuItem.Url) %>" value="<%=menuPartEntry.MenuItem.Url %>" /><% } %></td>
|
||||
<td><input type="hidden" name="<%=Html.NameOf(m => m.MenuItemEntries[i].MenuItemId) %>" value="<%=menuPartEntry.MenuItemId %>" /><a href="<%=Url.Action("Delete", new {id = menuPartEntry.MenuItemId, __RequestVerificationToken = Html.AntiForgeryTokenValueOrchard()}) %>" class="remove"><%=_Encoded(menuPartEntry.IsMenuItem ? "Delete" : "Remove") %></a></td>
|
||||
</tr><%
|
||||
++menuPartEntryIndex;
|
||||
} %>
|
||||
|
@@ -84,6 +84,9 @@
|
||||
<Compile Include="Common\ViewModels\BodyEditorViewModel.cs" />
|
||||
<Compile Include="Common\ViewModels\RoutableEditorViewModel.cs" />
|
||||
<Compile Include="Common\ViewModels\OwnerEditorViewModel.cs" />
|
||||
<Compile Include="Dashboard\AdminMenu.cs" />
|
||||
<Compile Include="Dashboard\Controllers\AdminController.cs" />
|
||||
<Compile Include="Dashboard\Routes.cs" />
|
||||
<Compile Include="Feeds\Controllers\FeedController.cs" />
|
||||
<Compile Include="Feeds\IFeedManager.cs" />
|
||||
<Compile Include="Feeds\Rss\Routes.cs" />
|
||||
@@ -212,6 +215,8 @@
|
||||
<Content Include="Themes\Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Dashboard\Module.txt" />
|
||||
<Content Include="Dashboard\Views\Admin\Index.ascx" />
|
||||
<Content Include="HomePage\Module.txt" />
|
||||
<Content Include="Navigation\Views\Admin\Index.ascx" />
|
||||
<Content Include="Navigation\Views\EditorTemplates\Parts\Navigation.EditMenuPart.ascx" />
|
||||
@@ -221,6 +226,9 @@
|
||||
<Content Include="Themes\Views\EditorTemplates\Items\ContentItem.ascx" />
|
||||
<Content Include="Themes\Views\DisplayTemplates\Items\ContentItem.ascx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Dashboard\Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Scheduling\Controllers\" />
|
||||
</ItemGroup>
|
||||
|
@@ -14,6 +14,7 @@ namespace Orchard.Core.Themes.Models {
|
||||
public string Version { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string HomePage { get; set; }
|
||||
public string Tags { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
@@ -8,5 +8,6 @@ namespace Orchard.Core.Themes.Records {
|
||||
public virtual string Version { get; set; }
|
||||
public virtual string Author { get; set; }
|
||||
public virtual string HomePage { get; set; }
|
||||
public virtual string Tags { get; set; }
|
||||
}
|
||||
}
|
@@ -74,6 +74,7 @@ namespace Orchard.Core.Themes.Services {
|
||||
HomePage = descriptor.HomePage ?? String.Empty,
|
||||
ThemeName = descriptor.Name,
|
||||
Version = descriptor.Version ?? String.Empty,
|
||||
Tags = descriptor.Tags ?? String.Empty
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -83,9 +84,7 @@ namespace Orchard.Core.Themes.Services {
|
||||
public IEnumerable<ITheme> GetInstalledThemes() {
|
||||
List<ITheme> themes = new List<ITheme>();
|
||||
foreach (var descriptor in _extensionManager.AvailableExtensions()) {
|
||||
//todo: (heskew) filter out Admin themes in a different manner - eventually we'll need a way to select the admin theme so there should be a clear separation
|
||||
if (String.Equals(descriptor.ExtensionType, "Theme", StringComparison.OrdinalIgnoreCase)
|
||||
&& !(descriptor.Name.EndsWith("Admin", StringComparison.OrdinalIgnoreCase))) {
|
||||
if (String.Equals(descriptor.ExtensionType, "Theme", StringComparison.OrdinalIgnoreCase)) {
|
||||
Theme theme = new Theme {
|
||||
Author = descriptor.Author ?? String.Empty,
|
||||
Description = descriptor.Description ?? String.Empty,
|
||||
@@ -93,14 +92,16 @@ namespace Orchard.Core.Themes.Services {
|
||||
HomePage = descriptor.HomePage ?? String.Empty,
|
||||
ThemeName = descriptor.Name,
|
||||
Version = descriptor.Version ?? String.Empty,
|
||||
Tags = descriptor.Tags ?? String.Empty
|
||||
};
|
||||
if (!theme.Tags.Contains("hidden")) {
|
||||
themes.Add(theme);
|
||||
}
|
||||
}
|
||||
}
|
||||
return themes;
|
||||
}
|
||||
|
||||
|
||||
public void InstallTheme(HttpPostedFileBase file) {
|
||||
_extensionManager.InstallExtension("Theme", file);
|
||||
}
|
||||
|
@@ -9,15 +9,16 @@
|
||||
} else {
|
||||
%><h3><%=_Encoded("Current Theme")%> - <%=Html.Encode(Model.CurrentTheme.DisplayName) %></h3>
|
||||
|
||||
<%=Html.Image(Html.ThemePath(Model.CurrentTheme, "/Theme.png"), Html.Encode(Model.CurrentTheme.DisplayName), null)%>
|
||||
<%=Html.Image(Html.ThemePath(Model.CurrentTheme, "/Theme.png"), Html.Encode(Model.CurrentTheme.DisplayName), new { @class = "themePreviewImage" })%>
|
||||
<h5><%=_Encoded("By") %> <%=Html.Encode(Model.CurrentTheme.Author) %></h5>
|
||||
|
||||
<p>
|
||||
<%=_Encoded("Version:") %> <%=Html.Encode(Model.CurrentTheme.Version) %><br />
|
||||
<%=Html.Encode(Model.CurrentTheme.Description) %><br />
|
||||
<%=Html.Encode(Model.CurrentTheme.HomePage) %><br />
|
||||
<%=Html.ActionLink(T("Install a new Theme").ToString(), "Install") %>
|
||||
<%=Html.Encode(Model.CurrentTheme.HomePage) %>
|
||||
</p>
|
||||
<%=Html.ActionLink(T("Install a new Theme").ToString(), "Install", null, new { @class = "button primaryAction" })%>
|
||||
|
||||
<% } %>
|
||||
<h2><%=_Encoded("Available Themes")%></h2>
|
||||
<ul class="templates">
|
||||
|
@@ -3,8 +3,8 @@
|
||||
<div id="logindisplay">
|
||||
<% if (Request.IsAuthenticated) { %>
|
||||
<%=T("Welcome, <strong>{0}</strong>!", Html.Encode(Page.User.Identity.Name)) %>
|
||||
<%=Html.Link(T("Admin").ToString(), "/admin/blogs") %> /
|
||||
<%=Html.ActionLink(T("Log Off").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users" }) %>
|
||||
<%=Html.ActionLink(T("Log Off").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users" })%>
|
||||
| <%= Html.ActionLink("Admin", "Index", new {Area = "Dashboard", Controller = "Admin"})%>
|
||||
<% } else { %>
|
||||
<%=Html.ActionLink(T("Log On").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl }) %>
|
||||
<% } %>
|
||||
|
@@ -16,12 +16,6 @@ namespace Orchard.Web {
|
||||
|
||||
public static void RegisterRoutes(RouteCollection routes) {
|
||||
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
||||
|
||||
routes.MapRoute(
|
||||
"Default", // Route name
|
||||
"{controller}/{action}/{id}", // URL with parameters
|
||||
new { controller = "Home", action = "Index", id = "" } // Parameter defaults
|
||||
);
|
||||
}
|
||||
|
||||
protected void Application_Start() {
|
||||
|
BIN
src/Orchard.Web/Media/OrchardLogo.png
Normal file
BIN
src/Orchard.Web/Media/OrchardLogo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
@@ -4,7 +4,7 @@
|
||||
<h1><%=Html.TitleForPage(T("Manage Blogs").ToString()) %></h1>
|
||||
<%-- todo: Add helper text here when ready. <p><%=_Encoded("Possible text about setting up and managing a blog goes here.") %></p> --%><%
|
||||
if (Model.Entries.Count() > 0) { %>
|
||||
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div>
|
||||
<div class="actions"><a class="add button primaryAction" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div>
|
||||
<%=Html.UnorderedList(Model.Entries, (entry, i) => {
|
||||
// Add blog post count rendering into "meta" zone
|
||||
entry.ContentItemViewModel.Zones.AddAction("meta", html => {
|
||||
@@ -20,7 +20,7 @@ if (Model.Entries.Count() > 0) { %>
|
||||
// Display the summary for the blog post
|
||||
return Html.DisplayForItem(entry.ContentItemViewModel).ToHtmlString();
|
||||
}, "blogs contentItems")%>
|
||||
<div class="actions"><a class="add button" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div><%
|
||||
<div class="actions"><a class="add button primaryAction" href="<%=Url.BlogCreate() %>"><%=_Encoded("New Blog") %></a></div><%
|
||||
} else { %>
|
||||
<div class="info message"><%=T("There are no blogs for you to see. Want to <a href=\"{0}\">add one</a>?", Url.BlogCreate()).ToString()%></div><%
|
||||
} %>
|
@@ -2,23 +2,30 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<h2><%=Html.Link(Html.Encode(Model.Item.Name), Url.BlogForAdmin(Model.Item.Slug)) %></h2>
|
||||
<div class="meta"><%Html.Zone("meta");%></div>
|
||||
|
||||
<div class="summary">
|
||||
<div class="properties">
|
||||
<h3><%=Html.Link(Html.Encode(Model.Item.Name), Url.BlogForAdmin(Model.Item.Slug)) %></h3>
|
||||
<p><%Html.Zone("meta");%></p>
|
||||
<%--<p>[list of authors] [modify blog access]</p>--%>
|
||||
<p><%=Html.Encode(Model.Item.Description) %></p>
|
||||
<ul class="actions">
|
||||
<li class="construct">
|
||||
<a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>" class="ibutton blog" title="<%=_Encoded("Manage Blog") %>"><%=_Encoded("Manage Blog") %></a>
|
||||
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit" title="<%=_Encoded("Edit Blog") %>"><%=_Encoded("Edit Blog") %></a>
|
||||
<a href="<%=Url.Blog(Model.Item.Slug) %>" class="ibutton view" title="<%=_Encoded("View Blog") %>"><%=_Encoded("View Blog") %></a>
|
||||
<a href="<%=Url.BlogPostCreate(Model.Item.Slug) %>" class="ibutton add page" title="<%=_Encoded("New Post") %>"><%=_Encoded("New Post") %></a>
|
||||
</li>
|
||||
<li class="destruct">
|
||||
</div>
|
||||
|
||||
<div class="related">
|
||||
|
||||
<%--<a href="<%=Url.BlogForAdmin(Model.Item.Slug) %>" title="<%=_Encoded("Manage Blog") %>"><%=_Encoded("Manage Blog") %></a><%=_Encoded(" | ")%>--%>
|
||||
<a href="<%=Url.Blog(Model.Item.Slug) %>" title="<%=_Encoded("View") %>"><%=_Encoded("View") %></a><%=_Encoded(" | ")%>
|
||||
<a href="<%=Url.BlogEdit(Model.Item.Slug) %>" title="<%=_Encoded("Edit") %>"><%=_Encoded("Edit") %></a><%=_Encoded(" | ")%>
|
||||
<a href="<%=Url.BlogPostCreate(Model.Item.Slug) %>" title="<%=_Encoded("New Post") %>"><%=_Encoded("New Post") %></a><%=_Encoded(" | ")%>
|
||||
|
||||
<%-- todo: (heskew) this is waaaaa too verbose. need template helpers for all ibuttons --%>
|
||||
<% using (Html.BeginFormAntiForgeryPost(Url.BlogDelete(Model.Item.Slug), FormMethod.Post, new { @class = "inline" })) { %>
|
||||
<fieldset>
|
||||
<button type="submit" class="ibutton remove" title="<%=_Encoded("Remove Blog") %>"><%=_Encoded("Remove Blog") %></button>
|
||||
</fieldset><%
|
||||
<button type="submit" class="linkButton" title="<%=_Encoded("Delete") %>"><%=_Encoded("Delete") %></button>
|
||||
<%
|
||||
} %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
@@ -7,7 +7,7 @@
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
|
||||
<div class="blogPost summary">
|
||||
<div class="summary">
|
||||
<div class="properties">
|
||||
<h3><%=Html.Link(Html.Encode(Model.Item.Title), Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Id))%></h3>
|
||||
|
||||
|
@@ -49,10 +49,10 @@ namespace Orchard.Comments.Controllers {
|
||||
CommentText = viewModel.CommentText,
|
||||
Email = viewModel.Email,
|
||||
SiteName = viewModel.SiteName,
|
||||
CommentedOn = viewModel.CommentedOn,
|
||||
CommentedOn = viewModel.CommentedOn
|
||||
};
|
||||
|
||||
Comment comment = _commentService.CreateComment(context);
|
||||
Comment comment = _commentService.CreateComment(context, CurrentSite.As<CommentSettings>().Record.ModerateComments);
|
||||
|
||||
if (!String.IsNullOrEmpty(returnUrl)) {
|
||||
if (comment.Record.Status == CommentStatus.Pending)
|
||||
|
@@ -1,8 +1,9 @@
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
|
||||
namespace Orchard.Comments.Models {
|
||||
namespace Orchard.Comments.Controllers {
|
||||
[UsedImplicitly]
|
||||
public class CommentDriver : ContentItemDriver<Comment> {
|
||||
public readonly static ContentType ContentType = new ContentType {
|
@@ -1,11 +1,12 @@
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.Comments.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.Common.Records;
|
||||
|
||||
namespace Orchard.Comments.Models {
|
||||
namespace Orchard.Comments.Controllers {
|
||||
[UsedImplicitly]
|
||||
public class HasCommentsContainerDriver : ContentPartDriver<HasCommentsContainer> {
|
||||
protected override DriverResult Display(HasCommentsContainer part, string displayType) {
|
@@ -1,9 +1,10 @@
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.Comments.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
|
||||
namespace Orchard.Comments.Models {
|
||||
namespace Orchard.Comments.Controllers {
|
||||
[UsedImplicitly]
|
||||
public class HasCommentsDriver : ContentPartDriver<HasComments> {
|
||||
protected override DriverResult Display(HasComments part, string displayType) {
|
@@ -1,4 +1,5 @@
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Comments.Controllers;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Data;
|
||||
|
@@ -3,6 +3,7 @@ using Orchard.ContentManagement.Records;
|
||||
namespace Orchard.Comments.Models {
|
||||
public class CommentSettingsRecord : ContentPartRecord {
|
||||
public virtual bool RequireLoginToAddComment { get; set; }
|
||||
public virtual bool ModerateComments { get; set; }
|
||||
public virtual bool EnableSpamProtection { get; set; }
|
||||
public virtual string AkismetKey { get; set; }
|
||||
public virtual string AkismetUrl { get; set; }
|
||||
|
@@ -68,16 +68,16 @@
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="Controllers\CommentController.cs" />
|
||||
<Compile Include="Controllers\CommentDriver.cs" />
|
||||
<Compile Include="Controllers\HasCommentsContainerDriver.cs" />
|
||||
<Compile Include="Controllers\HasCommentsDriver.cs" />
|
||||
<Compile Include="Extensions\HtmlHelperExtensions.cs" />
|
||||
<Compile Include="Models\ClosedCommentsRecord.cs" />
|
||||
<Compile Include="Models\Comment.cs" />
|
||||
<Compile Include="Models\CommentDriver.cs" />
|
||||
<Compile Include="Models\CommentHandler.cs" />
|
||||
<Compile Include="Models\CommentStatus.cs" />
|
||||
<Compile Include="Models\HasCommentsContainer.cs" />
|
||||
<Compile Include="Models\HasCommentsContainerDriver.cs" />
|
||||
<Compile Include="Models\HasCommentsContainerHandler.cs" />
|
||||
<Compile Include="Models\HasCommentsDriver.cs" />
|
||||
<Compile Include="Feeds\CommentedOnContainerFeedQuery.cs" />
|
||||
<Compile Include="Feeds\CommentedOnFeedQuery.cs" />
|
||||
<Compile Include="Feeds\CommentFeedItemBuilder.cs" />
|
||||
|
@@ -2,6 +2,7 @@
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.Comments.Controllers;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Data;
|
||||
using Orchard.Logging;
|
||||
@@ -18,7 +19,7 @@ namespace Orchard.Comments.Services {
|
||||
IEnumerable<Comment> GetCommentsForCommentedContent(int id, CommentStatus status);
|
||||
Comment GetComment(int id);
|
||||
ContentItemMetadata GetDisplayForCommentedContent(int id);
|
||||
Comment CreateComment(CreateCommentContext commentRecord);
|
||||
Comment CreateComment(CreateCommentContext commentRecord, bool moderateComments);
|
||||
void UpdateComment(int id, string name, string email, string siteName, string commentText, CommentStatus status);
|
||||
void ApproveComment(int commentId);
|
||||
void PendComment(int commentId);
|
||||
@@ -100,7 +101,7 @@ namespace Orchard.Comments.Services {
|
||||
return _contentManager.GetItemMetadata(content);
|
||||
}
|
||||
|
||||
public Comment CreateComment(CreateCommentContext context) {
|
||||
public Comment CreateComment(CreateCommentContext context, bool moderateComments) {
|
||||
var comment = _contentManager.Create<Comment>(CommentDriver.ContentType.Name);
|
||||
|
||||
comment.Record.Author = context.Author;
|
||||
@@ -111,7 +112,7 @@ namespace Orchard.Comments.Services {
|
||||
comment.Record.UserName = (CurrentUser == null ? context.Author : CurrentUser.UserName);
|
||||
comment.Record.CommentedOn = context.CommentedOn;
|
||||
|
||||
comment.Record.Status = _commentValidator.ValidateComment(comment) ? CommentStatus.Pending : CommentStatus.Spam;
|
||||
comment.Record.Status = _commentValidator.ValidateComment(comment) ? moderateComments ? CommentStatus.Pending : CommentStatus.Approved : CommentStatus.Spam;
|
||||
|
||||
// store id of the next layer for large-grained operations, e.g. rss on blog
|
||||
//TODO:(rpaquay) Get rid of this (comment aspect takes care of container)
|
||||
|
@@ -7,6 +7,11 @@
|
||||
<label class="forcheckbox" for="CommentSettings_RequireLoginToAddComment"><%=_Encoded("Require login to comment")%></label>
|
||||
<%=Html.ValidationMessage("RequireLoginToAddComment", "*")%>
|
||||
</div>
|
||||
<div>
|
||||
<%=Html.EditorFor(m => m.ModerateComments) %>
|
||||
<label class="forcheckbox" for="CommentSettings_ModerateComments"><%=_Encoded("Comments must be approved before they appear")%></label>
|
||||
<%=Html.ValidationMessage("ModerateComments", "*")%>
|
||||
</div>
|
||||
<div>
|
||||
<%=Html.EditorFor(m => m.EnableSpamProtection) %>
|
||||
<label class="forcheckbox" for="CommentSettings_EnableSpamProtection"><%=_Encoded("Enable spam protection") %></label>
|
||||
|
@@ -48,7 +48,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" value="true" name="<%=_Encoded("Checkbox.File.{0}", mediaFile.Name) %>"/>
|
||||
<input type="hidden" value="<%=_Encoded("Model.MediaPath") %>" name="<%=_Encoded("mediaFile.Name") %>" />
|
||||
<input type="hidden" value="<%=_Encoded(Model.MediaPath) %>" name="<%=_Encoded(mediaFile.Name) %>" />
|
||||
</td>
|
||||
<td>
|
||||
<%=Html.ActionLink(mediaFile.Name, "EditMedia", new { name = mediaFile.Name,
|
||||
|
@@ -132,6 +132,7 @@ namespace Orchard.Pages.Controllers {
|
||||
}
|
||||
|
||||
Services.ContentManager.Create(model.Page.Item.ContentItem, VersionOptions.Draft);
|
||||
Services.ContentManager.UpdateEditorModel(page, this);
|
||||
|
||||
// Execute publish command
|
||||
switch (Request.Form["Command"]) {
|
||||
|
@@ -33,6 +33,7 @@ using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<span>
|
||||
<label for="DatabaseConnectionString"><%=_Encoded("Connection string") %></label>
|
||||
<%=Html.EditorFor(svm => svm.DatabaseConnectionString)%>
|
||||
<i class="hint"><%=_Encoded("Example: Data Source=sqlServerName;Initial Catalog=dbName;Persist Security Info=True;User ID=userName;Password=password") %></i>
|
||||
</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
@@ -1,26 +0,0 @@
|
||||
using Orchard.Data;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.ContentManagement.Records;
|
||||
|
||||
namespace Orchard.Tags.Models {
|
||||
public class TagSettings : ContentPart<TagSettingsRecord> {
|
||||
}
|
||||
|
||||
public class TagSettingsRecord : ContentPartRecord {
|
||||
public virtual bool EnableTagsOnPages { get; set; }
|
||||
}
|
||||
|
||||
public class TagSettingsHandler : ContentHandler {
|
||||
public TagSettingsHandler(IRepository<TagSettingsRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<TagSettings>("site"));
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
Filters.Add(new TemplateFilterForRecord<TagSettingsRecord>("TagSettings", "Parts/Tags.SiteSettings"));
|
||||
OnActivated<TagSettings>(DefaultSettings);
|
||||
}
|
||||
|
||||
private static void DefaultSettings(ActivatedContentContext context, TagSettings settings) {
|
||||
settings.Record.EnableTagsOnPages = true;
|
||||
}
|
||||
}
|
||||
}
|
@@ -70,7 +70,6 @@
|
||||
<Compile Include="Helpers\TagHelpers.cs" />
|
||||
<Compile Include="Models\HasTags.cs" />
|
||||
<Compile Include="Models\Tag.cs" />
|
||||
<Compile Include="Models\TagSettings.cs" />
|
||||
<Compile Include="Models\HasTagsHandler.cs" />
|
||||
<Compile Include="Permissions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@@ -93,7 +92,6 @@
|
||||
<Content Include="Views\Home\Search.ascx" />
|
||||
<Content Include="Views\DisplayTemplates\Parts\Tags.ShowTags.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Tags.EditTags.ascx" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Tags.SiteSettings.ascx" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
|
@@ -1,11 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<TagSettingsRecord>" %>
|
||||
<%@ Import Namespace="Orchard.Tags.Models"%>
|
||||
<fieldset>
|
||||
<legend><%=_Encoded("Tags")%></legend>
|
||||
<div>
|
||||
<%= Html.EditorFor(x=>x.EnableTagsOnPages) %>
|
||||
<label class="forcheckbox" for="TagSettings_EnableTagsOnPages">Pages can be tagged</label>
|
||||
<%= Html.ValidationMessage("EnableTagsOnPages", "*")%>
|
||||
<span class="hint forcheckbox"><%=_Encoded("In the admin, if the user has permission to.") %></span>
|
||||
</div>
|
||||
</fieldset>
|
@@ -6,23 +6,23 @@
|
||||
<% using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<fieldset>
|
||||
<legend><%=_Encoded("Account Information")%></legend>
|
||||
<fieldset>
|
||||
<div>
|
||||
<label for="currentPassword"><%=_Encoded("Current password:")%></label>
|
||||
<%=Html.Password("currentPassword") %>
|
||||
<%=Html.ValidationMessage("currentPassword") %>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<label for="newPassword"><%=_Encoded("New password:")%></label>
|
||||
<%= Html.Password("newPassword") %>
|
||||
<%= Html.ValidationMessage("newPassword") %>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<label for="confirmPassword"><%=_Encoded("Confirm new password:")%></label>
|
||||
<%= Html.Password("confirmPassword") %>
|
||||
<%= Html.ValidationMessage("confirmPassword") %>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit" value="<%=_Encoded("Change Password") %>" />
|
||||
</fieldset>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% } %>
|
@@ -6,28 +6,28 @@
|
||||
<% using (Html.BeginFormAntiForgeryPost()) { %>
|
||||
<fieldset>
|
||||
<legend><%=_Encoded("Account Information")%></legend>
|
||||
<fieldset>
|
||||
<div>
|
||||
<label for="username"><%=_Encoded("Username:")%></label>
|
||||
<%= Html.TextBox("username") %>
|
||||
<%= Html.ValidationMessage("username") %>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<label for="email"><%=_Encoded("Email:")%></label>
|
||||
<%= Html.TextBox("email") %>
|
||||
<%= Html.ValidationMessage("email") %>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<label for="password"><%=_Encoded("Password:")%></label>
|
||||
<%= Html.Password("password") %>
|
||||
<%= Html.ValidationMessage("password") %>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<label for="confirmPassword"><%=_Encoded("Confirm password:")%></label>
|
||||
<%= Html.Password("confirmPassword") %>
|
||||
<%= Html.ValidationMessage("confirmPassword") %>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit" value="<%=_Encoded("Register") %>" />
|
||||
</fieldset>
|
||||
</div>
|
||||
</fieldset>
|
||||
<% } %>
|
@@ -172,6 +172,7 @@
|
||||
<Content Include="Themes\Classic\Theme.txt" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.Blog.Summary.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Items\Blogs.BlogPost.Summary.ascx" />
|
||||
<Content Include="Themes\Classic\Views\DisplayTemplates\Parts\Blogs.BlogPost.List.ascx" />
|
||||
<Content Include="Themes\Classic\Views\Footer.ascx" />
|
||||
@@ -197,7 +198,6 @@
|
||||
<Content Include="Themes\Green\Views\Footer.ascx" />
|
||||
<Content Include="Themes\Green\Views\Layout.ascx" />
|
||||
<Content Include="Themes\Green\Views\ListOfComments.ascx" />
|
||||
<Content Include="Themes\Green\Views\User.ascx" />
|
||||
<Content Include="Themes\SafeMode\Styles\images\backgroundHeader.gif" />
|
||||
<Content Include="Themes\SafeMode\Styles\images\backgroundVines.gif" />
|
||||
<Content Include="Themes\SafeMode\Styles\images\orchardLogo.gif" />
|
||||
|
@@ -1,31 +1,21 @@
|
||||
/*Blog specific styles
|
||||
----------------------------------------------------------*/
|
||||
|
||||
.posted {
|
||||
margin: 8px 0;
|
||||
font-size:105%;
|
||||
font-weight:600;
|
||||
h3.blogs, h3.blog {
|
||||
display:block;
|
||||
border-bottom:1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.meta, .manage {
|
||||
font-size:105%;
|
||||
float:right;
|
||||
margin:-23px 0 0 0;
|
||||
}
|
||||
|
||||
.blogdescription, .postsummary {
|
||||
ul.blogs p {
|
||||
clear:both;
|
||||
}
|
||||
|
||||
div.comment {
|
||||
margin: 16px 0 8px 0;
|
||||
}
|
||||
|
||||
span.who {
|
||||
font-weight:600;
|
||||
font-size:105%;
|
||||
}
|
||||
.post {
|
||||
margin: -8px 0 12px 0px;
|
||||
}
|
||||
|
||||
.meta {
|
||||
font-style:italic;
|
||||
color:#666666;
|
||||
}
|
||||
|
||||
.text {
|
||||
border-bottom:1px dotted #e5e5e5;
|
||||
}
|
||||
|
@@ -20,29 +20,31 @@ html {height: 100%;}
|
||||
|
||||
body {
|
||||
font: normal 90% "Georgia", Times New Roman, Times, serif;
|
||||
background:url(../Content/Images/bodyBackgroundgrey.gif) top left repeat-x #e5e5e5;
|
||||
height: 100%;
|
||||
text-align:left;
|
||||
color:#333;
|
||||
color:#373737;
|
||||
background:#fdfdfd;
|
||||
/*background:#E5E5E5 url(../Content/Images/bodyBackgroundgrey.gif) repeat-x scroll left top;*/
|
||||
}
|
||||
|
||||
/* ---------- Headings and defaults ---------- */
|
||||
|
||||
h1,h2,h3,h4,h5,h6, legend {font-weight:normal; font-style: normal; color:#670404; border-bottom:1px dotted #e5e5e5;}
|
||||
h1,h2,h3,h4,h5,h6,legend {font-weight:normal; font-style: normal; margin:12px 0 4px 0;}
|
||||
|
||||
h1 {font-size: 190%;}
|
||||
h1 {font-size: 180%;}
|
||||
h2 {font-size: 160%;}
|
||||
h3 {font-size: 150%;}
|
||||
h3 {font-size: 145%;}
|
||||
h4 {font-size: 130%;}
|
||||
h5 {font-size: 120%;}
|
||||
h6 {font-size: 105%;}
|
||||
|
||||
h1.sitename {border-bottom:none;}
|
||||
|
||||
p {line-height:24px; margin:12px 0 32px 0;}
|
||||
p.small {line-height:22px; font-size:85%;}
|
||||
p.small {line-height:24px; font-size:85%;}
|
||||
|
||||
a {
|
||||
color:#004386;
|
||||
color:#05325f;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
@@ -53,17 +55,17 @@ ol.decimal {list-style:decimal; list-style-position:inside; line-height:24px; ma
|
||||
/* Forms
|
||||
----------------------------------------------------------*/
|
||||
|
||||
input[type="text"], #CommentText, #password {
|
||||
border:1px solid #DDDEDF;
|
||||
input[type="text"], #CommentText, #password, #confirmPassword {
|
||||
border:1px solid #cacec6;
|
||||
display: block;
|
||||
}
|
||||
|
||||
fieldset {margin: 20px 0;}
|
||||
padding:2px;
|
||||
width:90%;
|
||||
}
|
||||
|
||||
fieldset div {margin:16px 0 0 0}
|
||||
|
||||
legend {
|
||||
font-size: 105%;
|
||||
font-size: 110%;
|
||||
border:none;
|
||||
}
|
||||
|
||||
@@ -72,18 +74,12 @@ label {
|
||||
margin:0 0 2px 0;
|
||||
}
|
||||
|
||||
input[type="text"], #CommentText, #password {
|
||||
border-color:#cacec6;
|
||||
padding:2px;
|
||||
width:90%;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
margin:2px 0 20px 10px;
|
||||
}
|
||||
|
||||
input[type="submit"], input[type="button"], .button {
|
||||
font:90% Verdana, Geneva, Tahoma, sans-serif;
|
||||
font: normal 90% "Georgia", Times New Roman, Times, serif;
|
||||
color:#333;
|
||||
padding:2px 14px;
|
||||
display: block;
|
||||
@@ -97,112 +93,182 @@ input[type="submit"], input[type="button"], .button {
|
||||
}
|
||||
|
||||
|
||||
/* Tables
|
||||
----------------------------------------------------------*/
|
||||
table {
|
||||
background:#fff;
|
||||
border:1px solid #f1f1f1;
|
||||
border-collapse:collapse;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
table thead, table th {
|
||||
overflow:hidden;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
table th {
|
||||
font:70% Verdana, Geneva, Tahoma, sans-serif;
|
||||
background-color:#69625e;
|
||||
color:#f1f1f1;
|
||||
}
|
||||
|
||||
table caption {
|
||||
padding:8px 0;
|
||||
text-indent:0;
|
||||
}
|
||||
|
||||
table col {
|
||||
display:table-column;
|
||||
}
|
||||
|
||||
table colgroup {
|
||||
display:table-column-group;
|
||||
}
|
||||
|
||||
table tbody {
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
|
||||
th, td {
|
||||
font:70% Verdana, Geneva, Tahoma, sans-serif;
|
||||
padding:6px
|
||||
}
|
||||
|
||||
td.even {
|
||||
background-color:#f1f1f1;
|
||||
}
|
||||
|
||||
/* ---------- Layout ---------- */
|
||||
|
||||
#headercontainer {
|
||||
border:2px solid #69625e;
|
||||
border-left:0;
|
||||
border-right:0;
|
||||
margin:0 auto;
|
||||
width:930px;
|
||||
}
|
||||
|
||||
#header {
|
||||
margin:0 38px 0 40px;
|
||||
height:75px;
|
||||
border-bottom:1px #d6d6d6 solid;
|
||||
}
|
||||
border:1px solid #69625e;
|
||||
border-left:0;
|
||||
border-right:0;
|
||||
margin:3px 0 3px 0;
|
||||
}
|
||||
|
||||
|
||||
#header h1{
|
||||
#header h1 {
|
||||
font-size:240%;
|
||||
color:#333;
|
||||
border:0;
|
||||
margin:12px 18px;
|
||||
float:left;
|
||||
font-size:220%;
|
||||
color:#000;
|
||||
padding:42px 0 0 0;
|
||||
border-bottom:none;
|
||||
}
|
||||
|
||||
|
||||
#logindisplay {
|
||||
float:right;
|
||||
margin:58px 8px 0 0;
|
||||
font:80%;
|
||||
margin:12px auto;
|
||||
text-align:right;
|
||||
width: 930px;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
width:985px;
|
||||
height:100%;
|
||||
display:block;
|
||||
margin:0em auto;
|
||||
background:url(../Content/Images/mainBackgroundgrey.png) no-repeat center top;
|
||||
background:#fff;
|
||||
border:1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
#main {
|
||||
clear:both;
|
||||
margin:32px 0 0 27px;
|
||||
margin:0 0 0 27px;
|
||||
width:930px;
|
||||
border:1px #f5f5f5 solid;
|
||||
border-top:none;
|
||||
background:url(../Content/Images/sidebarBackground.gif) no-repeat right top #fff;
|
||||
}
|
||||
|
||||
|
||||
#content {
|
||||
float:left;
|
||||
margin:0 0 0 27px;
|
||||
margin:26px 0 0 27px;
|
||||
width:520px;
|
||||
min-height:555px;
|
||||
}
|
||||
|
||||
#sidebar {
|
||||
float:right;
|
||||
margin:4px 12px 0 0;
|
||||
margin:28px 0 0 0;
|
||||
width:325px;
|
||||
}
|
||||
|
||||
#sidebar h3 {
|
||||
border-bottom:1px dotted #e5e5e5;
|
||||
border-bottom:1px solid #f1f1f1;
|
||||
font-size: 130%;
|
||||
}
|
||||
|
||||
|
||||
#content ul,#sideBar1 ul {
|
||||
list-style:none;
|
||||
line-height:normal;
|
||||
#footercontainer {
|
||||
clear:both;
|
||||
border:2px solid #69625e;
|
||||
width:930px;
|
||||
background:#69625e;
|
||||
margin:18px 0;
|
||||
}
|
||||
|
||||
#footer {
|
||||
color:#918e8e;
|
||||
clear:both;
|
||||
border-top:1px solid #d6d6d6;
|
||||
margin:0 12px;
|
||||
padding:18px 0 18px 8px;
|
||||
border:1px solid #fff;
|
||||
margin:3px;
|
||||
}
|
||||
|
||||
#footer a{
|
||||
color:#918e8e;
|
||||
margin:0 8px;
|
||||
text-transform:uppercase;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
|
||||
/* ---------- Navigation ---------- */
|
||||
|
||||
#menucontainer {
|
||||
width:960px;
|
||||
.menucontainer {
|
||||
display:block;
|
||||
height:35px;
|
||||
margin:0em auto;
|
||||
}
|
||||
|
||||
#menucontainer ul, #footer ul {
|
||||
list-style:none;
|
||||
float:right;
|
||||
margin:18px 0;
|
||||
}
|
||||
|
||||
#menucontainer ul li {
|
||||
.menucontainer ul, #footer ul {
|
||||
list-style:none
|
||||
}
|
||||
|
||||
.menucontainer ul li {
|
||||
margin:8px 0 0 0;
|
||||
float:left;
|
||||
background:url(../Content/Images/navDivider.gif) no-repeat top right;
|
||||
}
|
||||
|
||||
#menucontainer ul li.last {
|
||||
background:none;
|
||||
}
|
||||
|
||||
#menucontainer ul li a {
|
||||
margin:0 18px 0 18px;
|
||||
font-size:110%;
|
||||
display:block;
|
||||
text-decoration:none;
|
||||
float:left;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.menucontainer ul li a {
|
||||
margin:0 18px 0 18px;
|
||||
display:block;
|
||||
text-decoration:none;
|
||||
text-transform:uppercase;
|
||||
float:left;
|
||||
}
|
||||
|
||||
#footer .menucontainer {
|
||||
font-size:80%;
|
||||
float:left;
|
||||
margin:0px;
|
||||
}
|
||||
|
||||
#footer .menucontainer ul li {
|
||||
margin:12px 0;
|
||||
}
|
||||
|
||||
/* ---------- Tags and Comments ---------- */
|
||||
.tags, .comment {
|
||||
font-style:italic;
|
||||
color:#666666;
|
||||
}
|
||||
|
||||
|
||||
/* ---------- Generic ---------- */
|
||||
|
||||
.clearBoth {
|
||||
clear:both;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 33 KiB |
@@ -2,7 +2,7 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<h1><%=Html.TitleForPage(Model.Item.Name) %></h1>
|
||||
<h2><%=Html.TitleForPage(Model.Item.Name) %></h2>
|
||||
<div class="manage"><a href="<%=Url.BlogEdit(Model.Item.Slug) %>" class="ibutton edit"><%=_Encoded("Edit") %></a></div>
|
||||
<div class="blogdescription"><p><%=Html.Encode(Model.Item.Description) %></p></div>
|
||||
<% Html.Zone("primary");
|
||||
|
@@ -4,6 +4,6 @@
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<h3><%=Html.Link(Html.Encode(Model.Item.Title), Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug)) %></h3>
|
||||
<h2><%=Html.Link(Html.Encode(Model.Item.Title), Url.BlogPost(Model.Item.Blog.Slug, Model.Item.Slug)) %></h2>
|
||||
<div class="meta"><%=Html.PublishedState(Model.Item) %> | <%Html.Zone("meta");%></div>
|
||||
<div class="postsummary"><%=Model.Item.As<BodyAspect>().Text ?? string.Format("<p><em>{0}</em></p>", _Encoded("there's no content for this blog post"))%></div>
|
@@ -0,0 +1,12 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<ContentItemViewModel<BlogPost>>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
|
||||
<%@ Import Namespace="Orchard.Blogs.Models"%>
|
||||
<h1><%=Html.TitleForPage(Model.Item.Title)%></h1>
|
||||
<div class="metadata">
|
||||
<% if (Model.Item.Creator != null) {
|
||||
%><div class="posted"><%=_Encoded("Posted by {0} {1}", Model.Item.Creator.UserName, Html.PublishedWhen(Model.Item)) %> | <a href="<%=Url.BlogPostEdit(Model.Item.Blog.Slug, Model.Item.Id) %>" class="ibutton edit"><%=_Encoded("Edit") %></a></div><%
|
||||
} %>
|
||||
</div>
|
||||
<% Html.Zone("primary");
|
||||
Html.ZonesAny(); %>
|
@@ -1,5 +1,10 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
|
||||
|
||||
<div id="footercontainer">
|
||||
<div id="footer">
|
||||
<a href="/">Link 1</a> | <a href="/">Link 2</a> | <a href="/">Link 3</a> | <a href="/">Link 4</a>
|
||||
<div class="menucontainer">
|
||||
<% Html.Include("menu"); %>
|
||||
</div>
|
||||
<div class="clearBoth"></div>
|
||||
</div>
|
||||
</div>
|
@@ -5,21 +5,28 @@
|
||||
Html.RegisterStyle("site.css");
|
||||
Html.RegisterStyle("blog.css");
|
||||
%>
|
||||
<%--Top Navigation--%>
|
||||
|
||||
<%-- todo:(nheskew) this will need to be a generated menu --%>
|
||||
<% Html.Include("menu"); %>
|
||||
|
||||
<div id="wrapper">
|
||||
<%--HTML.Include will render a div with an id="logindisplay" --%>
|
||||
<% Html.Include("User"); %>
|
||||
|
||||
<%--Top Navigation and branding--%>
|
||||
<div id="headercontainer">
|
||||
<div id="header">
|
||||
<h1><%=Html.Encode(Html.SiteName()) %></h1>
|
||||
<%-- todo:(nheskew) this will need to all go in the header zone (user widget) --%>
|
||||
<% Html.Include("User"); %>
|
||||
<div class="menucontainer">
|
||||
<% Html.Include("menu"); %>
|
||||
</div>
|
||||
<div id="main">
|
||||
<div id="content">
|
||||
<div class="clearBoth"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
<div id="content">
|
||||
<%--Main Content--%>
|
||||
<%Html.ZoneBody("content");%>
|
||||
|
||||
</div>
|
||||
<div id="sidebar">
|
||||
<ul>
|
||||
|
@@ -2,5 +2,5 @@
|
||||
author: Jonathan Wall
|
||||
description: The Orchard Theme for setup and failure conditions.
|
||||
version: 1.0
|
||||
tags: Orchard
|
||||
tags: hidden
|
||||
homepage: http://www.orchardproject.net
|
@@ -701,7 +701,7 @@ todo: (heskew) pull out into relevant modules where appropriate
|
||||
.templates p {
|
||||
overflow:hidden;
|
||||
}
|
||||
.templates img {
|
||||
.templates img, .themePreviewImage {
|
||||
border:1px solid #e8e8e8;
|
||||
height:200px;
|
||||
margin:.27em 0 .93em 0;
|
||||
@@ -712,6 +712,12 @@ todo: (heskew) pull out into relevant modules where appropriate
|
||||
height:70%;
|
||||
width:70%;
|
||||
}
|
||||
.themes #main h2 {
|
||||
margin:1em 0 0 0;
|
||||
}
|
||||
.themePreviewImage {
|
||||
height:300px;
|
||||
}
|
||||
|
||||
/* Rounded borders and other "works in some browsers" additions
|
||||
----------------------------------------------------------
|
||||
@@ -733,7 +739,7 @@ table.items, textarea, input.text, input.text-box,
|
||||
/* Added classes for new blog list layout
|
||||
---------------------------------------------------------- */
|
||||
|
||||
.blogPost.summary {
|
||||
.summary {
|
||||
padding:.6em .4em;
|
||||
}
|
||||
.actions {
|
||||
@@ -750,7 +756,6 @@ table.items, textarea, input.text, input.text-box,
|
||||
}
|
||||
#main .contentItems .properties h3 {
|
||||
border-bottom:none;
|
||||
margin:0;
|
||||
margin:0 0 0 .2em;
|
||||
padding:0;
|
||||
}
|
||||
@@ -759,7 +764,8 @@ table.items, textarea, input.text, input.text-box,
|
||||
float:right;
|
||||
text-align:right;
|
||||
}
|
||||
.related .commentcount{
|
||||
.commentcount {
|
||||
margin:0 0 0 .2em;
|
||||
line-height:2em;
|
||||
}
|
||||
.contentItems .properties ul li{
|
||||
|
@@ -1,5 +1,6 @@
|
||||
name: The Admin
|
||||
version: 1.0
|
||||
author: Jon Wall
|
||||
tags: hidden, admin
|
||||
description: An admin theme not to be used for the site so don't click "Activate" (or "Uninstall"). In the near future admin themes won't be mixed in with site themes.
|
||||
homepage: http://www.orchardproject.net
|
@@ -1,7 +1,6 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<AdminViewModel>" %>
|
||||
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
|
||||
<ul id="navigation" role="navigation">
|
||||
<li class="first"><h3><span><%=_Encoded("Dashboard")%></span></h3></li>
|
||||
<%if (Model.AdminMenu != null) {
|
||||
foreach (var menuSection in Model.AdminMenu) {
|
||||
// todo: (heskew) need some help(er)
|
||||
@@ -9,8 +8,14 @@
|
||||
var sectionHeaderMarkup = firstSectionItem != null
|
||||
? Html.ActionLink(menuSection.Text, (string)firstSectionItem.RouteValues["action"], firstSectionItem.RouteValues).ToHtmlString()
|
||||
: string.Format("<span>{0}</span>", Html.Encode(menuSection.Text));
|
||||
var classification = "";
|
||||
if (menuSection == Model.AdminMenu.First())
|
||||
classification = "first ";
|
||||
if (menuSection == Model.AdminMenu.Last())
|
||||
classification += "last ";
|
||||
|
||||
%>
|
||||
<li><h3><%=sectionHeaderMarkup %></h3><ul><%foreach (var menuItem in menuSection.Items) { %>
|
||||
<li<%=!string.IsNullOrEmpty(classification) ? string.Format(" class=\"{0}\"", classification.TrimEnd()) : "" %>><h3><%=sectionHeaderMarkup %></h3><ul><%foreach (var menuItem in menuSection.Items) { %>
|
||||
<li><%=Html.ActionLink(menuItem.Text, (string)menuItem.RouteValues["action"], menuItem.RouteValues)%></li>
|
||||
<%} %></ul></li>
|
||||
<%
|
||||
|
@@ -1,18 +0,0 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Controllers {
|
||||
[HandleError]
|
||||
public class HomeController : Controller {
|
||||
public ActionResult Index() {
|
||||
ViewData["Message"] = "Welcome to ASP.NET MVC!";
|
||||
|
||||
return View(new BaseViewModel());
|
||||
}
|
||||
|
||||
public ActionResult About() {
|
||||
|
||||
return View(new BaseViewModel());
|
||||
}
|
||||
}
|
||||
}
|
@@ -53,6 +53,10 @@ namespace Orchard.Environment {
|
||||
IEnumerable<string> orchardMasterLocationFormats = new[] {
|
||||
"~/Modules/{2}/Views/{1}/{0}.master",
|
||||
"~/Modules/{2}/Views/Shared/{0}.master",
|
||||
"~/Core/{2}/Views/{1}/{0}.master",
|
||||
"~/Core/{2}/Views/Shared/{0}.master",
|
||||
"~/Areas/{2}/Views/{1}/{0}.master",
|
||||
"~/Areas/{2}/Views/Shared/{0}.master",
|
||||
};
|
||||
|
||||
IEnumerable<string> orchardLocationFormats = new[] {
|
||||
@@ -60,6 +64,14 @@ namespace Orchard.Environment {
|
||||
"~/Modules/{2}/Views/{1}/{0}.ascx",
|
||||
"~/Modules/{2}/Views/Shared/{0}.aspx",
|
||||
"~/Modules/{2}/Views/Shared/{0}.ascx",
|
||||
"~/Core/{2}/Views/{1}/{0}.aspx",
|
||||
"~/Core/{2}/Views/{1}/{0}.ascx",
|
||||
"~/Core/{2}/Views/Shared/{0}.aspx",
|
||||
"~/Core/{2}/Views/Shared/{0}.ascx",
|
||||
"~/Areas/{2}/Views/{1}/{0}.aspx",
|
||||
"~/Areas/{2}/Views/{1}/{0}.ascx",
|
||||
"~/Areas/{2}/Views/Shared/{0}.aspx",
|
||||
"~/Areas/{2}/Views/Shared/{0}.ascx",
|
||||
};
|
||||
|
||||
var viewEngine = _viewEngines.OfType<VirtualPathProviderViewEngine>().Single();
|
||||
|
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Autofac;
|
||||
using Orchard.ContentManagement;
|
||||
@@ -111,6 +110,7 @@ namespace Orchard.Environment.ShellBuilders {
|
||||
public string Version { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string HomePage { get; set; }
|
||||
public string Tags { get; set; }
|
||||
}
|
||||
|
||||
private readonly SafeModeTheme _theme = new SafeModeTheme {
|
||||
|
@@ -21,5 +21,6 @@
|
||||
public string Version { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string HomePage { get; set; }
|
||||
public string Tags { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -56,7 +56,8 @@ namespace Orchard.Extensions {
|
||||
Description = GetValue(fields, "description"),
|
||||
Version = GetValue(fields, "version"),
|
||||
Author = GetValue(fields, "author"),
|
||||
HomePage = GetValue(fields, "homepage")
|
||||
HomePage = GetValue(fields, "homepage"),
|
||||
Tags = GetValue(fields, "tags")
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -5,8 +5,6 @@ using System.Web.Routing;
|
||||
using Autofac;
|
||||
using Autofac.Builder;
|
||||
using Autofac.Integration.Web.Mvc;
|
||||
using Orchard.Controllers;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Mvc.Filters;
|
||||
using Orchard.Extensions;
|
||||
|
||||
@@ -20,7 +18,7 @@ namespace Orchard.Mvc {
|
||||
|
||||
protected override void Load(ContainerBuilder moduleBuilder) {
|
||||
var extensions = _extensionManager.ActiveExtensions();
|
||||
var assemblies = extensions.Select(x => x.Assembly).Concat(new[] { typeof(HomeController).Assembly });
|
||||
var assemblies = extensions.Select(x => x.Assembly);
|
||||
|
||||
var module = new AutofacControllerModule(assemblies.ToArray()) {
|
||||
ActionInvokerType = typeof(FilterResolvingActionInvoker),
|
||||
|
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Autofac;
|
||||
@@ -27,14 +26,29 @@ namespace Orchard.Mvc {
|
||||
return base.CreateController(requestContext, controllerName);
|
||||
}
|
||||
|
||||
private string GetAreaName(RouteData context) {
|
||||
object area;
|
||||
if (context.Values.TryGetValue("area", out area)) {
|
||||
return Convert.ToString(area);
|
||||
public static string GetAreaName(RouteBase route) {
|
||||
var routeWithArea = route as IRouteWithArea;
|
||||
if (routeWithArea != null) {
|
||||
return routeWithArea.Area;
|
||||
}
|
||||
|
||||
var castRoute = route as Route;
|
||||
if (castRoute != null && castRoute.DataTokens != null) {
|
||||
return castRoute.DataTokens["area"] as string;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string GetAreaName(RouteData routeData) {
|
||||
object area;
|
||||
if (routeData.DataTokens.TryGetValue("area", out area)) {
|
||||
return area as string;
|
||||
}
|
||||
|
||||
return GetAreaName(routeData.Route);
|
||||
}
|
||||
|
||||
public static IContainer GetRequestContainer(RouteData routeData) {
|
||||
object dataTokenValue;
|
||||
if (routeData != null &&
|
||||
|
@@ -216,7 +216,6 @@
|
||||
<Compile Include="Localization\Text.cs" />
|
||||
<Compile Include="Mvc\ViewModels\ContentItemViewModel.cs" />
|
||||
<Compile Include="ContentManagement\ViewModels\TemplateViewModel.cs" />
|
||||
<Compile Include="Controllers\HomeController.cs" />
|
||||
<Compile Include="Data\Conventions\AttributeCollectionConvention.cs" />
|
||||
<Compile Include="Data\Conventions\CascadeAllDeleteOrphanAttribute.cs" />
|
||||
<Compile Include="Data\TransactionManager.cs" />
|
||||
|
@@ -11,5 +11,6 @@ namespace Orchard.Themes {
|
||||
string Version { get; set; }
|
||||
string Author { get; set; }
|
||||
string HomePage { get; set; }
|
||||
string Tags { get; set; }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user