mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -39,7 +39,7 @@ Scenario: Some of the initial form values are required
|
||||
Scenario: Calling setup on a brand new install
|
||||
Given I have a clean site with
|
||||
| extension | names |
|
||||
| Module | Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Lists, Orchard.ContentTypes, Orchard.Messaging, Orchard.Media, Orchard.MediaPicker, Orchard.Scripting, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce, Orchard.Blogs, Orchard.Tags, Orchard.Packaging, Orchard.Recipes |
|
||||
| Module | Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Lists, Orchard.ContentTypes, Orchard.Messaging, Orchard.Media, Orchard.MediaPicker, Orchard.Scripting, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce, Orchard.Blogs, Orchard.Tags, Orchard.Packaging, Orchard.Recipes, Orchard.Warmup |
|
||||
| Core | Common, Containers, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Scheduling, Settings, Shapes, XmlRpc |
|
||||
| Theme | SafeMode, TheThemeMachine |
|
||||
And I am on "/Setup"
|
||||
|
||||
4
src/Orchard.Specs/Setup.feature.cs
generated
4
src/Orchard.Specs/Setup.feature.cs
generated
@@ -2,7 +2,7 @@
|
||||
// <auto-generated>
|
||||
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||
// SpecFlow Version:1.5.0.0
|
||||
// Runtime Version:4.0.30319.1
|
||||
// Runtime Version:4.0.30319.225
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -176,7 +176,7 @@ this.ScenarioSetup(scenarioInfo);
|
||||
"names"});
|
||||
table4.AddRow(new string[] {
|
||||
"Module",
|
||||
@"Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Lists, Orchard.ContentTypes, Orchard.Messaging, Orchard.Media, Orchard.MediaPicker, Orchard.Scripting, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce, Orchard.Blogs, Orchard.Tags, Orchard.Packaging, Orchard.Recipes"});
|
||||
@"Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Lists, Orchard.ContentTypes, Orchard.Messaging, Orchard.Media, Orchard.MediaPicker, Orchard.Scripting, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce, Orchard.Blogs, Orchard.Tags, Orchard.Packaging, Orchard.Recipes, Orchard.Warmup"});
|
||||
table4.AddRow(new string[] {
|
||||
"Core",
|
||||
"Common, Containers, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, S" +
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
|
||||
Model.Classes.Add("pager");
|
||||
Model.Classes.Add("group");
|
||||
var tag = Tag(Model, "ul");
|
||||
var pageTag = Tag(Model, "ul");
|
||||
|
||||
Model.Classes.Add("selector");
|
||||
var pageSizeTag = Tag(Model, "ul");
|
||||
|
||||
if (Model.RouteData != null) {
|
||||
foreach (var rd in Model.RouteData.Values) {
|
||||
@@ -40,21 +43,32 @@
|
||||
}
|
||||
|
||||
@if (Model.TotalItemCount > 1) {
|
||||
using (Html.BeginFormAntiForgeryPost()) {
|
||||
<div class="pager-footer">
|
||||
|
||||
@if (totalPageCount > 1 || Model.PageSize == 0 || Model.PageSize > pageSizes.First()) {
|
||||
<div class="page-size-options">
|
||||
<input type="hidden" name="Page" value="1" />
|
||||
<label for="pageSize">@T("Show:")</label>
|
||||
<select id="pageSize" name="PageSize">
|
||||
@Html.SelectOption((int)Model.PageSize, 0, T("All").ToString())
|
||||
@foreach (int size in pageSizes.OrderBy(p => p)) {
|
||||
@Html.SelectOption((int)Model.PageSize, size, size.ToString())
|
||||
}
|
||||
</select>
|
||||
<div>@T("Show:")</div>
|
||||
|
||||
<button id="submit-pager" type="submit">@T("Apply")</button>
|
||||
@pageSizeTag.StartElement
|
||||
|
||||
@{ routeData["pageSize"] = 0; }
|
||||
|
||||
@if ((int)Model.PageSize == 0) {
|
||||
<li class="selected"><span>@T("All").ToString()</span></li>
|
||||
} else {
|
||||
<li>@Html.ActionLink(T("All").ToString(), (string)routeData["action"], (string)routeData["controller"], routeData, null)</li>
|
||||
}
|
||||
|
||||
@foreach (int size in pageSizes.OrderBy(p => p)) {
|
||||
routeData["pageSize"] = size;
|
||||
|
||||
if ((int)Model.PageSize == size) {
|
||||
<li class="selected"><span>@size.ToString()</span></li>
|
||||
} else {
|
||||
<li>@Html.ActionLink(size.ToString(), (string)routeData["action"], (string)routeData["controller"], routeData, null)</li>
|
||||
}
|
||||
}
|
||||
|
||||
@pageSizeTag.EndElement
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -62,7 +76,7 @@
|
||||
|
||||
@if (totalPageCount > 1) {
|
||||
routeData["pageSize"] = Model.PageSize;
|
||||
@tag.StartElement
|
||||
@pageTag.StartElement
|
||||
|
||||
// first
|
||||
if (firstPage > 1) {
|
||||
@@ -79,7 +93,8 @@
|
||||
if (Model.Page > 1) {
|
||||
if (Model.Page == 2 && routeData.ContainsKey("page")) {
|
||||
routeData.Remove("page");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
routeData["page"] = Model.Page - 1;
|
||||
}
|
||||
|
||||
@@ -93,10 +108,12 @@
|
||||
<li class="page-@p">
|
||||
@if (p == Model.Page) {
|
||||
<span>@p</span>
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if (p == 1) {
|
||||
routeData.Remove("page");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
routeData["page"] = p;
|
||||
}
|
||||
@Html.ActionLink(p.ToString(), (string)routeData["action"], (string)routeData["controller"], routeData, null)
|
||||
@@ -122,27 +139,38 @@
|
||||
</li>
|
||||
}
|
||||
|
||||
@tag.EndElement
|
||||
@pageTag.EndElement
|
||||
}
|
||||
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@using(Script.Foot()) {
|
||||
@using (Script.Foot()) {
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$(function () {
|
||||
// Add the event handler for value change in the select field
|
||||
$("#pageSize").change(function () {
|
||||
var self = $(this);
|
||||
var form = self.parents("form");
|
||||
|
||||
// Submit form
|
||||
form.submit();
|
||||
|
||||
// disable button so that no other value can be chosen while the form is submited
|
||||
self.attr("disabled", true);
|
||||
$('ul.selector').each(function () {
|
||||
var self = $(this),
|
||||
options = $.map(self.find("li"), function (li) {
|
||||
var self = $(li);
|
||||
return $("<option/>", {
|
||||
value: self.children("a").attr("href"),
|
||||
text: self.text(),
|
||||
selected: self.hasClass("selected")
|
||||
})[0];
|
||||
}),
|
||||
select = $("<select/>", {
|
||||
id: self.attr("id") + "Selector",
|
||||
"class": self.attr("class"),
|
||||
name: self.attr("name") + "Selector"
|
||||
}).change(onSelectChange).append(options);
|
||||
self.replaceWith(select);
|
||||
});
|
||||
|
||||
function onSelectChange() {
|
||||
// redirect to page with new page size
|
||||
// disable button so that no other value can be chosen while the form is submited
|
||||
window.location = $(this).attr("disabled", true).val();
|
||||
}
|
||||
})
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user