-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display publisher as multilang #339
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a44ecef
feat: Display publisher as multilang
kovalch 3e8bbf1
feat: Update the publisher schema to for multilang
kovalch 44f1039
feat: Make publisher name multilang
kovalch 44efe88
feat: Make publisher from form multilang
kovalch a25cb9c
fix: Checking the publisher name type
kovalch 5adcf76
fix: Remove unneeded logs
kovalch b7fcc2d
fix: Remove unused const
kovalch 94339c3
fix: Include all four language keys
kovalch 35b2ddf
fix: Use languages list as a constant
kovalch 2aeb1e2
fix: Fix the logix of validator
kovalch 715894e
fix: Remove duplicate fieldgroup for publisher
kovalch f54531b
fix: Validate only for the case of missing value
kovalch e990ea2
fix: Put back check for dict
kovalch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
11 changes: 9 additions & 2 deletions
11
ckanext/switzerland/templates/scheming/display_snippets/publisher.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 |
---|---|---|
@@ -1,6 +1,13 @@ | ||
{%- set publisher = h.render_publisher(data[field.field_name]) -%} | ||
{% if publisher %} | ||
<a href="{{ publisher.url }}" target="_blank" class="break-word">{{ publisher.name }}</a> | ||
{%- set current_lang = h.lang() -%} {# Get the current CKAN language #} | ||
{%- set fallback_lang = 'de' -%} {# Default fallback language #} | ||
{% if publisher.name is string %} | ||
<a href="{{ publisher.url }}" target="_blank" class="break-word">{{ publisher.name }}</a> | ||
{% else %} | ||
{%- set publisher_name = publisher.name.get(current_lang) or publisher.name.get(fallback_lang) -%} | ||
<a href="{{ publisher.url }}" target="_blank" class="break-word">{{ publisher_name }}</a> | ||
{% endif %} | ||
{% else %} | ||
- | ||
<p>Publisher information not available.</p> | ||
{% endif %} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove this if statement and un-indent everything beneath it by one tab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not do this, actually I would remove
And really validate the missing value here. If we will remove
if not data.get(key)
It could lead to overwriting valid data, like str value (from foaf:Organization).