# HG changeset patch # User Thierry Florac # Date 1507882871 -7200 # Node ID 1e70316e086ae7c1faa68a30300d6d0db935dc0c # Parent 4d725464e237655b4e49363d06cb0cfcfc20dc09 Version 0.1.8 diff -r 4d725464e237 -r 1e70316e086a buildout.cfg --- a/buildout.cfg Fri Oct 13 09:09:23 2017 +0200 +++ b/buildout.cfg Fri Oct 13 10:21:11 2017 +0200 @@ -74,4 +74,4 @@ eggs = pyams_media [test] [versions] -pyams_media = 0.1.7 +pyams_media = 0.1.8 diff -r 4d725464e237 -r 1e70316e086a docs/HISTORY.txt --- a/docs/HISTORY.txt Fri Oct 13 09:09:23 2017 +0200 +++ b/docs/HISTORY.txt Fri Oct 13 10:21:11 2017 +0200 @@ -1,6 +1,11 @@ History ======= +0.1.8 +----- + - added video preview + - updated TALES extensions interfaces + 0.1.7 ----- - commit transaction before adding watermark to video thumbnail diff -r 4d725464e237 -r 1e70316e086a setup.py --- a/setup.py Fri Oct 13 09:09:23 2017 +0200 +++ b/setup.py Fri Oct 13 10:21:11 2017 +0200 @@ -22,7 +22,7 @@ README = os.path.join(DOCS, 'README.txt') HISTORY = os.path.join(DOCS, 'HISTORY.txt') -version = '0.1.7' +version = '0.1.8' long_description = open(README).read() + '\n\n' + open(HISTORY).read() tests_require = [] diff -r 4d725464e237 -r 1e70316e086a src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.mo Binary file src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.mo has changed diff -r 4d725464e237 -r 1e70316e086a src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.po --- a/src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.po Fri Oct 13 09:09:23 2017 +0200 +++ b/src/pyams_media/locales/fr/LC_MESSAGES/pyams_media.po Fri Oct 13 10:21:11 2017 +0200 @@ -119,11 +119,11 @@ #: src/pyams_media/zmi/video.py:55 msgid "Select thumbnail..." -msgstr "Sélectionner l'illustration" +msgstr "Image de lancement" #: src/pyams_media/zmi/video.py:66 msgid "Select thumbnail" -msgstr "Sélectionner cette illustration" +msgstr "Sélectionner cette image" #: src/pyams_media/zmi/video.py:72 msgid "Thumbnail timestamp" @@ -131,7 +131,7 @@ #: src/pyams_media/zmi/video.py:81 msgid "Select video thumbnail" -msgstr "Sélection de l'illustration" +msgstr "Image de lancement" #: src/pyams_media/zmi/video.py:121 msgid "Thumbnail selected successfully." diff -r 4d725464e237 -r 1e70316e086a src/pyams_media/zmi/audio.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_media/zmi/audio.py Fri Oct 13 10:21:11 2017 +0200 @@ -0,0 +1,64 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library +from decimal import Decimal + +# import interfaces +from pyams_file.interfaces import IVideo, IThumbnail, IAudio +from pyams_form.interfaces.form import IWidgetsPrefixViewletsManager, IFormHelp +from pyams_skin.interfaces.viewlet import IContextActions +from pyams_utils.interfaces import MANAGE_PERMISSION, VIEW_PERMISSION +from pyams_zmi.layer import IAdminLayer +from z3c.form.interfaces import HIDDEN_MODE + +# import packages +from pyams_form.form import AJAXAddForm +from pyams_form.help import FormHelp +from pyams_form.schema import CloseButton +from pyams_pagelet.pagelet import pagelet_config +from pyams_skin.layer import IPyAMSLayer +from pyams_skin.viewlet.toolbar import ToolbarActionItem +from pyams_template.template import template_config +from pyams_utils.adapter import adapter_config +from pyams_utils.schema import DottedDecimalField +from pyams_viewlet.viewlet import viewlet_config, Viewlet +from pyams_zmi.form import AdminDialogAddForm, AdminDialogDisplayForm +from pyramid.view import view_config +from z3c.form import field, button +from zope.interface import Interface + +from pyams_media import _ + + +# +# Video preview +# + +@pagelet_config(name='preview.html', context=IAudio, layer=IPyAMSLayer, permission=VIEW_PERMISSION) +class AudioPreview(AdminDialogDisplayForm): + """Audio preview""" + + label = _("Audio preview") + label_css_class = 'fa fa-fw fa-music' + + fields = field.Fields(Interface) + + +@viewlet_config(name='audio-preview-prefix', context=IAudio, layer=IAdminLayer, view=AudioPreview, + manager=IWidgetsPrefixViewletsManager) +@template_config(template='templates/audio-preview.pt') +class AudioPreviewViewletsPrefix(Viewlet): + """Audio preview viewlets prefix""" diff -r 4d725464e237 -r 1e70316e086a src/pyams_media/zmi/templates/audio-preview.pt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_media/zmi/templates/audio-preview.pt Fri Oct 13 10:21:11 2017 +0200 @@ -0,0 +1,19 @@ +
+ +