-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dev): frontend resource format;
- Started frontend code for resource format. - Changed autocomplete to basic selectable select2 element. - Moved some code to reusable helper. - Added API util endpoint.
- Loading branch information
1 parent
983194d
commit 84b82c6
Showing
8 changed files
with
95 additions
and
58 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
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,21 @@ | ||
window.addEventListener('load', function(){ | ||
$(document).ready(function() { | ||
|
||
let formatField = $('#field-format'); | ||
if ( formatField.length > 0 ){ | ||
|
||
$(formatField).select2({}); | ||
$(formatField).parent() | ||
.children('#s2id_field-format') | ||
.addClass('conrtol-medium') | ||
.removeClass('form-control') | ||
.css({'display': 'block'}); | ||
|
||
} | ||
|
||
let urlField = $('#field-image-url'); | ||
let uploadField = $('#field-image-upload'); | ||
// TODO: onchange above fields to clear the select2 field and call guess_resource_format endpoint | ||
|
||
}); | ||
}); |
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
26 changes: 0 additions & 26 deletions
26
ckanext/canada/templates/internal/scheming/form_snippets/select2.html
This file was deleted.
Oops, something went wrong.
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