source: trunk/Story.py @ 490

Revision 490, 5.1 KB checked in by tarmo, 13 years ago (diff)

More fixes to i18n strings.

  • Property svn:eol-style set to native
Line 
1# Copyright 2006 by the LeMill Team (see AUTHORS)
2#
3# This file is part of LeMill.
4#
5# LeMill is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# LeMill is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with LeMill; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
19from SharedMetadata import age_group, description, tags
20from Products.Archetypes.public import *
21from Products.ATReferenceBrowserWidget.ATReferenceBrowserWidget import ReferenceBrowserWidget
22from FieldsWidgets import WYSIWYMField, WYSIWYMWidget
23from Products.CMFCore.permissions import ModifyPortalContent
24from Products.Archetypes.public import BaseContent, registerType
25from Products.Archetypes.atapi import DisplayList
26from Globals import InitializeClass
27from Products.CMFCore.utils import getToolByName
28from AccessControl import ClassSecurityInfo, Unauthorized
29from config import PROJECTNAME, MODIFY_CONTENT, VIEW
30
31schema = BaseSchema + description + tags + age_group + Schema((
32    WYSIWYMField('bodyText',
33        required=True,
34        primary=False,
35        languageIndependent=False,
36        widget=WYSIWYMWidget(
37            label="Body",
38            label_msgid="label_bodytext",
39            description="Stories tell about teachers' experiences with the resources available in LeMill. If you've used the resource in this collection in a learning session, we would really like to hear your experiences.",
40            description_msgid="help_story_body",
41            i18n_domain="lemill",),
42        ),
43
44    ReferenceField('relatedContent',
45        relationship = 'relatesTo',
46        multiValued = True,
47        isMetadata = True,
48        languageIndependent = False,
49        index = 'KeywordIndex',
50        write_permission = ModifyPortalContent,
51        allowed_types=('Document','Piece','Content','Material', 'PresentationMaterial'),
52        widget = ReferenceBrowserWidget(
53            allow_search = True,
54            allow_browse = True,
55            show_indexes = False,
56            force_close_on_insert = True,
57            startup_directory = "content",
58            size = 4,
59
60            label = "Related Content",
61            label_msgid = "label_related_content",
62            description = "",
63            description_msgid = "help_story_related_content",
64            i18n_domain = "lemill",
65            visible = {'edit' : 'invisible', 'view' : 'invisible' }
66            )
67        ),
68    ReferenceField('relatedActivities',
69        relationship = 'relatesToActivities',
70        multiValued = True,
71        isMetadata = True,
72        languageIndependent = False,
73        index = 'KeywordIndex',
74        write_permission = ModifyPortalContent,
75        allowed_types=('Document','Activity',),
76        widget = ReferenceBrowserWidget(
77            allow_search = True,
78            allow_browse = True,
79            show_indexes = False,
80            force_close_on_insert = True,
81            startup_directory = "activities",
82            size = 4,
83
84            label = "Related Activities",
85            label_msgid = "label_related_activities",
86            description = "",
87            description_msgid = "help_story_related_activities",
88            i18n_domain = "lemill",
89            visible = {'edit' : 'invisible', 'view' : 'invisible' }
90            )
91        ),
92    ReferenceField('relatedTools',
93        relationship = 'relatesToTools',
94        multiValued = True,
95        isMetadata = True,
96        languageIndependent = False,
97        index = 'KeywordIndex',
98        write_permission = ModifyPortalContent,
99        allowed_types=('Document','Tool',),
100        widget = ReferenceBrowserWidget(
101            allow_search = True,
102            allow_browse = True,
103            show_indexes = False,
104            force_close_on_insert = True,
105            startup_directory = "tools",
106            size = 4,
107
108            label = "Related Tools",
109            label_msgid = "label_related_tools",
110            description = "",
111            description_msgid = "help_story_related_tools",
112            i18n_domain = "lemill",
113            visible = {'edit' : 'invisible', 'view' : 'invisible' }
114            )
115        )
116))
117
118class Story(BaseContent):
119    """Story"""
120   
121    schema = schema
122    actions= (
123    {
124    'id':'view',
125    'name':'view',
126    'action':'string:${object_url}/story_view',
127    'permission':(VIEW,),
128    },
129    {
130    'id':'edit',
131    'name':'Edit',
132    'action':'string:${object_url}/story_edit',
133    'permission':(MODIFY_CONTENT,),
134    },
135    )
136    meta_type = "Story"
137    archetype_name = "Story" 
138    typeDescription="Story of using a collection of learning resources together."
139    typeDescMsgId='description_story'
140    global_allow = 1
141    security = ClassSecurityInfo()
142    security.declareObjectPublic()
143
144
145registerType(Story, PROJECTNAME)
Note: See TracBrowser for help on using the repository browser.