Resurrect the code for showing the best-download button from the old 'Home' tool (uses JS, from sfpy) and make it a macro, probably [[download_button]]
Code is on allura js/2598. To test, add this to any markdown area: [[download_button]]. Make sure you see the data being pulled from a url like https://sf-jsteele-5015.sb.sf.net/projects/zzz/best_release.html in firebug. This is expected to 404 and not show a button if your project doesn't have any download files associated with it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I added a test. I did not change the behavior to say No Downloads, but I did add documentation for the macro which shows how to do it and explains that it won't show up if there aren't any downloads available.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-08-25
Originally by: algorithms
Test looks good, documentation update is great, and the macro functions as intended on wiki pages. Nice job. Merged to dev.
[root@h9v9029 Allura js/2598]# nosetests -x allura.tests.test_globals
....
----------------------------------------------------------------------
Ran 4 tests in 9.547s
OK
status: code-review --> closed
assigned_to: Wayne Witzel III --> Jenny Steele
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Code is on allura js/2598. To test, add this to any markdown area: [[download_button]]. Make sure you see the data being pulled from a url like https://sf-jsteele-5015.sb.sf.net/projects/zzz/best_release.html in firebug. This is expected to 404 and not show a button if your project doesn't have any download files associated with it.
Originally by: algorithms
macro works, code reads fine, missing a test
Thought: instead of now showing anything when they use this, would it be a better UX to display a No Downloads button?
I added a test. I did not change the behavior to say No Downloads, but I did add documentation for the macro which shows how to do it and explains that it won't show up if there aren't any downloads available.
Originally by: algorithms
Test looks good, documentation update is great, and the macro functions as intended on wiki pages. Nice job. Merged to dev.