Skip to content
Snippets Groups Projects
Commit 95588204 authored by anonymous's avatar anonymous
Browse files

ODPSH-12: add sharing

parent f450028d
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ from ckan.common import c ...@@ -9,6 +9,7 @@ from ckan.common import c
import datetime import datetime
from dateutil import parser from dateutil import parser
from ckan.common import config from ckan.common import config
import urllib
get_action = logic.get_action get_action = logic.get_action
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -104,3 +105,6 @@ def odsh_upload_known_formats(): ...@@ -104,3 +105,6 @@ def odsh_upload_known_formats():
value = config.get('ckanext.odsh.upload_formats', []) value = config.get('ckanext.odsh.upload_formats', [])
value = toolkit.aslist(value) value = toolkit.aslist(value)
return value return value
def odsh_encodeurl(url):
return urllib.quote(url, safe='')
\ No newline at end of file
No preview for this file type
...@@ -273,3 +273,6 @@ msgstr "Zeitbezug anwenden" ...@@ -273,3 +273,6 @@ msgstr "Zeitbezug anwenden"
msgid "daterange" msgid "daterange"
msgstr "Zeitbezug" msgstr "Zeitbezug"
msgid "share this dataset"
msgstr "Datensatz teilen"
\ No newline at end of file
...@@ -170,7 +170,8 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm ...@@ -170,7 +170,8 @@ class OdshPlugin(plugins.SingletonPlugin, DefaultTranslation, DefaultDatasetForm
'odsh_get_bounding_box': odsh_helpers.odsh_get_bounding_box, 'odsh_get_bounding_box': odsh_helpers.odsh_get_bounding_box,
'odsh_get_spatial_text': odsh_helpers.odsh_get_spatial_text, 'odsh_get_spatial_text': odsh_helpers.odsh_get_spatial_text,
'odsh_render_datetime': odsh_helpers.odsh_render_datetime, 'odsh_render_datetime': odsh_helpers.odsh_render_datetime,
'odsh_upload_known_formats': odsh_helpers.odsh_upload_known_formats 'odsh_upload_known_formats': odsh_helpers.odsh_upload_known_formats,
'odsh_encodeurl': odsh_helpers.odsh_encodeurl
} }
def before_map(self, map): def before_map(self, map):
......
...@@ -1241,3 +1241,14 @@ display: none; ...@@ -1241,3 +1241,14 @@ display: none;
margin-top: 40px; margin-top: 40px;
margin-left: 400px; margin-left: 400px;
} }
.share-links {
display: flex;
justify-content: space-between;
}
.share-links a{
font-size: 22px;
margin-top: 5px;
color:#003064;
}
...@@ -60,7 +60,8 @@ Example: ...@@ -60,7 +60,8 @@ Example:
{% block last_change %} {% block last_change %}
<div class="last-change-detail info-detail"> <div class="last-change-detail info-detail">
{%set issued=h.odsh_render_datetime(pkg.issued) if pkg.issued else h.odsh_render_datetime(pkg.metadata_created)%} {%set issued=h.odsh_render_datetime(pkg.issued) if pkg.issued else
h.odsh_render_datetime(pkg.metadata_created)%}
<div>{{ _('issued') }}:</div> <div>{{ _('issued') }}:</div>
{{issued}} {{issued}}
</div> </div>
...@@ -92,7 +93,19 @@ Example: ...@@ -92,7 +93,19 @@ Example:
{% endif %} {% endif %}
</div> </div>
{% endblock %} {% endblock %}
{% block social_nav %}
<div class="info-detail">
{% set current_url = h.odsh_encodeurl(h.full_current_url()) %}
<p>{{ _('share this dataset')}}:</p>
<div class="share-links">
<a href="https://www.linkedin.com/shareArticle?mini=true&url={{current_url}}" target="_blank"><i class="fa fa-linkedin"></i></a>
<a href="https://www.xing.com/app/user?op=share&url={{ current_url }}" target="_blank"><i class="fa fa-xing-square"></i></a>
<a href="https://www.facebook.com/sharer.php?href={{ current_url }}" target="_blank"><i class="fa fa-facebook-square"></i></a>
<a href="https://twitter.com/share?url={{ current_url }}" target="_blank"><i class="fa fa-twitter-square"></i></a>
<a href="mailto:?body={{ current_url }}" target="_blank"><i class="fa fa-envelope"></i></a>
</div>
</div> </div>
{% endblock %}
</section> </section>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment