Skip to content

Commit

Permalink
Remove liveblog workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rodfersou committed May 23, 2016
1 parent 46b796d commit 6bcc3cd
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 359 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,9 @@ Changelog
1.1b3 (unreleased)
------------------

- Remove liveblog workflow, now a liveblog is automatically inactivated after one day without new microupdates (closes `#31`_).
[rodfersou]

- Use absolute paths to link to micro-updates.
[hvelarde]

Expand Down Expand Up @@ -121,3 +124,4 @@ Changelog
.. _`#10`: https://github.com/collective/collective.liveblog/issues/10
.. _`#14`: https://github.com/collective/collective.liveblog/issues/14
.. _`#19`: https://github.com/collective/collective.liveblog/issues/19
.. _`#31`: https://github.com/collective/collective.liveblog/issues/31
15 changes: 1 addition & 14 deletions README.rst
Expand Up @@ -78,7 +78,6 @@ The image field is used to set up a header on the liveblog.
:height: 440px
:width: 640px

Before feeding the liveblog with micro-updates you will need to activate it.
Now, go to the Update tab and start writing micro-updates.

A micro-update is basically a text that should optionally have a title.
Expand Down Expand Up @@ -119,19 +118,7 @@ This way we avoid interrupting editors from their work.
:height: 500px
:width: 640px

When a liveblog is not going to be updated anymore you should deactivate it.

Workflow
--------

The package defines a workflow to be used with the content type (Liveblog Workflow).

The workflow defines 3 states: private, active and inactive.
Liveblogs are created in the private state.
When activated, the liveblog will be published and automatic refresh of micro-updates will be enabled.
When deactivated, the liveblog will remain public, but automatic refresh of micro-updates will be disabled.
No micro-updates can be added to a liveblog in inactive state.
To continue adding micro-updates, just activate the liveblog again.
The liveblog is automatically deactivated if there are no micro-updates in the last day.

How does it work
----------------
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -41,6 +41,7 @@
include_package_data=True,
zip_safe=False,
install_requires=[
'ftw.upgrade',
'plone.api',
'plone.app.dexterity',
'plone.app.layout',
Expand Down
9 changes: 6 additions & 3 deletions src/collective/liveblog/browser/view.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from collective.liveblog.browser.base import BaseView
from plone import api
from datetime import datetime
from datetime import timedelta
from plone.memoize import ram
from time import time
from zope.publisher.browser import BrowserView
Expand Down Expand Up @@ -29,9 +30,11 @@ def has_updates(self):
@property
def automatic_updates_enabled(self):
"""Check if the Livelog must be updated automatically.
Automatic updates should be enabled in active state only.
Automatic updates are disabled if no updates in the last day.
"""
return api.content.get_state(self.context) == 'active'
timestamp = self.context.modified().timeTime()
modified = datetime.fromtimestamp(timestamp)
return datetime.now() - modified < timedelta(days=1)

@property
def now(self):
Expand Down
32 changes: 0 additions & 32 deletions src/collective/liveblog/locales/es/LC_MESSAGES/plone.po
Expand Up @@ -16,35 +16,3 @@ msgstr ""
"X-Generator: Poedit 1.5.4\n"
"Language: Spanish\n"
"X-Poedit-SourceCharset: UTF-8\n"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Inactivate"
msgstr "Desactivar"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Liveblog Workflow"
msgstr "Flujo de trabajo para blog en vivo"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Member retracts submission"
msgstr "El miembro retrae el blog en vivo al estado privado"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Publish and activate"
msgstr "Publicar y activar"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Retract"
msgstr "Retraer"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Reviewer makes the liveblog active"
msgstr "El revisor activa el blog en vivo"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Reviewer makes the liveblog inactive"
msgstr "El revisor inactiva el blog en vivo"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Simple workflow to be used with liveblogs. A liveblog starts on the private state and can be activated (published) to allow the addition of micro-updates. When the liveblog is no longer going to be updated, we just simply inactivate it."
msgstr "Un flujo de trabajo sencillo para ser usado con blogs en vivo. Un blog en vivo comienza en estado privado y puede ser publicado y activado para permitir la adición de actualizaciones. Cuando el blog en vivo ya no va a ser actualizado, simplemente lo desactivamos."
32 changes: 0 additions & 32 deletions src/collective/liveblog/locales/plone.pot
Expand Up @@ -16,35 +16,3 @@ msgstr ""
"Language-Name: English\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: plone\n"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Inactivate"
msgstr ""

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Liveblog Workflow"
msgstr ""

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Member retracts submission"
msgstr ""

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Publish and activate"
msgstr ""

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Retract"
msgstr ""

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Reviewer makes the liveblog active"
msgstr ""

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Reviewer makes the liveblog inactive"
msgstr ""

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Simple workflow to be used with liveblogs. A liveblog starts on the private state and can be activated (published) to allow the addition of micro-updates. When the liveblog is no longer going to be updated, we just simply inactivate it."
msgstr ""
32 changes: 0 additions & 32 deletions src/collective/liveblog/locales/pt_BR/LC_MESSAGES/plone.po
Expand Up @@ -16,35 +16,3 @@ msgstr ""
"Language: Brazilian Portuguese\n"
"X-Generator: Poedit 1.5.4\n"
"X-Poedit-SourceCharset: UTF-8\n"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Inactivate"
msgstr "Desativar"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Liveblog Workflow"
msgstr "Workflow do Liveblog"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Member retracts submission"
msgstr "O membro retrai o liveblog para o estado privado"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Publish and activate"
msgstr "Publicar e ativar"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Retract"
msgstr "Retrair"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Reviewer makes the liveblog active"
msgstr "O revisor ativa o liveblog"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Reviewer makes the liveblog inactive"
msgstr "O revisor desativa o liveblog"

#: collective/liveblog/profiles/default/workflows/liveblog_workflow/definition.xml
msgid "Simple workflow to be used with liveblogs. A liveblog starts on the private state and can be activated (published) to allow the addition of micro-updates. When the liveblog is no longer going to be updated, we just simply inactivate it."
msgstr "Um workflow simples para ser usado con liveblogs. Um liveblog começa no estado privado e pode ser publicado y ativado para permitir a adição de atualizações. Cuando o liveblog não vai ser mais atualizado, simplesmente podemos desativá-lo."
2 changes: 1 addition & 1 deletion src/collective/liveblog/profiles/default/metadata.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<metadata>
<version>1001</version>
<version>1002</version>
<dependencies>
<dependency>profile-plone.app.dexterity:default</dependency>
</dependencies>
Expand Down
9 changes: 0 additions & 9 deletions src/collective/liveblog/profiles/default/workflows.xml

This file was deleted.

This file was deleted.

0 comments on commit 6bcc3cd

Please sign in to comment.