Files
i2p.i2p/apps/susidns/src/jsp/addressbook.jsp

209 lines
8.4 KiB
Plaintext
Raw Normal View History

2005-09-16 04:04:40 +00:00
<%
/*
* Created on Sep 02, 2005
*
* This file is part of susidns project, see http://susi.i2p/
*
* Copyright (C) 2005 <susi23@mail.i2p>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Revision: 1.3 $
2005-09-16 04:04:40 +00:00
*/
// http://www.crazysquirrel.com/computing/general/form-encoding.jspx
if (request.getCharacterEncoding() == null)
request.setCharacterEncoding("UTF-8");
2005-09-16 04:04:40 +00:00
%>
2009-12-15 01:46:10 +00:00
<%@page pageEncoding="UTF-8"%>
2005-09-16 04:04:40 +00:00
<%@ page contentType="text/html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:useBean id="version" class="i2p.susi.dns.VersionBean" scope="application" />
<jsp:useBean id="book" class="i2p.susi.dns.NamingServiceBean" scope="session" />
2009-12-15 17:25:01 +00:00
<jsp:useBean id="intl" class="i2p.susi.dns.Messages" scope="application" />
2005-09-16 04:04:40 +00:00
<jsp:setProperty name="book" property="*" />
<jsp:setProperty name="book" property="resetDeletionMarks" value="1"/>
<c:forEach items="${paramValues.checked}" var="checked">
<jsp:setProperty name="book" property="markedForDeletion" value="${checked}"/>
</c:forEach>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
2009-12-15 01:46:10 +00:00
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
2011-03-30 00:42:08 +00:00
<title>${book.book} <%=intl._("address book")%> - susidns</title>
2005-09-16 04:04:40 +00:00
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body>
2009-07-20 12:33:07 +00:00
<div class="page">
2005-09-16 04:04:40 +00:00
<div id="logo">
2011-11-14 15:06:23 +00:00
<a href="index"><img src="images/logo.png" alt="" title="<%=intl._("Overview")%>" border="0"/></a>
2005-09-16 04:04:40 +00:00
</div>
2009-07-20 12:33:07 +00:00
<hr>
2005-09-16 04:04:40 +00:00
<div id="navi">
2009-12-15 17:25:01 +00:00
<p>
2011-03-30 00:19:28 +00:00
<%=intl._("Address books")%>:
2011-11-14 15:06:23 +00:00
<a href="addressbook?book=private&amp;filter=none&amp;begin=0&amp;end=99"><%=intl._("private")%></a> |
<a href="addressbook?book=master&amp;filter=none&amp;begin=0&amp;end=99"><%=intl._("master")%></a> |
<a href="addressbook?book=router&amp;filter=none&amp;begin=0&amp;end=99"><%=intl._("router")%></a> |
<a href="addressbook?book=published&amp;filter=none&amp;begin=0&amp;end=99"><%=intl._("published")%></a> *
<a href="subscriptions"><%=intl._("Subscriptions")%></a> *
<a href="config"><%=intl._("Configuration")%></a> *
<a href="index"><%=intl._("Overview")%></a>
2005-09-16 04:04:40 +00:00
</p>
</div>
2009-07-20 12:33:07 +00:00
<hr>
2005-09-16 04:04:40 +00:00
<div id="headline">
2011-03-30 00:19:28 +00:00
<h3><%=intl._("Address book")%>: <%=intl._(book.getBook())%></h3>
<h4><%=intl._("Storage")%>: ${book.displayName}</h4>
2005-09-16 04:04:40 +00:00
</div>
<div id="messages">${book.messages}</div>
${book.loadBookMessages}
<c:if test="${book.notEmpty}">
2005-09-16 04:04:40 +00:00
<div id="filter">
2009-12-15 17:25:01 +00:00
<p><%=intl._("Filter")%>:
2011-11-14 15:06:23 +00:00
<a href="addressbook?filter=a&amp;begin=0&amp;end=99">a</a>
<a href="addressbook?filter=b&amp;begin=0&amp;end=99">b</a>
<a href="addressbook?filter=c&amp;begin=0&amp;end=99">c</a>
<a href="addressbook?filter=d&amp;begin=0&amp;end=99">d</a>
<a href="addressbook?filter=e&amp;begin=0&amp;end=99">e</a>
<a href="addressbook?filter=f&amp;begin=0&amp;end=99">f</a>
<a href="addressbook?filter=g&amp;begin=0&amp;end=99">g</a>
<a href="addressbook?filter=h&amp;begin=0&amp;end=99">h</a>
<a href="addressbook?filter=i&amp;begin=0&amp;end=99">i</a>
<a href="addressbook?filter=j&amp;begin=0&amp;end=99">j</a>
<a href="addressbook?filter=k&amp;begin=0&amp;end=99">k</a>
<a href="addressbook?filter=l&amp;begin=0&amp;end=99">l</a>
<a href="addressbook?filter=m&amp;begin=0&amp;end=99">m</a>
<a href="addressbook?filter=n&amp;begin=0&amp;end=99">n</a>
<a href="addressbook?filter=o&amp;begin=0&amp;end=99">o</a>
<a href="addressbook?filter=p&amp;begin=0&amp;end=99">p</a>
<a href="addressbook?filter=q&amp;begin=0&amp;end=99">q</a>
<a href="addressbook?filter=r&amp;begin=0&amp;end=99">r</a>
<a href="addressbook?filter=s&amp;begin=0&amp;end=99">s</a>
<a href="addressbook?filter=t&amp;begin=0&amp;end=99">t</a>
<a href="addressbook?filter=u&amp;begin=0&amp;end=99">u</a>
<a href="addressbook?filter=v&amp;begin=0&amp;end=99">v</a>
<a href="addressbook?filter=w&amp;begin=0&amp;end=99">w</a>
<a href="addressbook?filter=x&amp;begin=0&amp;end=99">x</a>
<a href="addressbook?filter=y&amp;begin=0&amp;end=99">y</a>
<a href="addressbook?filter=z&amp;begin=0&amp;end=99">z</a>
<a href="addressbook?filter=0-9&amp;begin=0&amp;end=99">0-9</a>
<a href="addressbook?filter=xn--&amp;begin=0&amp;end=99"><%=intl._("other")%></a>
<a href="addressbook?filter=none&amp;begin=0&amp;end=99"><%=intl._("all")%></a></p>
2005-09-16 04:04:40 +00:00
<c:if test="${book.hasFilter}">
2009-12-15 17:25:01 +00:00
<p><%=intl._("Current filter")%>: ${book.filter}
2011-11-14 15:06:23 +00:00
(<a href="addressbook?filter=none&amp;begin=0&amp;end=99"><%=intl._("clear filter")%></a>)</p>
2005-09-16 04:04:40 +00:00
</c:if>
</div>
<div id="search">
2011-11-14 15:06:23 +00:00
<form method="POST" action="addressbook">
<input type="hidden" name="begin" value="0">
<input type="hidden" name="end" value="99">
2005-09-16 04:04:40 +00:00
<table><tr>
<td class="search"><%=intl._("Search")%>: <input class="search" type="text" name="search" value="${book.search}" size="20" ></td>
<td class="search"><input class="search" type="submit" name="submitsearch" value="<%=intl._("Search")%>" ></td>
2005-09-16 04:04:40 +00:00
</tr>
</table>
</form></div>
</c:if>
2005-09-16 04:04:40 +00:00
<%
// have to only do this once per page
String susiNonce = book.getSerial();
%>
<c:if test="${book.notEmpty}">
2011-11-14 15:06:23 +00:00
<form method="POST" action="addressbook">
<input type="hidden" name="serial" value="<%=susiNonce%>">
<input type="hidden" name="begin" value="0">
<input type="hidden" name="end" value="99">
2005-09-16 04:04:40 +00:00
<jsp:setProperty name="book" property="trClass" value="0" />
<div id="book">
2005-09-16 04:04:40 +00:00
<table class="book" cellspacing="0" cellpadding="5">
<tr class="head">
<c:if test="${book.master || book.router || book.published || book.private}">
2005-09-16 04:04:40 +00:00
<th>&nbsp;</th>
</c:if>
2009-12-15 17:25:01 +00:00
<th><%=intl._("Name")%></th>
2011-03-29 02:16:42 +00:00
<th colspan="2"><%=intl._("Links")%></th>
2009-12-15 17:25:01 +00:00
<th><%=intl._("Destination")%></th>
2005-09-16 04:04:40 +00:00
</tr>
<!-- limit iterator, or "Form too large" may result on submit, and is a huge web page if we don't -->
<c:forEach items="${book.entries}" var="addr" begin="${book.resultBegin}" end="${book.resultEnd}">
2005-09-16 04:04:40 +00:00
<tr class="list${book.trClass}">
<c:if test="${book.master || book.router || book.published || book.private}">
2009-12-15 17:25:01 +00:00
<td class="checkbox"><input type="checkbox" name="checked" value="${addr.name}" title="<%=intl._("Mark for deletion")%>"></td>
2005-09-16 04:04:40 +00:00
</c:if>
<td class="names"><a href="http://${addr.name}/">${addr.displayName}</a>
</td><td class="names">
2011-03-29 02:16:42 +00:00
<span class="addrhlpr"><a href="http://${addr.b32}/" title="<%=intl._("Base 32 address")%>">b32</a></span>
</td><td class="names">
2011-11-14 15:06:23 +00:00
<span class="addrhlpr"><a href="details?h=${addr.name}" title="<%=intl._("More information on this entry")%>"><%=intl._("details")%></a></span>
2005-09-16 04:04:40 +00:00
</td>
2009-07-02 19:08:55 +00:00
<td class="destinations"><textarea rows="1" style="height: 3em;" cols="40" wrap="off" readonly="readonly" name="dest_${addr.name}" >${addr.destination}</textarea></td>
2005-09-16 04:04:40 +00:00
</tr>
</c:forEach>
</table>
</div>
<c:if test="${book.master || book.router || book.published || book.private}">
2005-09-16 04:04:40 +00:00
<div id="buttons">
2010-05-19 18:55:53 +00:00
<p class="buttons">
<input class="cancel" type="reset" value="<%=intl._("Cancel")%>" >
<input class="delete" type="submit" name="action" value="<%=intl._("Delete Selected")%>" >
2005-09-16 04:04:40 +00:00
</p>
</div></form>
2005-09-16 04:04:40 +00:00
</c:if>
</c:if>
<c:if test="${book.isEmpty}">
<div id="book">
2011-03-30 00:42:08 +00:00
<p class="book"><%=intl._("This address book is empty.")%></p>
2005-09-16 04:04:40 +00:00
</div>
</c:if>
2011-11-14 15:06:23 +00:00
<form method="POST" action="addressbook">
<input type="hidden" name="serial" value="<%=susiNonce%>">
<input type="hidden" name="begin" value="0">
<input type="hidden" name="end" value="99">
2005-09-16 04:04:40 +00:00
<div id="add">
2009-12-15 17:25:01 +00:00
<h3><%=intl._("Add new destination")%>:</h3>
2011-03-29 02:16:42 +00:00
<table><tr><td>
<b><%=intl._("Host Name")%></b></td><td><input type="text" name="hostname" value="${book.hostname}" size="54">
</td></tr><tr><td>
<b><%=intl._("Destination")%></b></td><td><textarea name="destination" rows="1" style="height: 3em;" cols="70" wrap="off" spellcheck="false">${book.destination}</textarea>
</td></tr></table>
<p class="buttons">
<input class="cancel" type="reset" value="<%=intl._("Cancel")%>" >
<input class="accept" type="submit" name="action" value="<%=intl._("Replace")%>" >
<input class="add" type="submit" name="action" value="<%=intl._("Add")%>" >
2005-09-16 04:04:40 +00:00
</p>
</div></form>
2005-09-16 04:04:40 +00:00
2009-07-20 12:33:07 +00:00
<hr>
2005-09-16 04:04:40 +00:00
<div id="footer">
<p class="footer">susidns v${version.version} &copy; <a href="${version.url}">susi</a> 2005</p>
</div>
2009-07-20 12:33:07 +00:00
</div>
2005-09-16 04:04:40 +00:00
</body>
</html>