diff --git a/src/Orchard.Web/Core/Navigation/Views/Admin/Index.ascx b/src/Orchard.Web/Core/Navigation/Views/Admin/Index.ascx index f4d02efe0..23bab71c7 100644 --- a/src/Orchard.Web/Core/Navigation/Views/Admin/Index.ascx +++ b/src/Orchard.Web/Core/Navigation/Views/Admin/Index.ascx @@ -1,3 +1,44 @@ <%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl" %> <%@ Import Namespace="Orchard.Core.Navigation.ViewModels"%> -

<%=Html.TitleForPage(T("Edit Main Menu").ToString())%>

+

<%=Html.TitleForPage(T("Edit Main Menu").ToString())%>

<% +using (Html.BeginFormAntiForgeryPost()) { %> + + + + + + + + + + + <%-- loop over menu items --%> + + + + + + + <%-- end loop --%> + + + + + + + +
TextPositionUrl
Delete Button
Update All Button
<% +} + +using (Html.BeginFormAntiForgeryPost()) { %> + + + + + + + + + +
Add Button
<% +} %> \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs index 621cba3d0..d2d913f32 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Web.Mvc; using Orchard.Comments.Models; using Orchard.ContentManagement; @@ -36,6 +37,14 @@ namespace Orchard.Setup.Controllers { private Localizer T { get; set; } public ActionResult Index(SetupViewModel model) { + string message = ""; + if(!CanWriteTo(Server.MapPath("~/App_Data"), out message)) { + _notifier.Error( + T( + "Hey, it looks like I can't write to the App_Data folder in the root of this application and that's where I need to save some of the information you're about to enter.\r\n\r\nPlease give me (the machine account this application is running under) write access to App_Data so I can get this app all set up for you.\r\n\r\nThanks!\r\n\r\n----\r\n{0}", + message)); + } + return View(model ?? new SetupViewModel { AdminUsername = "admin" }); } @@ -112,5 +121,21 @@ namespace Orchard.Setup.Controllers { return Index(model); } } + + static bool CanWriteTo(string path, out string message) { + try { + var systemCheckPath = Path.Combine(path, "_systemcheck.txt"); + + System.IO.File.WriteAllText(systemCheckPath, "Communicator check one two one two"); + System.IO.File.AppendAllText(systemCheckPath, "\r\nThis is Bones McCoy on a line to Sulu"); + System.IO.File.Delete(systemCheckPath); + + message = ""; + return true; + } catch (Exception ex) { + message = ex.Message.Replace("_systemcheck.txt", ""); + return false; + } + } } } diff --git a/src/Orchard.Web/Modules/Orchard.Setup/ViewModels/SetupViewModel.cs b/src/Orchard.Web/Modules/Orchard.Setup/ViewModels/SetupViewModel.cs index e44633f27..c0ee81b3f 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/ViewModels/SetupViewModel.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/ViewModels/SetupViewModel.cs @@ -4,11 +4,11 @@ using Orchard.Mvc.ViewModels; namespace Orchard.Setup.ViewModels { public class SetupViewModel : BaseViewModel { - [Required, StringLength(70)] + [Required(ErrorMessage = "Site name is required."), StringLength(70, ErrorMessage = "Site name can be no longer than 70 characters.")] public string SiteName { get; set; } - [Required, StringLengthMin(3), StringLength(25)] + [Required(ErrorMessage = "User name is required."), StringLengthMin(3, ErrorMessage = "User name must be longer than 3 characters."), StringLength(25, ErrorMessage = "User name can be no longer than 25 characters.")] public string AdminUsername { get; set; } - [Required, StringLengthMin(6), StringLength(50)] + [Required(ErrorMessage = "Password is required."), StringLengthMin(6, ErrorMessage = "Password must be longer than 6 characters."), StringLength(50, ErrorMessage = "Password can be no longer than 50 characters.")] public string AdminPassword { get; set; } [SqlDatabaseConnectionString] public string DatabaseConnectionString { get; set; } diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.ascx b/src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.ascx index 77ac0ca28..24c8b0c16 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.ascx +++ b/src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.ascx @@ -10,28 +10,25 @@ using (Html.BeginFormAntiForgeryPost()) { %>
<%=Html.EditorFor(svm => svm.SiteName) %> - <%=Html.ValidationMessage("SiteName", "*") %>
<%=Html.EditorFor(svm => svm.AdminUsername)%> - <%=Html.ValidationMessage("AdminUsername", "*")%>
<%=Html.PasswordFor(svm => svm.AdminPassword) %> - <%=Html.ValidationMessage("AdminPassword", "*") %>
-
+
"> <%=_Encoded("How would you like to store your data?") %> <%=Html.ValidationMessage("DatabaseOptions", "Unable to setup data storage") %>
- + <%=Html.RadioButtonFor(svm => svm.DatabaseOptions, true, new { id = "builtin" })%>
- + <%=Html.RadioButtonFor(svm => svm.DatabaseOptions, false, new { id = "sql" })%> diff --git a/src/Orchard.Web/Themes/SafeMode/Styles/site.css b/src/Orchard.Web/Themes/SafeMode/Styles/site.css index c49327828..981b2801d 100644 --- a/src/Orchard.Web/Themes/SafeMode/Styles/site.css +++ b/src/Orchard.Web/Themes/SafeMode/Styles/site.css @@ -60,7 +60,7 @@ h5 {font-size: 105%;} #main { - margin:0 auto; + margin:0 auto 40px; width:600px; } @@ -146,6 +146,58 @@ button:focus, .button:focus { text-decoration:none; } -html.dyn fieldset.data div span { +html.dyn fieldset.data.builtin div span { display:none; +} + + +/* Confirmations, Messages and the like +----------------------------------------------------------*/ +.message, .validation-summary-errors { + margin:10px 0 4px 0; + padding:4px; + white-space:pre-wrap; +} +form .message, form .validation-summary-errors { + margin:0 10px; + white-space:inherit; +} +span.message { + display:block; + margin:4px 0 4px 4px; +} +.message a { + font-weight:bold; +} + +.confirmation.message { + background:#e6f1c9; /* green */ + border:1px solid #cfe493; +} +.warning.message { + 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, +input[type="password"].input-validation-error { + border:1px solid #990808; +} +.critical.message, .validation-summary-errors { + background:#e68585; /* red */ + color:#fff; +} +.info.message { + background:#fff; /* orange :P */ + border:1px dashed #D2D6C6; +} +.debug.message { + background:#eee; + border:1px dashed #D2D6C6; + color:#7a7a7a; + margin:20px 0 14px 0; +} +.debug.message:before { + content:"DEBUG » "; } \ No newline at end of file