Slight changes in templates

main
Inga 🏳‍🌈 15 years ago
parent 4373f921cd
commit fc18882943
  1. 2
      Builder/IISMainHandler/build.txt
  2. 17
      Common/dataobjects/Board.cs
  3. 2
      Core/Util.cs
  4. 31
      templates/Full/Boards.xslt
  5. 1
      templates/Full/elems/Header.xslt
  6. 51
      templates/Full/elems/Main.xslt

@ -99,16 +99,29 @@ namespace FLocal.Common.dataobjects {
this._description = data[TableSpec.FIELD_DESCRIPTION];
}
private bool hasNewPosts() {
return Core.Util.RandomInt(0, 1) == 0;
}
private XElement exportLastPostInfo() {
if(!this.lastPostId.HasValue) {
return new XElement("none");
} else {
throw new NotImplementedException();
}
}
public XElement exportToXmlForMainPage() {
return new XElement("board",
new XElement("id", this.id),
new XElement("sortOrder", this.sortOrder),
new XElement("categoryId", this.categoryId),
new XElement("lastPostId", this.lastPostId),
new XElement("totalPosts", this.totalPosts),
new XElement("totalThreads", this.totalThreads),
new XElement("name", this.name),
new XElement("description", this.description)
new XElement("description", this.description),
new XElement("hasNewPosts", this.hasNewPosts() ? "true" : "false"),
new XElement("lastPostInfo", this.exportLastPostInfo())
);
}

@ -5,7 +5,7 @@ using System.Text;
namespace FLocal.Core {
class Util {
public class Util {
private static bool? _isRunningOnMono;

@ -1,7 +1,6 @@
<?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:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template name="specific">
<table width="95%" align="center" class="tablesurround" cellspacing="1" cellpadding="1">
<tr>
@ -79,7 +78,14 @@
<td width="4%" class="darktable" align="center" valign="middle">
<a>
<xsl:attribute name="onClick">if(!confirm('Ïîìåòèòü âñå ñîîáùåíèÿ êàê ïðî÷èòàííûå?')) {event.returnValue=false; return false;} else { alert("Not implemented yet"); }</xsl:attribute>
<img border="0" width="17" height="21" src="/static/images/newposts.gif" alt=""/>
<xsl:choose>
<xsl:when test="hasNewPosts='true'">
<img border="0" width="17" height="21" src="/static/images/newposts.gif" alt=""/>
</xsl:when>
<xsl:otherwise>
<img border="0" width="17" height="21" src="/static/images/nonewposts.gif" alt=""/>
</xsl:otherwise>
</xsl:choose>
</a>
</td>
<td width="57%" class="darktable">
@ -105,11 +111,7 @@
<td width="7%" align="center" class="threadtotal" nowrap="nowrap"><xsl:value-of select="totalThreads"/></td>
<td width="7%" align="center" class="posttotal" nowrap="nowrap"><xsl:value-of select="totalPosts"/></td>
<td width="15%" nowrap="nowrap" class="posttime">
08.06.2010 14:03<br />
<a>
<xsl:attribute name="href">/Thread/NOTIMPLEMENTED/p<xsl:value-of select="lastPostId"/>/</xsl:attribute>
îò igor
</a>
<xsl:apply-templates select="lastPostInfo"/>
</td>
<td width="10%" class="modcolumn" align="center">
<a href="/showprofile.php?User=Sash&amp;What=ubbthreads">Sash</a>,
@ -117,4 +119,19 @@
</td>
</tr>
</xsl:template>
<xsl:template match="lastPostInfo">
<xsl:choose>
<xsl:when test="post">
<xsl:value-of select="post/date"/><br />
<a>
<xsl:attribute name="href">/Thread/NOTIMPLEMENTED/p<xsl:value-of select="post/id"/>/</xsl:attribute>
îò <xsl:value-of select="post/user/name"/>
</a>
</xsl:when>
<xsl:otherwise>
N/A
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

@ -1,6 +1,5 @@
<?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:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:template name="header">
<table border="0" cellpadding="2" cellspacing="0" width="95%" class="tableborders" align="center">
<tr>

@ -1,7 +1,7 @@
<?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="Header.xslt"/>
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:output method="xml" indent="no" encoding="UCS-2"/>
<xsl:template match="/root">
<html>
<head>
@ -14,57 +14,12 @@
<xsl:call-template name="header"/>
<xsl:call-template name="specific"/>
<br />
Data used for authoring this XHTML document:
<xmp><xsl:copy-of select="/"/></xmp>
</body>
</html>
</xsl:template>
<xsl:template match="category">
<table width="100%" align="center" class="tableborders" cellpadding="3" cellspacing="1">
<tr>
<td class="tdheader" colspan="2"><xsl:value-of select="name"/></td>
<td class="tdheader" align="center">Òåìû</td>
<td class="tdheader" align="center">Ñîîáùåíèé</td>
<td class="tdheader" align="center">Ïîñëåäíåå</td>
<td class="tdheader" align="center">Ìîäåðàòîð</td>
</tr>
<xsl:apply-templates select="boards/board"/>
</table>
</xsl:template>
<xsl:template match="board">
<tr>
<td valign="top" width="1%" class="darktable">
<a href="/ubbthreads.php?Cat=&amp;C=&amp;check=Common&amp;src=">
<xsl:attribute name="onClick">if (!confirm('Ïîìåòèòü âñå ñîîáùåíèÿ êàê ïðî÷èòàííûå?')) {event.returnValue=false; return false;}</xsl:attribute>
<img border="0" width="17" height="21" src="/static/images/newposts.gif" alt=""/>
</a>
</td>
<td width="55%" class="darktable">
<font class="forumtitle">
<a href="/postlist.php?Cat=&amp;Board=Common&amp;time=1275991384&amp;showlite="><xsl:value-of select="name"/></a>
</font>
<br />
<table cellpadding="0" cellspacing="0">
<tr>
<td class="forumdescript">
<a href="/apostlist.php?Cat=&amp;Board=Common">A</a>&#160;&#160;
</td>
<td class="forumdescript"><xsl:value-of select="description"/></td>
</tr>
</table>
</td>
<td width="7%" align="center" class="threadtotal" nowrap="nowrap">373</td>
<td width="7%" align="center" class="posttotal" nowrap="nowrap">128648</td>
<td width="15%" nowrap="nowrap" class="posttime">
08.06.2010 14:03<br />
<a href="/showflat.php?Cat=&amp;Board=Common&amp;Number=9554129&amp;src=#Post9554129">îò igor</a>
</td>
<td width="10%" class="modcolumn" align="center">
&#160;<a href="/showprofile.php?User=Sash&amp;What=ubbthreads">Sash</a>,
<a href="/showprofile.php?User=DeadmoroZ&amp;What=ubbthreads">DeadmoroZ</a>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>
<!--

Loading…
Cancel
Save