Skip to content

Commit

Permalink
Fixes #3341 and provide a setting to enable/disable email display in …
Browse files Browse the repository at this point in the history
…profiles (#3342)
  • Loading branch information
capooti authored and simod committed Oct 5, 2017
1 parent 0b59145 commit fa416fd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/tutorials/advanced/geonode_settings/settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ Default::

A list of dictionaries that is used to generate the social links displayed in the Share tab. For each origin, the name and URL format parameters are replaced by the actual values of the ResourceBase object (layer, map, document).

SHOW_PROFILE_EMAIL
------------------
Default: ``False``

A boolean which specifies wether to display the email in user's profile.

CKAN_ORIGINS
--------------
Default::
Expand Down
5 changes: 5 additions & 0 deletions geonode/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ def resource_urls(request):
MAP_CLIENT_USE_CROSS_ORIGIN_CREDENTIALS=getattr(
settings, 'MAP_CLIENT_USE_CROSS_ORIGIN_CREDENTIALS', False
),
SHOW_PROFILE_EMAIL=getattr(
settings,
"SHOW_PROFILE_EMAIL",
False
),
)
defaults['message_create_url'] = 'message_create' if not settings.USER_MESSAGES_ALLOW_MULTIPLE_RECIPIENTS\
else 'message_create_multiple'
Expand Down
2 changes: 2 additions & 0 deletions geonode/people/templates/people/profile_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h5>
<h3>{{ profile.first_name|default:profile.name_long }}</h3>
<table class="table table-user-profile">
<tbody>
{% if SHOW_PROFILE_EMAIL %}
<tr>
<td class="table-user-profile-attribute">{% trans 'Email' %}</td>
{% if profile.email %}
Expand All @@ -69,6 +70,7 @@ <h3>{{ profile.first_name|default:profile.name_long }}</h3>
<td>{% trans 'Not provided.' %}</td>
{% endif %}
</tr>
{% endif %}
<tr>
<td class="table-user-profile-attribute">{% trans 'Position' %}</td>
<td>{{ profile.position | default:_('Not provided.') }}</td>
Expand Down
3 changes: 3 additions & 0 deletions geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,9 @@
# If this option is enabled, Groups will become strictly Mandatory on Metadata Wizard
GROUP_MANDATORY_RESOURCES = False

# A boolean which specifies wether to display the email in user's profile
SHOW_PROFILE_EMAIL = False

# Enables cross origin requests for geonode-client
MAP_CLIENT_USE_CROSS_ORIGIN_CREDENTIALS = strtobool(os.getenv(
'MAP_CLIENT_USE_CROSS_ORIGIN_CREDENTIALS',
Expand Down

0 comments on commit fa416fd

Please sign in to comment.