once http://drupal.org/node/89538 is done, if you go to the project browsing pages (e.g. http://drupal.org/project/Modules/name) and select <all> for the "Filter by Drupal Core compatibility" form element, instead of just displaying a random download link, if a project has more than 1 release, we should just use another instance of our happy project_release_table() from http://drupal.org/node/89539.

we already have to do a separate query for each project to get the "latest download" link (see http://drupal.org/node/89538#comment-163269 -- we tried), so if we're filtering by [all], we just call our table-generator with the right args, and it does a single query instead of us doing it ourselves.

(this patch depends on #89538 and #89539).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Title: using table of download when filtering by [all] versions in project browsing pages » table of downloads when filtering by [all] versions in project browsing pages
dww’s picture

re-rolling now that #89538 and #89539 are committed.

dww’s picture

Status: Needs review » Needs work

when i tried to install this on s.d.o, it gets weird with bluebeach. :( for example:
1) we need to patch bluebeach's template.php to include the table when rendering the project teasers
2) the zebra striping gets all fubar between projects and rows in the release table
3) projects that only have HEAD releases don't show up in the table
4) we should probably only include the table if there's more than 1 branch of releases

dww’s picture

also, this calls filesize() a *LOT*. :( we should either add an argument to project_release_table() so it leaves off the filesize column, or we should store that info in the DB, but this is generating *many* 100s of filesize() calls, which have to go touch the file system, etc, etc. yuck.

dww’s picture

Status: Needs work » Needs review
FileSize
11.36 KB

new version with the following improvements:

  • major redesign of project_release_table(). i think the args make a lot more sense now and the code is better, too. added a large doxygen comment to make everything more clear.
  • if the only release is an unclassified HEAD node, we still print it.
  • download table in this case doesn't call or print filesize()
  • download table honors the "snapshot_table" setting of project nodes, so if maintainers unselect that checkbox, dev snapshots don't show up on the browse pages when filtering by [all].

the bluebeach woes are still present, namely: a) we have to modify phptemplate_project_summary() to include the download table and b) we have to sort out the zebra striping conflicts between the projects themselves and the rows in the download tables. i know how to solve (a), but i'm not sure what to do about (b) just yet. :(

dww’s picture

yay, unconed was around in IRC just now, and helped me get bluebeach fixed up for this. ;) still not totally ideal, but much better. for example, take a look at http://scratch.drupal.org/project/Modules/category/61 now. at the top, be sure to select [all] in the "Filter by Drupal Core compatibility" drop-down and press "go". then you'll see both the patch from #5 and steven's recent fixes in action.

dww’s picture

open question: should we use a single-row download table for *all* of the existing "Download" links on these pages, even when filtering by a specific core version? it'd require a little more code-reorganization to avoid lots of extra queries, but it'd be quite possible. thoughts?

merlinofchaos’s picture

Seems to look good to me.

I think you should keep the filesize at least on the main project view page, even if it's off on the search all page.

The table-within-table does look kind of enh. I'm not sure what to do about it though. Maybe float the table to the right? I think part of the problem may be that it just doesn't line up with anything, so it seems like it's floating in the middle, awkwardly.

Naturally this gets me thinking about search module integration. Thanks to Gordon I have a rough idea of how to do that. (He wrote it for Views). But that's a completely other topic.

Otherwise I see nothing else that stands out at me.

dww’s picture

Status: Needs review » Needs work

I think you should keep the filesize at least on the main project view page, even if it's off on the search all page..

doh! it's supposed to be there. i dunno what happened. ;) missing an arg somewhere, clearly. my bad. i'll fix that up later this afternoon and roll a new patch.

thanks for the review,
-d

dww’s picture

Status: Needs work » Needs review
FileSize
11.37 KB

yup, i knew this was just something stupid. ;) behold: http://scratch.drupal.org/project/views

AjK’s picture

subscribing

dww’s picture

Status: Needs review » Fixed

hearing no objections, i committed to DRUPAL-4-7--2 and installed this on d.o.
AjK: if you find anything suspicious when you finally review the diff, please re-open.
otherwise, i'll assume you're happy. ;)

thanks,
-derek

merlinofchaos’s picture

I clicked through a little bit of the modules page, and adding this information to makes its absence on 5.x, 4.7.x, etc very conspicuous.

In thinking about it, I can't think of a really good reason to not just have the same table show up on all views, regardless of what the filter is.

Use the filter to reduce the resultset (i.e, exclude modules that aren't relevant for your version), but show all versions in all cases. The version number is useful, but it's also minorly useful to have the history. And certainly the code would probably be a touch simpler to just do it that way.

Anonymous’s picture

Status: Fixed » Closed (fixed)