bibliotheca.core 3.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bibliotheca/core/__init__.py +68 -0
- bibliotheca/core/browser/__init__.py +0 -0
- bibliotheca/core/browser/configure.zcml +23 -0
- bibliotheca/core/browser/faceted/__init__.py +0 -0
- bibliotheca/core/browser/faceted/configure.zcml +41 -0
- bibliotheca/core/browser/faceted/map.pt +112 -0
- bibliotheca/core/browser/faceted/map.py +35 -0
- bibliotheca/core/browser/overrides/.gitkeep +0 -0
- bibliotheca/core/browser/static/.gitkeep +0 -0
- bibliotheca/core/commentextender.py +96 -0
- bibliotheca/core/configure.zcml +110 -0
- bibliotheca/core/content/__init__.py +0 -0
- bibliotheca/core/content/configure.zcml +38 -0
- bibliotheca/core/content/patrimoine.py +541 -0
- bibliotheca/core/content/patrimoine.xml +279 -0
- bibliotheca/core/content/templates/contenus_lies.pt +13 -0
- bibliotheca/core/content/templates/patrimoine.pt +100 -0
- bibliotheca/core/indexers.py +13 -0
- bibliotheca/core/indexers.zcml +9 -0
- bibliotheca/core/interfaces.py +9 -0
- bibliotheca/core/locales/README.rst +37 -0
- bibliotheca/core/locales/__init__.py +0 -0
- bibliotheca/core/locales/bibliotheca.core.pot +38 -0
- bibliotheca/core/locales/en/LC_MESSAGES/bibliotheca.core.po +35 -0
- bibliotheca/core/locales/fr/LC_MESSAGES/bibliotheca.core.po +35 -0
- bibliotheca/core/locales/update.py +70 -0
- bibliotheca/core/locales/update.sh +12 -0
- bibliotheca/core/permissions.zcml +12 -0
- bibliotheca/core/profiles/default/browserlayer.xml +7 -0
- bibliotheca/core/profiles/default/catalog.xml +7 -0
- bibliotheca/core/profiles/default/metadata.xml +9 -0
- bibliotheca/core/profiles/default/registry.xml +5 -0
- bibliotheca/core/profiles/default/rolemap.xml +7 -0
- bibliotheca/core/profiles/default/types/patrimoine.xml +59 -0
- bibliotheca/core/profiles/default/types.xml +5 -0
- bibliotheca/core/profiles/uninstall/browserlayer.xml +7 -0
- bibliotheca/core/setuphandlers.py +22 -0
- bibliotheca/core/subscribers.py +15 -0
- bibliotheca/core/subscribers.zcml +9 -0
- bibliotheca/core/testing.py +43 -0
- bibliotheca/core/testing.zcml +7 -0
- bibliotheca/core/tests/__init__.py +0 -0
- bibliotheca/core/tests/test_geolocation.py +89 -0
- bibliotheca/core/tests/test_patrimoine.py +41 -0
- bibliotheca/core/tests/test_setup.py +55 -0
- bibliotheca/core/tiles/configure.zcml +38 -0
- bibliotheca/core/tiles/existingcontent.py +12 -0
- bibliotheca/core/upgrades/__init__.py +0 -0
- bibliotheca/core/upgrades/configure.zcml +68 -0
- bibliotheca/core/upgrades/profiles/1003_to_1004/types/patrimoine.xml +18 -0
- bibliotheca/core/upgrades/profiles/1004_to_1005/types/patrimoine.xml +18 -0
- bibliotheca/core/upgrades/upgrades.py +15 -0
- bibliotheca/core/utils.py +37 -0
- bibliotheca/core/viewlets/comments.pt +303 -0
- bibliotheca/core/viewlets/comments.py +144 -0
- bibliotheca/core/viewlets/configure.zcml +16 -0
- bibliotheca/core/vocabularies.py +332 -0
- bibliotheca/core/widget/__init__.py +0 -0
- bibliotheca/core/widget/configure.zcml +55 -0
- bibliotheca/core/widget/hidden_honeypot.py +23 -0
- bibliotheca/core/widget/overrides.py +23 -0
- bibliotheca/core/widget/textdate.py +73 -0
- bibliotheca/core/widget/title.pt +1 -0
- bibliotheca/core/widget/title.py +22 -0
- bibliotheca_core-3.0.1.dist-info/METADATA +424 -0
- bibliotheca_core-3.0.1.dist-info/RECORD +71 -0
- bibliotheca_core-3.0.1.dist-info/WHEEL +5 -0
- bibliotheca_core-3.0.1.dist-info/entry_points.txt +5 -0
- bibliotheca_core-3.0.1.dist-info/licenses/LICENSE.GPL +339 -0
- bibliotheca_core-3.0.1.dist-info/licenses/LICENSE.rst +15 -0
- bibliotheca_core-3.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""Init and utils."""
|
|
3
|
+
|
|
4
|
+
from Acquisition import aq_base
|
|
5
|
+
from plone.resource.file import FilesystemFile
|
|
6
|
+
from Products.CMFPlone.resources import utils
|
|
7
|
+
from Products.CMFPlone.resources import webresource
|
|
8
|
+
from Products.CMFPlone.resources.utils import get_override_directory
|
|
9
|
+
from Products.CMFPlone.resources.utils import logger
|
|
10
|
+
from zExceptions import NotFound
|
|
11
|
+
from zope.i18nmessageid import MessageFactory
|
|
12
|
+
|
|
13
|
+
_ = MessageFactory("bibliotheca.core")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def patched_get_resource(context, path):
|
|
17
|
+
"""
|
|
18
|
+
Avoid errors with TTW theme resources
|
|
19
|
+
See https://github.com/plone/Products.CMFPlone/issues/3705
|
|
20
|
+
"""
|
|
21
|
+
if path.startswith("++plone++"):
|
|
22
|
+
# ++plone++ resources can be customized, we return their override
|
|
23
|
+
# value if any
|
|
24
|
+
overrides = get_override_directory(context)
|
|
25
|
+
filepath = path[9:]
|
|
26
|
+
if overrides.isFile(filepath):
|
|
27
|
+
return overrides.readFile(filepath)
|
|
28
|
+
if "?" in path:
|
|
29
|
+
# Example from plone.session:
|
|
30
|
+
# "acl_users/session/refresh?session_refresh=true&type=css&minutes=5"
|
|
31
|
+
# Traversing will not work then. In this example we could split on "?"
|
|
32
|
+
# and traverse to the first part, acl_users/session/refresh, but this
|
|
33
|
+
# gives a function, and this fails when we call it below, missing a
|
|
34
|
+
# REQUEST argument
|
|
35
|
+
return
|
|
36
|
+
try:
|
|
37
|
+
resource = context.unrestrictedTraverse(path)
|
|
38
|
+
except (NotFound, AttributeError, KeyError):
|
|
39
|
+
logger.warning(
|
|
40
|
+
f"Could not find resource {path}. You may have to create it first."
|
|
41
|
+
) # noqa
|
|
42
|
+
return
|
|
43
|
+
if isinstance(resource, FilesystemFile):
|
|
44
|
+
directory, sep, filename = path.rpartition("/")
|
|
45
|
+
return context.unrestrictedTraverse(directory).readFile(filename)
|
|
46
|
+
# calling the resource may modify the header, i.e. the content-type.
|
|
47
|
+
# we do not want this, so keep the original header intact.
|
|
48
|
+
response_before = context.REQUEST.response
|
|
49
|
+
context.REQUEST.response = response_before.__class__()
|
|
50
|
+
if hasattr(aq_base(resource), "GET"):
|
|
51
|
+
# for FileResource
|
|
52
|
+
result = resource.GET()
|
|
53
|
+
else:
|
|
54
|
+
# any BrowserView
|
|
55
|
+
try:
|
|
56
|
+
# MONKEY IMIO: this avoids AttributeError: __call__ on resources
|
|
57
|
+
result = resource()
|
|
58
|
+
except AttributeError:
|
|
59
|
+
if isinstance(resource.data, bytes):
|
|
60
|
+
result = resource.data
|
|
61
|
+
elif isinstance(resource.data.data, bytes):
|
|
62
|
+
result = resource.data.data
|
|
63
|
+
context.REQUEST.response = response_before
|
|
64
|
+
return result
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
utils.get_resource = patched_get_resource
|
|
68
|
+
webresource.get_resource = patched_get_resource
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<configure
|
|
2
|
+
xmlns="http://namespaces.zope.org/zope"
|
|
3
|
+
xmlns:browser="http://namespaces.zope.org/browser"
|
|
4
|
+
xmlns:plone="http://namespaces.plone.org/plone"
|
|
5
|
+
i18n_domain="bibliotheca.core">
|
|
6
|
+
|
|
7
|
+
<!-- Set overrides folder for Just-a-Bunch-Of-Templates product -->
|
|
8
|
+
<include package="z3c.jbot" file="meta.zcml" />
|
|
9
|
+
<browser:jbot
|
|
10
|
+
directory="overrides"
|
|
11
|
+
layer="bibliotheca.core.interfaces.IBibliothecaCoreLayer"
|
|
12
|
+
/>
|
|
13
|
+
|
|
14
|
+
<include package=".faceted" />
|
|
15
|
+
|
|
16
|
+
<!-- Publish static files -->
|
|
17
|
+
<plone:static
|
|
18
|
+
name="bibliotheca.core"
|
|
19
|
+
type="plone"
|
|
20
|
+
directory="static"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
</configure>
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<configure
|
|
2
|
+
xmlns="http://namespaces.zope.org/zope"
|
|
3
|
+
xmlns:faceted="http://namespaces.zope.org/faceted"
|
|
4
|
+
xmlns:browser="http://namespaces.zope.org/browser"
|
|
5
|
+
i18n_domain="imio.smartweb">
|
|
6
|
+
|
|
7
|
+
<!-- Unconfigure default faceted layout views -->
|
|
8
|
+
<unconfigure package="eea.facetednavigation.views">
|
|
9
|
+
<faceted:view
|
|
10
|
+
name="faceted-preview-items"
|
|
11
|
+
template="preview-items.pt"
|
|
12
|
+
title="Faceted items preview"
|
|
13
|
+
permission="zope2.View"
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<browser:page
|
|
17
|
+
name="faceted-preview-item"
|
|
18
|
+
for="zope.interface.Interface"
|
|
19
|
+
template="preview-item.pt"
|
|
20
|
+
permission="zope2.View"
|
|
21
|
+
/>
|
|
22
|
+
</unconfigure>
|
|
23
|
+
|
|
24
|
+
<faceted:view
|
|
25
|
+
name="faceted-map"
|
|
26
|
+
template="map.pt"
|
|
27
|
+
class=".map.FacetedMapView"
|
|
28
|
+
title="Faceted map"
|
|
29
|
+
permission="zope2.View"
|
|
30
|
+
layer="bibliotheca.core.interfaces.IBibliothecaCoreLayer"
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
<!--browser:page
|
|
34
|
+
for="*"
|
|
35
|
+
name="faceted-map-geojson"
|
|
36
|
+
class=".map.FacetedGeoJSON"
|
|
37
|
+
permission="zope2.View"
|
|
38
|
+
layer="bibliotheca.core.interfaces.IBibliothecaCoreLayer"
|
|
39
|
+
/-->
|
|
40
|
+
|
|
41
|
+
</configure>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
|
|
2
|
+
xmlns:tal="http://xml.zope.org/namespaces/tal"
|
|
3
|
+
xmlns:metal="http://xml.zope.org/namespaces/metal"
|
|
4
|
+
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
|
|
5
|
+
metal:use-macro="context/main_template/macros/master"
|
|
6
|
+
i18n:domain="collective.faceted.map">
|
|
7
|
+
|
|
8
|
+
<body>
|
|
9
|
+
<metal:content-core fill-slot="content-core">
|
|
10
|
+
<metal:block define-macro="content-core">
|
|
11
|
+
<div tal:define="
|
|
12
|
+
folderContents folderContents | python:context.getFolderContents();
|
|
13
|
+
Batch python:modules['Products.CMFPlone'].Batch;
|
|
14
|
+
b_start python:request.get('b_start', 0);
|
|
15
|
+
batch python:isinstance(folderContents, Batch) and folderContents or Batch(folderContents, 100, int(b_start), orphan=2);
|
|
16
|
+
self nocall:context/@@faceted-map;
|
|
17
|
+
map_view context/@@faceted-map-geojson;">
|
|
18
|
+
|
|
19
|
+
<div metal:use-macro="context/batch_macros/macros/navigation"/>
|
|
20
|
+
|
|
21
|
+
<div class="eea-preview-items">
|
|
22
|
+
|
|
23
|
+
<div id="faceted-results-items" class="" data-geojson=""
|
|
24
|
+
data-pat-leaflet="${self/map_configuration}"
|
|
25
|
+
tal:define="thumb_scale view/get_thumb_scale_list;
|
|
26
|
+
images_orientation context/orientation | nothing;
|
|
27
|
+
orientation_class python:images_orientation and f'display-{images_orientation}' or ''"
|
|
28
|
+
tal:attributes="data-geojson python:map_view.data_geo(batch);
|
|
29
|
+
class string:no-map ${orientation_class}">
|
|
30
|
+
<tal:entries repeat="brain batch">
|
|
31
|
+
<tal:entry tal:define="obj brain/getObject|nothing"
|
|
32
|
+
tal:condition="python:obj is not None">
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<div class=""
|
|
36
|
+
tal:define="portal_type brain/portal_type|string:;
|
|
37
|
+
useViewTypes brain/portal_properties/site_properties/typesUseViewActionInListings|python:[];
|
|
38
|
+
useView python:portal_type in useViewTypes;"
|
|
39
|
+
tal:attributes="data-index python:self.get_index(brain);
|
|
40
|
+
class python:self.css_class(brain)">
|
|
41
|
+
<a tal:define="description brain/Description|string:;
|
|
42
|
+
title brain/pretty_title_or_id|string:;
|
|
43
|
+
url brain/getURL|string:#"
|
|
44
|
+
tal:attributes="href url;
|
|
45
|
+
title title">
|
|
46
|
+
|
|
47
|
+
<div class="items-content">
|
|
48
|
+
<div class="geo-item-image">
|
|
49
|
+
<img style="border: none"
|
|
50
|
+
tal:attributes="src python:self.get_images(obj)"/>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="geo-item-text">
|
|
53
|
+
<div class="geo-item-title" tal:content="brain/pretty_title_or_id|string:">Title</div>
|
|
54
|
+
<div class="geo-item-description" tal:content="description"></div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</a>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
</tal:entry>
|
|
61
|
+
</tal:entries>
|
|
62
|
+
<span tal:condition="not: batch/sequence_length"
|
|
63
|
+
class="table_faceted_no_results"
|
|
64
|
+
i18n:domain="plone"
|
|
65
|
+
i18n:translate="description_no_results_found">No results were found.</span>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<script type="text/javascript">
|
|
69
|
+
|
|
70
|
+
var refresh_map = function() {
|
|
71
|
+
var data = $("#faceted-results-items").attr("data-geojson");
|
|
72
|
+
if ( typeof data != "undefined" && data ) {
|
|
73
|
+
data = JSON.parse(data);
|
|
74
|
+
$('#faceted-map-container').trigger('leaflet.refresh', data);
|
|
75
|
+
window.dispatchEvent(new Event('resize'));
|
|
76
|
+
}};
|
|
77
|
+
|
|
78
|
+
jQuery(document).ready(function($) {
|
|
79
|
+
|
|
80
|
+
$(Faceted.Events).bind(Faceted.Events.AJAX_QUERY_START, function() {
|
|
81
|
+
$("#faceted-map-container").appendTo($("#viewlet-below-content-body"));
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
$(Faceted.Events).bind(Faceted.Events.AJAX_QUERY_SUCCESS, function() {
|
|
85
|
+
$("#faceted-map-container").prependTo($(".eea-preview-items"));
|
|
86
|
+
refresh_map();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
$("#faceted-map-container").prependTo($(".eea-preview-items"));
|
|
90
|
+
$(".button-map-content").prependTo($(".eea-preview-items"));
|
|
91
|
+
refresh_map();
|
|
92
|
+
|
|
93
|
+
$('.faceted-map-item').hover(
|
|
94
|
+
function() {
|
|
95
|
+
$('#faceted-map-container').trigger('leaflet.openPopup', $(this).data('index'));
|
|
96
|
+
},
|
|
97
|
+
function() {
|
|
98
|
+
$('#faceted-map-container').trigger('leaflet.closePopup', $(this).data('index'));
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<div metal:use-macro="context/batch_macros/macros/navigation"/>
|
|
105
|
+
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
</metal:block>
|
|
109
|
+
</metal:content-core>
|
|
110
|
+
</body>
|
|
111
|
+
</html>
|
|
112
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from collective.faceted.map.browser.map import MapView
|
|
3
|
+
from plone.api.portal import get_registry_record
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FacetedMapView(MapView):
|
|
9
|
+
"""Faceted map view"""
|
|
10
|
+
|
|
11
|
+
def get_images(self, obj):
|
|
12
|
+
if getattr(obj, "image", None) is None:
|
|
13
|
+
return ""
|
|
14
|
+
image_field_id = "image"
|
|
15
|
+
images = obj.restrictedTraverse("@@images")
|
|
16
|
+
image_mini = images.scale(image_field_id, "mini")
|
|
17
|
+
return image_mini.url
|
|
18
|
+
|
|
19
|
+
def map_configuration(self):
|
|
20
|
+
"""Returns global map configuration from registry"""
|
|
21
|
+
map_layers = get_registry_record("geolocation.map_layers") or []
|
|
22
|
+
config = {
|
|
23
|
+
"fullscreencontrol": get_registry_record("geolocation.fullscreen_control"),
|
|
24
|
+
"locatecontrol": get_registry_record("geolocation.locate_control"),
|
|
25
|
+
"zoomcontrol": get_registry_record("geolocation.zoom_control"),
|
|
26
|
+
"minimap": get_registry_record("geolocation.show_minimap"),
|
|
27
|
+
"addmarker": get_registry_record("geolocation.show_add_marker"),
|
|
28
|
+
"geosearch": get_registry_record("geolocation.show_geosearch"),
|
|
29
|
+
"geosearch_provider": get_registry_record("geolocation.geosearch_provider"),
|
|
30
|
+
"default_map_layer": get_registry_record("geolocation.default_map_layer"),
|
|
31
|
+
"map_layers": [{"title": "Titre", "id": layer} for layer in map_layers],
|
|
32
|
+
"latitude": get_registry_record("geolocation.default_latitude"),
|
|
33
|
+
"longitude": get_registry_record("geolocation.default_longitude"),
|
|
34
|
+
}
|
|
35
|
+
return json.dumps(config)
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
from AccessControl import ClassSecurityInfo
|
|
2
|
+
from bibliotheca.core.interfaces import IBibliothecaCoreLayer
|
|
3
|
+
from persistent import Persistent
|
|
4
|
+
from plone.app.discussion.browser.comments import CommentForm
|
|
5
|
+
from plone.app.discussion.comment import Comment
|
|
6
|
+
from plone.app.standardtiles import PloneMessageFactory as _
|
|
7
|
+
from plone.namedfile.field import NamedBlobImage
|
|
8
|
+
from plone.namedfile.interfaces import IImageScaleTraversable
|
|
9
|
+
from plone.z3cform.fieldsets import extensible
|
|
10
|
+
from Products.CMFCore.permissions import View
|
|
11
|
+
from z3c.form.field import Fields
|
|
12
|
+
from zope.annotation import factory
|
|
13
|
+
from zope.component import adapter
|
|
14
|
+
from zope.interface import implementer
|
|
15
|
+
from zope.interface import Interface
|
|
16
|
+
|
|
17
|
+
from zope.annotation.interfaces import IAnnotations
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ICommentExtenderFields(Interface):
|
|
21
|
+
"""Marker interface for comments."""
|
|
22
|
+
|
|
23
|
+
picture = NamedBlobImage(
|
|
24
|
+
title=_("Picture"),
|
|
25
|
+
description=_("Picture to illustrate your comment"),
|
|
26
|
+
required=False,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# Persistent class that implements the ICommentExtenderFields interface
|
|
31
|
+
@adapter(Comment)
|
|
32
|
+
@implementer(ICommentExtenderFields, IImageScaleTraversable)
|
|
33
|
+
class CommentExtenderFields(Persistent):
|
|
34
|
+
""" " """
|
|
35
|
+
|
|
36
|
+
# security = ClassSecurityInfo()
|
|
37
|
+
# security.declareProtected(View, 'picture')
|
|
38
|
+
|
|
39
|
+
def __init__(self, context):
|
|
40
|
+
self.context = context # Initialise le champ picture
|
|
41
|
+
self.picture = context.picture
|
|
42
|
+
|
|
43
|
+
def set_picture(self, value):
|
|
44
|
+
self.picture = value
|
|
45
|
+
|
|
46
|
+
def get_picture(self):
|
|
47
|
+
# import pdb;pdb.set_trace()
|
|
48
|
+
return self.picture
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# def __init__(self, context):
|
|
52
|
+
# self.context = context
|
|
53
|
+
# import pdb;pdb.set_trace()
|
|
54
|
+
# annotations = IAnnotations(self.context)
|
|
55
|
+
# # Utilisation des annotations pour stocker l'image
|
|
56
|
+
# self._picture_key = 'bibliotheca.core.commentextender.picture'
|
|
57
|
+
|
|
58
|
+
# @property
|
|
59
|
+
# def picture(self):
|
|
60
|
+
# annotations = IAnnotations(self.context)
|
|
61
|
+
# return annotations.get(self._picture_key, None)
|
|
62
|
+
|
|
63
|
+
# @picture.setter
|
|
64
|
+
# def picture(self, value):
|
|
65
|
+
# annotations = IAnnotations(self.context)
|
|
66
|
+
# annotations[self._picture_key] = value
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
# CommentExtenderFields factory
|
|
70
|
+
CommentExtenderFactory = factory(CommentExtenderFields)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# context, request, form
|
|
74
|
+
@adapter(Interface, IBibliothecaCoreLayer, CommentForm)
|
|
75
|
+
class CommentExtender(extensible.FormExtender):
|
|
76
|
+
|
|
77
|
+
fields = Fields(ICommentExtenderFields)
|
|
78
|
+
|
|
79
|
+
def __init__(self, context, request, form):
|
|
80
|
+
self.context = context
|
|
81
|
+
self.request = request
|
|
82
|
+
self.form = form
|
|
83
|
+
|
|
84
|
+
def update(self):
|
|
85
|
+
# Add the fields defined in ICommentExtenderFields to the form.
|
|
86
|
+
self.add(ICommentExtenderFields, prefix="")
|
|
87
|
+
# Move the picture field to the top of the comment form.
|
|
88
|
+
self.move("picture", before="text", prefix="")
|
|
89
|
+
#
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@adapter(Comment, IImageScaleTraversable)
|
|
93
|
+
@implementer(IImageScaleTraversable)
|
|
94
|
+
def comment_image_scale_traversable(obj):
|
|
95
|
+
# Cela permet de récupérer l'image pour l'URL @@images/comment_picture
|
|
96
|
+
return obj
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<configure
|
|
2
|
+
xmlns="http://namespaces.zope.org/zope"
|
|
3
|
+
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
|
|
4
|
+
xmlns:i18n="http://namespaces.zope.org/i18n"
|
|
5
|
+
xmlns:plone="http://namespaces.plone.org/plone"
|
|
6
|
+
i18n_domain="bibliotheca.core">
|
|
7
|
+
|
|
8
|
+
<i18n:registerTranslations directory="locales" />
|
|
9
|
+
|
|
10
|
+
<!--
|
|
11
|
+
Be careful if you use general includeDependencies, it can have sideffects!
|
|
12
|
+
Better import explicite packages or configurations ;)
|
|
13
|
+
-->
|
|
14
|
+
<!--<includeDependencies package="." />-->
|
|
15
|
+
<include package="z3c.unconfigure" file="meta.zcml" />
|
|
16
|
+
<include package="collective.faceted.map" />
|
|
17
|
+
<include package="collective.geolocationbehavior" />
|
|
18
|
+
|
|
19
|
+
<include package=".browser" />
|
|
20
|
+
<include package=".widget" />
|
|
21
|
+
<include package=".content" />
|
|
22
|
+
<include package=".tiles" />
|
|
23
|
+
<include package=".upgrades" />
|
|
24
|
+
<include package=".viewlets" />
|
|
25
|
+
|
|
26
|
+
<include file="indexers.zcml" />
|
|
27
|
+
<include file="permissions.zcml" />
|
|
28
|
+
<include file="subscribers.zcml" />
|
|
29
|
+
|
|
30
|
+
<genericsetup:registerProfile
|
|
31
|
+
name="default"
|
|
32
|
+
title="bibliotheca.core"
|
|
33
|
+
directory="profiles/default"
|
|
34
|
+
description="Installs the bibliotheca.core add-on."
|
|
35
|
+
provides="Products.GenericSetup.interfaces.EXTENSION"
|
|
36
|
+
post_handler=".setuphandlers.post_install"
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<genericsetup:registerProfile
|
|
40
|
+
name="uninstall"
|
|
41
|
+
title="bibliotheca.core (uninstall)"
|
|
42
|
+
directory="profiles/uninstall"
|
|
43
|
+
description="Uninstalls the bibliotheca.core add-on."
|
|
44
|
+
provides="Products.GenericSetup.interfaces.EXTENSION"
|
|
45
|
+
post_handler=".setuphandlers.uninstall"
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<!--adapter
|
|
49
|
+
factory=".commentextender.CommentExtenderFactory"
|
|
50
|
+
provides=".commentextender.ICommentExtenderFields"
|
|
51
|
+
for="plone.app.discussion.comment.Comment" /-->
|
|
52
|
+
|
|
53
|
+
<!-- browser:page
|
|
54
|
+
allowed_attributes="scale tag"
|
|
55
|
+
class=".scaling.ImageScaling"
|
|
56
|
+
for=".interfaces.IImageScaleTraversable"
|
|
57
|
+
name="images"
|
|
58
|
+
permission="zope2.View" / -->
|
|
59
|
+
<!--
|
|
60
|
+
<class class="plone.app.discussion.comment.Comment">
|
|
61
|
+
<implements interface="plone.namedfile.interfaces.IImageScaleTraversable" />
|
|
62
|
+
</class>
|
|
63
|
+
|
|
64
|
+
<adapter
|
|
65
|
+
factory=".commentextender.comment_image_scale_traversable"
|
|
66
|
+
for="plone.app.discussion.comment.Comment"
|
|
67
|
+
provides="plone.namedfile.interfaces.IImageScaleTraversable" />
|
|
68
|
+
|
|
69
|
+
<adapter
|
|
70
|
+
factory=".commentextender.CommentExtender"
|
|
71
|
+
provides="plone.z3cform.fieldsets.interfaces.IFormExtender" />
|
|
72
|
+
-->
|
|
73
|
+
<!-- adapter
|
|
74
|
+
for="bibliotheca.core.commentextender.ICommentExtenderFields"
|
|
75
|
+
provides="plone.namedfile.interfaces.IImageScaleTraversable"
|
|
76
|
+
factory="plone.namedfile.scaling.ImageScaling" /-->
|
|
77
|
+
|
|
78
|
+
<utility
|
|
79
|
+
factory=".setuphandlers.HiddenProfiles"
|
|
80
|
+
name="bibliotheca.core-hiddenprofiles"
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<utility
|
|
84
|
+
component=".vocabularies.eventsdatevocabulary"
|
|
85
|
+
name="bibliotheca.core.vocabularies.eventsdate_vocabulary"
|
|
86
|
+
provides="zope.schema.interfaces.IVocabularyFactory"
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
<utility
|
|
90
|
+
component=".vocabularies.colorsvocabulary"
|
|
91
|
+
name="bibliotheca.core.vocabularies.colors_vocabulary"
|
|
92
|
+
provides="zope.schema.interfaces.IVocabularyFactory"
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<utility
|
|
96
|
+
component=".vocabularies.provincesvocabulary"
|
|
97
|
+
name="bibliotheca.core.vocabularies.provinces_vocabulary"
|
|
98
|
+
provides="zope.schema.interfaces.IVocabularyFactory"
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
<utility
|
|
102
|
+
component=".vocabularies.municipalentitiesvocabulary"
|
|
103
|
+
name="bibliotheca.core.vocabularies.municipalentities_vocabulary"
|
|
104
|
+
provides="zope.schema.interfaces.IVocabularyFactory"
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
<!-- -*- extra stuff goes here -*- -->
|
|
109
|
+
|
|
110
|
+
</configure>
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<configure
|
|
2
|
+
xmlns="http://namespaces.zope.org/zope"
|
|
3
|
+
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
|
|
4
|
+
xmlns:i18n="http://namespaces.zope.org/i18n"
|
|
5
|
+
xmlns:plone="http://namespaces.plone.org/plone"
|
|
6
|
+
xmlns:browser="http://namespaces.zope.org/browser"
|
|
7
|
+
i18n_domain="bibliotheca.core">
|
|
8
|
+
|
|
9
|
+
<browser:page
|
|
10
|
+
for=".patrimoine.IPatrimoine"
|
|
11
|
+
name="view"
|
|
12
|
+
class=".patrimoine.PatrimoineView"
|
|
13
|
+
template="templates/patrimoine.pt"
|
|
14
|
+
permission="zope2.View"
|
|
15
|
+
layer="..interfaces.IBibliothecaCoreLayer"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<!-- Render contenus_lies -->
|
|
19
|
+
<browser:viewlet
|
|
20
|
+
for=".patrimoine.IPatrimoine"
|
|
21
|
+
name="bibliotheca.core.patrimoine.contenus_lies"
|
|
22
|
+
manager="plone.app.layout.viewlets.interfaces.IBelowContent"
|
|
23
|
+
template="templates/contenus_lies.pt"
|
|
24
|
+
permission="zope2.View"
|
|
25
|
+
layer="..interfaces.IBibliothecaCoreLayer"
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
<adapter
|
|
29
|
+
name="SearchableText"
|
|
30
|
+
factory=".patrimoine.searchabletext_patrimoine"
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
<adapter
|
|
34
|
+
name="is_geolocated"
|
|
35
|
+
factory=".patrimoine.is_geolocated_indexer"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
</configure>
|