more on i18n and German translations

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@1766 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2007-05-24 12:55:12 +00:00
parent 6d4cffaf0f
commit c34f2d79ba
4 changed files with 36 additions and 6 deletions

View file

@ -157,7 +157,8 @@ class ResourceView(BaseView):
response.setHeader('Content-Type', context.contentType) response.setHeader('Content-Type', context.contentType)
response.setHeader('Content-Length', len(data)) response.setHeader('Content-Length', len(data))
ct = context.contentType ct = context.contentType
if useAttachment or (not ct.startswith('image/') and ct != 'application/pdf'): #if useAttachment or (not ct.startswith('image/') and ct != 'application/pdf'):
if useAttachment:
response.setHeader('Content-Disposition', response.setHeader('Content-Disposition',
'attachment; filename=%s' % zapi.getName(self.context)) 'attachment; filename=%s' % zapi.getName(self.context))
return data return data
@ -166,6 +167,12 @@ class ResourceView(BaseView):
""" Force download, e.g. of a PDF file """ """ Force download, e.g. of a PDF file """
return self.show(True) return self.show(True)
@property
def viewable(self):
return True
ct = self.context.contentType
return ct.startswith('image/') or ct == 'application/pdf'
def getActions(self, category='object'): def getActions(self, category='object'):
renderer = node_macros.macros['external_edit'] renderer = node_macros.macros['external_edit']
node = self.request.annotations.get('loops.view', {}).get('node') node = self.request.annotations.get('loops.view', {}).get('node')

View file

@ -49,16 +49,20 @@
<p><i tal:content="item/description">Description</i></p> <p><i tal:content="item/description">Description</i></p>
<p> <p>
<a href="#" <a href="#"
tal:condition="nothing" i18n:translate=""
tal:attributes="href string:${view/url}/.target${view/targetId}/download.html"> tal:attributes="href string:${view/url}/.target${view/targetId}/download.html">
Download Download
</a> </a>
<tal:view condition="item/viewable | nothing"> |
<a href="#" <a href="#"
i18n:translate=""
tal:attributes="href string:${view/url}/.target${view/targetId}/view"> tal:attributes="href string:${view/url}/.target${view/targetId}/view">
Download View
</a> </a>
</tal:view>
<tal:xedit condition="item/xeditable"> | <tal:xedit condition="item/xeditable"> |
<a href="#" title="Edit with External Editor" <a href="#" title="Edit with External Editor"
i18n:translate=""
tal:define="url string:${view/url}/.target${view/targetId}" tal:define="url string:${view/url}/.target${view/targetId}"
tal:attributes="href string:$url/external_edit?version=this"> tal:attributes="href string:$url/external_edit?version=this">
Open for editing Open for editing

Binary file not shown.

View file

@ -47,6 +47,9 @@ msgstr "Unterbegriffe"
msgid "Title" msgid "Title"
msgstr "Titel" msgstr "Titel"
msgid "Description"
msgstr "Beschreibung"
msgid "Related Items" msgid "Related Items"
msgstr "Verwandte Begriffe" msgstr "Verwandte Begriffe"
@ -71,6 +74,9 @@ msgstr "Inhalt"
msgid "Create Resource, Type = " msgid "Create Resource, Type = "
msgstr "Ressource anlegen, Typ = " msgstr "Ressource anlegen, Typ = "
msgid "Edit Resource"
msgstr "Ressource bearbeiten"
msgid "Edit Resource..." msgid "Edit Resource..."
msgstr "Ressource bearbeiten..." msgstr "Ressource bearbeiten..."
@ -155,3 +161,16 @@ msgstr "Alle Versionen"
msgid "Search results" msgid "Search results"
msgstr "Suchergebnisse" msgstr "Suchergebnisse"
msgid "Download"
msgstr "Herunterladen"
msgid "Open for editing"
msgstr "Zum Bearbeiten öffnen"
msgid "View"
msgstr "Ansehen"
msgid "Concept Assignments"
msgstr "Zugeordnete Begriffe"