Skip to content

Commit

Permalink
Merge pull request #5 from rich-id/feature/t66586
Browse files Browse the repository at this point in the history
Remove publication date field instead of hiding it
  • Loading branch information
hdumazeau authored Oct 3, 2023
2 parents f1a0127 + 25f5854 commit b062eeb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@

<div class="terms-module-admin-edition-title-block terms-module-admin-row">
<div class="terms-module-admin-edition-title terms-module-admin-col">{{ form_row(form.title, {'attr': {'class': 'terms-module-form-field-full'}}) }}</div>
<div class="terms-module-admin-edition-publication-date terms-module-admin-col{% if lastTermsVersion.version < 2 %} d-none{% endif %}">{{ form_row(form.publicationDate, {'attr': {'class': 'terms-module-form-field-small'}}) }}</div>
{% if lastTermsVersion.version > 1 %}
<div class="terms-module-admin-edition-publication-date terms-module-admin-col">{{ form_row(form.publicationDate, {'attr': {'class': 'terms-module-form-field-small'}}) }}</div>
{% else %}
{% do form.publicationDate.setRendered() %}
{% endif %}
</div>

{{ form_row(form.content, {'attr': {'class': 'terms-module-form-field-full'}}) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ document.getElementById('{{ form.title.vars.id }}').addEventListener('input', fu
window.computeExitButtonText();
});

document.getElementById('{{ form.publicationDate.vars.id }}').addEventListener('input', function () {
window.currentTermsVersion.publicationDate = window.getTermsVersionPublicationDate();
window.computeSaveButtonStatus();
window.computeExitButtonText();
});
const publicationDate = document.getElementById('{{ form.publicationDate.vars.id }}');
if (publicationDate !== null) {
publicationDate.addEventListener('input', function () {
window.currentTermsVersion.publicationDate = window.getTermsVersionPublicationDate();
window.computeSaveButtonStatus();
window.computeExitButtonText();
});
}

CKEDITOR.instances.terms_version_form_content.on('change', function () {
window.currentTermsVersion.content = window.getTermsVersionContent();
Expand Down

0 comments on commit b062eeb

Please sign in to comment.