source: main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/fileviewlets.py @ 12389

Last change on this file since 12389 was 12382, checked in by Henrik Bettermann, 10 years ago

Uups, we agreed to attach only one file to each document.

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1## $Id: fileviewlets.py 12382 2015-01-03 15:28:53Z henrik $
2##
3## Copyright (C) 2014 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18
19import grok
20from waeup.ikoba.interfaces import MessageFactory as _
21
22from waeup.ikoba.browser.fileviewlets import (
23    FileDisplay, FileUpload, Image)
24
25from ikobacustom.skeleton.customers.documents import SkeletonCustomerDocument
26
27from waeup.ikoba.customers.browser import (
28    DocumentDisplayFormPage,
29    DocumentManageFormPage,
30    DocumentEditFormPage,
31    PDFDocumentSlipPage,)
32
33grok.templatedir('browser_templates')
34
35# File viewlets for customer documents
36
37class SampleScanManageUpload(FileUpload):
38    """Scan upload viewlet for officers.
39    """
40    grok.order(1)
41    grok.context(SkeletonCustomerDocument)
42    grok.view(DocumentManageFormPage)
43    grok.require('waeup.manageCustomer')
44    label = _(u'Sample Scan')
45    title = _(u'Sample Scan')
46    mus = 1024 * 50
47    download_name = u'sample'
48    tab_redirect = '#tab2'
49
50
51class SampleScanEditUpload(SampleScanManageUpload):
52    """Scan upload viewlet for customer.
53    """
54    grok.view(DocumentEditFormPage)
55    grok.require('waeup.handleCustomer')
56
57
58class SampleScanDisplay(FileDisplay):
59    """Scan display viewlet.
60    """
61    grok.order(1)
62    grok.context(SkeletonCustomerDocument)
63    grok.require('waeup.viewCustomer')
64    grok.view(DocumentDisplayFormPage)
65    label = _(u'Sample Scan')
66    title = _(u'Sample Scan')
67    download_name = u'sample'
68
69
70class SampleScanImage(Image):
71    """Scan document.
72    """
73    grok.name('sample')
74    grok.context(SkeletonCustomerDocument)
75    grok.require('waeup.viewCustomer')
76    download_name = u'sample'
77
78class SampleScanPDFSlip(SampleScanDisplay):
79    grok.view(PDFDocumentSlipPage)
80
Note: See TracBrowser for help on using the repository browser.