UserList and UserInfo responsehandlers implemented

main
Inga 🏳‍🌈 15 years ago
parent 6f73cb6119
commit bdad094172
  1. 2
      Builder/IISMainHandler/build.txt
  2. 6
      Common/dataobjects/AnonymousUserSettings.cs
  3. 4
      Common/dataobjects/IUserSettings.cs
  4. 17
      Common/dataobjects/User.cs
  5. 4
      IISMainHandler/HandlersFactory.cs
  6. 2
      IISMainHandler/IISMainHandler.csproj
  7. 32
      IISMainHandler/handlers/response/UserInfoHandler.cs
  8. 34
      IISMainHandler/handlers/response/UserListHandler.cs
  9. BIN
      static/images/addtobook.gif
  10. BIN
      static/images/graph.gif
  11. BIN
      static/images/heart.gif
  12. BIN
      static/images/sendprivate.gif
  13. BIN
      static/images/sundial.gif
  14. BIN
      static/images/viewposts.gif
  15. 209
      templates/Full/UserInfo.xslt
  16. 96
      templates/Full/UserList.xslt
  17. 2
      templates/Full/elems/Header.xslt

@ -18,5 +18,11 @@ namespace FLocal.Common.dataobjects {
}
}
public int usersPerPage {
get {
return 50;
}
}
}
}

@ -14,5 +14,9 @@ namespace FLocal.Common.dataobjects {
get;
}
int usersPerPage {
get;
}
}
}

@ -156,5 +156,22 @@ namespace FLocal.Common.dataobjects {
);
}
public static IEnumerable<User> getUsers(Diapasone diapasone, UserContext context) {
return User.LoadByIds(
from stringId in Config.instance.mainConnection.LoadIdsByConditions(
User.TableSpec.instance,
new EmptyCondition(),
diapasone,
new JoinSpec[0],
new SortSpec[] {
new SortSpec(
User.TableSpec.instance.getIdSpec(),
true
),
}
) select int.Parse(stringId)
);
}
}
}

@ -29,6 +29,10 @@ namespace FLocal.IISHandler {
return new handlers.response.LoginHandler();
case "migrateaccount":
return new handlers.response.MigrateAccountHandler();
case "users":
return new handlers.response.UserListHandler();
case "user":
return new handlers.response.UserInfoHandler();
case "static":
return new handlers.StaticHandler(context.requestParts);
case "do":

@ -64,9 +64,11 @@
<Compile Include="handlers\response\BoardAsThread.cs" />
<Compile Include="handlers\response\LoginHandler.cs" />
<Compile Include="handlers\response\MigrateAccountHandler.cs" />
<Compile Include="handlers\response\UserInfoHandler.cs" />
<Compile Include="handlers\RootHandler.cs" />
<Compile Include="handlers\StaticHandler.cs" />
<Compile Include="handlers\ThreadHandler.cs" />
<Compile Include="handlers\response\UserListHandler.cs" />
<Compile Include="handlers\WrongUrlHandler.cs" />
<Compile Include="ISpecificHandler.cs" />
<Compile Include="MainHandler.cs" />

@ -0,0 +1,32 @@
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 UserInfoHandler : AbstractGetHandler {
override protected string templateName {
get {
return "UserInfo.xslt";
}
}
override protected XElement[] getSpecificData(WebContext context) {
User user = User.LoadById(int.Parse(context.requestParts[1]));
return new XElement[] {
user.exportToXmlForViewing(context),
};
}
}
}

