venice-main-classic/web/format/conf/topics.jsp

261 lines
11 KiB
Plaintext

<%--
The contents of this file are subject to the Mozilla Public License Version 1.1
(the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at <http://www.mozilla.org/MPL/>.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
The Original Code is the Venice Web Communities System.
The Initial Developer of the Original Code is Eric J. Bowersox <erbo@users.sf.net>,
for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
Copyright (C) 2001-2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
Contributor(s):
--%>
<%@ page import = "java.util.*" %>
<%@ page import = "com.silverwrist.venice.core.*" %>
<%@ page import = "com.silverwrist.venice.ui.conf.CurrentConference" %>
<%@ page import = "com.silverwrist.venice.ui.view.JSPView" %>
<%@ taglib uri="/tlds/util" prefix="util" %>
<%@ taglib uri="/tlds/community" prefix="comm" %>
<%@ taglib uri="/tlds/conference" prefix="conf" %>
<%@ taglib uri="/tlds/topic" prefix="topic" %>
<%!
// since these values are used frequently in this page, redeclare them from ConferenceContext
// to help minimize the clutter
private static final int DISPLAY_NEW = ConferenceContext.DISPLAY_NEW;
private static final int DISPLAY_ACTIVE = ConferenceContext.DISPLAY_ACTIVE;
private static final int DISPLAY_ALL = ConferenceContext.DISPLAY_ALL;
private static final int DISPLAY_HIDDEN = ConferenceContext.DISPLAY_HIDDEN;
private static final int DISPLAY_ARCHIVED = ConferenceContext.DISPLAY_ARCHIVED;
private static final int SORT_NUMBER = ConferenceContext.SORT_NUMBER;
private static final int SORT_NAME = ConferenceContext.SORT_NAME;
private static final int SORT_UNREAD = ConferenceContext.SORT_UNREAD;
private static final int SORT_TOTAL = ConferenceContext.SORT_TOTAL;
private static final int SORT_DATE = ConferenceContext.SORT_DATE;
%>
<%
JSPView view = JSPView.get(request);
CurrentConference currc = CurrentConference.get(request);
final int view_opt = currc.getViewOption();
final int sort_opt = currc.getSortOption();
final String base_locator = "cc=" + view.getCommunity().getCommunityID() + "&conf="
+ currc.getConference().getConfID();
%>
<util:comment>Topic list for conference "<conf:name/>"</util:comment>
<util:header><util:title>Topics in <util:escape><conf:name/></util:escape></util:title></util:header>
<%= view.getRequestAttribute("conference.custom.top").toString() %>
<util:font color="content.fg" size="content">
<div align="left" class="content">
<util:xlink>
<util:href type="servlet">conf/conferences.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="conf_list"/></util:text>
</util:xlink>&nbsp;
<topic:can_create>
<util:xlink>
<util:href type="servlet">conf/new_topic.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="add_topic"/></util:text>
</util:xlink>&nbsp;
</topic:can_create>
<% final String rnew = (String)(view.getRequestAttribute("conference.readnew")); %>
<% if (rnew!=null) { %>
<util:xlink>
<util:href type="servlet"><%= rnew %></util:href>
<util:text><util:button id="read_new"/></util:text>
</util:xlink>&nbsp;
<% } // end if %>
<util:xlink>
<util:href type="servlet">conf/find.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="find"/></util:text>
</util:xlink>&nbsp;
<util:xlink>
<util:href type="servlet">conf/manage_conf.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="manage"/></util:text>
</util:xlink>&nbsp;
<conf:can_add_to_hotlist>
<util:xlink>
<util:href type="servlet">conf/add_to_hotlist.js.vs?<%= base_locator %></util:href>
<util:text><util:button id="add_to_hotlist"/></util:text>
</util:xlink>&nbsp;
</conf:can_add_to_hotlist>
<br />
<util:font color="content.fg" size="post-reference"><util:xlink aclass="content">
<util:href type="servlet"><%= view.getPageQID() %></util:href>
<util:text>[Permalink to this conference]</util:text>
</util:xlink></util:font>
</div>
<% out.flush(); response.flushBuffer(); %>
<% final List topics = (List)(view.getRequestAttribute("topics.list")); %>
<% if (topics.size()>0) { %>
<table width="100%" border="0" cellpadding="0" cellspacing="3">
<tr valign="top">
<td align="left" width="1%" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<b><util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_NUMBER) ? -SORT_NUMBER : SORT_NUMBER) %></util:href>
<util:text>#</util:text>
</util:xlink></b>&nbsp;&nbsp;
</util:font></td>
<td align="left" class="content"><util:font color="content.fg" size="content">
<b><util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_NAME) ? -SORT_NAME : SORT_NAME) %></util:href>
<util:text>Topic Name</util:text>
</util:xlink></b>
</util:font></td>
<td align="right" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<b><util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_UNREAD) ? -SORT_UNREAD : SORT_UNREAD) %></util:href>
<util:text>New</util:text>
</util:xlink></b>
</util:font></td>
<td align="right" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<b><util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_TOTAL) ? -SORT_TOTAL : SORT_TOTAL) %></util:href>
<util:text>Total</util:text>
</util:xlink></b>
</util:font></td>
<td align="left" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<b><util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&sort=<%= ((sort_opt==SORT_DATE) ? -SORT_DATE : SORT_DATE) %></util:href>
<util:text>Last Response</util:text>
</util:xlink></b>
</util:font></td>
</tr>
<tr valign="top"><td align="left" colspan="5">&nbsp;</td></tr>
<% out.flush(); response.flushBuffer(); %>
<%
for (Iterator it=topics.iterator(); it.hasNext(); ) {
TopicContext topic = (TopicContext)(it.next());
short num = topic.getTopicNumber();
String my_locator = base_locator + "&top=" + num;
%>
<tr valign="top">
<td align="left" width="1%" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<util:xlink aclass="content">
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&rnm=1</util:href>
<util:text><%= num %></util:text>
</util:xlink>&nbsp;&nbsp;
</util:font></td>
<td align="left" class="content"><util:font color="content.fg" size="content">
<util:xlink aclass="content">
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&rnm=1</util:href>
<util:text><%= topic.getName() %></util:text>
</util:xlink>
<% if (topic.isSticky()) { %>
<i>(sticky)</i>
<% } // end if %>
<% if (topic.isArchived() && (view_opt!=DISPLAY_ARCHIVED)) { %>
<i>(archived)</i>
<% } else if (topic.isFrozen()) { %>
<i>(frozen)</i>
<% } // end if %>
</util:font></td>
<td align="right" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<util:xlink aclass="content">
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&rnm=1</util:href>
<util:text><%= topic.getUnreadMessages() %></util:text>
</util:xlink>
</util:font></td>
<td align="right" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<util:xlink aclass="content">
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&p1=0&p2=-1</util:href>
<util:text><%= topic.getTotalMessages() %></util:text>
</util:xlink>
</util:font></td>
<td align="left" class="content" nowrap="nowrap"><util:font color="content.fg" size="content">
<util:xlink aclass="content">
<util:href type="servlet">conf/posts.js.vs?<%= my_locator %>&rnm=1</util:href>
<util:text><%= view.formatDate(topic.getLastUpdateDate()) %></util:text>
</util:xlink>
</util:font></td>
</tr>
<%
out.flush();
response.flushBuffer();
} // end for (all topics in enumeration)
%>
</table><p />
<% } else { %>
<i><%
switch (view_opt)
{
case DISPLAY_NEW:
out.write("No topics with unread messages found.");
break;
case DISPLAY_ACTIVE:
case DISPLAY_ALL:
out.write("No active topics found.");
break;
case DISPLAY_HIDDEN:
out.write("No hidden topics found.");
break;
case DISPLAY_ARCHIVED:
out.write("No archived topics found.");
break;
default:
out.write("Invalid display option selected.");
break;
} // end switch
%></i>
<p />
<% } // end if %>
<% out.flush(); response.flushBuffer(); %>
<div align="center" class="content">
<b>[</b>
<% if (view_opt==DISPLAY_NEW) { %>
<b>New</b>
<% } else { %>
<util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_NEW %></util:href>
<util:text>New</util:text>
</util:xlink>
<% } // end if %>
<b>|</b>
<% if (view_opt==DISPLAY_ACTIVE) { %>
<b>Active</b>
<% } else { %>
<util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_ACTIVE %></util:href>
<util:text>Active</util:text>
</util:xlink>
<% } // end if %>
<b>|</b>
<% if (view_opt==DISPLAY_ALL) { %>
<b>All</b>
<% } else { %>
<util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_ALL %></util:href>
<util:text>All</util:text>
</util:xlink>
<% } // end if %>
<b>|</b>
<% if (view_opt==DISPLAY_HIDDEN) { %>
<b>Hidden</b>
<% } else { %>
<util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_HIDDEN %></util:href>
<util:text>Hidden</util:text>
</util:xlink>
<% } // end if %>
<b>|</b>
<% if (view_opt==DISPLAY_ARCHIVED) { %>
<b>Archived</b>
<% } else { %>
<util:xlink aclass="content">
<util:href type="servlet">conf/topics.js.vs?<%= base_locator %>&view=<%= DISPLAY_ARCHIVED %></util:href>
<util:text>Archived</util:text>
</util:xlink>
<% } // end if %>
<b>]</b>
</div>
</util:font>
<%= view.getRequestAttribute("conference.custom.bottom").toString() %>
<%-- EOF --%>