-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plone 5 (tests OK) #20
Open
daggelpop
wants to merge
12
commits into
master
Choose a base branch
from
plone5
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bf5fd95
add z3c.autoinclude.plugin
pbauer fc5b693
fix controlpanel (widget needs love though)
pbauer f449c8f
Revert "add z3c.autoinclude.plugin"
c3d0c73
Recreate control panel functional tests as robot tests
daggelpop 01959a3
Test on Travis for Plone 4.3 & 5.1
daggelpop be88ffa
Test for Plone 5.1 only
daggelpop 01b0148
Fix diagnosis collection view
daggelpop 8cbde9e
Adapt symptoms to Dexterity
daggelpop 59bb44b
Handle plone.protect
daggelpop 580fdf0
Get request without help from the context
daggelpop 6e88776
add z3c.autoinclude and uninstall profile
spereverde 645f64a
Handle write on read for annotations
laulaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,14 +19,18 @@ | |
# Get more strings from | ||
# http://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
classifiers=[ | ||
"Framework :: Plone", | ||
"Framework :: Plone :: 4.3", | ||
"Framework :: Plone :: 5.0", | ||
"Framework :: Plone :: 5.1", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2.6", | ||
"Programming Language :: Python :: 2.7", | ||
], | ||
keywords='Plone content diagnosis', | ||
author='Godefroid Chapelle', | ||
author_email='[email protected]', | ||
url='http://svn.plone.org/svn/collective/', | ||
url='https://github.com/collective/collective.jekyll', | ||
license='gpl', | ||
packages=find_packages('src'), | ||
package_dir={'': 'src'}, | ||
|
@@ -49,4 +53,9 @@ | |
'pytest', | ||
'gocept.pytestlayer', | ||
]), | ||
entry_points=""" | ||
# -*- Entry points: -*- | ||
[z3c.autoinclude.plugin] | ||
target = plone | ||
""", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,7 @@ | |
batch topicContents;"> | ||
<table class="listing" | ||
summary="Content listing" | ||
tal:define="vocab python:here.listMetaDataFields(False); | ||
use_view_action site_properties/typesUseViewActionInListings|python:();" | ||
tal:define="use_view_action site_properties/typesUseViewActionInListings|python:();" | ||
i18n:attributes="summary summary_content_listing;"> | ||
<thead> | ||
<tr> | ||
|
@@ -27,8 +26,8 @@ | |
tal:attributes="title type/help; href type/url" /> | ||
<span tal:condition="python:view.getSymptomName() == type.name">▼</span> | ||
</th> | ||
<th tal:repeat="field here/getCustomViewFields" | ||
tal:content="python:vocab.getValue(field, field)" | ||
<th tal:repeat="field here/selectedViewFields" | ||
tal:content="python:field[1]" | ||
i18n:translate=""/> | ||
</tr> | ||
</thead> | ||
|
@@ -44,38 +43,45 @@ | |
tal:replace="structure symptom/@@status" /> | ||
</td> | ||
</tal:symptoms> | ||
<tal:fields repeat="field here/getCustomViewFields" | ||
<tal:fields repeat="field here/customViewFields" | ||
define="normalizeString nocall:context/@@plone/normalizeString; | ||
toLocalizedTime nocall: context/@@plone/toLocalizedTime; | ||
url obj/getURL; | ||
obj_type obj/portal_type; | ||
obj_type_class python:'contenttype-' + normalizeString(obj_type); | ||
obj_description obj/Description; | ||
obj_typeinfo python: here.portal_types.getTypeInfo(obj_type); | ||
obj_icon python:plone_view.getIcon(obj); | ||
obj_has_image python:obj.getIcon; | ||
obj_wf_state obj/review_state|python: wtool.getInfoFor(obj, 'review_state', ''); | ||
obj_wf_state_class python:'state-' + normalizeString(obj_wf_state); | ||
obj_url python:url+'/view' if obj_type in use_view_action else url; | ||
title_or_id obj/pretty_title_or_id"> | ||
<tal:block define="value python: getattr(obj, field, None)"> | ||
<td tal:condition="python: field != 'Title'" | ||
tal:content="python:here.formatCatalogMetadata(value)" | ||
<td tal:condition="python: field != 'Title' and field not in ['ModificationDate', | ||
'CreationDate', 'EffectiveDate', | ||
'ExpirationDate', ]" | ||
tal:content="value" | ||
i18n:translate=""/> | ||
<td tal:condition="python:field in ['ModificationDate', | ||
'CreationDate', 'EffectiveDate', | ||
'ExpirationDate', ]"> | ||
<span tal:replace="python:toLocalizedTime(value,long_format=1)"> | ||
August 16, 2001 at 23:35:59 | ||
</span> | ||
</td> | ||
<td tal:condition="python: field == 'Title'"> | ||
<a href="#" tal:attributes="href obj_url; | ||
title obj_description;"> | ||
<img src="#" | ||
height="16" | ||
width="16" | ||
tal:condition="obj_icon/url" | ||
tal:attributes="src obj_icon/url; | ||
alt obj_icon/description; | ||
title obj_icon/title; | ||
width obj_icon/width; | ||
height obj_icon/height;"/> | ||
<a href="#" | ||
tal:condition="obj_has_image" | ||
tal:attributes="href obj_url; | ||
title obj_description;"> | ||
<img class="thumb-icon" | ||
tal:define="getIcon python:obj.getURL() +'/@@images/image/icon'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
tal:attributes="src string:$getIcon;alt obj/Description"> | ||
</a> | ||
<a href="#" | ||
tal:condition="python: obj.portal_type != 'Link'" | ||
tal:attributes="href obj_url; | ||
class string:${obj_wf_state_class}; | ||
class string:${obj_type_class} ${obj_wf_state_class} url; | ||
title obj_description;" | ||
tal:content="title_or_id"> | ||
Item Title | ||
|
@@ -84,7 +90,7 @@ | |
<a href="#" | ||
tal:condition="python: obj.portal_type == 'Link'" | ||
tal:attributes="href obj/getRemoteUrl; | ||
class string:${obj_wf_state_class} link-plain; | ||
class string:${obj_type_class} ${obj_wf_state_class} link-plain; | ||
title obj_description;" | ||
class="link-plain" | ||
tal:content="title_or_id" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,16 @@ | ||
from zope.interface import implements | ||
from zope.component import adapts | ||
from zope.component import getUtility | ||
from zope.formlib import form | ||
from zope.schema.interfaces import IVocabularyFactory | ||
|
||
from Products.CMFDefault.formlib.schema import SchemaAdapterBase | ||
from Products.CMFPlone.interfaces import IPloneSiteRoot | ||
|
||
from plone.registry.interfaces import IRegistry | ||
from plone.app.controlpanel.form import ControlPanelForm | ||
from plone.app.controlpanel.widgets import MultiCheckBoxThreeColumnWidget | ||
|
||
# -*- coding: utf-8 -*- | ||
from collective.jekyll import jekyllMessageFactory as _ | ||
from collective.jekyll.interfaces import IJekyllSettings | ||
from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper | ||
from plone.app.registry.browser.controlpanel import RegistryEditForm | ||
from plone.z3cform import layout | ||
|
||
|
||
class JekyllControlPanelAdapter(SchemaAdapterBase): | ||
|
||
adapts(IPloneSiteRoot) | ||
implements(IJekyllSettings) | ||
|
||
def __init__(self, context): | ||
super(JekyllControlPanelAdapter, self).__init__(context) | ||
registry = getUtility(IRegistry) | ||
self.settings = registry.forInterface(IJekyllSettings, False) | ||
vocabFactory = getUtility(IVocabularyFactory, | ||
name="collective.jekyll.SymptomsVocabulary") | ||
self.symptoms = vocabFactory(context) | ||
|
||
def getActiveSymptoms(self): | ||
if self.settings.activeSymptoms is None: | ||
return [s.value for s in self.symptoms] | ||
|
||
activeSymptoms = [] | ||
for symptom in self.symptoms: | ||
if symptom.value in self.settings.activeSymptoms: | ||
activeSymptoms.append(symptom.value) | ||
return activeSymptoms | ||
|
||
def setActiveSymptoms(self, value): | ||
self.settings.activeSymptoms = value | ||
|
||
activeSymptoms = property(getActiveSymptoms, | ||
setActiveSymptoms) | ||
|
||
|
||
class JekyllControlPanel(ControlPanelForm): | ||
|
||
class JekyllControlPanelForm(RegistryEditForm): | ||
schema = IJekyllSettings | ||
label = _("Content quality") | ||
description = _("You can activate / deactivate symptoms using this form.") | ||
form_name = _("Symptoms activation") | ||
|
||
form_fields = form.FormFields(IJekyllSettings) | ||
active_symptoms = form_fields['activeSymptoms'] | ||
active_symptoms.custom_widget = MultiCheckBoxThreeColumnWidget | ||
active_symptoms.custom_widget.cssClass = 'label' | ||
|
||
JekyllControlPanel = layout.wrap_form( | ||
JekyllControlPanelForm, ControlPanelFormWrapper) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer logic to be kept in view classes. Would it be possible to move this
tal:condition
test to a method on a view class ?