Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
ckanext-odsh
Commits
2ecb57ed
Commit
2ecb57ed
authored
1 year ago
by
Thorge Petersen
Browse files
Options
Downloads
Patches
Plain Diff
Enable editing of custom extra fields in the organization webform
parent
ee2a79e5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+2
-1
2 additions, 1 deletion
CHANGELOG.md
ckanext/odsh/templates/organization/snippets/organization_form.html
+46
-13
46 additions, 13 deletions
...sh/templates/organization/snippets/organization_form.html
with
48 additions
and
14 deletions
CHANGELOG.md
+
2
−
1
View file @
2ecb57ed
...
@@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
### Added
-
Configuration variable
`ckanext.odsh.min_tag_length`
indicating minimum characters allowed for tag length.
-
Configuration variable
`ckanext.odsh.min_tag_length`
indicating minimum characters allowed for tag length.
-
Configuration variable
`ckanext.odsh.max_tag_length`
indicating maximum characters allowed
-
Configuration variable
`ckanext.odsh.max_tag_length`
indicating maximum characters allowed for tag length.
-
Editing of custom extra fields alongside the fixed fields in organizations form.
### Removed
### Removed
...
...
This diff is collapsed.
Click to expand it.
ckanext/odsh/templates/organization/snippets/organization_form.html
+
46
−
13
View file @
2ecb57ed
...
@@ -26,24 +26,57 @@
...
@@ -26,24 +26,57 @@
{% endblock %}
{% endblock %}
{% block custom_fields %}
{% set extras = h.get_address_org(data) %}
<div
data-module=
"custom-fields"
>
{% set extras = h.get_address_org(data) %}
{{ form.input_address('person','Ansprechpartner', value= extras.person , index=0, placeholder='', type='text', attrs={}) }}
{{ form.input_address('person','Ansprechpartner', value= extras.person , index=0, placeholder='', type='text', attrs={}) }}
{{ form.input_address('street','Straße', value= extras.street, index=1, placeholder='', type='text', attrs={}) }}
{{ form.input_address('street','Straße', value= extras.street, index=1, placeholder='', type='text', attrs={}) }}
{{ form.input_address('location','Stadt', value=extras.location, index=2, placeholder='', type='text', attrs={}) }}
{{ form.input_address('telephone','Tel.-Nr.', value=extras.telephone, index=3, placeholder='', type='text', attrs={}) }}
{{ form.input_address('location','Stadt', value=extras.location, index=2, placeholder='', type='text', attrs={}) }}
{{ form.input_address('mail','E-Mail', value=extras.mail, index=4, placeholder='', type='text', attrs={}) }}
{{ form.input_address('web','Website', value=extras.web, index=5, placeholder='', type='text', attrs={}) }}
{{ form.input_address('
telephone','Tel.-Nr.
', value=extras.
telephone
, index=
3
, placeholder='', type='text', attrs={}) }}
{{ form.input_address('
gnd','GND URI
', value=extras.
gnd
, index=
6
, placeholder='
https://d-nb.info/gnd/1136109587
', type='text', attrs={}) }}
{{ form.input_address('mail','E-Mail', value=extras.mail, index=4, placeholder='', type='text', attrs={}) }}
{% for extra in data.extras %}
{% if extra.key not in ['person','street','location','telephone','mail','web','gnd'] %}
{{ form.input_address('web','Website', value=extras.web, index=5, placeholder='', type='text', attrs={}) }}
{% set prefix = 'extras__%d__' % (loop.index0 + 7) %}
{{ form.custom(
{{ form.input_address('gnd','GND URI', value=extras.gnd, index=6, placeholder='https://d-nb.info/gnd/1136109587', type='text', attrs={}) }}
names=(prefix ~ 'key', prefix ~ 'value', prefix ~ 'deleted'),
id='field-extras-%d' % loop.index,
label=_('Custom Field'),
values=(extra.key, extra.value, extra.deleted),
error=errors[prefix ~ 'key'] or errors[prefix ~ 'value']
) }}
{% endif %}
{% endfor %}
{# Add a max of 3 empty columns #}
{% set total_extras = data.extras|count %}
{% set empty_extras = (limit or 3) - total_extras %}
{% if empty_extras
<
=
0
%}{%
set
empty_extras =
1
%}{%
endif
%}
{%
for
extra
in
range
(
total_extras
,
total_extras
+
empty_extras
)
%}
{%
set
index =
loop.index0
+
(
data.extras
|
count
)
+
7
%}
{%
set
prefix =
'extras__%d__'
%
index
%}
{{
form.custom
(
names=
(prefix
~
'
key
',
prefix
~
'
value
',
prefix
~
'
deleted
'),
id=
'field-extras-%d'
%
index
,
label=
_('Custom
Field
'),
values=
(extra.key,
extra.value
,
extra.deleted
),
error=
errors[prefix
~
'
key
']
or
errors
[
prefix
~
'
value
']
)
}}
{%
endfor
%}
</
div
>
{% endblock %}
{{ form.required_message() }}
{{ form.required_message() }}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment