Test coverage report: markupmirror.feincms.admin

# markupmirror.feincms.admin: 12 total statements, 50.0% covered

Generated: Tue 2012-04-10 04:53 CDT

Source file: /home/buechler/Sites/django-markupmirror/markupmirror/feincms/admin.py

Stats: 4 executed, 4 missed, 4 excluded, 21 ignored

1. `from django import forms`
2. `from django.utils.translation import ugettext_lazy as _`
3. ``
4. `from feincms.admin.item_editor import ItemEditorForm`
5. ``
6. `from markupmirror.markup.base import markup_pool`
7. ``
8. ``
9. `class MarkupMirrorContentAdminForm(ItemEditorForm):`
10. `"""Custom admin form for MarkupMirrorContent in FeinCMS pages.`
11. ``
12. `This initializes the CodeMirror editor and preview for each text area.`
13. ``
14. `"""`
15. `content = forms.CharField(`
16. `widget=forms.Textarea,`
17. `required=False,`
18. `label=_(u"text"))`
19. ``
20. `def __init__(self, *args, **kwargs):`
21. `super(MarkupMirrorContentAdminForm, self).__init__(*args, **kwargs)`
22. ``
23. `# add 'item-markupmirror' class and mode for CodeMirror`
24. `markup_type = self.fields['content'].default_markup_type`
25. `markup = markup_pool.get_markup(markup_type)`
26. `self.fields['content'].widget.attrs.update({`
27. `'class': 'item-markupmirror',`
28. `'data-markuptype': markup_type,`
29. `'data-mode': markup.codemirror_mode,`
30. `})`
31. ``
32. ``
33. `__all__ = ('MarkupMirrorContentAdminForm',)`