Polls list implemented; polls header implemented

main
Inga 🏳‍🌈 14 years ago
parent 2f3ce6b12d
commit d912c56375
  1. 2
      Builder/IISMainHandler/build.txt
  2. 3
      Common/Common.csproj
  3. 19
      Common/URL/UrlManager.cs
  4. 24
      Common/URL/polls/List.cs
  5. 6
      Common/URL/polls/New.cs
  6. 3
      IISMainHandler/HandlersFactory.cs
  7. 1
      IISMainHandler/IISMainHandler.csproj
  8. 2
      IISMainHandler/handlers/response/CreatePollHandler.cs
  9. 2
      IISMainHandler/handlers/response/UserPollsParticipatedHandler.cs
  10. 33
      templates/Full/PollsList.xslt
  11. 9
      templates/Full/elems/Header.xslt
  12. 4
      templates/Full/elems/PollShortInfo.xslt
  13. 37
      templates/Full/elems/PollsHeader.xslt
  14. 2
      templates/Full/elems/TextEditor.xslt

@ -160,7 +160,8 @@
<Compile Include="URL\my\login\RegisterByInvite.cs" />
<Compile Include="URL\my\Settings.cs" />
<Compile Include="URL\polls\Info.cs" />
<Compile Include="URL\polls\NewPoll.cs" />
<Compile Include="URL\polls\List.cs" />
<Compile Include="URL\polls\New.cs" />
<Compile Include="URL\QuickLink.cs" />
<Compile Include="URL\Robots.cs" />
<Compile Include="URL\Static.cs" />

