show download button on report view if appropriate
This commit is contained in:
parent
e21adfa364
commit
59d5174f21
2 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,10 @@
|
|||
<div metal:define-macro="buttons">
|
||||
<input type="submit" name="report_execute" value="Execute Report"
|
||||
i18n:attributes="value" />
|
||||
<input type="submit"
|
||||
tal:condition="item/reportDownload"
|
||||
tal:attributes="name string:${item/reportDownload}:method;
|
||||
value item/reportDownloadTitle" />
|
||||
</div>
|
||||
</form>
|
||||
<div metal:use-macro="item/resultsRenderer" />
|
||||
|
|
|
@ -138,6 +138,7 @@ class ResultsConceptView(ConceptView):
|
|||
"""
|
||||
|
||||
reportName = None # define in subclass if applicable
|
||||
reportDownload = None
|
||||
reportType = None # set for using special report instance adapter
|
||||
|
||||
def __init__(self, context, request):
|
||||
|
@ -157,6 +158,9 @@ class ResultsConceptView(ConceptView):
|
|||
def macro(self):
|
||||
return self.result_macros['content']
|
||||
|
||||
def reportDownloadTitle(self):
|
||||
return _(u'Download $title', mapping={'title': self.report.title})
|
||||
|
||||
@Lazy
|
||||
def hasReportPredicate(self):
|
||||
return self.conceptManager['hasreport']
|
||||
|
|
Loading…
Add table
Reference in a new issue