cms.plugins.video.cms_plugins: 20 total statements, 0.0% covered

Generated: Wed 2013-03-13 10:33 CET

Source file: /media/Envs/Envs/filer-gallery/lib/python2.7/site-packages/cms/plugins/video/cms_plugins.py

Stats: 0 executed, 14 missed, 6 excluded, 35 ignored

  1. from cms.plugin_pool import plugin_pool
  2. from cms.plugin_base import CMSPluginBase
  3. from django.utils.translation import ugettext_lazy as _
  4. from cms.plugins.video import settings
  5. from cms.plugins.video.models import Video
  6. from cms.plugins.video.forms import VideoForm
  7. class VideoPlugin(CMSPluginBase):
  8. model = Video
  9. name = _("Video")
  10. form = VideoForm
  11. render_template = "cms/plugins/video.html"
  12. general_fields = [
  13. ('movie', 'movie_url'),
  14. 'image',
  15. ('width', 'height'),
  16. 'auto_play',
  17. 'auto_hide',
  18. 'fullscreen',
  19. 'loop',
  20. ]
  21. color_fields = [
  22. 'bgcolor',
  23. 'textcolor',
  24. 'seekbarcolor',
  25. 'seekbarbgcolor',
  26. 'loadingbarcolor',
  27. 'buttonoutcolor',
  28. 'buttonovercolor',
  29. 'buttonhighlightcolor',
  30. ]
  31. fieldsets = [
  32. (None, {
  33. 'fields': general_fields,
  34. }),
  35. ]
  36. if settings.VIDEO_PLUGIN_ENABLE_ADVANCED_SETTINGS:
  37. fieldsets += [
  38. (_('Color Settings'), {
  39. 'fields': color_fields,
  40. 'classes': ('collapse',),
  41. }),
  42. ]
  43. def render(self, context, instance, placeholder):
  44. context.update({
  45. 'object': instance,
  46. 'placeholder':placeholder,
  47. })
  48. return context
  49. plugin_pool.register_plugin(VideoPlugin)