-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
group utils views into one place and add export-incarichi
- Loading branch information
Showing
17 changed files
with
171 additions
and
13 deletions.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
46 changes: 46 additions & 0 deletions
46
src/design/plone/contenttypes/browser/utils/export_incarichi.py
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
from plone import api | ||
from Products.Five import BrowserView | ||
from six import StringIO | ||
|
||
import csv | ||
|
||
|
||
class View(BrowserView): | ||
def __call__(self, *args, **kwargs): | ||
self.request.response.setHeader("Content-type", "application/csv") | ||
self.request.response.setHeader( | ||
"Content-dispsition", "attachment; filename=incarichi.csv" | ||
) | ||
|
||
sbuf = StringIO() | ||
|
||
fieldnames = ["nome", "incarico", "data inizio", "tipo", "url"] | ||
writer = csv.DictWriter(sbuf, fieldnames=fieldnames, quoting=csv.QUOTE_ALL) | ||
writer.writeheader() | ||
brains = api.content.find(portal_type="Persona") | ||
for brain in brains: | ||
ruolo = brain.ruolo and brain.ruolo[0] or "" | ||
persona = brain.getObject() | ||
incarico_obj = ( | ||
persona.incarichi_persona | ||
and persona.incarichi_persona[0].to_object | ||
or None | ||
) | ||
data_inizio = incarico_obj and incarico_obj.data_inizio_incarico or "" | ||
if data_inizio: | ||
data_inizio = data_inizio.strftime("%d/%m/%Y") | ||
tipo_incarico = incarico_obj and incarico_obj.tipologia_incarico or "" | ||
writer.writerow( | ||
{ | ||
"nome": brain.Title, | ||
"incarico": ruolo, | ||
"data inizio": data_inizio, | ||
"tipo": tipo_incarico, | ||
"url": brain.getPath().replace("/Plone", ""), | ||
} | ||
) | ||
|
||
res = sbuf.getvalue() | ||
sbuf.close() | ||
return res |
File renamed without changes.
File renamed without changes.
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
64 changes: 64 additions & 0 deletions
64
src/design/plone/contenttypes/browser/utils/templates/utils.pt
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | ||
xmlns:metal="http://xml.zope.org/namespaces/metal" | ||
xmlns:tal="http://xml.zope.org/namespaces/tal" | ||
lang="en" | ||
metal:use-macro="here/main_template/macros/master" | ||
xml:lang="en" | ||
i18n:domain="design.plone.contenttypes" | ||
> | ||
|
||
<body> | ||
<metal:content-title fill-slot="content-title"> | ||
<h1 i18n:translate="">Viste di utility per Design Plone Contenttypes</h1> | ||
</metal:content-title> | ||
<metal:content-description fill-slot="content-description" | ||
i18n:translate="" | ||
> | ||
Una raccolta di utility per i contenuti agid | ||
</metal:content-description> | ||
<metal:content-core fill-slot="content-core"> | ||
<div> | ||
<h3>Content-types</h3> | ||
<ul class="list-group"> | ||
<li class="list-group-item"> | ||
<a href="${context/portal_url}/change-news-type">Cambia la Tipologia Notizia</a> | ||
<p class="discreet"> | ||
Questo tool viene usato per cambiare il valore del campo 'Tipologia Notizia' in tutte le notizie che hanno il valore del campo selezionato. Fa anche il giro su tutti i blocchi elenco. | ||
</p> | ||
</li> | ||
<li class="list-group-item"> | ||
<a href="${context/portal_url}/export_incarichi">Export incarichi</a> | ||
<p class="discreet"> | ||
Scarica un csv con la lista delle persone del sito e relativi incarichi. | ||
</p> | ||
</li> | ||
<li class="list-group-item"> | ||
<a href="${context/portal_url}/check-servizi">Check servizi</a> | ||
<p class="discreet"> | ||
Verifica dello stato dei servizi. | ||
</p> | ||
</li> | ||
</ul> | ||
</div> | ||
<br /> | ||
<div> | ||
<h3>Redturtle Volto</h3> | ||
<ul class="list-group"> | ||
<li class="list-group-item"> | ||
<a href="${context/portal_url}/fix-links">Fix links</a> | ||
<p class="discreet"> | ||
Controlla e corregge i link interni nei blocchi. | ||
</p> | ||
</li> | ||
<li class="list-group-item"> | ||
<a href="${context/portal_url}/find-blocks">Find blocks</a> | ||
<p class="discreet"> | ||
Permette di trovare i contenuti che hanno un determinato blocco. | ||
</p> | ||
</li> | ||
</div> | ||
</metal:content-core> | ||
</body> | ||
|
||
</html> |
16 changes: 16 additions & 0 deletions
16
src/design/plone/contenttypes/profiles/default/actions.xml
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<object name="portal_actions" meta_type="Plone Actions Tool" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n"> | ||
<object name="user" meta_type="CMF Action Category" purge="False"> | ||
<object name="agid-utils" meta_type="CMF Action" i18n:domain="plone"> | ||
<property name="title" i18n:translate="">Agid utils</property> | ||
<property name="url_expr">string:${globals_view/navigationRootUrl}/agid-utils</property> | ||
<property name="link_target"></property> | ||
<property name="icon_expr"></property> | ||
<property name="permissions"> | ||
<element value="Manage portal"/> | ||
</property> | ||
<property name="visible">True</property> | ||
</object> | ||
</object> | ||
</object> |
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