Skip to content

Commit

Permalink
Merge pull request #332 from opendata-swiss/add_-subscribe_with_recap…
Browse files Browse the repository at this point in the history
…tcha

Add email  subscribe  with recaptcha
  • Loading branch information
kovalch authored Jul 5, 2024
2 parents afe1f4d + 8a12892 commit 0681884
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/install_test_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pip install -e git+https://github.com/opendata-swiss/ckanext-dcatapchharvest.git
pip install -r https://raw.githubusercontent.com/opendata-swiss/ckanext-dcatapchharvest/master/requirements.txt
pip install -e git+https://github.com/opendata-swiss/ckanext-harvester_dashboard.git#egg=ckanext-harvester_dashboard
pip install -r https://raw.githubusercontent.com/opendata-swiss/ckanext-harvester_dashboard/master/requirements.txt
pip install -e git+https://github.com/opendata-swiss/ckanext-subscribe.git#egg=ckanext-subscribe
pip install -r https://raw.githubusercontent.com/opendata-swiss/ckanext-subscribe/master/requirements.txt
pip install -e git+https://github.com/bellisk/ckanext-subscribe.git#egg=ckanext-subscribe
pip install -r https://raw.githubusercontent.com/bellisk/ckanext-subscribe/master/requirements.txt
pip install -e git+https://github.com/opendata-swiss/ckanext-password-policy.git#egg=ckanext-password-policy
pip install -r https://raw.githubusercontent.com/opendata-swiss/ckanext-password-policy/master/requirements.txt

Expand Down
18 changes: 18 additions & 0 deletions ckanext/switzerland/templates/package/snippets/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@
{% block nums %}
{% endblock %}
{% block follow_button %}
{% resource 'subscribe/subscribe.css' %}
<div class="nums">
{% import 'macros/form.html' as form %}
<!-- {{ form.errors(error_summary) }} -->
<label class="control-label" for="subscribe-email">{{ _('Sign up for email updates') }}</label>
<form method='post' action="{{ h.url_for('/subscribe/signup') }}" id="subscribe-form" enctype="multipart/form-data" class="form-inline">
<!-- (Bootstrap 3) <div class="form-group input-group-sm"> -->
<input id="subscribe-email" type="email" name="email" class="form-control input-small" value="" placeholder="" />
{% if h.apply_recaptcha() %}
<!-- reCAPTCHA -->
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<div class="g-recaptcha" data-sitekey={{ h.get_recaptcha_publickey() }} style="transform:scale(0.85);transform-origin:0"></div>
{% endif %}
<input id="subscribe-dataset" type="hidden" name="dataset" value="{{ pkg.name }}"` />
<!-- </div> -->
<button type="submit" class="btn btn-default" name="save">{{ _('Submit') }}</button>
</form>
</div>
{% if h.ogdch_get_env() != 'production' %}
{% for group in pkg.groups %}
{% if group.name == "ener" %}
Expand Down

0 comments on commit 0681884

Please sign in to comment.