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