This repository was archived by the owner on Nov 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 178
Expand file tree
/
Copy pathcms_plugins.py
More file actions
62 lines (53 loc) · 1.6 KB
/
cms_plugins.py
File metadata and controls
62 lines (53 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from __future__ import unicode_literals
from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from django.templatetags.static import static
from django.utils.translation import ugettext_lazy as _
from cmsplugin_filer_video import settings
from cmsplugin_filer_video.models import FilerVideo
from cmsplugin_filer_video.forms import VideoForm
class FilerVideoPlugin(CMSPluginBase):
module = _('Filer')
model = FilerVideo
name = _("Video")
form = VideoForm
render_template = "cmsplugin_filer_video/video.html"
text_enabled = True
general_fields = [
'movie',
'movie_url',
'image',
('width', 'height'),
'auto_play',
'auto_hide',
'fullscreen',
'loop',
]
color_fields = [
'bgcolor',
'textcolor',
'seekbarcolor',
'seekbarbgcolor',
'loadingbarcolor',
'buttonoutcolor',
'buttonovercolor',
'buttonhighlightcolor',
]
fieldsets = [
(None, {
'fields': general_fields,
}),
]
if settings.VIDEO_PLUGIN_ENABLE_ADVANCED_SETTINGS:
fieldsets += [
(_('Color Settings'), {
'fields': color_fields,
'classes': ('collapse',),
}),
]
def render(self, context, instance, placeholder):
context['object'] = instance
return super(FilerVideoPlugin, self).render(context, instance, placeholder)
def icon_src(self, instance):
return static("filer/icons/video_%sx%s.png" % (32, 32,))
plugin_pool.register_plugin(FilerVideoPlugin)