diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index aa76643..6d847fb 100644 --- a/AssemblyVersion.cs +++ b/AssemblyVersion.cs @@ -16,5 +16,5 @@ using System.Reflection; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.0.4.567")] -[assembly: AssemblyFileVersion("3.0.4.567")] \ No newline at end of file +[assembly: AssemblyVersion("3.0.4.568")] +[assembly: AssemblyFileVersion("3.0.4.568")] \ No newline at end of file diff --git a/Core/Host.cs b/Core/Host.cs index 756279f..af9f56f 100644 --- a/Core/Host.cs +++ b/Core/Host.cs @@ -144,6 +144,8 @@ namespace ScrewTurn.Wiki { return Settings.DefaultCacheProvider; case SettingName.RootNamespaceTheme: return Settings.GetTheme(null); + case SettingName.ListSize: + return Settings.ListSize.ToString(); } return ""; } diff --git a/Core/Settings.cs b/Core/Settings.cs index b6d7a6b..a2ead8f 100644 --- a/Core/Settings.cs +++ b/Core/Settings.cs @@ -432,6 +432,18 @@ namespace ScrewTurn.Wiki { } } + /// + /// Gets or sets the number of items displayed in pages/users lists. + /// + public static int ListSize { + get { + return GetInt(Provider.GetSetting("ListSize"), 50); + } + set { + Provider.SetSetting("ListSize", value.ToString()); + } + } + /// /// Gets or sets the Account Activation Mode. /// diff --git a/PluginFramework/IHost.cs b/PluginFramework/IHost.cs index 6e33a95..670b402 100644 --- a/PluginFramework/IHost.cs +++ b/PluginFramework/IHost.cs @@ -631,7 +631,11 @@ namespace ScrewTurn.Wiki.PluginFramework { /// /// The name of the theme of the root namespace. /// - RootNamespaceTheme + RootNamespaceTheme, + /// + /// The number of items to display in lists of items before enabling paging. + /// + ListSize } /// diff --git a/WebApplication/AdminConfig.aspx b/WebApplication/AdminConfig.aspx index 6138dad..585af8c 100644 --- a/WebApplication/AdminConfig.aspx +++ b/WebApplication/AdminConfig.aspx @@ -232,73 +232,73 @@ CssClass="configlarge" meta:resourcekey="lstDefaultTimeZoneResource1"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -419,6 +419,21 @@ Text="Display Gravatars for user accounts" meta:resourcekey="chkDisplayGravatarsResource1" /> + +
+ + + + + +
@@ -442,9 +457,9 @@ CssClass="configlarge" meta:resourcekey="lstAccountActivationModeResource1"> - -
@@ -584,10 +599,10 @@
-
- +
+
@@ -600,21 +615,21 @@
-
- -
+ +
-
- +
+ @@ -465,6 +466,7 @@ namespace ScrewTurn.Wiki { if(txtKeptBackupNumber.Text == "") Settings.KeptBackupNumber = -1; else Settings.KeptBackupNumber = int.Parse(txtKeptBackupNumber.Text); Settings.DisplayGravatars = chkDisplayGravatars.Checked; + Settings.ListSize = int.Parse(txtListSize.Text); // Save security configuration Settings.UsersCanRegister = chkAllowUsersToRegister.Checked; diff --git a/WebApplication/AdminConfig.aspx.designer.cs b/WebApplication/AdminConfig.aspx.designer.cs index 43d47a0..996c59e 100644 --- a/WebApplication/AdminConfig.aspx.designer.cs +++ b/WebApplication/AdminConfig.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -706,6 +705,42 @@ namespace ScrewTurn.Wiki { /// protected global::Anthem.CheckBox chkDisplayGravatars; + /// + /// lblDisplayAtMostPre control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal lblDisplayAtMostPre; + + /// + /// txtListSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Anthem.TextBox txtListSize; + + /// + /// lblDisplayAtMostPost control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal lblDisplayAtMostPost; + + /// + /// rvListSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::Anthem.RangeValidator rvListSize; + /// /// lblSecurityConfig control. /// diff --git a/WebApplication/AdminPages.aspx b/WebApplication/AdminPages.aspx index 46160e7..5301c80 100644 --- a/WebApplication/AdminPages.aspx +++ b/WebApplication/AdminPages.aspx @@ -44,7 +44,7 @@
- +
diff --git a/WebApplication/AdminPages.aspx.cs b/WebApplication/AdminPages.aspx.cs index d5f6fc6..2ef4fa9 100644 --- a/WebApplication/AdminPages.aspx.cs +++ b/WebApplication/AdminPages.aspx.cs @@ -13,18 +13,20 @@ namespace ScrewTurn.Wiki { /// /// The numer of items in a page. /// - public const int PageSize = 50; + public int PageSize = 50; private IList currentPages = null; private int rangeBegin = 0; - private int rangeEnd = PageSize - 1; + private int rangeEnd = 49; private int selectedPage = 0; private PageInfo externallySelectedPage = null; protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); + PageSize = Settings.ListSize; + rangeEnd = PageSize - 1; if(!Page.IsPostBack) { // Load namespaces diff --git a/WebApplication/AdminPages.aspx.designer.cs b/WebApplication/AdminPages.aspx.designer.cs index f51f2b6..d8037ef 100644 --- a/WebApplication/AdminPages.aspx.designer.cs +++ b/WebApplication/AdminPages.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebApplication/AdminUsers.aspx b/WebApplication/AdminUsers.aspx index 3dffb1c..a9f616d 100644 --- a/WebApplication/AdminUsers.aspx +++ b/WebApplication/AdminUsers.aspx @@ -55,7 +55,7 @@ meta:resourcekey="btnFilterResource1" />
- +
diff --git a/WebApplication/AdminUsers.aspx.cs b/WebApplication/AdminUsers.aspx.cs index 9afeba6..6e6defb 100644 --- a/WebApplication/AdminUsers.aspx.cs +++ b/WebApplication/AdminUsers.aspx.cs @@ -14,16 +14,18 @@ namespace ScrewTurn.Wiki { /// /// The numer of items in a page. /// - public const int PageSize = 50; + public int PageSize = 50; private IList currentUsers = null; private int rangeBegin = 0; - private int rangeEnd = PageSize - 1; + private int rangeEnd = 49; private int selectedPage = 0; protected void Page_Load(object sender, EventArgs e) { AdminMaster.RedirectToLoginIfNeeded(); + PageSize = Settings.ListSize; + rangeEnd = PageSize - 1; if(!AdminMaster.CanManageUsers(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames())) UrlTools.Redirect("AccessDenied.aspx"); aclActionsSelector.Visible = AdminMaster.CanManagePermissions(SessionFacade.GetCurrentUsername(), SessionFacade.GetCurrentGroupNames()); diff --git a/WebApplication/AdminUsers.aspx.designer.cs b/WebApplication/AdminUsers.aspx.designer.cs index 01a0c35..d67d9bf 100644 --- a/WebApplication/AdminUsers.aspx.designer.cs +++ b/WebApplication/AdminUsers.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebApplication/AllPages.aspx b/WebApplication/AllPages.aspx index bfb4dd6..65361a5 100644 --- a/WebApplication/AllPages.aspx +++ b/WebApplication/AllPages.aspx @@ -4,18 +4,18 @@ -

-

-
- - - • - - -
- +

+

+
+ + + • + + +
+
- + diff --git a/WebApplication/AllPages.aspx.cs b/WebApplication/AllPages.aspx.cs index a6d36d5..a4ed1a5 100644 --- a/WebApplication/AllPages.aspx.cs +++ b/WebApplication/AllPages.aspx.cs @@ -21,16 +21,18 @@ namespace ScrewTurn.Wiki { /// /// The number of items in a page. /// - public const int PageSize = 50; + public int PageSize = 50; private int selectedPage = 0; private int rangeBegin = 0; - private int rangeEnd = PageSize - 1; + private int rangeEnd = 49; private IList currentPages = null; - protected void Page_Load(object sender, EventArgs e) { + protected void Page_Load(object sender, EventArgs e) { Page.Title = Properties.Messages.AllPagesTitle + " - " + Settings.WikiTitle; + PageSize = Settings.ListSize; + rangeEnd = PageSize - 1; LoginTools.VerifyReadPermissionsForCurrentNamespace(); @@ -58,7 +60,7 @@ namespace ScrewTurn.Wiki { // This page cannot use a repeater because the page list has particular elements used for grouping pages PrintPages(); - } + } protected void pageSelector_SelectedPageChanged(object sender, SelectedPageChangedEventArgs e) { rangeBegin = e.SelectedPage * PageSize; @@ -120,7 +122,7 @@ namespace ScrewTurn.Wiki { /// /// Prints the pages. /// - public void PrintPages() { + public void PrintPages() { StringBuilder sb = new StringBuilder(65536); if(currentPages == null) currentPages = GetAllPages(); @@ -343,7 +345,7 @@ namespace ScrewTurn.Wiki { lbl.Text = sb.ToString(); pnlPageList.Controls.Clear(); pnlPageList.Controls.Add(lbl); - } + } } diff --git a/WebApplication/AllPages.aspx.designer.cs b/WebApplication/AllPages.aspx.designer.cs index 8cd876c..1e9f4e4 100644 --- a/WebApplication/AllPages.aspx.designer.cs +++ b/WebApplication/AllPages.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebApplication/App_LocalResources/AdminConfig.aspx.resx b/WebApplication/App_LocalResources/AdminConfig.aspx.resx index 40d7bec..d49d331 100644 --- a/WebApplication/App_LocalResources/AdminConfig.aspx.resx +++ b/WebApplication/App_LocalResources/AdminConfig.aspx.resx @@ -1077,4 +1077,27 @@ + + items in a list, then start paging + As in 'Display at most 5 items in a list, ...' + + + Display at most + As in 'Display at most: 5 items' + + + Number must be between 10 and 1000 + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebApplication/PageSelector.ascx.cs b/WebApplication/PageSelector.ascx.cs index e51bde5..79e8462 100644 --- a/WebApplication/PageSelector.ascx.cs +++ b/WebApplication/PageSelector.ascx.cs @@ -16,6 +16,10 @@ namespace ScrewTurn.Wiki { private int pageSize = 50; private int selectedPage = 0; + protected PageSelector() { + pageSize = Settings.ListSize; + } + protected void Page_Load(object sender, EventArgs e) { // Load data from ViewState object temp = ViewState[ItemCountName];