Skip to content

Commit

Permalink
Fix the issue with contacting for collection creation/access.
Browse files Browse the repository at this point in the history
  • Loading branch information
NTaherifar committed May 29, 2024
1 parent 530dc03 commit b770a54
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
{% link_for h.humanize_entity_type('organization', group_type, 'add link') or _('Add Organization'), named_route=group_type ~ '.new', class_='btn btn-primary', icon='plus-square' %}
{% else %}
{% if c.userobj %}
<a href="{{ h.url_for('igsn_theme.request_new_collection') }}" role="button" class="btn btn-primary">
<a
data-module="modal-contact"
data-module-template="{{ url_for('igsn_theme.request_new_collection')}}"
href="{{ h.url_for('igsn_theme.request_new_collection') }}"
role="button" class="btn btn-primary">
{{ _('New Collection') }}
</a>
</a>
{% endif %}
{% endif %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
{% import 'macros/form.html' as form %}
{% asset 'ckanext-contact/main' %}
{% extends "contact/snippets/form.html" %}

{% set recaptcha_v3_key = h.get_recaptcha_v3_key() %}
{% set recaptcha_v3_action = h.get_recaptcha_v3_action() %}

{% block contact_form %}
<form class="contact-form form-horizontal" method="post" data-module="form-contact"
data-module-action="{{ recaptcha_v3_action }}" data-module-key="{{ recaptcha_v3_key }}">

{{ form.errors(error_summary) }}

<fieldset>
{% block contact_form_legend %}
{% block contact_form_legend_content %}
{% endblock %}

{% block contact_form_fields %}
<input type="hidden" name="subject" value="Join Collection Request">
<input type="hidden" name="subject" value="Collection Access">

{{ form.input('full_name', label=_('Contact Name'), id='field-name', value=data.full_name,
error=errors.full_name, classes=['control-medium'], is_required=true) }}

Expand All @@ -30,18 +21,4 @@
value=data.description, error=errors.description,
placeholder=_('Brief description'), is_required=true) }}


{% endblock %}
</fieldset>

<div class="form-actions">
{% block contact_form_actions %}
{{ form.required_message() }}

<button class="btn btn-primary save" type="submit" name="save">
{{ _('Submit') }}
</button>
{% endblock %}
</div>
</form>
{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,56 +1,28 @@
{% import 'macros/form.html' as form %}
{% asset 'ckanext-contact/main' %}

{% set recaptcha_v3_key = h.get_recaptcha_v3_key() %}
{% set recaptcha_v3_action = h.get_recaptcha_v3_action() %}

{% block contact_form %}
<form class="contact-form form-horizontal" method="post" data-module="form-contact"
data-module-action="{{ recaptcha_v3_action }}" data-module-key="{{ recaptcha_v3_key }}">

{{ form.errors(error_summary) }}

<fieldset>
{% block contact_form_legend %}
<legend>
{% block contact_form_legend_content %}
{{ _('Please provide the following information to request the creation of a new collection') }}
{% endblock %}
</legend>
{% endblock %}
{% block contact_form_fields %}
<input type="hidden" name="subject" value="New Collection Request">
{{ form.input('full_name', label=_('Collection Contact Name'), id='field-name', value=data.full_name,
error=errors.full_name, classes=['control-medium'], is_required=true) }}

{{ form.input('email', label=_('Collection Contact Email'), id='field-email', type='email',
value=data.email, error=errors.email, classes=['control-medium'],
is_required=true) }}

{{ form.input('collection_full_name', label=_('Full Name of the Collection'), id='field-collection_full_name',
value=data.collection_full_name, error=errors.collection_full_name, classes=['control-medium'],
is_required=true) }}

{{ form.input('collection_short_name', label=_('Short Name of the Collection'), id='field-collection_short_name',
value=data.collection_short_name, error=errors.collection_short_name, classes=['control-medium'],
is_required=true) }}

{{ form.textarea('description', label=_('Description'), id='field-description',
value=data.description, error=errors.description,
placeholder=_('Brief description of the collection'), is_required=true) }}


{% endblock %}
</fieldset>

<div class="form-actions">
{% block contact_form_actions %}
{{ form.required_message() }}

<button class="btn btn-primary save" type="submit" name="save">
{{ _('Submit') }}
</button>
{% endblock %}
</div>
</form>
{% extends "contact/snippets/form.html" %}

{% block contact_form_legend_content %}
{% endblock %}

{% block contact_form_fields %}
<input type="hidden" name="subject" value="Collection Creation">

{{ form.input('full_name', label=_('Collection Contact Name'), id='field-name', value=data.full_name,
error=errors.full_name, classes=['control-medium'], is_required=true) }}

{{ form.input('email', label=_('Collection Contact Email'), id='field-email', type='email',
value=data.email, error=errors.email, classes=['control-medium'],
is_required=true) }}

{{ form.input('collection_full_name', label=_('Full Name of the Collection'), id='field-collection_full_name',
value=data.collection_full_name, error=errors.collection_full_name, classes=['control-medium'],
is_required=true) }}

{{ form.input('collection_short_name', label=_('Short Name of the Collection'), id='field-collection_short_name',
value=data.collection_short_name, error=errors.collection_short_name, classes=['control-medium'],
is_required=true) }}

{{ form.textarea('description', label=_('Description'), id='field-description',
value=data.description, error=errors.description,
placeholder=_('Brief description of the collection'), is_required=true) }}

{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
{% if user_role %}
{{ user_role | capitalize }}
{% else %}
<a href="{{ h.url_for('igsn_theme.request_join_collection' , org_id=organization.id , org_name=organization.name) }}" role="button" class="btn btn-link">
<a
data-module="modal-contact"
data-module-template="{{ url_for('igsn_theme.request_join_collection')}}"
href="{{ h.url_for('igsn_theme.request_join_collection' , org_id=organization.id , org_name=organization.name) }}"
role="button" class="btn btn-link">
{{ _('Join') }}
</a>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
{% link_for h.humanize_entity_type('organization', group_type, 'add link') or _('Add Organization'), named_route=group_type ~ '.new', class_='btn btn-primary', icon='plus-square' %}
{% else %}
{% if c.userobj %}
<a href="{{ h.url_for('igsn_theme.request_new_collection') }}" role="button" class="btn btn-primary">
<a
data-module="modal-contact"
data-module-template="{{ url_for('igsn_theme.request_new_collection')}}"
href="{{ h.url_for('igsn_theme.request_new_collection') }}"
role="button" class="btn btn-primary">
{{ _('New Collection') }}
</a>
</a>
{% endif %}
{% endif %}
{% endblock %}

0 comments on commit b770a54

Please sign in to comment.