source: main/waeup.ikoba/trunk/src/waeup/ikoba/documents/viewlets.py @ 12226

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

Add DocumentTriggerTransitionFormPage?.

Do not add document without editing document title.

  • Property svn:keywords set to Id
File size: 2.8 KB
RevLine 
[12206]1## $Id: viewlets.py 12215 2014-12-13 17:21:27Z 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"""Viewlet components for documents offered for download by the company.
19"""
20
21import grok
22from waeup.ikoba.browser.viewlets import (
23    PrimaryNavTab, ManageActionButton, AddActionButton)
24from waeup.ikoba.interfaces import IIkobaObject
25from waeup.ikoba.interfaces import MessageFactory as _
26from waeup.ikoba.browser.viewlets import PrimaryNavTab
27
28from waeup.ikoba.documents.interfaces import (
[12215]29    IDocumentsContainer, IPublicDocument)
[12206]30from waeup.ikoba.documents.browser import (
31    DocumentsContainerManageFormPage, DocumentsContainerPage,
32    DocumentManageFormPage, DocumentDisplayFormPage)
33
34
35grok.context(IIkobaObject)  # Make IIkobaObject the default context
36grok.templatedir('browser_templates')
37
38
39class DocumentsTab(PrimaryNavTab):
40    """Documents tab in primary navigation.
41    """
42
43    grok.context(IIkobaObject)
44    grok.order(1)
45    grok.require('waeup.viewDocuments')
46    grok.name('documentstab')
47
48    pnav = 2
49    tab_title = _(u'Documents')
50
51    @property
52    def link_target(self):
53        return self.view.application_url('documents')
54
55class DocumentsContainerManageActionButton(ManageActionButton):
56    grok.order(1)
57    grok.context(IDocumentsContainer)
58    grok.view(DocumentsContainerPage)
59    grok.require('waeup.manageDocuments')
60    text = _('Manage')
61    target = 'manage'
62
63
64class DocumentViewActionButton(ManageActionButton):
65    grok.order(1)
[12215]66    grok.context(IPublicDocument)
[12206]67    grok.view(DocumentManageFormPage)
68    grok.require('waeup.manageDocuments')
69    text = _('View')
70    target = 'index'
71    icon = 'actionicon_view.png'
72
73
74class DocumentManageActionButton(ManageActionButton):
75    grok.order(1)
[12215]76    grok.context(IPublicDocument)
[12206]77    grok.view(DocumentDisplayFormPage)
78    grok.require('waeup.manageDocuments')
79    text = _('Manage')
80    target = 'manage'
[12215]81
82
83class DocumentTrigTransActionButton(ManageActionButton):
84    grok.order(2)
85    grok.context(IPublicDocument)
86    grok.view(DocumentDisplayFormPage)
87    grok.require('waeup.manageDocuments')
88    icon = 'actionicon_trigtrans.png'
89    text = _(u'Transition')
90    target = 'trigtrans'
91
92
Note: See TracBrowser for help on using the repository browser.