{
+ { Board.TableSpec.FIELD_TOTALPOSTS, new IncrementFieldValue() },
+ {
+ Board.TableSpec.FIELD_LASTPOSTID,
+ new TwoWayReferenceFieldValue(
+ postInsert,
+ (oldStringId, newStringId) => {
+ int oldId = int.Parse(oldStringId);
+ int newId = int.Parse(newStringId);
+ return Math.Max(oldId, newId).ToString();
+ }
+ )
+ }
+ },
+ board.id
+ )
+ );
+ boardId = board.parentBoardId;
+ } while(boardId.HasValue);
+
+ ChangeSetUtil.ApplyChanges(changes.ToArray());
+
+ return Post.LoadById(postInsert.getId().Value);
+ }
+
}
}
diff --git a/Common/dataobjects/User.cs b/Common/dataobjects/User.cs
index c2d0ed9..96987b2 100644
--- a/Common/dataobjects/User.cs
+++ b/Common/dataobjects/User.cs
@@ -192,5 +192,9 @@ namespace FLocal.Common.dataobjects {
);
}
+ public int getMinAllowedLayer(Board board) {
+ return 1;
+ }
+
}
}
diff --git a/IISMainHandler/HandlersFactory.cs b/IISMainHandler/HandlersFactory.cs
index 96b5fa7..5e3c3e6 100644
--- a/IISMainHandler/HandlersFactory.cs
+++ b/IISMainHandler/HandlersFactory.cs
@@ -31,7 +31,15 @@ namespace FLocal.IISHandler {
case "thread":
return new handlers.ThreadHandler();
case "post":
- return new handlers.PostHandler();
+ if(context.requestParts.Length < 2) {
+ return new handlers.WrongUrlHandler();
+ }
+ switch(context.requestParts[2].ToLower()) {
+ case "reply":
+ return new handlers.response.ReplyHandler();
+ default:
+ return new handlers.PostHandler();
+ }
case "login":
return new handlers.response.LoginHandler();
case "migrateaccount":
@@ -67,6 +75,8 @@ namespace FLocal.IISHandler {
return new handlers.request.LogoutHandler();
case "migrateaccount":
return new handlers.request.MigrateAccountHandler();
+ case "reply":
+ return new handlers.request.ReplyHandler();
default:
return new handlers.WrongUrlHandler();
}
diff --git a/IISMainHandler/IISMainHandler.csproj b/IISMainHandler/IISMainHandler.csproj
index 800fb43..28ea5e3 100644
--- a/IISMainHandler/IISMainHandler.csproj
+++ b/IISMainHandler/IISMainHandler.csproj
@@ -58,15 +58,19 @@
+
+
+
+
diff --git a/IISMainHandler/handlers/PostHandler.cs b/IISMainHandler/handlers/PostHandler.cs
index 4dcf6ad..510399a 100644
--- a/IISMainHandler/handlers/PostHandler.cs
+++ b/IISMainHandler/handlers/PostHandler.cs
@@ -28,6 +28,7 @@ namespace FLocal.IISHandler.handlers {
XElement[] result = new XElement[] {
new XElement("currentLocation", post.exportToXmlSimpleWithParent(context)),
+ post.thread.exportToXml(context, false),
new XElement("posts", post.exportToXmlWithoutThread(context, true, new XElement("isUnread", (post.id > lastReadId).ToPlainString())))
};
diff --git a/IISMainHandler/handlers/ThreadHandler.cs b/IISMainHandler/handlers/ThreadHandler.cs
index 2b788a1..6f2fda9 100644
--- a/IISMainHandler/handlers/ThreadHandler.cs
+++ b/IISMainHandler/handlers/ThreadHandler.cs
@@ -57,6 +57,7 @@ namespace FLocal.IISHandler.handlers {
XElement[] result = new XElement[] {
new XElement("currentLocation", thread.exportToXmlSimpleWithParent(context)),
+ thread.exportToXml(context, false),
new XElement("posts",
from post in posts select post.exportToXmlWithoutThread(context, true, new XElement("isUnread", (post.id > lastReadId).ToPlainString())),
pageOuter.exportToXml(2, 5, 2)
diff --git a/IISMainHandler/handlers/request/AbstractNewMessageHandler.cs b/IISMainHandler/handlers/request/AbstractNewMessageHandler.cs
new file mode 100644
index 0000000..e7b3b9e
--- /dev/null
+++ b/IISMainHandler/handlers/request/AbstractNewMessageHandler.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using FLocal.Core;
+
+namespace FLocal.IISHandler.handlers.request {
+ abstract class AbstractNewMessageHandler : AbstractPostHandler {
+
+ protected string getTitle(WebContext context) {
+ string title = context.httprequest.Form["title"].Trim();
+ if(title == "") {
+ throw new FLocalException("Title is empty");
+ }
+ return title;
+ }
+
+ protected string getBody(WebContext context) {
+ string body = context.httprequest.Form["body"].Trim();
+ if(body == "") {
+ throw new FLocalException("Body is empty");
+ }
+ return body;
+ }
+
+ }
+}
diff --git a/IISMainHandler/handlers/request/CreateThreadHandler.cs b/IISMainHandler/handlers/request/CreateThreadHandler.cs
new file mode 100644
index 0000000..1d03ca1
--- /dev/null
+++ b/IISMainHandler/handlers/request/CreateThreadHandler.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Linq;
+
+namespace FLocal.IISHandler.handlers.request {
+ class CreateThreadHandler : AbstractNewMessageHandler {
+
+ protected override string templateName {
+ get {
+ throw new NotImplementedException();
+ }
+ }
+
+ protected override XElement[] Do(WebContext context) {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/IISMainHandler/handlers/request/ReplyHandler.cs b/IISMainHandler/handlers/request/ReplyHandler.cs
new file mode 100644
index 0000000..50a4a36
--- /dev/null
+++ b/IISMainHandler/handlers/request/ReplyHandler.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Linq;
+using FLocal.Common.dataobjects;
+
+namespace FLocal.IISHandler.handlers.request {
+ class ReplyHandler : AbstractNewMessageHandler {
+
+ protected override string templateName {
+ get {
+ return "result/MessageCreated.xslt";
+ }
+ }
+
+ protected override XElement[] Do(WebContext context) {
+// Post post = Post.LoadById(int.Parse(context.httprequest.Form["parent"]));
+ //int desiredLayerId = Math.Min(context.session.account.user.getMinAllowedLayer(post.thread.board), int.Parse(context.httprequest.Form["layer"]));
+
+ Post newPost = Post.LoadById(
+ int.Parse(context.httprequest.Form["parent"])
+ ).Reply(
+ context.session.account.user,
+ this.getTitle(context),
+ this.getBody(context),
+ int.Parse(context.httprequest.Form["layerId"])
+ );
+
+ newPost.thread.markAsRead(context.session.account, newPost, newPost);
+
+ return new XElement[] { newPost.exportToXmlWithoutThread(context, false) };
+ }
+
+ }
+}
diff --git a/IISMainHandler/handlers/response/ReplyHandler.cs b/IISMainHandler/handlers/response/ReplyHandler.cs
new file mode 100644
index 0000000..04b2d11
--- /dev/null
+++ b/IISMainHandler/handlers/response/ReplyHandler.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.Core;
+using FLocal.Common;
+using FLocal.Common.dataobjects;
+
+namespace FLocal.IISHandler.handlers.response {
+
+ class ReplyHandler : AbstractGetHandler {
+
+ override protected string templateName {
+ get {
+ return "PostReply.xslt";
+ }
+ }
+
+ override protected XElement[] getSpecificData(WebContext context) {
+ Post post = Post.LoadById(int.Parse(context.requestParts[1]));
+
+ return new XElement[] {
+ post.thread.board.exportToXml(context, false),
+ post.thread.exportToXml(context, false),
+ post.exportToXmlWithoutThread(context, false),
+ };
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/static/css/coffeehaus.css b/static/css/coffeehaus.css
index ee9af64..e88a796 100644
--- a/static/css/coffeehaus.css
+++ b/static/css/coffeehaus.css
@@ -1,6 +1,12 @@
/* File Version 6.5.1 */
-a:link {
+[pseudolink] {
+ color: #303030;
+ background: none;
+ text-decoration: underline;
+}
+
+a:link {
color: #303030;
background: none;
}
diff --git a/static/css/global.css b/static/css/global.css
index 4ae9c2e..0d61d36 100644
--- a/static/css/global.css
+++ b/static/css/global.css
@@ -70,4 +70,8 @@ pre
}
.navigation {
margin:3px;
+}
+
+[pseudolink] {
+ cursor:hand;
}
\ No newline at end of file
diff --git a/static/js/textEditor.js b/static/js/textEditor.js
new file mode 100644
index 0000000..9056ada
Binary files /dev/null and b/static/js/textEditor.js differ
diff --git a/templates/Full/Login.xslt b/templates/Full/Login.xslt
index bdfd4be..9cd8510 100644
--- a/templates/Full/Login.xslt
+++ b/templates/Full/Login.xslt
@@ -15,7 +15,7 @@
Ââåäèòå âàøå èìÿ ïîëüçîâàòåëÿ è ïàðîëü äëÿ ðåãèñòðàöèè â ôîðóìå.
- Åñëè âû åù¸ íå ïîëüçîâàëèñü ýòèì ôîðóìîì, íî ïðèøëè ñî ñòàðîãî ôîðóì.ëîêàëà âû ìîæåòå ñîçäàòü ïàðîëü â ôîðìå ìèãðàöèè.
+ Åñëè âû åù¸ íå ïîëüçîâàëèñü ýòèì ôîðóìîì, íî ïðèøëè ñî ñòàðîãî ôîðóì.ëîêàëà – âû ìîæåòå ñîçäàòü ïàðîëü â ôîðìå ìèãðàöèè.
|
@@ -45,7 +45,7 @@
- Åñëè âû ïðèøëè ñî ñòàðîãî ôîðóì.ëîêàëà ââåäèòå ñâîé ëîãèí.
+ Åñëè âû ïðèøëè ñî ñòàðîãî ôîðóì.ëîêàëà – ââåäèòå ñâîé ëîãèí.
|
diff --git a/templates/Full/Post.xslt b/templates/Full/Post.xslt
index f2cd876..1b49c50 100644
--- a/templates/Full/Post.xslt
+++ b/templates/Full/Post.xslt
@@ -9,7 +9,9 @@
|
diff --git a/templates/Full/PostReply.xslt b/templates/Full/PostReply.xslt
new file mode 100644
index 0000000..2da3a4c
--- /dev/null
+++ b/templates/Full/PostReply.xslt
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Çàïîëíèòå ïðèâåäåííóþ íèæå ôîðìó äëÿ îòïðàâêè ñîîáùåíèÿ â ôîðóì. HTML îòêëþ÷åí. UBBCode âêëþ÷åí, è âû ìîæåòå èñïîëüçîâàòü UBBCode â âàøèõ ñîîáùåíèÿõ. Àíîíèìíûå ñîîáùåíèÿ ðàçðåøåíû, è âû ìîæåòå âûáðàòü ëþáîå íåçàðåãèñòðèðîâàííîå èìÿ.
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Àâòîð:
+
+
+ Òåìà:
+
+
+ |
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/Full/Thread.xslt b/templates/Full/Thread.xslt
index e8a7eed..18f14ad 100644
--- a/templates/Full/Thread.xslt
+++ b/templates/Full/Thread.xslt
@@ -23,7 +23,9 @@
-
+
+
+