- Timestamp:
- 15 Dec 2014, 10:48:40 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/templates/filedisplay.pt
r11254 r12242 11 11 </td> 12 12 </tr> 13 14 <tr tal:condition = "python: viewlet.file_exists and getattr(context, 'state', None) == 'published'"> 15 <td class="fieldname" i18n:translate=""> 16 HTML Element: 17 </td> 18 <td> 19 <a href=" 20 <span tal:replace="python: view.url(context, viewlet.download_name)"></span> 21 "><span tal:replace="viewlet/label">FILENAME</span></a> 22 </td> 23 </tr> 24 -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/browser.py
r12239 r12242 36 36 from waeup.ikoba.interfaces import MessageFactory as _ 37 37 from waeup.ikoba.interfaces import ( 38 IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils )38 IContactForm, IObjectHistory, IIkobaObject, IIkobaUtils, PUBLISHED) 39 39 from waeup.ikoba.browser.layout import ( 40 40 IkobaPage, IkobaEditFormPage, IkobaAddFormPage, IkobaDisplayFormPage, … … 187 187 188 188 189 class HTMLDocumentDisplayContentPage(IkobaPage): 190 """ Page to display the html content of document 191 """ 192 grok.context(IHTMLDocument) 193 grok.name('display') 194 grok.template('htmldisplaypage') 195 196 @property 197 def label(self): 198 return self.context.title 199 200 def update(self): 201 if self.context.state != PUBLISHED: 202 self.flash(_('The document requested has not yet been published.'), 203 type="warning") 204 self.redirect(self.url(self.context)) 205 super(HTMLDocumentDisplayContentPage, self).update() 206 return 207 208 @property 209 def content(self): 210 lang = self.request.cookies.get('ikoba.language') 211 html = self.context.html_dict.get(lang,'') 212 if html =='': 213 portal_language = getUtility(IIkobaUtils).PORTAL_LANGUAGE 214 html = self.context.html_dict.get(portal_language,'') 215 return html 216 217 189 218 class DocumentManageFormPage(IkobaEditFormPage, 190 219 LocalRoleAssignmentUtilityView): -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/browser_templates/htmldocumentpage.pt
r12227 r12242 24 24 <tr> 25 25 <td i18n:translate="" class="fieldname"> 26 RenderedContent:26 Content: 27 27 </td> 28 28 <td> … … 30 30 </td> 31 31 </tr> 32 <tr tal:condition="python: getattr(context, 'state', None) == 'published'"> 33 <td i18n:translate="" class="fieldname"> 34 HTML Element: 35 </td> 36 <td> 37 <a href=" 38 <span tal:replace="python: view.url(context, 'display')"></span> 39 "><span tal:replace="context/title">FILENAME</span></a> 40 </td> 41 </tr> 32 42 </tbody> 33 43 </table>
Note: See TracChangeset for help on using the changeset viewer.