Header refactored

main
Inga 🏳‍🌈 14 years ago
parent be6bdf2dbe
commit a2068003af
  1. 2
      Builder/IISMainHandler/build.txt
  2. 8
      IISMainHandler/HandlersFactory.cs
  3. 3
      IISMainHandler/handlers/AbstractGetHandler.cs
  4. 2
      IISMainHandler/handlers/response/UserListHandler.cs
  5. 3
      static/css/global.css
  6. 2
      templates/Full/UserList.xslt
  7. 97
      templates/Full/elems/Header.xslt

@ -83,17 +83,15 @@ namespace FLocal.IISHandler {
case "registerbyinvite": case "registerbyinvite":
return new handlers.response.RegisterByInviteHandler(); return new handlers.response.RegisterByInviteHandler();
case "users": case "users":
if(context.requestParts.Length < 2) {
return new handlers.response.UserListHandler();
} else {
switch(context.requestParts[1].ToLower()) { switch(context.requestParts[1].ToLower()) {
case "all":
return new handlers.response.UserListHandler();
case "active": case "active":
return new handlers.response.ActiveAccountListHandler(); return new handlers.response.ActiveAccountListHandler();
case "online": case "online":
return new handlers.response.WhoIsOnlineHandler(); return new handlers.response.WhoIsOnlineHandler();
default: default:
return new handlers.response.UserListHandler(); return new handlers.WrongUrlHandler();
}
} }
case "user": case "user":
if(context.requestParts.Length < 2) { if(context.requestParts.Length < 2) {

@ -21,7 +21,8 @@ namespace FLocal.IISHandler.handlers {
new XElement("title", Config.instance.AppInfo), new XElement("title", Config.instance.AppInfo),
new XElement("current", DateTime.Now.ToXml()), new XElement("current", DateTime.Now.ToXml()),
context.exportSession(), context.exportSession(),
context.userSettings.skin.exportToXml() context.userSettings.skin.exportToXml(),
new XElement("currentUrl", "/" + String.Join("/", context.requestParts) + "/")
) )
); );
} }

