Patch #1860
Download button Wiki/Textile macro
100%
Description
Many times I wanted to put Download button in Wiki pages, news etc.
So it would be nice to have a macro like {DOWNLOAD}
...
History
#1 Updated by Andreas Schuh almost 13 years ago
- File compatibility_with_chili_project_and_addition_of_wiki_macro_or_liquid_tag_for_chili_project_3_0.patch View added
Wow, I actually didn’t notice this issue before... I just implemented this and wanted to share the patch with you.
The implementation for Redmine was actually quickly done, but the new Liquid layer in ChiliProject 3.0 gave me some troubles. However, here it is.
Use in Redmine/ChiliProject < 3.0 as follows: {{download_button}}
Use in ChiliProject >= 3.0 as follows: {% download_button %}
Additionally, each of these macros/tags can have additional attributes to slightly change the style and/or the attributes of the DownloadButton.
For example,
Redmine/ChiliProject 2.x
{{download_button(package=nifticlib, label=Get the NIfTI library for C!, include_version=false, width=200px, font_size=20px)}}
{{download_button(float=left, margin_right=10px)}}
ChiliProject 3.x:
{% download_button package=nifticlib, label=Get the NIfTI library for C!, include_version=false, width=200px, font_size=20px %}
{% download_button float=left, margin_right=10px %}
(optionally, the argument list can in this case be enclosed in either braces, double quotes, or single quotes)
You may consider renaming this macro/tag to !{{download}}
if you prefer. I was just thinking download_button
clarifies that the macro/tag will only place a button there, but not perform a download action... on the other side, the name of the plugin is download
. The decision is up to you.
BTW This macro/tag works also great with your sidebar content plugin. This way it is even better configurable for which views to render the download button in the sidebar. Further it can be accompanied by additional text/graphics...
#2 Updated by Andreas Schuh almost 13 years ago
- File 02-compatibility_with_chili_project_and_addition_of_wiki_macro_or_liquid_tag_for_chili_project_3_0.patch View added
Here is a clean version of the patch with all unnecessary changes reverted which I made while I was trying to get the Liquid tag for ChiliProject 3.0 working... further, I reverted the bump of the version number here as well.
#3 Updated by Andreas Schuh almost 13 years ago
- File 03-compatibility_with_chili_project_and_addition_of_wiki_macro_or_liquid_tag_for_chili_project_3_0.patch View added
Of course I yet found some bugs in the parsing of the macro arguments (shouldn’t have just copied the function from Redmine). Played more with it now and am satisfied so far. I renamed the macro to !{{download}}
, respectively, {% download %}
now, by the way.
#4 Updated by Andriy Lesyuk almost 13 years ago
Wow! Thank you very much! Will include your changes in the next version!
#5 Updated by Andriy Lesyuk almost 13 years ago
- Target version set to 0.0.3
#6 Updated by Andreas Schuh almost 13 years ago
- File 04-compatibility_with_chili_project_and_addition_of_wiki_macro_or_liquid_tag_for_chili_project_3_0.patch View added
I just noticed a minor mistake in the patch. I forgot to remove the obsolete code from DownloadMacroHelper#extract_download_options() which has been moved to DownloadMacroHelper#to_container_style() and DownloadMacroHelper#to_button_style(), respectively.
So here’s the once more modified patch...
#7 Updated by Andriy Lesyuk almost 13 years ago
- Tracker changed from Feature to Patch
- % Done changed from 0 to 80
- External issue set to ChiliProject#816
#8 Updated by Andriy Lesyuk almost 13 years ago
- Due date set to 28 Jan 2012
- Status changed from Open to Closed
- % Done changed from 80 to 100