Changesets can be listed by changeset number.
The Git repository is here.
Changeset 267
Support better directory listings for download components, with better
handling of filename extensions, version numbers and datestamps.
- Comitted by: rool
- Date: Tuesday April 28 12:22:08 2009 (over 15 years ago)
Affected files:
- rool/rails/radiant/trunk/app/models/page_context.rb (diff)
- rool/www/static/trunk/css/risc_os_open.css (diff)
rool/rails/radiant/trunk/app/models/page_context.rb:
prev. | current | |
# | ||
# Items which override values determined from the filename | ||
# -------------------------------------------------------- | ||
482 | | |
482 | # | |
# name: 'Component display name" | ||
# version: 'Version string' | ||
# icon: 'Icon filename name' (no path components allowed) | ||
# link: 'Details link' (Wiki by default; for links within the | ||
# ROOL site, use "/foo/bar/baz.html" - | ||
# i.e. do NOT include the host name) | ||
489 | | |
489 | # | |
# Items which are optional | ||
# ------------------------ | ||
492 | | |
492 | # | |
# info: 'One-liner description' (else "-" by default) | ||
# group: 'Group name' (groups are sorted alphabetically and | ||
# ungrouped items are listed afterwards; | ||
... | ... | |
list.each do |entry| | ||
804 | # Parser: Various charaters, a dot, then: one or more digits (0-9) | |
805 | # followed by an optional dot, repeated at least once, this whole | |
806 | # assembly optional, recording only the collection of digits and | |
807 | # dots, not individual digits-plus-dots sets ("(?:" => don't include | |
808 | # this group in the match data). Then zero or more other characters, | |
809 | # non-greedy. | |
810 | ||
leaf = entry[:leaf] | ||
805 | | |
806 | | |
807 | | |
808 | | |
812 | regexp = /^(.*?)\.((?:[0-9]+\.?)+)?(.*?)$/ | |
813 | scanned = leaf.scan( regexp )[ 0 ] | |
814 | base_name = scanned[0] | |
815 | version = (scanned[1] || '').chomp('.') # May have trailing '.' | |
816 | filetype = scanned[2] || '' | |
818 | config = configuration[base_name] || configuration[leaf] || {} | |
819 | ||
name = config['name'] || base_name.humanize.titleize | ||
811 | | |
821 | version = config['version'] || ((version.empty?) ? '-' : version) | |
icon = config['icon'] || "#{base_name}.png" | ||
link = config['link'] || "#{link_base}#{name}" | ||
info = config['info'] || '-' | ||
... | ... | |
:icon => icon, | ||
:link => link, | ||
:info => info, | ||
833 | | |
843 | :raw => entry | |
} ) | ||
end | ||
... | ... | |
# For each sorted key, output a table. | ||
866 | dscwd = link_base ? '40%' : '50%' | |
867 | ||
count = 0 | ||
html << "<h3>#{group_key}</h3>\n" | ||
html << "<table width=\"100%\" class=\"parsed_directory_listing\" border=\"0\">\n" | ||
859 | | |
860 | | |
871 | html << "<tr><th width=\"10%\">Icon</th><th width=\"20%\" align=\"left\">Name & date</th><th width=\"#{dscwd}\" align=\"left\">Description</th><th width=\"10%\">Version</th><th width=\"10%\">Size</th>" | |
872 | html << "<th width=\"10%\">Details</th>" if (link_base) | |
html << "</tr>\n" | ||
# Sort the items inside each group by name and output each in a table | ||
... | ... | |
html << "<td align=\"center\"><a href=\"#{entry[:raw][:link]}\" class=\"img\"><img src=\"#{entry[:icon]}\" alt=\"icon\" /></a></td>" | ||
end | ||
883 | | |
895 | time = entry[:raw][:mod] | |
896 | ||
897 | if (time.nil?) | |
898 | tstr = '' | |
899 | else | |
900 | tstr = "<div class=\"parsed_directory_listing_datestamp\">" << | |
901 | "#{time.strftime('%Y-%m-%d')} " << | |
902 | "#{time.strftime('%H:%M:%S')}" << | |
903 | "</div>" | |
904 | end | |
905 | ||
906 | html << "<td><a href=\"#{entry[:raw][:link]}\">#{entry[:name]}</a>#{tstr}</td>" | |
html << "<td class=\"can_wrap\">#{entry[:info]}</td>" | ||
html << "<td align=\"center\">#{entry[:version]}</td>" | ||
html << "<td align=\"center\">#{entry[:raw][:size]}</td>" |
rool/www/static/trunk/css/risc_os_open.css:
prev. | current | |
color: #5b6370; | ||
} | ||
239 | ||
239 | a img, a:hover img | |
{ | ||
border: none; | ||
} | ||
244 | ||
244 | a.img, a:hover.img | |
{ | ||
246 | background: transparent; | |
border-bottom: none; | ||
} | ||
... | ... | |
table.parsed_directory_listing | ||
{ | ||
447 | table-layout: auto; | |
border-collapse: collapse; | ||
margin: 0 0 20px 0; | ||
padding: 0; | ||
... | ... | |
background: #eee; | ||
} | ||
470 | div.parsed_directory_listing_datestamp | |
471 | { | |
472 | margin-top: 5px; | |
473 | font-size: 70%; | |
474 | } | |
475 | ||
/* CVS revisions and SVN changesets */ | ||
div.log, |