webapps.mason: make it look like the factorcode.org site

db4
Slava Pestov 2009-05-22 17:32:27 -05:00
parent 07e30edfad
commit a1436e69cd
2 changed files with 15 additions and 12 deletions

View File

@ -1,8 +1,11 @@
<?xml version='1.0' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
<html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="http://factorcode.org/css/master.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<title>Factor binary package for <t:label t:name="platform" /></title>

View File

@ -21,12 +21,13 @@ TUPLE: mason-app < dispatcher ;
] dip link ;
: download-grid-cell ( cpu os -- xml )
builder new swap >>os swap >>cpu select-tuple dup
[
builder new swap >>os swap >>cpu select-tuple [
dup last-release>> dup
[ "." split1 drop 16 tail* 6 head* download-link ] [ 2drop f ] if
] when
[XML <td><-></td> XML] ;
[XML <td class="supported"><div class="bigdiv"><-></div></td> XML]
] [
[XML <td /> XML]
] if* ;
CONSTANT: oses
{
@ -47,22 +48,21 @@ CONSTANT: cpus
: download-grid ( -- xml )
oses
[ values [ [XML <th><-></th> XML] ] map ]
[ values [ [XML <th align='center' scope='col'><-></th> XML] ] map ]
[
keys
cpus [
[ nip second ] [ first ] 2bi [
swap download-grid-cell
] curry map [XML <tr><th><-></th><-></tr> XML]
] curry map
[XML <tr><th align='center' scope='row'><-></th><-></tr> XML]
] with map
] bi [XML <table><tr><th/><-></tr><-></table> XML] ;
] bi
[XML <table id="downloads" cellspacing="0"><tr><th/><-></tr><-></table> XML] ;
: <download-grid-action> ( -- action )
<action>
[
download-grid
xml>string "text/html" <content>
] >>display ;
[ download-grid xml>string "text/html" <content> ] >>display ;
: validate-os/cpu ( -- )
{