mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
Taking care of some (mainly cleanup) todos.
--HG-- extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4044524
This commit is contained in:
@@ -143,6 +143,7 @@
|
||||
<Content Include="Themes\Views\document.aspx" />
|
||||
<Content Include="Themes\Views\EditorTemplates\Parts\Themes.SiteSettings.ascx" />
|
||||
<Content Include="Themes\Views\layout.ascx" />
|
||||
<Content Include="Themes\Views\messages.ascx" />
|
||||
<Content Include="Themes\Views\user.ascx" />
|
||||
<Content Include="Themes\Views\menu.ascx" />
|
||||
<Content Include="Themes\Views\Web.config" />
|
||||
|
@@ -1,8 +1,6 @@
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Web.Routing;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Settings.Models;
|
||||
using Orchard.Settings;
|
||||
using Orchard.Themes;
|
||||
|
||||
@@ -15,8 +13,7 @@ namespace Orchard.Core.Themes.Services {
|
||||
}
|
||||
|
||||
public ThemeSelectorResult GetTheme(RequestContext context) {
|
||||
//todo: (heskew) get at the SiteUrl the "right" way. or is this the right way :|
|
||||
var siteUrl = _siteService.GetSiteSettings().ContentItem.As<SiteSettings>().Record.SiteUrl;
|
||||
var siteUrl = _siteService.GetSiteSettings().SiteUrl;
|
||||
//todo: (heskew) get at the admin path in a less hacky way
|
||||
if (!context.HttpContext.Request.Path.StartsWith(Path.Combine(siteUrl, "admin").Replace("\\", "/"), true, CultureInfo.InvariantCulture))
|
||||
return null;
|
||||
|
16
src/Orchard.Web/Core/Themes/Views/messages.ascx
Normal file
16
src/Orchard.Web/Core/Themes/Views/messages.ascx
Normal file
@@ -0,0 +1,16 @@
|
||||
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<NotifyEntry>>" %>
|
||||
<%@ Import Namespace="Orchard.UI.Notify"%>
|
||||
<%-- todo: (heskew) not this --%>
|
||||
<script runat="server">
|
||||
string CssClassName(NotifyType type) {
|
||||
switch(type) {
|
||||
case NotifyType.Error:
|
||||
return "critical";
|
||||
case NotifyType.Warning:
|
||||
return "warning";
|
||||
}
|
||||
return "info";
|
||||
}</script>
|
||||
<% foreach (var item in Model) { %>
|
||||
<div class="<%=CssClassName(item.Type) %> message"><%=Html.Encode(item.Message) %></div>
|
||||
<% } %>
|
Reference in New Issue
Block a user