Skip to content

Commit 39e4b01

Browse files
committed
add support for download links on exhibition objects, including view template and batch update script
1 parent 995c430 commit 39e4b01

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

scripts/batch_update.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
'credits',
2424
'date',
2525
'description',
26+
'download_link',
27+
'download_link_text',
28+
'download_link_type',
2629
'dimensions',
2730
'exhibition_context',
2831
'full_title',

src/isaw.exhibitions/isaw/exhibitions/browser/exhibition_object.pt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<h2 tal:condition="full" tal:content="full">FULL</h2>
1818
<h2 tal:condition="not:full" tal:content="short">SHORT</h2>
1919
</div>
20-
<dl class="ExhibitObjectTitleDetail" tal:condition="python:detail != full"><dt>Detail:</dt><dd tal:content="context/title_detail">Title Detail</dd></dl>
20+
<dl class="ExhibitObjectTitleDetail" tal:condition="python:detail != full"><dt>Description:</dt><dd tal:content="context/title_detail">Title Detail</dd></dl>
2121
<dl class="ExhibitObjectArtist" tal:condition="context/artist|nothing"><dt>Artist:</dt><dd tal:content="context/artist">Artist</dd></dl>
2222
<dl class="ExhibitObjectAuthor" tal:condition="context/author|nothing"><dt>Author:</dt><dd tal:content="context/author">Author</dd></dl>
2323
<dl class="ExhibitObjectCopyist" tal:condition="context/copyist|nothing"><dt>Copyist:</dt><dd tal:content="context/copyist">Copyist</dd></dl>
@@ -34,7 +34,14 @@
3434
<dl class="ExhibitObjectInventoryNum" tal:condition="context/inventory_num|nothing"><dt>Inventory Number:</dt><dd tal:content="context/inventory_num">Inventory Number</dd></dl>
3535
<dl class="ExhibitObjectLender" tal:condition="context/lender|nothing">
3636
<dt>Lender:</dt>
37-
<dd><a href="" title="Lender" tal:attributes="href context/lender_link" tal:omit-tag="not:context/lender_link" tal:content="context/lender">Lender</a></dd>
37+
<dd><a href="" rel="external" title="Visit the website of the lender" tal:attributes="href context/lender_link" tal:omit-tag="not:context/lender_link" tal:content="context/lender">Lender</a></dd>
38+
</dl>
39+
<dl class="ExhibitObjectDownload" tal:define="dlink context/download_link|nothing; dtext context/download_link_text|string:select link to download; dtype context/download_link_type|nothing" tal:condition="dlink">
40+
<dt>Download:</dt>
41+
<dd>
42+
<a tal:condition="dtype" href="" title="Download the document" type="" rel="external" tal:attributes="href dlink; type dtype" tal:content="dtext">link text</a>
43+
<a tal:condition="not:dtype" href="" title="Download the document" rel="external" tal:attributes="href dlink; type dtype" tal:content="dtext">link text</a>
44+
</dd>
3845
</dl>
3946
<dl class="ExhibitObjectLabel"
4047
tal:define="text context/label/output|nothing"

src/isaw.exhibitions/isaw/exhibitions/interfaces/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class IExhibitionObject(model.Schema):
1919
artist = schema.TextLine(title=_(u'Artist'), required=False)
2020
author = schema.TextLine(title=_(u'Author'), required=False)
2121
copyist = schema.TextLine(title=_(u'Copyist'), required=False)
22+
download_link = schema.TextLine(title=_(u'Download Link'), required=False)
23+
download_link_text = schema.TextLine(title=_(u'Download Link Text'), required=False)
24+
download_link_type = schema.TextLine(title=_(u'Download Link Type'), required=False)
2225
translator = schema.TextLine(title=_(u'Translator'), required=False)
2326
copyright = schema.TextLine(title=_(u'Copyright Notice'), required=False)
2427
credits = schema.TextLine(title=_(u'Credit Line'), required=False)

0 commit comments

Comments
 (0)