Download pool/shard003/Python/0027171_cms_plugins.py from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard003/Python/0027171_cms_plugins.py
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard003/Python/0027171_cms_plugins.py
-
curl -L -o 0027171_cms_plugins.py https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard003/Python/0027171_cms_plugins.py
1.37 kB
| from django.utils.translation import ugettext_lazy as _ | |
| from cms.plugin_base import CMSPluginBase | |
| from cms.plugin_pool import plugin_pool | |
| from . import settings | |
| from .forms import VideoForm | |
| from .models import Video | |
| class VideoPlugin(CMSPluginBase): | |
| model = Video | |
| name = _("Video") | |
| form = VideoForm | |
| text_enabled = True | |
| render_template = "cms/plugins/video.html" | |
| 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.update({ | |
| 'object': instance, | |
| 'placeholder': placeholder, | |
| }) | |
| return context | |
| plugin_pool.register_plugin(VideoPlugin) |