Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
person
Commits
f725bd2d3e66
Commit
285a58d7
authored
Feb 22, 2019
by
Laurent Peuch
Browse files
pep8
parent
38ad54ad7705
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb_person/views.py
View file @
f725bd2d
...
...
@@ -14,9 +14,11 @@ from cubicweb.web import action
from
cubicweb.web.views
import
baseviews
,
primary
,
uicfg
,
vcard
from
cubicweb.web.facet
import
AttributeFacet
_pvs
=
uicfg
.
primaryview_section
_pvs
=
uicfg
.
primaryview_section
for
attr
in
(
'civility'
,
'firstname'
,
'surname'
):
_pvs
.
tag_attribute
((
'Person'
,
attr
),
'hidden'
)
_pvs
.
tag_subject_of
((
'Person'
,
'use_email'
,
'*'
),
'attributes'
)
_pvs
.
tag_subject_of
((
'Person'
,
'primary_email'
,
'*'
),
'hidden'
)
...
...
@@ -84,7 +86,7 @@ class VCardPersonView(vcard.VCardCWUserView):
w
(
u
'N:%s;;;;
\n
'
%
who
)
w
(
u
'TITLE:%s
\n
'
%
who
)
# XXX
#if entity.address:
#
if entity.address:
# w(u'ADR;TYPE=WORK,POSTAL,PARCEL:;;%s\n' % ';'.join(entity.address.splitlines()))
for
phone
in
getattr
(
entity
,
'phone'
,
()):
ptype
=
vcard
.
VCARD_PHONE_TYPES
.
get
(
phone
.
type
,
phone
.
type
.
upper
())
...
...
@@ -93,7 +95,7 @@ class VCardPersonView(vcard.VCardCWUserView):
w
(
u
'EMAIL;TYPE=INTERNET:%s
\n
'
%
email
.
address
)
#
# actions ####################################################################
# actions ####################################################################
class
AddPersonFromEmailAction
(
action
.
LinkToEntityAction
):
__regid__
=
'addperson-fromemail'
...
...
@@ -105,7 +107,8 @@ class AddPersonFromEmailAction(action.LinkToEntityAction):
rtype
=
'use_email'
target
=
'subject'
## facets #####################################################################
# facets #####################################################################
class
CivilityFacet
(
AttributeFacet
):
__regid__
=
'civility-facet'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment