index.shtml revision 1116
742N/A## -*- coding: utf-8 -*-
742N/A##
742N/A## CDDL HEADER START
742N/A##
742N/A## The contents of this file are subject to the terms of the
742N/A## Common Development and Distribution License (the "License").
742N/A## You may not use this file except in compliance with the License.
742N/A##
742N/A## You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
742N/A## or http://www.opensolaris.org/os/licensing.
742N/A## See the License for the specific language governing permissions
742N/A## and limitations under the License.
742N/A##
742N/A## When distributing Covered Code, include this CDDL HEADER in each
742N/A## file and include the License file at usr/src/OPENSOLARIS.LICENSE.
742N/A## If applicable, add the following below this CDDL HEADER, with the
742N/A## fields enclosed by brackets "[]" replaced with your own identifying
742N/A## information: Portions Copyright [yyyy] [name of copyright owner]
742N/A##
742N/A## CDDL HEADER END
742N/A##
817N/A## Copyright 2009 Sun Microsystems, Inc. All rights reserved.
742N/A## Use is subject to license terms.
742N/A##
742N/A<%inherit file="layout.shtml"/>\
742N/A<%page args="g_vars"/>\
742N/A<%
742N/A catalog = g_vars["catalog"]
742N/A config = g_vars["config"]
742N/A request = g_vars["request"]
742N/A%>\
742N/A<%def name="page_title(g_vars)"><%
742N/A return self.shared.rcval(g_vars, "repository", "name")
742N/A%></%def>\
742N/A<%def name="page_crumbs(g_vars)"><%
742N/A # None at top level.
742N/A return []
742N/A%></%def>\
742N/A<%def name="document_class()"><%
742N/A return "yui-t4"
742N/A%></%def>\
742N/A<div id="yui-main">
742N/A <div class="yui-b">
758N/A<%
758N/A repo_desc = self.shared.rcval(g_vars, "repository", "description")
758N/A%>
758N/A% if repo_desc:
758N/A <h2 class="section-title">About</h2>
758N/A <p>${repo_desc}</p>
758N/A% endif
742N/A% if catalog.search_available:
1116N/A <form class="search" action="search.shtml">
742N/A <h2 class="section-title">Search Packages</h2>
742N/A <p>
1116N/A <input id="search-field" type="text" size="40"
742N/A maxlength="512" name="token"/>
742N/A <input id="submit-search" type="submit"
742N/A name="action" value="Search"/>
1116N/A <a href="advanced_search.shtml">Advanced Search</a>
742N/A </p>
742N/A </form>
742N/A% endif
742N/A% if not config.mirror:
742N/A<%
742N/A versions = self.shared.get_releases(g_vars)
742N/A selected_version = request.params.get("version", None)
742N/A selected_match = False
742N/A for v in versions:
742N/A ver, val, label = v
742N/A if selected_version == val:
742N/A selected_match = True
742N/A
742N/A if versions and (not selected_version or not selected_match):
742N/A # Either a version wasn't already selected, or the version
742N/A # provided didn't match a valid one, so default to the first in
742N/A # the list.
742N/A selected_version = versions[0][1]
742N/A%>
742N/A% if versions:
742N/A <form action="catalog.shtml">
742N/A <h2 class="section-title">Browse Packages</h2>
742N/A <p>
742N/A <label for="version">Release and Branch</label>
742N/A <select id="version" name="version">
742N/A<%
742N/A for v in versions:
742N/A ver, val, label = v
742N/A attrs = ""
742N/A if val == selected_version:
742N/A attrs = 'selected="selected" '
742N/A
742N/A context.write("""<option %svalue="%s">%s</option>\n""" % (
742N/A attrs, val, label))
742N/A%>
742N/A </select>
742N/A <input id="submit-browse" type="submit"
742N/A name="action" value="Browse"/>
742N/A </p>
742N/A <p>Select a release from the list above to see all of
742N/Athe packages available for it.</p>
742N/A </form>
742N/A% else:
742N/A <h2 class="section-title">Browse Packages</h2>
758N/A <p>The list of all available packages can be found
758N/A<a href="catalog.shtml">here</a>.</p>
742N/A% endif
742N/A% else:
742N/A <p>Information about packages is not available when the server is operating in mirror mode.</p>
742N/A% endif
742N/A </div>
742N/A</div>
742N/A<div class="yui-b">
742N/A% if not config.mirror:
817N/A <table class="stats" summary="A summary of information about the
817N/A package repository.">
742N/A <tr class="first">
742N/A <th colspan="2" class="last">
742N/A <a id="catalog-feed"
742N/A href="../feed"
742N/A title="${self.shared.rcval(g_vars, 'feed', 'name')}"></a>
742N/A Catalog
742N/A </th>
742N/A </tr>
742N/A <tr>
742N/A <td class="label">Packages</td>
742N/A <td class="value">${catalog.package_count}</td>
742N/A </tr>
742N/A <tr>
742N/A <td class="label">Last Updated</td>
742N/A<%
754N/A # Note: last_modified() is in local time relative to the timezone where
754N/A # catalog was last modified.
754N/A lm = catalog.last_modified
754N/A if lm:
754N/A lm = lm.replace(microsecond=0)
754N/A else:
754N/A lm = "Never"
742N/A%>
742N/A <td class="value">${lm}</td>
742N/A </tr>
742N/A </table>
742N/A% endif
742N/A</div>