<%--
  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@silcom.com>,
  for Silverwrist Design Studios.  Portions created by Eric J. Bowersox are
  Copyright (C) 2001 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.view.JSPView" %>
<%@ taglib uri="/tlds/util" prefix="util" %>
<%@ taglib uri="/tlds/community" prefix="comm" %>
<%@ taglib uri="/tlds/conference" prefix="conf" %>
<%
  JSPView view = JSPView.get(request);
  List confs = (List)(view.getRequestAttribute("conferences.list"));
  List hosts = (List)(view.getRequestAttribute("conferences.hosts.list"));
%>
<util:comment>Conference list for community "<comm:name/>"</util:comment>
<util:header title="Conference List:">
  <util:subtitle><comm:name/></util:subtitle>
</util:header>
<% if (confs.size()>0) { %>
  <TABLE BORDER=0 ALIGN=LEFT>
    <% for (int i=0; i<confs.size(); i++) { %>
      <TR VALIGN=TOP>
        <TD ALIGN=CENTER WIDTH=14><util:stdbullet/></TD>
        <TD ALIGN=LEFT CLASS="content"><util:font color="content.fg" size="content">
          <% ConferenceContext conf = (ConferenceContext)(confs.get(i)); %>
          <util:xlink>
            <util:href type="servlet">conf/topics.js.vs?cc=<comm:ID/>&conf=<%= conf.getConfID() %></util:href>
            <util:text><util:escape><%= conf.getName() %></util:escape></util:text>
          </util:xlink> -
          Latest activity: <%= view.getActivityString(conf.getLastUpdateDate()) %>
          <% if (conf.anyUnread()) { %>
            <util:xlink>
      <util:href type="servlet">conf/read_new.js.vs?cc=<comm:ID/>&conf=<%= conf.getConfID() %></util:href>
      <util:text><util:image src="tag_new.gif" fixup="true" alt="New!" width="40" height="20"/></util:text>
            </util:xlink>
          <% } // end if %>
          <BR>
          <% List hosts1 = (List)(hosts.get(i)); %>
          <% if (hosts1.size()>0) { %>
            <% if (hosts1.size()>1) { %>Hosts:<% } else { %>Host:<% } %>
            <% for (int j=0; j<hosts1.size(); j++) { %>
              <% UserFound uf = (UserFound)(hosts1.get(j)); %>
              <% if (j>0) { %>, <% } %>
              <util:xlink>
                <util:href type="servlet">user/<%= uf.getName() %></util:href>
                <util:text><%= uf.getName() %></util:text>
              </util:xlink>
            <% } // end for %>
          <% } else { %>
            Hosts: <EM>(none)</EM>
          <% } // end if (hosts present in the conterence) %>
          <BR>
          <EM><util:escape><%= conf.getDescription() %></util:escape></EM>
        </util:font></TD>
      </TR>
    <% } // end for %>
  </TABLE><BR CLEAR=LEFT>
<% } else { %>
  <util:font color="content.fg" size="content"><EM>No conferences found in this community.</EM></util:font><BR>
<% } // end if %>
<P>
<DIV ALIGN="LEFT" CLASS="content">
  <util:xlink>
    <util:href type="servlet">conf/find.js.vs?cc=<comm:ID/></util:href>
    <util:text><util:button id="find"/></util:text>
  </util:xlink>&nbsp;
  <conf:can_manage>
    <util:xlink>
      <util:href type="servlet">conf/manage.js.vs?cc=<comm:ID/></util:href>
      <util:text><util:button id="manage"/></util:text>
    </util:xlink>&nbsp;
  </conf:can_manage>
  <conf:can_create>
    <util:xlink>
      <util:href type="servlet">conf/create.js.vs?cc=<comm:ID/></util:href>
      <util:text><util:button id="createnew"/></util:text>
    </util:xlink>&nbsp;
  </conf:can_create>
</DIV>
