AllThreads page implemented

main
Inga 🏳‍🌈 14 years ago
parent ec75f52e47
commit b638da72a0
  1. 2
      Builder/IISMainHandler/build.txt
  2. 2
      IISMainHandler/HandlersFactory.cs
  3. 1
      IISMainHandler/IISMainHandler.csproj
  4. 62
      IISMainHandler/handlers/response/AllThreadsHandler.cs
  5. 61
      templates/Full/AllThreads.xslt
  6. 9
      templates/Full/Boards.xslt

@ -41,6 +41,8 @@ namespace FLocal.IISHandler {
return new handlers.response.QuickLinkHandler(); return new handlers.response.QuickLinkHandler();
case "allposts": case "allposts":
return new handlers.response.AllPostsHandler(); return new handlers.response.AllPostsHandler();
case "allthreads":
return new handlers.response.AllThreadsHandler();
case "boards": case "boards":
return new handlers.BoardsHandler(); return new handlers.BoardsHandler();
case "board": case "board":

@ -149,6 +149,7 @@
<Compile Include="handlers\request\avatars\SetAsDefaultHandler.cs" /> <Compile Include="handlers\request\avatars\SetAsDefaultHandler.cs" />
<Compile Include="handlers\request\UserDataHandler.cs" /> <Compile Include="handlers\request\UserDataHandler.cs" />
<Compile Include="handlers\response\AbstractUserGetHandler.cs" /> <Compile Include="handlers\response\AbstractUserGetHandler.cs" />
<Compile Include="handlers\response\AllThreadsHandler.cs" />
<Compile Include="handlers\response\AvatarsSettingsHandler.cs" /> <Compile Include="handlers\response\AvatarsSettingsHandler.cs" />
<Compile Include="handlers\response\UserDataHandler.cs" /> <Compile Include="handlers\response\UserDataHandler.cs" />
<Compile Include="handlers\response\UserThreadsHandler.cs" /> <Compile Include="handlers\response\UserThreadsHandler.cs" />

@ -0,0 +1,62 @@
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 AllThreadsHandler : AbstractGetHandler {
override protected string templateName {
get {
return "AllThreads.xslt";
}
}
override protected IEnumerable<XElement> getSpecificData(WebContext context) {
PageOuter pageOuter = PageOuter.createFromGet(
context.requestParts,
context.userSettings.threadsPerPage,
1
);
IEnumerable<Thread> threads = Thread.LoadByIds(
from stringId
in Config.instance.mainConnection.LoadIdsByConditions(
Thread.TableSpec.instance,
new ComparisonCondition(
Thread.TableSpec.instance.getColumnSpec(Thread.TableSpec.FIELD_LASTPOSTID),
ComparisonType.GREATEROREQUAL,
Thread.FORMALREADMIN.ToString()
),
pageOuter,
new JoinSpec[0],
new SortSpec[] {
new SortSpec(
Thread.TableSpec.instance.getColumnSpec(Thread.TableSpec.FIELD_LASTPOSTID),
false
)
}
)
select int.Parse(stringId)
);
XElement[] result = new XElement[] {
new XElement("threads",
from thread in threads select thread.exportToXml(context),
pageOuter.exportToXml(1, 5, 1)
)
};
return result;
}
}
}

@ -0,0 +1,61 @@
<?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\ThreadInfo.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" class="tablesurround">
<tr>
<td>
<table cellpadding="3" cellspacing="1" width="100%" class="tableborders">
<tr>
<td align="left" width="55%" class="tdheader">Òåìà</td>
<td align="left" nowrap="nowrap" width="15%" class="tdheader">Àâòîð</td>
<td nowrap="nowrap" width="5%" class="tdheader" align="center">Ïðîñìîòðîâ</td>
<td nowrap="nowrap" width="5%" class="tdheader" align="center">Ïîñòîâ</td>
<td nowrap="nowrap" width="20%" class="tdheader" align="center">Ïîñëåäíåå</td>
</tr>
<!-- BEGIN POST LOOP DO NOT DELETE -->
<xsl:apply-templates select="threads/thread"/>
<!-- END OF LOOP -->
<tr class="tdheader">
<td colspan="5">
<font class="onbody">
<xsl:text>ñòðàíèöû:</xsl:text>
<xsl:apply-templates select="threads/pageOuter" mode="withCurrent">
<xsl:with-param name="baseLink">/AllThreads/</xsl:with-param>
</xsl:apply-templates>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>

@ -50,11 +50,14 @@
<xsl:apply-templates select="currentDate" mode="dateTime"/> <xsl:apply-templates select="currentDate" mode="dateTime"/>
</td> </td>
<td width="30%" class="small" valign="top"> <td width="30%" class="small" valign="top">
<b>Просмотр новых сообщений</b>
<br />
<a> <a>
<xsl:attribute name="href">/AllPosts/</xsl:attribute> <xsl:attribute name="href">/AllPosts/</xsl:attribute>
<xsl:text>Последние 7 дней</xsl:text> <xsl:text>Последние сообщения</xsl:text>
</a>
<br />
<a>
<xsl:attribute name="href">/AllThreads/</xsl:attribute>
<xsl:text>Последние темы</xsl:text>
</a> </a>
<br /> <br />
<a> <a>

Loading…
Cancel
Save