This repository has been archived by the owner on Jan 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
174 - Add mandatory check box about personally identifiable informati…
…on (#40) * added a multi checkbox in schema * added a new preset * added a new preset * Updated preset * Invalidate this change * Small update to display_snippet * Small fix to schema * More update * More update * Changed default values * Small id change * invalidate changes on react files * invalidate changes on react files
- Loading branch information
Showing
6 changed files
with
73 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,15 @@ | ||
{ | ||
"scheming_presets_version": 1, | ||
"about": "These are Scheming presets specific to WHO AFRO", | ||
"about": "These are Scheming presets specific to ZaRR", | ||
"about_url": "http://github.com/ckan/ckanext-scheming#preset", | ||
"presets": [ | ||
{ | ||
"preset_name": "resource_giftless_upload", | ||
"preset_name": "approval", | ||
"values": { | ||
"form_snippet": "resource_upload.html" | ||
} | ||
}, { | ||
"preset_name": "preset_value", | ||
"values": { | ||
"form_snippet": "no_input.html", | ||
"validators": "autofill" | ||
} | ||
}, { | ||
"preset_name": "month", | ||
"values": { | ||
"form_snippet": "month.html", | ||
"display_snippet": "month.html", | ||
"validators": "isomonth" | ||
"form_snippet": "confirm.html", | ||
"display_snippet": "confirm.html", | ||
"validators": "approval_required" | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
ckanext/zarr/templates/scheming/display_snippets/confirm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% set value = data[field.field_name] %} | ||
{% if value == '1' %} | ||
<strong>{{ _('Yes') }}</strong> | ||
{% else %} | ||
<strong style="color: red">{{ _('No') }}</strong> | ||
{% endif %} |
43 changes: 43 additions & 0 deletions
43
ckanext/zarr/templates/scheming/form_snippets/confirm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{% import 'macros/form.html' as form %} | ||
|
||
<style> | ||
fieldset.checkboxes label { | ||
font-weight: normal; | ||
display: block; | ||
} | ||
fieldset.checkboxes label:after { | ||
content: none; | ||
} | ||
fieldset.checkboxes label input { | ||
width: auto; | ||
top: 0; | ||
} | ||
</style> | ||
|
||
{%- call form.input_block( | ||
label=h.scheming_language_text(field.label), | ||
classes=field.classes if 'classes' in field else ['control-medium'], | ||
error=errors[field.field_name], | ||
is_required=h.scheming_field_required(field)) -%} | ||
|
||
{% set placeholder = h.scheming_language_text(field.form_placeholder) %} | ||
|
||
|
||
<fieldset class="checkboxes"> | ||
<label for="approved-{{ field.field_name }}"> | ||
<input id="approved-{{ field.field_name }}" | ||
type="checkbox" | ||
{{"checked " if data[field.field_name] == '1'}} | ||
name="approved-{{ field.field_name }}" | ||
onchange=" | ||
var hiddenInput = document.getElementById('approval-status-{{ field.field_name }}'); | ||
hiddenInput.value = this.checked ? '1' : '0'; | ||
" | ||
/> | ||
{{ placeholder }} | ||
</label> | ||
<input type="hidden" id="approval-status-{{ field.field_name }}" name="{{ field.field_name }}" value="0"/> | ||
</fieldset> | ||
|
||
{%- snippet 'scheming/form_snippets/help_text.html', field=field -%} | ||
{%- endcall -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters