diff --git a/src/Orchard.Specs/Blogs.feature b/src/Orchard.Specs/Blogs.feature index 7d2a60a27..cc773d77f 100644 --- a/src/Orchard.Specs/Blogs.feature +++ b/src/Orchard.Specs/Blogs.feature @@ -15,18 +15,18 @@ Scenario: I can create a new blog and blog post | name | value | | Routable.Title | My Blog | And I hit "Save" - And I go to "my-blog" - Then I should see "]*>.*?My Blog.*?" - When I go to "admin/blogs" + And I go to "admin/blogs" And I follow "My Blog" - Then I should see "foo" - When I follow "New Post" + And I follow "New Post" And I fill in | name | value | | Routable.Title | My Post | | Body.Text | Hi there. | And I hit "Publish Now" - And I go to "my-blog/my-post" + And I go to "my-blog" + Then I should see "]*>.*?My Blog.*?" + And I should see "]*>.*?My Post.*?" + When I go to "my-blog/my-post" Then I should see "]*>.*?My Post.*?" And I should see "Hi there." diff --git a/src/Orchard.Specs/Blogs.feature.cs b/src/Orchard.Specs/Blogs.feature.cs index 619696117..47fef6b10 100644 --- a/src/Orchard.Specs/Blogs.feature.cs +++ b/src/Orchard.Specs/Blogs.feature.cs @@ -93,17 +93,11 @@ this.ScenarioSetup(scenarioInfo); #line 17 testRunner.And("I hit \"Save\""); #line 18 - testRunner.And("I go to \"my-blog\""); + testRunner.And("I go to \"admin/blogs\""); #line 19 - testRunner.Then("I should see \"]*>.*?My Blog.*?\""); -#line 20 - testRunner.When("I go to \"admin/blogs\""); -#line 21 testRunner.And("I follow \"My Blog\""); -#line 22 - testRunner.Then("I should see \"foo\""); -#line 23 - testRunner.When("I follow \"New Post\""); +#line 20 + testRunner.And("I follow \"New Post\""); #line hidden TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { "name", @@ -114,12 +108,18 @@ this.ScenarioSetup(scenarioInfo); table2.AddRow(new string[] { "Body.Text", "Hi there."}); -#line 24 +#line 21 testRunner.And("I fill in", ((string)(null)), table2); -#line 28 +#line 25 testRunner.And("I hit \"Publish Now\""); +#line 26 + testRunner.And("I go to \"my-blog\""); +#line 27 + testRunner.Then("I should see \"]*>.*?My Blog.*?\""); +#line 28 + testRunner.And("I should see \"]*>.*?My Post.*?\""); #line 29 - testRunner.And("I go to \"my-blog/my-post\""); + testRunner.When("I go to \"my-blog/my-post\""); #line 30 testRunner.Then("I should see \"]*>.*?My Post.*?\""); #line 31 diff --git a/src/Orchard.Specs/Comments.feature b/src/Orchard.Specs/Comments.feature new file mode 100644 index 000000000..8ac0badd4 --- /dev/null +++ b/src/Orchard.Specs/Comments.feature @@ -0,0 +1,44 @@ +Feature: Comments + In order to enable simple comment capabilities on my site + As an author + I want to allow comments to be safely posted on specific content item pages + +Scenario: HTML markup in any given comment is encoded + Given I have installed Orchard + When I go to "admin/blogs/create" + And I fill in + | name | value | + | Routable.Title | My Blog | + And I hit "Save" + And I go to "admin/blogs" + And I follow "My Blog" + And I follow "New Post" + And I fill in + | name | value | + | Routable.Title | My Post | + | Body.Text | Hi there. | + And I hit "Publish Now" + And I go to "my-blog/my-post" + And I fill in + | name | value | + | CommentText | This is
a link. | + And I hit "Submit Comment" + And I am redirected + # because the ToUrlString extension method breaks in this specific (test) environment, the returnUrl is broken... + And I go to "my-blog/my-post" + Then I should see "This is<br id="bad-br" />a <a href" + And I should not see "
" + # another workaround because of ToUrlString in this environment + When I go to "Users/Account/LogOff" + And I am redirected + And I go to "my-blog/my-post" + And I fill in + | name | value | + | Name | Some One | + | CommentText | This is
a link. | + And I hit "Submit Comment" + And I am redirected + # because the ToUrlString extension method breaks in this specific (test) environment, the returnUrl is broken... + And I go to "my-blog/my-post" + Then I should see "This is<br id="bad-anon-br" />a <a href" + And I should not see "
" \ No newline at end of file diff --git a/src/Orchard.Specs/Comments.feature.cs b/src/Orchard.Specs/Comments.feature.cs new file mode 100644 index 000000000..d7110fc1b --- /dev/null +++ b/src/Orchard.Specs/Comments.feature.cs @@ -0,0 +1,152 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.4.0.0 +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +namespace Orchard.Specs +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Comments")] + public partial class CommentsFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "Comments.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Comments", "In order to enable simple comment capabilities on my site\r\nAs an author\r\nI want t" + + "o allow comments to be safely posted on specific content item pages", GenerationTargetLanguage.CSharp, ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("HTML markup in any given comment is encoded")] + public virtual void HTMLMarkupInAnyGivenCommentIsEncoded() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("HTML markup in any given comment is encoded", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 + testRunner.Given("I have installed Orchard"); +#line 8 + testRunner.When("I go to \"admin/blogs/create\""); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Routable.Title", + "My Blog"}); +#line 9 + testRunner.And("I fill in", ((string)(null)), table1); +#line 12 + testRunner.And("I hit \"Save\""); +#line 13 + testRunner.And("I go to \"admin/blogs\""); +#line 14 + testRunner.And("I follow \"My Blog\""); +#line 15 + testRunner.And("I follow \"New Post\""); +#line hidden + TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table2.AddRow(new string[] { + "Routable.Title", + "My Post"}); + table2.AddRow(new string[] { + "Body.Text", + "Hi there."}); +#line 16 + testRunner.And("I fill in", ((string)(null)), table2); +#line 20 + testRunner.And("I hit \"Publish Now\""); +#line 21 + testRunner.And("I go to \"my-blog/my-post\""); +#line hidden + TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table3.AddRow(new string[] { + "CommentText", + "This is
a link."}); +#line 22 + testRunner.And("I fill in", ((string)(null)), table3); +#line 25 + testRunner.And("I hit \"Submit Comment\""); +#line 26 + testRunner.And("I am redirected"); +#line 28 + testRunner.And("I go to \"my-blog/my-post\""); +#line 29 + testRunner.Then("I should see \"This is<br id="bad-br" />a <a href\""); +#line 30 + testRunner.And("I should not see \"
\""); +#line 32 + testRunner.When("I go to \"Users/Account/LogOff\""); +#line 33 + testRunner.And("I am redirected"); +#line 34 + testRunner.And("I go to \"my-blog/my-post\""); +#line hidden + TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table4.AddRow(new string[] { + "Name", + "Some One"}); + table4.AddRow(new string[] { + "CommentText", + "This is
a link."}); +#line 35 + testRunner.And("I fill in", ((string)(null)), table4); +#line 39 + testRunner.And("I hit \"Submit Comment\""); +#line 40 + testRunner.And("I am redirected"); +#line 42 + testRunner.And("I go to \"my-blog/my-post\""); +#line 43 + testRunner.Then("I should see \"This is<br id="bad-anon-br" />a <a href\""); +#line 44 + testRunner.And("I should not see \"
\""); +#line hidden + testRunner.CollectScenarioErrors(); + } + } +} +#endregion diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config index 10d6ff484..b2cbbbd39 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Core/Web.config @@ -1,6 +1,9 @@ + + + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config index dd900f1a0..61a4dd271 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config index 5253812f5..9fbdb6964 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config @@ -15,7 +15,9 @@ - + + + diff --git a/src/Orchard.Specs/Hosting/RequestExtensions.cs b/src/Orchard.Specs/Hosting/RequestExtensions.cs index 4a5ba60ce..1cd5d7fd9 100644 --- a/src/Orchard.Specs/Hosting/RequestExtensions.cs +++ b/src/Orchard.Specs/Hosting/RequestExtensions.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Text; +using System.Text.RegularExpressions; using System.Web; using System.Web.Hosting; using Orchard.Specs.Util; @@ -45,7 +46,28 @@ namespace Orchard.Specs.Hosting { string setCookie; if (details.ResponseHeaders.TryGetValue("Set-Cookie", out setCookie)) { Trace.WriteLine(string.Format("Set-Cookie: {0}", setCookie)); - webHost.Cookies = (webHost.Cookies + ';' + setCookie.Split(';').FirstOrDefault()).Trim(';'); + var cookieName = setCookie.Split(';')[0].Split('=')[0]; + DateTime expires; + if (!string.IsNullOrEmpty(webHost.Cookies) + && setCookie.Contains("expires=") + && DateTime.TryParse(setCookie.Split(new[] { "expires=" }, 2, StringSplitOptions.None)[1].Split(';')[0], out expires) + && expires < DateTime.Now) { + // remove + Trace.WriteLine(string.Format("Removing cookie: {0}", cookieName)); + webHost.Cookies = Regex.Replace(webHost.Cookies, string.Format("{0}=[^;]*;?", cookieName), ""); + } + else if (!string.IsNullOrEmpty(webHost.Cookies) + && Regex.IsMatch(webHost.Cookies, string.Format("\b{0}=", cookieName))) { + // replace + Trace.WriteLine(string.Format("Replacing cookie: {0}", cookieName)); + webHost.Cookies = Regex.Replace(webHost.Cookies, string.Format("{0}=[^;]*(;?)", cookieName), string.Format("{0}$1", setCookie.Split(';')[0])); + } + else { + // add + Trace.WriteLine(string.Format("Adding cookie: {0}", cookieName)); + webHost.Cookies = (webHost.Cookies + ';' + setCookie.Split(';').FirstOrDefault()).Trim(';'); + } + Trace.WriteLine(string.Format("Cookie jar: {0}", webHost.Cookies)); } return details; diff --git a/src/Orchard.Specs/Hosting/Simple.Web/Web.config b/src/Orchard.Specs/Hosting/Simple.Web/Web.config index 1090760b1..34890f7f7 100644 --- a/src/Orchard.Specs/Hosting/Simple.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Simple.Web/Web.config @@ -23,7 +23,9 @@ - + + + - + diff --git a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Container.cshtml b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Container.cshtml index e321e9841..d9cc0c7d2 100644 --- a/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Container.cshtml +++ b/src/Orchard.Web/Core/Containers/Views/EditorTemplates/Container.cshtml @@ -6,9 +6,9 @@ @Html.SelectOption(Model.Record.OrderByProperty, "CommonPart.PublishedUtc", T("Date Published").Text) @Html.SelectOption(Model.Record.OrderByProperty, "RoutePart.Title", T("Title").Text) @Html.SelectOption(Model.Record.OrderByProperty, "RoutePart.Slug", T("Slug").Text) - @Html.SelectOption(Model.Record.OrderByProperty, "ContainerCustomPart.CustomOne", T("Custom 1").Text) - @Html.SelectOption(Model.Record.OrderByProperty, "ContainerCustomPart.CustomTwo", T("Custom 2").Text) - @Html.SelectOption(Model.Record.OrderByProperty, "ContainerCustomPart.CustomThree", T("Custom 3").Text) + @Html.SelectOption(Model.Record.OrderByProperty, "CustomPropertiesPart.CustomOne", T("Custom 1").Text) + @Html.SelectOption(Model.Record.OrderByProperty, "CustomPropertiesPart.CustomTwo", T("Custom 2").Text) + @Html.SelectOption(Model.Record.OrderByProperty, "CustomPropertiesPart.CustomThree", T("Custom 3").Text)
- - @Html.AntiForgeryTokenOrchard() - -} +@{ +

@Html.TitleForPage(T("Install a Theme").ToString())

+ using (Html.BeginFormAntiForgeryPost(Url.Action("AddTheme", new { area = "Orchard.Gallery" }), FormMethod.Post, new { enctype = "multipart/form-data" })) { + Html.ValidationSummary(); +
+ + +
+ + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config index 271dd8ba1..5c76d8df5 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config @@ -1,6 +1,9 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Web.config b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Web.config index b4210f3e0..0dc62ece6 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Web.config +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Content/Web.config @@ -1,5 +1,8 @@  - + + + + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config index 37513c05c..c56b45fa7 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config @@ -1,5 +1,8 @@ - + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Content/Web.config b/src/Orchard.Web/Modules/Orchard.Roles/Content/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Content/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Roles/Content/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Roles/Views/Web.config index 37513c05c..b7d215131 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Roles/Views/Web.config @@ -1,5 +1,8 @@ + + + diff --git a/src/Orchard.Web/Modules/Orchard.Search/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Search/Styles/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Search/Styles/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config index 37513c05c..b7d215131 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config @@ -1,5 +1,8 @@ + + + diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Content/Web.config b/src/Orchard.Web/Modules/Orchard.Setup/Content/Web.config new file mode 100644 index 000000000..df1c33504 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Setup/Content/Web.config @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Content/synchronizing.gif b/src/Orchard.Web/Modules/Orchard.Setup/Content/synchronizing.gif new file mode 100644 index 000000000..9fb3552b7 Binary files /dev/null and b/src/Orchard.Web/Modules/Orchard.Setup/Content/synchronizing.gif differ diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj b/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj index 3c67c661a..9a3f09c68 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj +++ b/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj @@ -74,9 +74,9 @@ - - Designer - + + + @@ -100,6 +100,16 @@ + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Scripts/setup.js b/src/Orchard.Web/Modules/Orchard.Setup/Scripts/setup.js index a9c59453d..07ab184c0 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Scripts/setup.js +++ b/src/Orchard.Web/Modules/Orchard.Setup/Scripts/setup.js @@ -1 +1,14 @@ -$("#SiteName").closest("form").helpfullyFocus(); \ No newline at end of file +(function () { + function show() { + window.setTimeout(function () { + document.getElementById("throbber").style.display = "block"; + }, 2000); + } + + if (document.addEventListener) { + document.addEventListener("submit", show, false); + } + else { + document.forms[0].attachEvent("onsubmit", show); + } +})(); diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.cshtml index 3fd26831f..970ab927b 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Setup/Views/Setup/Index.cshtml @@ -1,5 +1,7 @@ @model Orchard.Setup.ViewModels.SetupViewModel - +@{ + Script.Include("setup.js").AtFoot(); +}

@Html.TitleForPage(T("Get Started").ToString())

@using (Html.BeginFormAntiForgeryPost()) { @@ -48,6 +50,18 @@ if (!Model.DatabaseIsPreconfigured) { } +
+
+
+
+

@T("Configuring Orchard...")

+

+ +

+
+
+
+
diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Setup/Views/Web.config index dd900f1a0..61a4dd271 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Setup/Views/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Tags/Styles/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Tags/Styles/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Tags/Views/Web.config index 37513c05c..b7d215131 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Tags/Views/Web.config @@ -1,5 +1,8 @@ + + + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Content/Web.config b/src/Orchard.Web/Modules/Orchard.Themes/Content/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Content/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Themes/Content/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Themes/Styles/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Themes/Styles/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Themes/Views/Admin/Index.cshtml index bfd026f26..e84d5c3e9 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Themes/Views/Admin/Index.cshtml @@ -19,7 +19,7 @@

if (Model.InstallThemes) { - @Html.ActionLink(T("Install a new Theme").ToString(), "Install", null, new { @class = "button primaryAction" }) + @Html.ActionLink(T("Install a new Theme").ToString(), "AddTheme", "Gallery", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl }, new { @class = "button primaryAction" }) } } @@ -55,11 +55,13 @@
} } - @using (Html.BeginFormAntiForgeryPost(Url.Action("Uninstall"), FormMethod.Post, new { @class = "inline link" })) { - @Html.Hidden("themeName", theme.Id) - + + @if (Model.InstallThemes) { + using (Html.BeginFormAntiForgeryPost(Url.Action("RemoveTheme", "Gallery", new { area = "Orchard.Packaging", returnUrl = HttpContext.Current.Request.RawUrl, retryUrl = HttpContext.Current.Request.RawUrl, themeId = theme.Id }), FormMethod.Post, new { @class = "inline link" })) { + + } } - + } } diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config index dd900f1a0..61a4dd271 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Content/Web.config b/src/Orchard.Web/Modules/Orchard.Users/Content/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Content/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Users/Content/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs index 85d5cc320..5491cf92f 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs @@ -57,19 +57,19 @@ namespace Orchard.Users.Controllers { if (_authenticationService.GetAuthenticatedUser() != null) return Redirect("~/"); - return View(new LogOnViewModel {Title = "Log On"}); + return View(new LogOnViewModel { Title = T("Log On").Text }); } [HttpPost] [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", Justification = "Needs to take same parameter type as Controller.Redirect()")] - public ActionResult LogOn(string userNameOrEmail, string password, bool rememberMe, string returnUrl) { + public ActionResult LogOn(string userNameOrEmail, string password, string returnUrl) { var user = ValidateLogOn(userNameOrEmail, password); if (!ModelState.IsValid) { - return View(new LogOnViewModel {Title = "Log On"}); + return View(new LogOnViewModel { Title = T("Log On").Text }); } - _authenticationService.SignIn(user, rememberMe); + _authenticationService.SignIn(user, false); if (string.IsNullOrEmpty(returnUrl)) return new RedirectResult("~/"); @@ -263,8 +263,8 @@ namespace Orchard.Users.Controllers { return View(); } - public ActionResult ChallengeEmail(string token) { - var user = _userService.ValidateChallenge(token); + public ActionResult ChallengeEmail(string nonce) { + var user = _userService.ValidateChallenge(nonce); if ( user != null ) { _authenticationService.SignIn(user, false /* createPersistentCookie */); diff --git a/src/Orchard.Web/Modules/Orchard.Users/Handlers/UserMessagesAlteration.cs b/src/Orchard.Web/Modules/Orchard.Users/Handlers/UserMessagesAlteration.cs index 19c84262e..5cde4ed1c 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Handlers/UserMessagesAlteration.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Handlers/UserMessagesAlteration.cs @@ -1,15 +1,19 @@ -using Orchard.Localization; +using System; +using Orchard.Localization; using Orchard.Messaging.Events; using Orchard.Messaging.Models; using Orchard.ContentManagement; +using Orchard.Settings; using Orchard.Users.Models; namespace Orchard.Users.Handlers { public class UserMessagesAlteration : IMessageEventHandler { private readonly IContentManager _contentManager; + private readonly ISiteService _siteService; - public UserMessagesAlteration(IContentManager contentManager) { + public UserMessagesAlteration(IContentManager contentManager, ISiteService siteService) { _contentManager = contentManager; + _siteService = siteService; T = NullLocalizer.Instance; } @@ -30,8 +34,15 @@ namespace Orchard.Users.Handlers { } if (context.Type == MessageTypes.Validation) { - context.MailMessage.Subject = T("User account validation").Text; - context.MailMessage.Body = T("Dear {0}, please click here to validate you email address.", recipient.UserName, context.Properties["ChallengeUrl"]).Text; + var registeredWebsite = _siteService.GetSiteSettings().As().ValidateEmailRegisteredWebsite; + var contactEmail = _siteService.GetSiteSettings().As().ValidateEmailContactEMail; + context.MailMessage.Subject = T("Verification E-Mail").Text; + context.MailMessage.Body = + T("Thank you for registering with {0}.


Final Step
To verify that you own this e-mail address, please click the following link:
{1}

Troubleshooting:
If clicking on the link above does not work, try the following:

Select and copy the entire link.
Open a browser window and paste the link in the address bar.
Click Go or, on your keyboard, press Enter or Return.", registeredWebsite, context.Properties["ChallengeUrl"]).Text; + + if (!String.IsNullOrWhiteSpace(contactEmail)) { + context.MailMessage.Body += T("

If you continue to have access problems or want to report other issues, please Contact Us.", contactEmail).Text; + } } if (context.Type == MessageTypes.LostPassword) { @@ -39,6 +50,12 @@ namespace Orchard.Users.Handlers { context.MailMessage.Body = T("Dear {0}, please click here to change your password.", recipient.UserName, context.Properties["LostPasswordUrl"]).Text; } + FormatEmailBody(context); + } + + private static void FormatEmailBody(MessageContext context) { + context.MailMessage.Body = "

" + context.MailMessage.Body; + context.MailMessage.Body += "

"; } public void Sent(MessageContext context) { diff --git a/src/Orchard.Web/Modules/Orchard.Users/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Users/Migrations.cs index fecbac8a4..4175a2dc5 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Migrations.cs @@ -24,8 +24,11 @@ namespace Orchard.Users { .ContentPartRecord() .Column("UsersCanRegister", c => c.WithDefault(false)) .Column("UsersMustValidateEmail", c => c.WithDefault(false)) + .Column("ValidateEmailRegisteredWebsite", c => c.WithLength(255)) + .Column("ValidateEmailContactEMail", c => c.WithLength(255)) .Column("UsersAreModerated", c => c.WithDefault(false)) .Column("NotifyModeration", c => c.WithDefault(false)) + .Column("NotificationsRecipients", c => c.Unlimited()) .Column("EnableLostPassword", c => c.WithDefault(false)) ); diff --git a/src/Orchard.Web/Modules/Orchard.Users/Models/RegistrationSettingsPart.cs b/src/Orchard.Web/Modules/Orchard.Users/Models/RegistrationSettingsPart.cs index b81af213d..711997a4b 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Models/RegistrationSettingsPart.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Models/RegistrationSettingsPart.cs @@ -13,6 +13,16 @@ namespace Orchard.Users.Models { set { Record.UsersMustValidateEmail = value; } } + public string ValidateEmailRegisteredWebsite { + get { return Record.ValidateEmailRegisteredWebsite; } + set { Record.ValidateEmailRegisteredWebsite = value; } + } + + public string ValidateEmailContactEMail { + get { return Record.ValidateEmailContactEMail; } + set { Record.ValidateEmailContactEMail = value; } + } + public bool UsersAreModerated { get { return Record.UsersAreModerated; } set { Record.UsersAreModerated = value; } @@ -23,6 +33,11 @@ namespace Orchard.Users.Models { set { Record.NotifyModeration = value; } } + public string NotificationsRecipients { + get { return Record.NotificationsRecipients; } + set { Record.NotificationsRecipients = value; } + } + public bool EnableLostPassword { get { return Record.EnableLostPassword; } set { Record.EnableLostPassword = value; } diff --git a/src/Orchard.Web/Modules/Orchard.Users/Models/RegistrationSettingsPartRecord.cs b/src/Orchard.Web/Modules/Orchard.Users/Models/RegistrationSettingsPartRecord.cs index ee6a5efea..fcc3e86c9 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Models/RegistrationSettingsPartRecord.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Models/RegistrationSettingsPartRecord.cs @@ -1,11 +1,19 @@ +using System.ComponentModel.DataAnnotations; using Orchard.ContentManagement.Records; namespace Orchard.Users.Models { public class RegistrationSettingsPartRecord : ContentPartRecord { public virtual bool UsersCanRegister { get; set; } public virtual bool UsersMustValidateEmail { get; set; } + [StringLength(255)] + public virtual string ValidateEmailRegisteredWebsite { get; set; } + [StringLength(255)] + public virtual string ValidateEmailContactEMail { get; set; } + public virtual bool UsersAreModerated { get; set; } public virtual bool NotifyModeration { get; set; } + public virtual string NotificationsRecipients { get; set; } + public virtual bool EnableLostPassword { get; set; } } } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Users/Services/MembershipService.cs b/src/Orchard.Web/Modules/Orchard.Users/Services/MembershipService.cs index 13fe5349a..19e0c0b4a 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Services/MembershipService.cs +++ b/src/Orchard.Web/Modules/Orchard.Users/Services/MembershipService.cs @@ -81,9 +81,18 @@ namespace Orchard.Users.Services { } if ( registrationSettings != null && registrationSettings.UsersAreModerated && registrationSettings.NotifyModeration && !createUserParams.IsApproved ) { - var superUser = GetUser(_orchardServices.WorkContext.CurrentSite.SuperUser); - if(superUser != null) - _messageManager.Send(superUser.ContentItem.Record, MessageTypes.Moderation, "email"); + var usernames = String.IsNullOrWhiteSpace(registrationSettings.NotificationsRecipients) + ? new string[0] + : registrationSettings.NotificationsRecipients.Split(new[] {',', ' '}, StringSplitOptions.RemoveEmptyEntries); + + foreach ( var userName in usernames ) { + if (String.IsNullOrWhiteSpace(userName)) { + continue; + } + var recipient = GetUser(userName); + if (recipient != null) + _messageManager.Send(recipient.ContentItem.Record, MessageTypes.Moderation, "email"); + } } return user; diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LogOn.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LogOn.cshtml index 8fd148678..5e43b57e1 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LogOn.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Account/LogOn.cshtml @@ -28,9 +28,6 @@ @Html.Password("password") @Html.ValidationMessage("password") -
  • - @Html.CheckBox("rememberMe", new { id = "remember-me" }) -
  • diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml index 0d827da2b..684d319a4 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Admin/Index.cshtml @@ -22,11 +22,11 @@ @foreach (var row in Model.Rows) { - @if(row.UserPart.RegistrationStatus == UserStatus.Approved) { + @if(row.UserPart.RegistrationStatus == UserStatus.Approved && row.UserPart.EmailStatus == UserStatus.Approved) { @T( } else { - @T( + @T( } @Html.ActionLink(row.UserPart.UserName, "Edit", new { row.UserPart.Id }) @@ -42,7 +42,7 @@ @Html.ActionLink(T("Disable").ToString(), "Moderate", new { row.UserPart.Id }) } @if ( row.UserPart.EmailStatus == UserStatus.Pending ) { | - @Html.ActionLink(T("Challenge Email").ToString(), "SendChallengeEmail", new { row.UserPart.Id }) + @Html.ActionLink(T("Send challenge E-mail").ToString(), "SendChallengeEmail", new { row.UserPart.Id }) } diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/EditorTemplates/Parts/Users.RegistrationSettings.cshtml b/src/Orchard.Web/Modules/Orchard.Users/Views/EditorTemplates/Parts/Users.RegistrationSettings.cshtml index 6c8230863..8c9d4c568 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/EditorTemplates/Parts/Users.RegistrationSettings.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/EditorTemplates/Parts/Users.RegistrationSettings.cshtml @@ -5,26 +5,38 @@
    @Html.EditorFor(m => m.UsersCanRegister) - @Html.ValidationMessage("UsersCanRegister", "*")
    @Html.EditorFor(m => m.EnableLostPassword) - @Html.ValidationMessage("EnableLostPassword", "*")
    @Html.EditorFor(m => m.UsersMustValidateEmail) - @Html.ValidationMessage("UsersMustValidateEmail", "*") +
    +
    + + @Html.TextBoxFor(m => m.ValidateEmailRegisteredWebsite, new { @class = "textMedium" } ) + @Html.ValidationMessage("ValidateEmailRegisteredWebsite", "*") + @T("The name of your website as it will appear in the verification e-mail.") + + + @Html.TextBoxFor(m => m.ValidateEmailContactEMail, new { @class = "textMedium" } ) + @Html.ValidationMessage("ValidateEmailContactEMail", "*") + @T("The e-mail address displayed in the verification e-mail for a Contact Us link. Leave empty for no link.")
    @Html.EditorFor(m => m.UsersAreModerated) - @Html.ValidationMessage("UsersAreModerated", "*")
    @Html.EditorFor(m => m.NotifyModeration) - @Html.ValidationMessage("NotifyModeration", "*")
    +
    + + @Html.TextBoxFor(m => m.NotificationsRecipients, new { @class = "textMedium" } ) + @Html.ValidationMessage("NotificationsRecipients", "*") + @T("The usernames to send the notifications to (e.g., \"admin, user1, ...\").") +
    \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Users/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Users/Views/Web.config index 37513c05c..b7d215131 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Users/Views/Web.config @@ -1,5 +1,8 @@ + + + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Content/Web.config b/src/Orchard.Web/Modules/Orchard.Widgets/Content/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Content/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Content/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Drivers/WidgetBagPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Drivers/WidgetBagPartDriver.cs deleted file mode 100644 index d4072c7a8..000000000 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Drivers/WidgetBagPartDriver.cs +++ /dev/null @@ -1,13 +0,0 @@ -using JetBrains.Annotations; -using Orchard.ContentManagement.Drivers; -using Orchard.Widgets.Models; - -namespace Orchard.Widgets.Drivers { - [UsedImplicitly] - public class WidgetBagPartDriver : ContentPartDriver { - protected override DriverResult Editor(WidgetBagPart part, dynamic shapeHelper) { - return ContentShape("Parts_Widgets_WidegetBagPart", - () => shapeHelper.EditorTemplate(TemplateName: "Parts/Widgets.WidgetBagPart", Model: part, Prefix: Prefix)); - } - } -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs index f14da7222..cf2ad4b81 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Migrations.cs @@ -60,15 +60,6 @@ namespace Orchard.Widgets { .WithSetting("Stereotype", "Widget") ); - ContentDefinitionManager.AlterTypeDefinition("WidgetPage", - cfg => cfg - .WithPart("CommonPart") - .WithPart("RoutePart") - .WithPart("WidgetBagPart") - .WithPart("MenuPart") - .Creatable() - ); - return 1; } } diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Models/WidgetBagPart.cs b/src/Orchard.Web/Modules/Orchard.Widgets/Models/WidgetBagPart.cs deleted file mode 100644 index 4561d6014..000000000 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Models/WidgetBagPart.cs +++ /dev/null @@ -1,5 +0,0 @@ -using Orchard.ContentManagement; - -namespace Orchard.Widgets.Models { - public class WidgetBagPart : ContentPart {} -} diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj index cbc367726..4e9284f5c 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj @@ -47,14 +47,12 @@ - - diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Widgets/Styles/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Styles/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config index 1f92a3531..7d689782e 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.jQuery/Scripts/Web.config b/src/Orchard.Web/Modules/Orchard.jQuery/Scripts/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.jQuery/Scripts/Web.config +++ b/src/Orchard.Web/Modules/Orchard.jQuery/Scripts/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config b/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config +++ b/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Modules/TinyMce/Views/Web.config b/src/Orchard.Web/Modules/TinyMce/Views/Web.config index 37513c05c..b7d215131 100644 --- a/src/Orchard.Web/Modules/TinyMce/Views/Web.config +++ b/src/Orchard.Web/Modules/TinyMce/Views/Web.config @@ -1,5 +1,8 @@ + + + diff --git a/src/Orchard.Web/Themes/SafeMode/Content/Web.config b/src/Orchard.Web/Themes/SafeMode/Content/Web.config index b4210f3e0..0dc62ece6 100644 --- a/src/Orchard.Web/Themes/SafeMode/Content/Web.config +++ b/src/Orchard.Web/Themes/SafeMode/Content/Web.config @@ -1,5 +1,8 @@  - + + + + diff --git a/src/Orchard.Web/Themes/SafeMode/Styles/Web.config b/src/Orchard.Web/Themes/SafeMode/Styles/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Themes/SafeMode/Styles/Web.config +++ b/src/Orchard.Web/Themes/SafeMode/Styles/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Themes/SafeMode/Styles/site.css b/src/Orchard.Web/Themes/SafeMode/Styles/site.css index e7238cbcd..02f1cc0f8 100644 --- a/src/Orchard.Web/Themes/SafeMode/Styles/site.css +++ b/src/Orchard.Web/Themes/SafeMode/Styles/site.css @@ -173,6 +173,34 @@ button:focus::-moz-focus-inner, .button:focus::-moz-focus-inner { /* Confirmations, Messages and the like ***************************************************************/ +#throbber { + display:none; +} +#throbber .curtain +{ + position:absolute; + left:0; + top:0; + width:100%; + height:100%; + background-color:Gray; + filter:alpha(opacity=70); + opacity: 0.7; +} +#throbber .curtain-content +{ + position:absolute; + left:0; + top:0; + width:100%; + height:100%; +} +#throbber .curtain-content div { + text-align:center; + padding:250px; + color:White; +} + .message, .validation-summary-errors { margin:10px 0 4px 0; padding:4px; diff --git a/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config b/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config index b4210f3e0..0dc62ece6 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config +++ b/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config @@ -1,5 +1,8 @@  - + + + + diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config b/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config index b4210f3e0..0dc62ece6 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config @@ -1,5 +1,8 @@  - + + + + diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css index e8fdc6504..293b3de49 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css @@ -58,7 +58,6 @@ blockquote, q { quotes: "" ""; } header, footer, aside, nav, article { display: block; } /* end: reset */ - /* Clearing Floats ***************************************************************/ @@ -460,6 +459,10 @@ form.inline fieldset { padding-top:0; } +input[type="checkbox"]:focus, input[type="radio"]:focus { + outline:1px dotted #666d51; +} + legend span { font-weight:normal; } diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config index b4210f3e0..df1c33504 100644 --- a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config +++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard.Web/Themes/Web.config b/src/Orchard.Web/Themes/Web.config index d0b6640a4..be244e18c 100644 --- a/src/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Web/Themes/Web.config @@ -1,5 +1,8 @@  + + + diff --git a/src/Orchard/Utility/Extensions/StringExtensions.cs b/src/Orchard/Utility/Extensions/StringExtensions.cs index d0a760210..bc1225b1e 100644 --- a/src/Orchard/Utility/Extensions/StringExtensions.cs +++ b/src/Orchard/Utility/Extensions/StringExtensions.cs @@ -6,8 +6,8 @@ namespace Orchard.Utility.Extensions { public static class StringExtensions { private static readonly Regex humps = new Regex("(?:^[a-zA-Z][^A-Z]*|[A-Z][^A-Z]*)"); public static string CamelFriendly(this string camel) { - if (camel == null) - return null; + if (string.IsNullOrWhiteSpace(camel)) + return ""; var matches = humps.Matches(camel).OfType().Select(m => m.Value); return matches.Any() @@ -20,17 +20,19 @@ namespace Orchard.Utility.Extensions { } public static string Ellipsize(this string text, int characterCount, string ellipsis) { - var cleanTailRegex = new Regex(@"\s+\S*$"); - - if (string.IsNullOrEmpty(text) || characterCount < 0 || text.Length <= characterCount) + if (string.IsNullOrWhiteSpace(text)) + return ""; + + if (characterCount < 0 || text.Length <= characterCount) return text; - return cleanTailRegex.Replace(text.Substring(0, characterCount + 1), "") + ellipsis; + return Regex.Replace(text.Substring(0, characterCount + 1), @"\s+\S*$", "") + ellipsis; } public static string HtmlClassify(this string text) { if (string.IsNullOrWhiteSpace(text)) - return text; + return ""; + var friendlier = text.CamelFriendly(); return Regex.Replace(friendlier, @"[^a-zA-Z]+", m => m.Index == 0 ? "" : "-").ToLowerInvariant(); } @@ -42,10 +44,16 @@ namespace Orchard.Utility.Extensions { } public static string RemoveTags(this string html) { - var tagRegex = new Regex("<[^<>]*>", RegexOptions.Singleline); - var text = tagRegex.Replace(html, ""); + return string.IsNullOrEmpty(html) + ? "" + : Regex.Replace(html, "<[^<>]*>", "", RegexOptions.Singleline); + } - return text; + // not accounting for only \r (e.g. Apple OS 9 carriage return only new lines) + public static string ReplaceNewLinesWith(this string text, string replacement) { + return string.IsNullOrWhiteSpace(text) + ? "" + : Regex.Replace(text, @"(\r?\n)", replacement, RegexOptions.Singleline); } } } \ No newline at end of file