Skip to content

Commit 0420896

Browse files
Merge branch 'develop' of github.com:UPCnet/genweb6.core into develop
2 parents 1e093e5 + a98014a commit 0420896

File tree

16 files changed

+333
-183
lines changed

16 files changed

+333
-183
lines changed

CHANGES.rst

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,39 @@ Changelog
22
=========
33

44

5-
1.63 (unreleased)
5+
1.65 (unreleased)
66
-----------------
77

88
- Nothing changed yet.
99

1010

11+
1.64 (2025-03-10)
12+
-----------------
13+
14+
* [FIX] Solucionar error TOO_MANY_REDIRECTS SSO in portlet [Iago López]
15+
* [FIX] Solucionar error TOO_MANY_REDIRECTS SSO [Iago López]
16+
* [UPD] Cambio de literal Title line [Iago López]
17+
* [FIX] Header viewlet [Iago López]
18+
19+
1.63 (2025-03-07)
20+
-----------------
21+
22+
* [UPD] Añadir icono al nuevo contenido existing content [Iago López]
23+
* [FIX] Solucionar error TOO_MANY_REDIRECTS SSO [Pilar Marinas]
24+
* [UPD] Añadir nuevos directorios en el robots.txt [Iago López]
25+
* [UPD] Cambios controlpanel cabecera [Iago López]
26+
* [UPD] Quitar collective.behavior.seo [Iago López]
27+
* [UPD] Cambios controlpanel cabecera [Iago López]
28+
* [ADD] new tiny format for headers [Clàudia Andreu]
29+
* Merge branch 'develop' of github.com:UPCnet/genweb6.core into develop [Clàudia Andreu]
30+
* [UPD] fields in header-controlpanel [Clàudia Andreu]
31+
* [UPD] Quitar collective.behavior.seo y traer funcionalidad necesaria en el paquete [Iago López]
32+
* [UPD] Quitar twitter del compartir [Iago López]
33+
* [FIX] way of scan paths in linkchecker_intranet [Alberto Durán]
34+
* [FIX] linkchecker intranet view to be more verbose [Alberto Durán]
35+
* Merge branch 'develop' of github.com:UPCnet/genweb6.core into develop [Clàudia Andreu]
36+
* [ADD] New content type- existing content [Clàudia Andreu]
37+
1138
1.62 (2025-02-18)
1239
-----------------
1340

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
setup(
1616
name='genweb6.core',
17-
version='1.63.dev0',
17+
version='1.65.dev0',
1818
description="Genweb 6 Core package",
1919
long_description=long_description,
2020
# Get more from https://pypi.org/classifiers/

src/genweb6/core/behaviors/seo.py

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,24 @@ class ISeo(model.Schema, IDexteritySchema):
2626
"""
2727

2828
model.fieldset(
29-
"seofields", _("SEO"), fields=["seo_robots"],
29+
"seofields", _("SEO"), fields=["seo_title", "seo_description", "seo_robots"],
30+
)
31+
32+
seo_title = schema.TextLine(
33+
title=_("SEO Title"),
34+
description=_("S'utilitza al títol de la secció 'head' de la pàgina web"),
35+
required=False,
36+
)
37+
38+
seo_description = schema.Text(
39+
title=_("SEO Description"),
40+
description=_("S'utilitza a la descripció de la secció 'head' de la pàgina web"),
41+
required=False,
3042
)
3143

3244
seo_robots = schema.Choice(
3345
title=_("Metatag Robots"),
34-
description=_(
35-
"seo_robots_help",
36-
default=(
37-
"Select options that hint search engines how "
38-
"to treat this content. Typically listings are to "
39-
"navigate the site, but add little to no value in its "
40-
"own and should be set to 'noindex, follow'. In some "
41-
"cases you want a listing to be indexed. E.g. when "
42-
"publishing a Top 10 recipes list with extra content "
43-
"above and below the list, in which case you would use "
44-
"'index,follow'."
45-
),
46-
),
46+
description=_("<ul><li><span class='fw-bold'>No value (per defecte):</span> Els motors de cerca indexen la pàgina i segueixen els enllaços (comportament per defecte).</li><li><span class='fw-bold'>index, nofollow:</span> Indexa la pàgina, però no segueix els enllaços que conté.</li><li><span class='fw-bold'>noindex, follow:</span> No indexa la pàgina, però sí que segueix els enllaços.</li><li><span class='fw-bold'>index, follow:</span> Indexa la pàgina i segueix els enllaços (equivalent a no especificar res).</li><li><span class='fw-bold'>noindex:</span> No indexa la pàgina i no segueix els enllaços.</li><li><span class='fw-bold'>noindex, nofollow:</span> No indexa la pàgina ni segueix els enllaços.</li></ul>"),
4747
vocabulary=seoRobotsVocabulary,
4848
required=False,
4949
)
@@ -58,6 +58,22 @@ class Seo(object):
5858
def __init__(self, context):
5959
self.context = context
6060

61+
def _set_seo_title(self, value):
62+
self.context.seo_title = value
63+
64+
def _get_seo_title(self):
65+
return getattr(self.context, 'seo_title', None)
66+
67+
seo_title = property(_get_seo_title, _set_seo_title)
68+
69+
def _set_seo_description(self, value):
70+
self.context.seo_description = value
71+
72+
def _get_seo_description(self):
73+
return getattr(self.context, 'seo_description', None)
74+
75+
seo_description = property(_get_seo_description, _set_seo_description)
76+
6177
def _set_seo_robots(self, value):
6278
self.context.seo_robots = value
6379

src/genweb6/core/browser/helpers/helpers_touchers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ class setup_robots_txt(BrowserView):
796796

797797
def __call__(self):
798798
registry = getUtility(IRegistry)
799-
registry["plone.robots_txt"] = 'Sitemap: {portal_url}/sitemap.xml.gz\r\n\r\n# Define access-restrictions for robots/spiders\r\n# http://www.robotstxt.org/wc/norobots.html\r\n\r\n\r\n\r\n# By default we allow robots to access all areas of our site\r\n# already accessible to anonymous users\r\n\r\nUser-agent: *\r\nDisallow: */noindex-upc/*\r\nDisallow: /*sendto_form$\r\nDisallow: /*folder_factories$\r\nDisallow: */ca/shared/*\r\nDisallow: */es/shared/*\r\nDisallow: */en/shared/*\r\nDisallow: */plantilles/*\r\n\r\n\r\n\r\n# Add Googlebot-specific syntax extension to exclude forms\r\n# that are repeated for each piece of content in the site\r\n# the wildcard is only supported by Googlebot\r\n# http://www.google.com/support/webmasters/bin/answer.py?answer=40367&ctx=sibling\r\n\r\nUser-Agent: Googlebot\r\nDisallow: /*?\r\nDisallow: /*atct_album_view$\r\nDisallow: /*folder_factories$\r\nDisallow: /*folder_summary_view$\r\nDisallow: /*login_form$\r\nDisallow: /*mail_password_form$\r\nDisallow: /@@search\r\nDisallow: /*search_rss$\r\nDisallow: /*sendto_form$\r\nDisallow: /*summary_view$\r\nDisallow: /*thumbnail_view$\r\nDisallow: /*view$'
799+
registry["plone.robots_txt"] = 'Sitemap: {portal_url}/sitemap.xml.gz\r\n\r\n# Define access-restrictions for robots/spiders\r\n# http://www.robotstxt.org/wc/norobots.html\r\n\r\n\r\n\r\n# By default we allow robots to access all areas of our site\r\n# already accessible to anonymous users\r\n\r\nUser-agent: *\r\nDisallow: */noindex-upc/*\r\nDisallow: /*sendto_form$\r\nDisallow: /*folder_factories$\r\nDisallow: */ca/shared/*\r\nDisallow: */es/shared/*\r\nDisallow: */en/shared/*\r\nDisallow: */plantilles/*\r\nDisallow: */ca/banners-ca/*\r\nDisallow: */es/banners-es/*\r\nDisallow: */en/banners-en/*\r\nDisallow: */ca/logosfooter-ca/*\r\nDisallow: */es/logosfooter-es/*\r\nDisallow: */en/logosfooter-en/*\r\n\r\n\r\n\r\n# Add Googlebot-specific syntax extension to exclude forms\r\n# that are repeated for each piece of content in the site\r\n# the wildcard is only supported by Googlebot\r\n# http://www.google.com/support/webmasters/bin/answer.py?answer=40367&ctx=sibling\r\n\r\nUser-Agent: Googlebot\r\nDisallow: /*?\r\nDisallow: /*atct_album_view$\r\nDisallow: /*folder_factories$\r\nDisallow: /*folder_summary_view$\r\nDisallow: /*login_form$\r\nDisallow: /*mail_password_form$\r\nDisallow: /@@search\r\nDisallow: /*search_rss$\r\nDisallow: /*sendto_form$\r\nDisallow: /*summary_view$\r\nDisallow: /*thumbnail_view$\r\nDisallow: /*view$'
800800
transaction.commit()
801801
return 'OK'
802802

src/genweb6/core/browser/setup_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ def setGenwebProperties(self):
15391539

15401540
def setPloneProperties(self):
15411541
registry = getUtility(IRegistry)
1542-
registry["plone.robots_txt"] = 'Sitemap: {portal_url}/sitemap.xml.gz\r\n\r\n# Define access-restrictions for robots/spiders\r\n# http://www.robotstxt.org/wc/norobots.html\r\n\r\n\r\n\r\n# By default we allow robots to access all areas of our site\r\n# already accessible to anonymous users\r\n\r\nUser-agent: *\r\nDisallow: */noindex-upc/*\r\nDisallow: /*sendto_form$\r\nDisallow: /*folder_factories$\r\nDisallow: */ca/shared/*\r\nDisallow: */es/shared/*\r\nDisallow: */en/shared/*\r\nDisallow: */plantilles/*\r\n\r\n\r\n\r\n# Add Googlebot-specific syntax extension to exclude forms\r\n# that are repeated for each piece of content in the site\r\n# the wildcard is only supported by Googlebot\r\n# http://www.google.com/support/webmasters/bin/answer.py?answer=40367&ctx=sibling\r\n\r\nUser-Agent: Googlebot\r\nDisallow: /*?\r\nDisallow: /*atct_album_view$\r\nDisallow: /*folder_factories$\r\nDisallow: /*folder_summary_view$\r\nDisallow: /*login_form$\r\nDisallow: /*mail_password_form$\r\nDisallow: /@@search\r\nDisallow: /*search_rss$\r\nDisallow: /*sendto_form$\r\nDisallow: /*summary_view$\r\nDisallow: /*thumbnail_view$\r\nDisallow: /*view$'
1542+
registry["plone.robots_txt"] = 'Sitemap: {portal_url}/sitemap.xml.gz\r\n\r\n# Define access-restrictions for robots/spiders\r\n# http://www.robotstxt.org/wc/norobots.html\r\n\r\n\r\n\r\n# By default we allow robots to access all areas of our site\r\n# already accessible to anonymous users\r\n\r\nUser-agent: *\r\nDisallow: */noindex-upc/*\r\nDisallow: /*sendto_form$\r\nDisallow: /*folder_factories$\r\nDisallow: */ca/shared/*\r\nDisallow: */es/shared/*\r\nDisallow: */en/shared/*\r\nDisallow: */plantilles/*\r\nDisallow: */ca/banners-ca/*\r\nDisallow: */es/banners-es/*\r\nDisallow: */en/banners-en/*\r\nDisallow: */ca/logosfooter-ca/*\r\nDisallow: */es/logosfooter-es/*\r\nDisallow: */en/logosfooter-en/*\r\n\r\n\r\n\r\n# Add Googlebot-specific syntax extension to exclude forms\r\n# that are repeated for each piece of content in the site\r\n# the wildcard is only supported by Googlebot\r\n# http://www.google.com/support/webmasters/bin/answer.py?answer=40367&ctx=sibling\r\n\r\nUser-Agent: Googlebot\r\nDisallow: /*?\r\nDisallow: /*atct_album_view$\r\nDisallow: /*folder_factories$\r\nDisallow: /*folder_summary_view$\r\nDisallow: /*login_form$\r\nDisallow: /*mail_password_form$\r\nDisallow: /@@search\r\nDisallow: /*search_rss$\r\nDisallow: /*sendto_form$\r\nDisallow: /*summary_view$\r\nDisallow: /*thumbnail_view$\r\nDisallow: /*view$'
15431543
acl = api.portal.get_tool("acl_users")
15441544
acl.session.timeout = 12*3600
15451545
transaction.commit()

src/genweb6/core/browser/viewlets.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,22 @@ def getLogosHeader(self):
200200
else:
201201
secondary_logo_responsive = secondary_logo
202202

203-
lang = self.pref_lang()
204-
is_ca = lang not in ['es', 'en']
203+
logo_alt = getattr(header_config, 'logo_alt', "")
204+
logo_url = getattr(header_config, 'logo_url', None)
205+
secondary_logo_alt = getattr(header_config, 'secondary_logo_alt', "")
206+
secondary_logo_url = getattr(header_config, 'secondary_logo_url', None)
205207

206-
logo_alt = getattr(header_config, 'logo_alt' if is_ca else 'logo_alt_' + lang, "")
207-
logo_url = getattr(header_config, 'logo_url' if is_ca else 'logo_url_' + lang, None)
208-
secondary_logo_alt = getattr(header_config, 'secondary_logo_alt' if is_ca else 'secondary_logo_alt_' + lang, "")
209-
secondary_logo_url = getattr(header_config, 'secondary_logo_url' if is_ca else 'secondary_logo_url_' + lang, None)
208+
lang = self.pref_lang()
209+
if lang == 'es':
210+
logo_alt = getattr(header_config, 'logo_alt_es', "") or logo_alt
211+
logo_url = getattr(header_config, 'logo_url_es', None) or logo_url
212+
secondary_logo_alt = getattr(header_config, 'secondary_logo_alt_es', "") or secondary_logo_alt
213+
secondary_logo_url = getattr(header_config, 'secondary_logo_url_es', None) or secondary_logo_url
214+
elif lang == 'en':
215+
logo_alt = getattr(header_config, 'logo_alt_en', "") or logo_alt
216+
logo_url = getattr(header_config, 'logo_url_en', None) or logo_url
217+
secondary_logo_alt = getattr(header_config, 'secondary_logo_alt_en', "") or secondary_logo_alt
218+
secondary_logo_url = getattr(header_config, 'secondary_logo_url_en', None) or secondary_logo_url
210219

211220
return {"logo": logo,
212221
"logo_responsive": logo_responsive,

src/genweb6/core/content/existing_content/existing_content.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1-
from zope.interface import implementer
1+
# -*- coding: utf-8 -*-
2+
3+
from AccessControl.SecurityManagement import getSecurityManager
4+
from Products.Five.browser import BrowserView
5+
6+
from bs4 import BeautifulSoup
7+
from plone import api
8+
from plone.autoform import directives
29
from plone.dexterity.content import Container
3-
from plone.supermodel import model
4-
from zope import schema
510
from plone.dexterity.content import Container
6-
from plone.app.content.interfaces import INameFromTitle
7-
from zope.component import hooks
11+
from plone.supermodel import model
12+
from pyquery import PyQuery as pq
13+
from requests.exceptions import ReadTimeout
14+
from requests.exceptions import RequestException
15+
from z3c.relationfield.relation import RelationValue
816
from z3c.relationfield.schema import RelationChoice
9-
from genweb6.core import GenwebMessageFactory as _
10-
from plone.autoform import directives
17+
from zope import schema
1118
from zope.interface import Invalid
19+
from zope.interface import implementer
1220
from zope.interface import invariant
13-
from plone import api
14-
from z3c.relationfield.relation import RelationValue
15-
from requests.exceptions import ReadTimeout
16-
from requests.exceptions import RequestException
17-
from bs4 import BeautifulSoup
18-
from Products.Five.browser import BrowserView
19-
from plone.dexterity.interfaces import IDexteritySchema
20-
from AccessControl.SecurityManagement import getSecurityManager
21-
from zope.interface import provider
22-
from plone.autoform.interfaces import IFormFieldProvider
21+
22+
from genweb6.core import GenwebMessageFactory as _
2323
from genweb6.core.portlets.new_existing_content.new_existing_content import NewContentPortletJSFieldWidget
24-
from pyquery import PyQuery as pq
2524
from genweb6.core.validations import validate_externalurl
2625

2726
import DateTime
27+
import logging
2828
import re
2929
import requests
30-
import time
31-
import logging
3230

3331
logger = logging.getLogger("genweb6.core")
3432

@@ -80,13 +78,13 @@ class ExistingContent(Container):
8078
""" Implementación de ExistingContent """
8179

8280
class ExistingContentView(BrowserView):
83-
81+
8482
def __init__(self, context, request):
8583
super().__init__(context, request)
8684
self.data = {}
8785

8886
def check_configuration_error(self):
89-
87+
9088
pm = api.portal.get_tool(name='portal_membership')
9189
user = pm.getAuthenticatedMember()
9290
roles = user.getRoles()

0 commit comments

Comments
 (0)