24
24
25
25
# Import from ikaaro
26
26
from ikaaro .forms import AutoForm , SelectWidget , TextWidget , BooleanCheckBox
27
- from ikaaro .forms import RTEWidget , XHTMLBody , DateWidget
27
+ from ikaaro .forms import RTEWidget , XHTMLBody , BooleanRadio
28
28
from ikaaro .table import OrderedTable , OrderedTableFile
29
29
from ikaaro .table_views import OrderedTable_View
30
30
33
33
34
34
# Import from shop
35
35
from cross_selling_views import AddProduct_View
36
- from datatypes import ProductPathDataType
37
36
from products .models import get_real_datatype
38
37
from products .enumerate import Datatypes
39
38
from registry import shop_widgets
@@ -62,8 +61,7 @@ def get_widget(cls, widget_name):
62
61
63
62
class ShopForm_Display (AutoForm ):
64
63
65
- access = True
66
-
64
+ access = 'is_allowed_to_view_for_authenticated'
67
65
68
66
def get_submit_value (self ):
69
67
context = get_context ()
@@ -72,7 +70,6 @@ def get_submit_value(self):
72
70
submit_value = property (get_submit_value , None , None , '' )
73
71
74
72
75
-
76
73
def get_title (self , context ):
77
74
return context .resource .get_title ()
78
75
@@ -177,7 +174,7 @@ class ShopForm(OrderedTable):
177
174
class_views = ['display' , 'edit' , 'view' , 'add_record' ]
178
175
179
176
display = ShopForm_Display ()
180
- view = OrderedTable_View (search_template = None )
177
+ view = OrderedTable_View (search_template = None , access = 'is_admin' )
181
178
edit = AutomaticEditView ()
182
179
183
180
add_product = AddProduct_View ()
@@ -191,15 +188,19 @@ class ShopForm(OrderedTable):
191
188
SelectWidget ('widget' , title = MSG (u'Widget' )),
192
189
]
193
190
194
- edit_widgets = [TextWidget ('submit_value' , title = MSG (u'Submit value' )),
195
- TextWidget ('to_addr' , title = MSG (u'To addr' )),
196
- RTEWidget ('introduction' , title = MSG (u'Introduction' )),
197
- RTEWidget ('final_message' , title = MSG (u'Final message' ))]
191
+ edit_widgets = [
192
+ TextWidget ('submit_value' , title = MSG (u'Submit value' )),
193
+ TextWidget ('to_addr' , title = MSG (u'To addr' )),
194
+ RTEWidget ('introduction' , title = MSG (u'Introduction' )),
195
+ RTEWidget ('final_message' , title = MSG (u'Final message' )),
196
+ BooleanRadio ('must_be_authentificated' ,
197
+ title = MSG (u'Must be authentificated to see form' ))]
198
198
199
199
edit_schema = {'submit_value' : Unicode (multilingual = True , mandatory = True ),
200
200
'to_addr' : Email (mandatory = True ),
201
201
'introduction' : XHTMLBody (multilingual = True ),
202
- 'final_message' : XHTMLBody (multilingual = True )}
202
+ 'final_message' : XHTMLBody (multilingual = True ),
203
+ 'must_be_authentificated' : Boolean }
203
204
204
205
@classmethod
205
206
def get_metadata_schema (cls ):
0 commit comments