comparison MoinMoin/items/__init__.py @ 248:1a1dab306214

move the flatland form html generator to the global environment
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 02 Jun 2011 18:14:48 +0200
parents 727e03c59dbf
children 91330de48b9c cbf97d9067f3
comparison
equal deleted inserted replaced
247:5028c04190a9 248:1a1dab306214
26 from flatland.validation import Validator, Present, IsEmail, ValueBetween, URLValidator, Converted 26 from flatland.validation import Validator, Present, IsEmail, ValueBetween, URLValidator, Converted
27 from MoinMoin.util.forms import FileStorage 27 from MoinMoin.util.forms import FileStorage
28 28
29 from MoinMoin.security.textcha import TextCha, TextChaizedForm, TextChaValid 29 from MoinMoin.security.textcha import TextCha, TextChaizedForm, TextChaValid
30 from MoinMoin.signalling import item_modified 30 from MoinMoin.signalling import item_modified
31 from MoinMoin.util.forms import make_generator
32 from MoinMoin.util.mimetype import MimeType 31 from MoinMoin.util.mimetype import MimeType
33 from MoinMoin.util.mime import Type, type_moin_document 32 from MoinMoin.util.mime import Type, type_moin_document
34 from MoinMoin.util.tree import moin_page, html, xlink, docbook 33 from MoinMoin.util.tree import moin_page, html, xlink, docbook
35 from MoinMoin.util.iri import Iri 34 from MoinMoin.util.iri import Iri
36 from MoinMoin.util.crypto import cache_key 35 from MoinMoin.util.crypto import cache_key
719 return render_template(self.template, 718 return render_template(self.template,
720 item_name=self.name, 719 item_name=self.name,
721 rows_meta=str(ROWS_META), cols=str(COLS), 720 rows_meta=str(ROWS_META), cols=str(COLS),
722 help=self.modify_help, 721 help=self.modify_help,
723 form=form, 722 form=form,
724 gen=make_generator(),
725 ) 723 )
726 724
727 copy_template = 'copy.html' 725 copy_template = 'copy.html'
728 delete_template = 'delete.html' 726 delete_template = 'delete.html'
729 destroy_template = 'destroy.html' 727 destroy_template = 'destroy.html'
1184 return render_template(self.template, 1182 return render_template(self.template,
1185 item_name=self.name, 1183 item_name=self.name,
1186 rows_data=str(ROWS_DATA), rows_meta=str(ROWS_META), cols=str(COLS), 1184 rows_data=str(ROWS_DATA), rows_meta=str(ROWS_META), cols=str(COLS),
1187 help=self.modify_help, 1185 help=self.modify_help,
1188 form=form, 1186 form=form,
1189 gen=make_generator(),
1190 ) 1187 )
1191 1188
1192 item_registry.register(Text._factory, Type('text/*')) 1189 item_registry.register(Text._factory, Type('text/*'))
1193 1190
1194 1191
1374 return render_template(self.template, 1371 return render_template(self.template,
1375 item_name=self.name, 1372 item_name=self.name,
1376 rows_meta=str(ROWS_META), cols=str(COLS), 1373 rows_meta=str(ROWS_META), cols=str(COLS),
1377 help=self.modify_help, 1374 help=self.modify_help,
1378 form=form, 1375 form=form,
1379 gen=make_generator(),
1380 ) 1376 )
1381 1377
1382 def _render_data(self): 1378 def _render_data(self):
1383 # TODO: this could be a converter -> dom, then transcluding this kind 1379 # TODO: this could be a converter -> dom, then transcluding this kind
1384 # of items and also rendering them with the code in base class could work 1380 # of items and also rendering them with the code in base class could work
1472 item_name=self.name, 1468 item_name=self.name,
1473 rows_meta=str(ROWS_META), cols=str(COLS), 1469 rows_meta=str(ROWS_META), cols=str(COLS),
1474 help=self.modify_help, 1470 help=self.modify_help,
1475 drawing_exists=drawing_exists, 1471 drawing_exists=drawing_exists,
1476 form=form, 1472 form=form,
1477 gen=make_generator(),
1478 ) 1473 )
1479 1474
1480 def _render_data(self): 1475 def _render_data(self):
1481 # TODO: this could be a converter -> dom, then transcluding this kind 1476 # TODO: this could be a converter -> dom, then transcluding this kind
1482 # of items and also rendering them with the code in base class could work 1477 # of items and also rendering them with the code in base class could work
1556 return render_template(self.template, 1551 return render_template(self.template,
1557 item_name=self.name, 1552 item_name=self.name,
1558 rows_meta=str(ROWS_META), cols=str(COLS), 1553 rows_meta=str(ROWS_META), cols=str(COLS),
1559 help=self.modify_help, 1554 help=self.modify_help,
1560 form=form, 1555 form=form,
1561 gen=make_generator(),
1562 ) 1556 )
1563 1557
1564 def _render_data(self): 1558 def _render_data(self):
1565 # TODO: this could be a converter -> dom, then transcluding this kind 1559 # TODO: this could be a converter -> dom, then transcluding this kind
1566 # of items and also rendering them with the code in base class could work 1560 # of items and also rendering them with the code in base class could work