@ -0,0 +1,34 @@
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.DB;
namespace FLocal.IISHandler.handlers.response {
class UserListHandler : AbstractGetHandler {
override protected string templateName {
get {
return "UserList.xslt";
}
}
override protected XElement[] getSpecificData(WebContext context) {
PageOuter pageOuter = PageOuter.createFromGet(context.requestParts, context.userSettings.usersPerPage);
IEnumerable<User> users = User.getUsers(pageOuter, context);
return new XElement[] {
new XElement("users",
from user in users select user.exportToXmlForViewing(context),
pageOuter.exportToXml(2, 5, 2)
)
};
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

@ -0,0 +1,209 @@
<?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: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>
<td class="tdheader">
<xsl:text>Ïåðñîíàëüíàÿ èíôîðìàöèÿ î </xsl:text><xsl:value-of select="user/name"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="95%" align="center" cellpadding="1" cellspacing="1" class="tablesurround">
<tr>
<td>
<table cellpadding="3" cellspacing="1" width="100%" class="tableborders">
<tr class="lighttable">
<td>
<table border="0" width="100%" class="lighttable" cellpadding="0">
<tr>
<td width="10%" class="darktable">
<xsl:text>Email</xsl:text>
</td>
<td width="40%">
<xsl:text>Not implemented</xsl:text>
</td>
<td align="right" valign="top" rowspan="11">
<img src="/user/14291.png" alt="Picture" width="80" height="80" />
</td>
</tr>
<tr>
<td class="darktable">
<xsl:text>Èìÿ</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td class="darktable">
<xsl:text>Òèòóë</xsl:text>
</td>
<td>
<xsl:value-of select="user/title"/>
</td>
</tr>
<tr>
<td class="darktable">
<xsl:text>Èòîãî ñîîáùåíèé</xsl:text>
</td>
<td>
<xsl:value-of select="totalPosts"/>
</td>
</tr>
<tr>
<td class="darktable">
<xsl:text>Ðåéòèíã</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td class="darktable">
<xsl:text>Äîìàøíÿÿ ñòðàíèöà</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Ðîä çàíÿòèé</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Õîááè</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Ðàñïîëîæåíèå</xsl:text>
</td>
<td>
<xsl:value-of select="user/location"/>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Áèîãðàôèÿ</xsl:text>
</td>
<td colspan="2">
<xsl:value-of select="user/biography"/>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Íîìåð ICQ</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Ïîë (gender)</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Äàòà ðåãèñòðàöèè</xsl:text>
</td>
<td>
<xsl:apply-templates select="user/regDate" mode="dateTime"/>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Ïîñëåäíèé ðàç îíëàéí</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Ïîäïèñü</xsl:text>
</td>
<td>
<xsl:value-of select="user/signature"/>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Ñèìïàòèè</xsl:text>
</td>
<td title="Âûðàçèòü ñèìïàòèþ ýòîìó ÷åëîâåêó">
<input type="submit" class="buttons" value=" " style="width:24px;background-image:url('/static/images/heart.gif');background-position:center left;background-repeat:no-repeat;"/>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Penalties</xsl:text>
</td>
<td colspan="2">
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td valign="top" class="darktable">
<xsl:text>Êîììåíòàðèé</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
</tr>
<tr>
<td valign="top" colspan="3" align="center" class="darktable">
<a>
<img src="/static/images/sendprivate.gif" border="0" style="vertical-align: text-bottom" />
<xsl:text>Ïîñëàòü ëè÷íîå ñîîáùåíèå</xsl:text>
</a>
<xsl:text> | </xsl:text>
<a>
<img src="/static/images/sundial.gif" border="0" style="vertical-align: text-bottom" />
<xsl:text>Èñòîðèÿ</xsl:text>
</a>
<xsl:text> | </xsl:text>
<a>
<img src="/static/images/addtobook.gif" align="top" style="vertical-align: text-bottom" />
<xsl:text>Äîáàâèòü â àäðåñíóþ êíèãó</xsl:text>
</a>
<xsl:text> | </xsl:text>
<a>
<img src="/static/images/viewposts.gif" align="top" style="vertical-align: text-bottom" />
<xsl:text>Ïîêàçàòü âñå ñîîáùåíèÿ ïîëüçîâàòåëÿ</xsl:text>
</a>
<xsl:text> | </xsl:text>
<a>
<img src="/static/images/graph.gif" align="top" border="0" style="vertical-align: text-bottom" />
<xsl:text>Ñòàòèñòèêà</xsl:text>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>

@ -0,0 +1,96 @@
<?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:template name="specific">
<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 align="left" width="15%" nowrap="nowrap">
<a>
<xsl:text>Ïîëüçîâàòåëü</xsl:text>
</a>
</td>
<td align="left" width="12%" nowrap="nowrap">
<a>
<xsl:text>Ñòàòóñ</xsl:text>
</a>
</td>
<td align="left" width="28%" nowrap="nowrap">
<a>
<xsl:text>Äîìàøíÿÿ ñòðàíèöà</xsl:text>
</a>
</td>
<td align="left" width="5%" nowrap="nowrap">
<a>
<xsl:text>Èòîãî ñîîáùåíèé</xsl:text>
</a>
</td>
<td align="left" width="12%" nowrap="nowrap">
<a>
<xsl:text>Íîìåð ICQ</xsl:text>
</a>
</td>
<td align="left" width="5%" nowrap="nowrap">
<a>
<xsl:text>Ðåéòèíã</xsl:text>
</a>
</td>
<td align="left" width="18%" nowrap="nowrap">
<a>
<xsl:text>Äàòà ðåãèñòðàöèè</xsl:text>
</a>
</td>
</tr>
<xsl:apply-templates select="users/user"/>
<tr class="tdheader">
<td colspan="7">
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td>
<xsl:text>ñòðàíèöû:</xsl:text>
<xsl:apply-templates select="users/pageOuter" mode="withCurrent">
<xsl:with-param name="baseLink">/UserList/<xsl:value-of select="currentLocation/thread/id"/>/</xsl:with-param>
</xsl:apply-templates>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="users/user">
<tr class="lighttable">
<td>
<a>
<xsl:attribute name="href">/User/<xsl:value-of select="id"/>/</xsl:attribute>
<xsl:value-of select="name"/>
</a>
</td>
<td>
<xsl:text>Ïîëüçîâàòåëü</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
<td>
<xsl:value-of select="totalPosts"/>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
<td>
<xsl:text>Not implemented</xsl:text>
</td>
<td>
<xsl:apply-templates select="regDate" mode="dateTime"/>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>

@ -58,7 +58,7 @@
<xsl:text>Âűőîä</xsl:text>
</a>
<xsl:text> | </xsl:text>
<a target="_top">Пользователи</a>
<a href="/Users/" target="_top">Ïîëüçîâàòåëè</a>
</td>
</tr>
</table>

Loading…
Cancel
Save