[Cruce-commit] SF.net SVN: cruce:[159] JSP/trunk/Forum/WebContent
Status: Beta
Brought to you by:
caiusb
|
From: <ali...@us...> - 2010-05-18 16:15:29
|
Revision: 159
http://cruce.svn.sourceforge.net/cruce/?rev=159&view=rev
Author: alinposho
Date: 2010-05-18 16:15:23 +0000 (Tue, 18 May 2010)
Log Message:
-----------
Something s very wrong with this Web designing. I can't take it any more!
Modified Paths:
--------------
JSP/trunk/Forum/WebContent/Thread.jsp
JSP/trunk/Forum/WebContent/index.jsp
Modified: JSP/trunk/Forum/WebContent/Thread.jsp
===================================================================
--- JSP/trunk/Forum/WebContent/Thread.jsp 2010-05-18 15:14:48 UTC (rev 158)
+++ JSP/trunk/Forum/WebContent/Thread.jsp 2010-05-18 16:15:23 UTC (rev 159)
@@ -12,17 +12,69 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+
+<!-- Linking css -->
+<link rel="stylesheet" href="pageStyle.css" type="text/css">
+
<%
String sID = request.getParameter("id");
int id = Integer.parseInt(sID);
- ForumThread thread = Singleton.getInstance().getThreadDAO().get(id);;
+ ForumThread thread = Singleton.getInstance().getThreadDAO().get(id);
+ session.setAttribute("currentThreadID", Integer.toString(thread.thread_id));
%>
<title>Forum Bubulina: Thread - <% out.println(thread.name); %></title>
</head>
<body>
+
+<!-- The so called header of the forum where you can login/register and add topics if
+you are logged in of course -->
+<%
+ //This form is to be dispayed only if the user is logged in
+ String user = (String)session.getAttribute("user");
+ if(user != null && !user.equalsIgnoreCase("null"))
+ {//If the user has logged in
+ %>
+ <!-- The form for adding a new Thread -->
+ <div id="leftContent" align="right">
+ <FORM NAME="AddTopic" action="index.jsp" method="get">
+ Topic name: <INPUT TYPE="TEXT" NAME="TopicName" value="">
+ <INPUT TYPE="submit" VALUE="Add Topic">
+ </FORM>
+ </div>
+ <div id="#rigthContent" align="right" >
+ <font size="4px">
+ Hello <%out.print(user); %>!
+ Welcome to our forum.
+ </font>
+ </div>
+ <%
+ }
+ else
+ {
+ %>
+
+ <div id="#rigthContent" align="right" >
+ <form name="Login" action="login.jsp" method="post">
+ User name: <input type="text" name="username"><br>
+ Password: <input type="password" name="password"><br>
+ <input type="submit" value="login">
+ </form>
+ <%
+ //Setting the page to return to
+ session.setAttribute("pageToReturnTo", "Thread.jsp");
+ %>
+ <form action="register.jsp" action=post>
+ <input type="submit" value="register">
+ </form>
+ </div>
+<% }
+%>
+
+<!-- The actual table with topics -->
+
<div>
-<table>
- <caption align="top">Topics in this thread are:</caption>
+<table align = center>
+ <caption align="top">Topics in thread <%out.print(thread.name); %> are:</caption>
<tr>
<th>Topic name</th>
<th>Post count</th>
Modified: JSP/trunk/Forum/WebContent/index.jsp
===================================================================
--- JSP/trunk/Forum/WebContent/index.jsp 2010-05-18 15:14:48 UTC (rev 158)
+++ JSP/trunk/Forum/WebContent/index.jsp 2010-05-18 16:15:23 UTC (rev 159)
@@ -11,13 +11,13 @@
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Team Bubulina's Forum</title>
-
<!-- Linking css -->
<link rel="stylesheet" href="pageStyle.css" type="text/css">
</head>
<body>
-
+<!-- The so called header of the forum where you can login/register and add threads if
+you are logged in of course -->
<%
//This form is to be dispayed only if the user is logged in
String user = (String)session.getAttribute("user");
@@ -49,6 +49,10 @@
Password: <input type="password" name="password"><br>
<input type="submit" value="login">
</form>
+ <%
+ //Setting the page to return to
+ session.setAttribute("pageToReturnTo", "index.jsp");
+ %>
<form action="register.jsp" action=post>
<input type="submit" value="register">
</form>
@@ -57,7 +61,7 @@
%>
<!-- The actual table with threads -->
-
+<br>
<div>
<table align = center>
<caption align="top">The threads running on this forum are:<br></caption>
@@ -78,10 +82,10 @@
for (ForumThread thread : threads.getAllThreads()) {
%>
<tr>
- <td>
+ <td>
<a href=Thread.jsp?id=<%= thread.thread_id %>>
- <%
- out.print(thread.name);
+ <%
+ out.print(thread.name);
%>
</a>
</td>
@@ -97,12 +101,6 @@
</table>
</div>
-<!-- Forwarding user name -->
-<form name="dummy">
-<input type="hidden" name="user"
- value="<%request.getParameter("user"); %>"
- >
-</form>
<p>
</p>
</body>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|