@ -29,7 +29,7 @@ namespace FLocal.Common.URL {
return null;
}
switch(scriptParts[0].ToLower()) {
switch(scriptParts[0].TrimStart('/').ToLower()) {
case "showflat":
case "ashowflat":
dataobjects.Post post = dataobjects.Post.LoadById(int.Parse(Query["Number"]));
@ -47,6 +47,8 @@ namespace FLocal.Common.URL {
}
if(Path.ToLower().StartsWith("/images/graemlins/") || Path.ToLower().StartsWith("/images/icons/")) {
return new Static("smileys/" + GetRemainder(requestParts, 2));
} else if(Path.ToLower().StartsWith("/smiles/")) {
return new Static("smileys/" + GetRemainder(requestParts, 1));
}
#endregion
@ -245,18 +247,23 @@ namespace FLocal.Common.URL {
#endregion my;
#region polls
case "poll":
case "polls":
if(requestParts.Length < 2) {
return null;
}
return new polls.Info(requestParts[1], GetRemainder(requestParts, 2));
case "polls":
if(requestParts.Length < 2) {
return new polls.List("");
}
switch(requestParts[1].ToLower()) {
case "info":
return new polls.Info(requestParts[2], GetRemainder(requestParts, 3));
case "newpoll":
case "create":
return new polls.NewPoll(GetRemainder(requestParts, 2));
case "new":
return new polls.New(GetRemainder(requestParts, 2));
case "list":
return new polls.List(GetRemainder(requestParts, 2));
default:
return new polls.Info(requestParts[1], GetRemainder(requestParts, 2));
return null;
}
#endregion polls
#region upload;

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FLocal.Common.URL.polls {
public class List : AbstractUrl {
public List(string remainder) : base(remainder) {
}
public override string title {
get {
return "Polls";
}
}
protected override string _canonical {
get {
return "/Polls/List/";
}
}
}
}

@ -4,9 +4,9 @@ using System.Linq;
using System.Text;
namespace FLocal.Common.URL.polls {
public class NewPoll : AbstractUrl {
public class New : AbstractUrl {
public NewPoll(string remainder) : base(remainder) {
public New(string remainder) : base(remainder) {
}
public override string title {
@ -17,7 +17,7 @@ namespace FLocal.Common.URL.polls {
protected override string _canonical {
get {
return "/Polls/NewPoll/";
return "/Polls/New/";
}
}
}

@ -36,7 +36,8 @@ namespace FLocal.IISHandler {
{ typeof(URL.my.Settings), CreateHandler<URL.my.Settings, handlers.response.SettingsHandler> },
{ typeof(URL.my.UserData), CreateHandler<URL.my.UserData, handlers.response.UserDataHandler> },
{ typeof(URL.polls.Info), CreateHandler<URL.polls.Info, handlers.response.PollHandler> },
{ typeof(URL.polls.NewPoll), CreateHandler<URL.polls.NewPoll, handlers.response.CreatePollHandler> },
{ typeof(URL.polls.List), CreateHandler<URL.polls.List, handlers.response.PollsListHandler> },
{ typeof(URL.polls.New), CreateHandler<URL.polls.New, handlers.response.CreatePollHandler> },
{ typeof(URL.QuickLink), CreateHandler<URL.QuickLink, handlers.response.QuickLinkHandler> },
{ typeof(URL.Robots), CreateHandler<URL.Robots, handlers.response.RobotsHandler> },
{ typeof(URL.Static), CreateHandler<URL.Static, handlers.StaticHandler> },

@ -150,6 +150,7 @@
<Compile Include="handlers\response\AbstractUserGetHandler.cs" />
<Compile Include="handlers\response\AllThreadsHandler.cs" />
<Compile Include="handlers\response\AvatarsSettingsHandler.cs" />
<Compile Include="handlers\response\PollsListHandler.cs" />
<Compile Include="handlers\response\SkipXsltTransformException.cs" />
<Compile Include="handlers\response\UserDataHandler.cs" />
<Compile Include="handlers\response\UserThreadsHandler.cs" />

@ -10,7 +10,7 @@ using FLocal.Common.dataobjects;
namespace FLocal.IISHandler.handlers.response {
class CreatePollHandler : AbstractGetHandler<FLocal.Common.URL.polls.NewPoll> {
class CreatePollHandler : AbstractGetHandler<FLocal.Common.URL.polls.New> {
override protected string templateName {
get {

@ -21,7 +21,7 @@ namespace FLocal.IISHandler.handlers.response {
}
override protected IEnumerable<XElement> getUserSpecificData(WebContext context, User user) {
PageOuter pageOuter = PageOuter.createFromUrl(this.url, context.userSettings.postsPerPage);
PageOuter pageOuter = PageOuter.createFromUrl(this.url, context.userSettings.threadsPerPage);
IEnumerable<Poll.Vote> votes = Poll.Vote.LoadByIds(
from stringId in Config.instance.mainConnection.LoadIdsByConditions(
Poll.Vote.TableSpec.instance,

@ -0,0 +1,33 @@
<?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\PollShortInfo.xslt"/>
<xsl:template name="specificTitle">Îïðîñû</xsl:template>
<xsl:template name="specific">
<table width="95%" align="center" class="tablesurround">
<tr>
<td>
<table cellpadding="3" cellspacing="1" width="100%" class="tableborders">
<tr>
<td align="left" nowrap="nowrap" width="75%" class="tdheader">Íàçâàíèå</td>
<td nowrap="nowrap" width="15%" 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="polls/poll"/>
<!-- END OF LOOP -->
<tr class="tdheader">
<td colspan="3">
<font class="onbody">
<xsl:text>ñòðàíèöû:</xsl:text>
<xsl:apply-templates select="polls/pageOuter" mode="withCurrent"/>
</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>

@ -2,6 +2,7 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:import href="ForumHeader.xslt"/>
<xsl:import href="MyHeader.xslt"/>
<xsl:import href="PollsHeader.xslt"/>
<xsl:import href="UsersHeader.xslt"/>
<xsl:import href="UploadHeader.xslt"/>
@ -53,6 +54,11 @@
<xsl:with-param name="text">Ôîðóì</xsl:with-param>
</xsl:call-template>
<xsl:text> | </xsl:text>
<xsl:call-template name="headerLink">
<xsl:with-param name="url">/Polls/</xsl:with-param>
<xsl:with-param name="text">Îïðîñû</xsl:with-param>
</xsl:call-template>
<xsl:text> | </xsl:text>
<xsl:call-template name="headerLink">
<xsl:with-param name="url">/Upload/</xsl:with-param>
<xsl:with-param name="text">Àïëîàä</xsl:with-param>
@ -161,6 +167,9 @@
<xsl:if test="starts-with(/root/currentUrl, '/Upload/')">
<xsl:call-template name="uploadHeader"/>
</xsl:if>
<xsl:if test="starts-with(/root/currentUrl, '/Polls/')">
<xsl:call-template name="pollsHeader"/>
</xsl:if>
<center>&#160;&#160;</center>
</xsl:template>
</xsl:stylesheet>

@ -18,11 +18,11 @@
<xsl:text> </xsl:text>
<a>
<xsl:attribute name="href">
<xsl:text>/Poll/</xsl:text>
<xsl:text>/Poll/Info/</xsl:text>
<xsl:value-of select="id"/>
<xsl:text>/</xsl:text>
</xsl:attribute>
<xsl:value-of select="title"/>
<xsl:value-of select="title" disable-output-escaping="yes" />
</a>
</td>
<td align="left" nowrap="nowrap">

@ -0,0 +1,37 @@
<?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:template name="pollsHeader">
<table width="95%" align="center" class="tablesurround" cellpadding="1" cellspacing="1">
<tr>
<td>
<table width="100%" class="tableborders" cellpadding="3" cellspacing="1">
<tr>
<td align="center" class="menubar">
<xsl:call-template name="headerLink">
<xsl:with-param name="url">/Polls/List/</xsl:with-param>
<xsl:with-param name="text">Ñïèñîê</xsl:with-param>
</xsl:call-template>
<xsl:text> | </xsl:text>
<xsl:call-template name="headerLink">
<xsl:with-param name="url">/Polls/New/</xsl:with-param>
<xsl:with-param name="text">Ñîçäàòü íîâûé</xsl:with-param>
</xsl:call-template>
<xsl:text> | </xsl:text>
<img src="/static/images/shortcut.png" border="0"/>
<xsl:call-template name="headerLink">
<xsl:with-param name="url">/Users/User/<xsl:value-of select="session/user/id"/>/PollsParticipated/</xsl:with-param>
<xsl:with-param name="text">Ñ ìîèìè ãîëîñàìè</xsl:with-param>
<xsl:with-param name="isDisabled">
<xsl:if test="not(session/sessionKey)">true</xsl:if>
</xsl:with-param>
</xsl:call-template>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>

@ -145,7 +145,7 @@ function insertInBody(str) {
</td>
-->
<td class="darktable" colspan="3" align="center">
<a href="/Poll/Create/">Ñîçäàòü îïðîñ</a>
<a href="/Polls/New/">Ńîçäŕňü îďđîń</a>
</td>
</tr>
<tr>

Loading…
Cancel
Save