Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/plumi/plumi.content
Browse files Browse the repository at this point in the history
  • Loading branch information
Markos Gogoulos committed Feb 21, 2012
2 parents 4a914fa + c435fb4 commit 94dffe4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
6 changes: 5 additions & 1 deletion plumi/content/adapters.py
Expand Up @@ -266,10 +266,14 @@ def autoPublishOrHide(self):
try:
workflow = getToolByName(self.context, 'portal_workflow')
state = workflow.getInfoFor(self.context,'review_state')
if state == 'private':
workflow.doActionFor(self.context, 'show')
state = workflow.getInfoFor(self.context,'review_state')
#dont try to resubmit if already published.
if not state == 'published':
workflow.doActionFor(self.context, 'submit')
worked = True
import transaction; transaction.commit()
worked = True
except WorkflowException:
worked = False
pass
Expand Down
3 changes: 2 additions & 1 deletion plumi/content/browser/templates/video_brain.pt
Expand Up @@ -16,7 +16,7 @@
tal:define="mp4 video/isTranscodedPlumiVideoObj/mp4-low|nothing;
webm video/isTranscodedPlumiVideoObj/webm-low|nothing;">

<video id="main-video" class="featured-video" controls width="320" height="183" tal:attributes="poster fullThumb" controls="controls" preload="none">
<video id="main-video" class="featured-video" controls width="320" height="183" tal:attributes="poster fullThumb" controls="controls" preload="metadata">
<source tal:condition="python:webm and webm['status']=='ok'" tal:attributes="src string:${webm/address}/${webm/path}" type="video/webm" />
<source tal:condition="python:mp4 and mp4['status']=='ok'" tal:attributes="src string:${mp4/address}/${mp4/path}" type="video/mp4" />
<object width="320" height="183" type="application/x-shockwave-flash" data="++resource++collective.mediaelementjs/flashmediaelement.swf">
Expand Down Expand Up @@ -130,3 +130,4 @@
</dl>

</tal:video>
<script type="text/javascript" src="http://s3.www.universalsubtitles.org/js/unisubs-widgetizer.js"></script>
2 changes: 0 additions & 2 deletions plumi/content/profiles/default/rolemap.xml
Expand Up @@ -5,7 +5,6 @@
<permission name="plumi.content: Add PlumiCallOut" acquire="False">
<role name="Manager" />
<role name="Contributor" />
<role name="Member"/>
<role name="Owner"/>
</permission>
<permission name="plumi.content: Add Plumi Callout Folder" acquire="False">
Expand All @@ -21,7 +20,6 @@
<permission name="plumi.content: Add PlumiVideo" acquire="False">
<role name="Manager" />
<role name="Contributor" />
<role name="Member"/>
<role name="Owner"/>
</permission>
<permission name="plumi.content: ReTranscode Video" acquire="False">
Expand Down
14 changes: 6 additions & 8 deletions plumi/content/subscribers.py
Expand Up @@ -120,7 +120,7 @@ def notifyModifiedPlumiVideo(obj ,event):
log.info("notifyModifiedPlumiVideo... %s in state (%s) with event %s " % (obj.Title(), state, event))
request = getSite().REQUEST
#VISIBLE
if state == 'visible' and request.has_key('form.button.save'):
if state in ['private','visible'] and request.has_key('form.button.save'):
#call IPlumiWorkflow API to decide if its ready to publish or needs hiding.
# The adapter object will implement the logic for various content types
if IPlumiWorkflow(obj).autoPublishOrHide():
Expand All @@ -146,17 +146,15 @@ def notifyInitPlumiVideo(obj ,event):
state = None
request = getSite().REQUEST
#VISIBLE
if state == 'visible' and request.has_key('form.button.save'):
#if state in ['private','visible'] and request.has_key('form.button.save'):
#call IPlumiWorkflow API to decide if its ready to publish or needs hiding.
# The adapter object will implement the logic for various content types
if IPlumiWorkflow(obj).autoPublishOrHide():
IPlumiWorkflow(obj).notifyOwnerVideoSubmitted()
IPlumiWorkflow(obj).notifyReviewersVideoSubmitted()
# if IPlumiWorkflow(obj).autoPublishOrHide():
# IPlumiWorkflow(obj).notifyOwnerVideoSubmitted()
# IPlumiWorkflow(obj).notifyReviewersVideoSubmitted()

setup_metadata(obj)
#setup_metadata(obj)


@adapter(IPlumiVideo, IObjectInitializedEvent)
def autoSubmit(obj, event):
""" Automatically submit news items, events & callouts """
log = logging.getLogger('plumi.content.subscribers')
Expand Down

0 comments on commit 94dffe4

Please sign in to comment.