formulaire ajout de fonte okay

This commit is contained in:
fredtempez 2022-03-11 11:12:16 +01:00
parent 29396c8a10
commit cd6e6145f4
2 changed files with 29 additions and 14 deletions

View File

@ -15,7 +15,8 @@
*/
$(document).ready(function(){
$('input[name=fontAddFontImported]').prop('checked', true);
$('#fontAddFileWrapper').hide();
$('input[name=fontAddFontUrl]').prop('checked', false);
$('#containerFontAddUrl').hide();
});
@ -28,7 +29,8 @@ $("input[name=fontAddFontImported]").on("click", function() {
} else {
$('input[name=fontAddFontFile]').prop('checked', true);
}
$('#fontAddFileWrapper').hide();
$('#containerFontAddFile').hide();
$('#containerFontAddUrl').show();
});
$("input[name=fontAddFontFile]").on("click", function() {
@ -37,5 +39,6 @@ $("input[name=fontAddFontFile]").on("click", function() {
} else {
$('input[name=fontAddFontImported]').prop('checked', true);
}
$('#fontAddFileWrapper').show();
$('#containerFontAddFile').show();
$('#containerFontAddUrl').hide();
});

View File

@ -30,14 +30,10 @@
<h4>Identité de la fonte</h4>
<div class="row">
<div class="col6">
<?php echo template::checkbox('fontAddFontImported', true, 'Fonte téléchargée sur <a href="https://cdnfonts.com" target="_blank">cdnFonts</a>', [
'help' => 'Police utilisée en ligne, se connecter sur cdnFonts pour récupérer les informations nécessaires.'
]); ?>
<?php echo template::checkbox('fontAddFontImported', true, 'Fonte en ligne', []); ?>
</div>
<div class="col6">
<?php echo template::checkbox('fontAddFontFile', true,'Fonte installée', [
'help' => 'Sélectionnez un fichier de fonte au format WOFF.'
]); ?>
<?php echo template::checkbox('fontAddFontFile', true,'Fonte installée', []); ?>
</div>
</div>
<div class="row">
@ -45,23 +41,39 @@
<?php echo template::text('fontAddFontId', [
'autocomplete' => 'off',
'label' => 'Identifiant (sans espace ni majuscule)',
'placeholder' => 'perry-gothic'
'placeholder' => 'big-marker-extrude'
]); ?>
</div>
<div class="col6">
<?php echo template::text('fontAddFontName', [
'autocomplete' => 'off',
'label' => 'Nom (Font Family)',
'placeholder' => 'PerryGothic'
'label' => 'Nom',
'placeholder' => 'Big Marker Extrude'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::text('fontAddFontFamilyName', [
'autocomplete' => 'off',
'label' => 'Famille',
'placeholder' => "'Big Marker Extrude', sans-serif"
]); ?>
</div>
</div>
<div class="row" id="containerFontAddFile">
<div class="col12">
<?php echo template::file('fontAddFile', [
'label' => 'Fichier de police (Format WOFF)',
'placeholder' => 'https://fonts.cdnfonts.com/s/7896/PERRYGOT.woff'
'label' => 'Fichier de fonte (Format WOFF)'
]); ?>
</div>
</div>
<div class="row" id="containerFontAddUrl">
<div class="col12">
<?php echo template::text('fontAddUrl', [
'label' => 'Url du fichier de fonte',
'placeholder' => 'https://fonts.cdnfonts.com/css/big-marker-extrude'
]); ?>
</div>
</div>