mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Load advisory message in dashboard
- Current implementation uses a local file, publish it on orcharproject.net later --HG-- branch : dev
This commit is contained in:
14
src/Orchard.Web/Advisory.html
Normal file
14
src/Orchard.Web/Advisory.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<html>
|
||||
<body onload="iframeResizePipe()">
|
||||
<iframe id="helpframe" src="" frameborder="0" width="0" height="0"></iframe>
|
||||
<script type="text/javascript">
|
||||
function iframeResizePipe() {
|
||||
var height = document.body.scrollHeight;
|
||||
var helpFrame = document.getElementById('helpframe') || frames['helpframe'];
|
||||
helpFrame.src = 'Admin/DashboardProxy' + '#' + height;
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Your advisory message here -->
|
||||
</body>
|
||||
</html>
|
@@ -0,0 +1,12 @@
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Themes;
|
||||
|
||||
namespace Orchard.Core.Dashboard.Controllers {
|
||||
[Themed(false)]
|
||||
public class HelperController : Controller {
|
||||
|
||||
public ActionResult Index() {
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
@@ -26,6 +26,21 @@ namespace Orchard.Core.Dashboard {
|
||||
{"area", "Dashboard"}
|
||||
},
|
||||
new MvcRouteHandler())
|
||||
},
|
||||
new RouteDescriptor {
|
||||
Priority = -5,
|
||||
Route = new Route(
|
||||
"Admin/DashboardProxy",
|
||||
new RouteValueDictionary {
|
||||
{"area", "Dashboard"},
|
||||
{"controller", "Helper"},
|
||||
{"action", "Index"}
|
||||
},
|
||||
new RouteValueDictionary(),
|
||||
new RouteValueDictionary {
|
||||
{"area", "Dashboard"}
|
||||
},
|
||||
new MvcRouteHandler())
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -1,5 +1,22 @@
|
||||
@model dynamic
|
||||
|
||||
<script type="text/javascript">
|
||||
// Resize iframe to full height
|
||||
function resizeIframe(height) {
|
||||
// resize if there is content
|
||||
if (10 < parseInt(height)) {
|
||||
var advisory = document.getElementById('advisory') || frames['advisory'];
|
||||
advisory.height = 60 + parseInt(height) ; // add a small gap to handle browsers differences
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<iframe id="advisory" src="http://localhost:30320/OrchardLocal/Advisory.aspx" frameborder="0" height="0" width="100%" >
|
||||
<p>Your browser does not support iframes.</p>
|
||||
</iframe>
|
||||
|
||||
<h1>@Html.TitleForPage(T("Welcome to Orchard").ToString())</h1>
|
||||
<p>@T("This is the place where you can manage your web site, its appearance and its contents. Please take a moment to explore the different menu items on the left of the screen to familiarize yourself with the features of the application. For example, try to change the theme through the “Manage Themes” menu entry. You can also create new pages and manage existing ones through the “Manage Pages” menu entry or create blogs through “Manage Blogs”.")</p>
|
||||
<p>@T("Have fun!")<br />@T("The Orchard Team")</p>
|
||||
|
||||
|
||||
|
16
src/Orchard.Web/Core/Dashboard/Views/Helper/Index.cshtml
Normal file
16
src/Orchard.Web/Core/Dashboard/Views/Helper/Index.cshtml
Normal file
@@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<!-- This page is on the same domain as the parent, so can
|
||||
communicate with it to order the iframe window resizing
|
||||
to fit the content -->
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
// Tell the parent iframe what height the iframe needs to be
|
||||
function resizeFrame() {
|
||||
var height = window.location.hash.substr(1);
|
||||
parent.parent.resizeIframe(height);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="resizeFrame()">
|
||||
</body>
|
||||
</html>
|
@@ -36,9 +36,11 @@
|
||||
|
||||
@using(Script.Foot()){
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
(function ($) {
|
||||
$(".manage-field h3,.manage-part h3").expandoControl(function (controller) { return controller.nextAll(".details"); }, { collapse: true, remember: false });
|
||||
$(".manage-field h4").expandoControl(function (controller) { return controller.nextAll(".settings"); }, { collapse: true, remember: false });
|
||||
})(jQuery);
|
||||
//]]>
|
||||
</script>
|
||||
}
|
@@ -366,14 +366,6 @@ span.message {
|
||||
.messages a {
|
||||
font-weight:bold;
|
||||
}
|
||||
.message-Confirmation {
|
||||
background:#D1F2A5; /* green */
|
||||
border:1px solid #BCD994;
|
||||
}
|
||||
.message-Warning {
|
||||
background:#fdf5bc; /* yellow */
|
||||
border:1px solid #ffea9b;
|
||||
}
|
||||
/* todo: (heskew) what else (other inputs) needs this? */
|
||||
.critical.message, .validation-summary-errors,
|
||||
.input-validation-error.text-box, .input-validation-error.text {
|
||||
@@ -388,7 +380,15 @@ span.message {
|
||||
border:1px solid #cfe493;
|
||||
color:#062232;
|
||||
}
|
||||
.debug.message {
|
||||
.message-Warning {
|
||||
background:#fdf5bc; /* yellow */
|
||||
border:1px solid #ffea9b;
|
||||
}
|
||||
.message-Error {
|
||||
background:#e68585; /* green */
|
||||
border:1px solid #990808;
|
||||
color:#fff;
|
||||
}.debug.message {
|
||||
background:#eee;
|
||||
border:1px dashed #D2D6C6;
|
||||
color:#7a7a7a;
|
||||
|
Reference in New Issue
Block a user