@ -19,7 +19,7 @@ namespace FLocal.IISHandler.handlers.response {
} }
override protected IEnumerable<XElement> getSpecificData(WebContext context) { override protected IEnumerable<XElement> getSpecificData(WebContext context) {
PageOuter pageOuter = PageOuter.createFromGet(context.requestParts, context.userSettings.usersPerPage, 1); PageOuter pageOuter = PageOuter.createFromGet(context.requestParts, context.userSettings.usersPerPage, 2);
IEnumerable<User> users = User.getUsers(pageOuter); IEnumerable<User> users = User.getUsers(pageOuter);
return new XElement[] { return new XElement[] {
new XElement("users", new XElement("users",

@ -112,3 +112,6 @@ p {
color:red !important; color:red !important;
text-decoration: line-through; text-decoration: line-through;
} }
.currentLink {
border: solid 3px;
}

@ -65,7 +65,7 @@
<td> <td>
<xsl:text>ñòðàíèöû:</xsl:text> <xsl:text>ñòðàíèöû:</xsl:text>
<xsl:apply-templates select="users/pageOuter" mode="withCurrent"> <xsl:apply-templates select="users/pageOuter" mode="withCurrent">
<xsl:with-param name="baseLink">/Users/</xsl:with-param> <xsl:with-param name="baseLink">/Users/All/</xsl:with-param>
</xsl:apply-templates> </xsl:apply-templates>
</td> </td>
</tr> </tr>

@ -1,5 +1,21 @@
<?xml version="1.0" encoding="Windows-1251"?> <?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:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:template name="headerLink">
<xsl:param name="url"/>
<xsl:param name="text"/>
<xsl:param name="isDisabled"/>
<a target="_top">
<xsl:if test="not($isDisabled='true')">
<xsl:attribute name="href"><xsl:value-of select="$url"/>?<xsl:value-of select="current/date/ticks"/></xsl:attribute>
</xsl:if>
<xsl:if test="starts-with(/root/currentUrl, $url)">
<xsl:attribute name="class">currentLink</xsl:attribute>
</xsl:if>
<xsl:value-of select="$text"/>
</a>
</xsl:template>
<xsl:template name="header"> <xsl:template name="header">
<table width="95%" align="center" class="tablesurround" cellpadding="1" cellspacing="1"> <table width="95%" align="center" class="tablesurround" cellpadding="1" cellspacing="1">
<tr> <tr>
@ -7,14 +23,14 @@
<table width="100%" class="tableborders" cellpadding="3" cellspacing="1"> <table width="100%" class="tableborders" cellpadding="3" cellspacing="1">
<tr> <tr>
<td align="center" class="menubar"> <td align="center" class="menubar">
<a target="_top"> <xsl:call-template name="headerLink">
<xsl:attribute name="href">/Boards/?<xsl:value-of select="current/date/ticks"/></xsl:attribute> <xsl:with-param name="url">/Boards/</xsl:with-param>
<xsl:text>Ñïèñîê ôîðóìîâ</xsl:text> <xsl:with-param name="text">Ñïèñîê ôîðóìîâ</xsl:with-param>
</a> </xsl:call-template>
<xsl:text> | </xsl:text> <xsl:text> | </xsl:text>
<a target="_top"> <xsl:call-template name="headerLink">
<xsl:if test="session/sessionKey"> <xsl:with-param name="url">/Conversations/</xsl:with-param>
<xsl:attribute name="href">/Conversations/?<xsl:value-of select="current/date/ticks"/></xsl:attribute> <xsl:with-param name="text">
<xsl:if test="session/indicators/unreadPrivateMessages != '0'"> <xsl:if test="session/indicators/unreadPrivateMessages != '0'">
<img src="/static/images/newpm.gif" border="0"> <img src="/static/images/newpm.gif" border="0">
<xsl:attribute name="alt"> <xsl:attribute name="alt">
@ -24,40 +40,46 @@
</xsl:attribute> </xsl:attribute>
</img> </img>
</xsl:if> </xsl:if>
</xsl:if>
<xsl:text>Ëè÷íûå ñîîáùåíèÿ</xsl:text> <xsl:text>Ëè÷íûå ñîîáùåíèÿ</xsl:text>
</a> </xsl:with-param>
<xsl:with-param name="isDisabled">
<xsl:if test="not(session/sessionKey)">true</xsl:if>
</xsl:with-param>
</xsl:call-template>
<xsl:text> | </xsl:text> <xsl:text> | </xsl:text>
<a target="_top"> <xsl:call-template name="headerLink">
<xsl:if test="session/sessionKey"> <xsl:with-param name="url">/Upload/List/</xsl:with-param>
<xsl:attribute name="href">/Upload/List/?<xsl:value-of select="current/date/ticks"/></xsl:attribute> <xsl:with-param name="text">Àïëîàä</xsl:with-param>
</xsl:if> <xsl:with-param name="isDisabled">
<xsl:text>Àïëîàä</xsl:text> <xsl:if test="not(session/sessionKey)">true</xsl:if>
</a> </xsl:with-param>
</xsl:call-template>
<xsl:text> | </xsl:text> <xsl:text> | </xsl:text>
<a target="_top"> <xsl:call-template name="headerLink">
<xsl:if test="session/sessionKey"> <xsl:with-param name="url">/Settings/</xsl:with-param>
<xsl:attribute name="href">/Settings/</xsl:attribute> <xsl:with-param name="text">Íàñòðîéêè</xsl:with-param>
</xsl:if> <xsl:with-param name="isDisabled">
<xsl:text>Íàñòðîéêè</xsl:text> <xsl:if test="not(session/sessionKey)">true</xsl:if>
</a> </xsl:with-param>
</xsl:call-template>
<xsl:text> | </xsl:text> <xsl:text> | </xsl:text>
<a target="_top"> <xsl:call-template name="headerLink">
<xsl:if test="session/notLoggedIn"> <xsl:with-param name="url">/Login/</xsl:with-param>
<xsl:attribute name="href">/Login/</xsl:attribute> <xsl:with-param name="text">Âõîä</xsl:with-param>
</xsl:if> <xsl:with-param name="isDisabled">
<xsl:text>Âõîä</xsl:text> <xsl:if test="session/sessionKey">true</xsl:if>
</a> </xsl:with-param>
</xsl:call-template>
<xsl:text> | </xsl:text> <xsl:text> | </xsl:text>
<a target="_top"> <xsl:call-template name="headerLink">
<xsl:attribute name="href">/Users/Online/?<xsl:value-of select="current/date/ticks"/></xsl:attribute> <xsl:with-param name="url">/Users/Online/</xsl:with-param>
<xsl:text>Êòî â îíëàéíå</xsl:text> <xsl:with-param name="text">Êòî â îíëàéíå</xsl:with-param>
</a> </xsl:call-template>
<xsl:text> | </xsl:text> <xsl:text> | </xsl:text>
<a target="_top"> <xsl:call-template name="headerLink">
<xsl:attribute name="href">/q/faq</xsl:attribute> <xsl:with-param name="url">/q/faq/</xsl:with-param>
<xsl:text>FAQ</xsl:text> <xsl:with-param name="text">FAQ</xsl:with-param>
</a> </xsl:call-template>
<xsl:text> | </xsl:text> <xsl:text> | </xsl:text>
<a target="_top"> <a target="_top">
<xsl:if test="session/sessionKey"> <xsl:if test="session/sessionKey">
@ -66,7 +88,10 @@
<xsl:text>Âûõîä</xsl:text> <xsl:text>Âûõîä</xsl:text>
</a> </a>
<xsl:text> | </xsl:text> <xsl:text> | </xsl:text>
<a href="/Users/" target="_top">Ïîëüçîâàòåëè</a> <xsl:call-template name="headerLink">
<xsl:with-param name="url">/Users/All/</xsl:with-param>
<xsl:with-param name="text">Ïîëüçîâàòåëè</xsl:with-param>
</xsl:call-template>
</td> </td>
</tr> </tr>
</table> </table>

Loading…
Cancel
Save