AllPosts page implemented

main
Inga 🏳‍🌈 15 years ago
parent 2e866a787c
commit 9abf42aa9a
  1. 2
      Builder/IISMainHandler/build.txt
  2. 2
      Builder/IISUploadHandler/build.txt
  3. 2
      IISMainHandler/HandlersFactory.cs
  4. 1
      IISMainHandler/IISMainHandler.csproj
  5. 43
      IISMainHandler/handlers/response/AllPostsHandler.cs
  6. 70
      templates/Full/AllPosts.xslt
  7. 5
      templates/Full/Boards.xslt

@ -30,6 +30,8 @@ namespace FLocal.IISHandler {
switch(context.requestParts[0].ToLower()) { switch(context.requestParts[0].ToLower()) {
case "q": case "q":
return new handlers.response.QuickLinkHandler(); return new handlers.response.QuickLinkHandler();
case "allposts":
return new handlers.response.AllPostsHandler();
case "boards": case "boards":
return new handlers.BoardsHandler(); return new handlers.BoardsHandler();
case "board": case "board":

@ -72,6 +72,7 @@
<Compile Include="handlers\request\SettingsHandler.cs" /> <Compile Include="handlers\request\SettingsHandler.cs" />
<Compile Include="handlers\request\UploadHandler.cs" /> <Compile Include="handlers\request\UploadHandler.cs" />
<Compile Include="handlers\response\ActiveAccountListHandler.cs" /> <Compile Include="handlers\response\ActiveAccountListHandler.cs" />
<Compile Include="handlers\response\AllPostsHandler.cs" />
<Compile Include="handlers\response\BoardAsThread.cs" /> <Compile Include="handlers\response\BoardAsThread.cs" />
<Compile Include="handlers\response\ConversationHandler.cs" /> <Compile Include="handlers\response\ConversationHandler.cs" />
<Compile Include="handlers\response\ConversationsHandler.cs" /> <Compile Include="handlers\response\ConversationsHandler.cs" />

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Xml.Linq;
using FLocal.Common;
using FLocal.Common.dataobjects;
using FLocal.Core;
using FLocal.Core.DB;
using FLocal.Core.DB.conditions;
namespace FLocal.IISHandler.handlers.response {
class AllPostsHandler : AbstractGetHandler {
override protected string templateName {
get {
return "AllPosts.xslt";
}
}
override protected XElement[] getSpecificData(WebContext context) {
PageOuter pageOuter = PageOuter.createFromGet(
context.requestParts,
context.userSettings.postsPerPage,
3
);
IEnumerable<Post> posts = from stringId in Config.instance.mainConnection.LoadIdsByConditions(Post.TableSpec.instance, new EmptyCondition(), pageOuter, new JoinSpec[0], new SortSpec[] { new SortSpec(Post.TableSpec.instance.getIdSpec(), false) }) select Post.LoadById(int.Parse(stringId));
XElement[] result = new XElement[] {
new XElement("posts",
from post in posts select post.exportToXmlWithoutThread(context, true),
pageOuter.exportToXml(2, 5, 2)
)
};
return result;
}
}
}

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="Windows-1251"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:import href="elems\Main.xslt"/>
<xsl:import href="elems\PostInfo.xslt"/>
<xsl:template name="specificTitle">
<xsl:text>Âñå ñîîáùåíèÿ</xsl:text>
</xsl:template>
<xsl:template name="specific">
<table width="95%" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
<table cellpadding="3" cellspacing="1" width="100%" class="tableborders">
<tr class="darktable">
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr class="darktable">
<td align="left" width="33%">
<font class="catandforum">
<xsl:text>Âñå ñîîáùåíèÿ</xsl:text>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<table width="95%" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
<table cellpadding="0" cellspacing="1" width="100%" class="tableborders">
<tr class="tdheader">
<td>
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td>
<xsl:text>ñòðàíèöû:</xsl:text>
<xsl:apply-templates select="posts/pageOuter" mode="withCurrent">
<xsl:with-param name="baseLink">/AllPosts/</xsl:with-param>
</xsl:apply-templates>
</td>
</tr>
</table>
</td>
</tr>
<xsl:apply-templates select="posts/post"/>
<tr class="tdheader">
<td>
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td>
<xsl:text>ñòðàíèöû:</xsl:text>
<xsl:apply-templates select="posts/pageOuter" mode="withCurrent">
<xsl:with-param name="baseLink">/AllPosts/</xsl:with-param>
</xsl:apply-templates>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>

@ -54,7 +54,10 @@
<td width="30%" class="small" valign="top"> <td width="30%" class="small" valign="top">
<b>Ïðîñìîòð íîâûõ ñîîáùåíèé</b> <b>Ïðîñìîòð íîâûõ ñîîáùåíèé</b>
<br /> <br />
<a>Последние 7 дней</a> <a>
<xsl:attribute name="href">/AllPosts/</xsl:attribute>
<xsl:text>Ïîñëåäíèå 7 äíåé</xsl:text>
</a>
<br /> <br />
<a> <a>
<xsl:attribute name="href">/User/<xsl:value-of select="session/user/id"/>/Replies/</xsl:attribute> <xsl:attribute name="href">/User/<xsl:value-of select="session/user/id"/>/Replies/</xsl:attribute>

Loading…
Cancel
Save