Kabano is a PHP web application listing alpine huts. https://kabano.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

d.blog.edit.html 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <? include('blocks/d.head.html'); ?>
  4. <body>
  5. <? include('blocks/d.nav.html'); ?>
  6. <section>
  7. <? if(isset($new) AND $new==1) { ?>
  8. <form class="form" action="<?=$config['rel_root_folder']?>blog/new" method="post">
  9. <? }
  10. else { ?>
  11. <form class="form" action="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/edit" method="post">
  12. <? } ?>
  13. <h1>
  14. <select name="locale" id="locale">
  15. <? foreach($locales->objs as $locale) { ?>
  16. <option <?=$blogArticle->locale==$locale->name?'selected':''?> value="<?=$locale->name?>"><?=$locale->display_name?></option>
  17. <? } ?>
  18. </select>
  19. <input type="text" value="<?=$blogArticle->name?>" name="name" id="name" placeholder="Titre">
  20. </h1>
  21. <? if(isset($error) AND $error=="permalink") { ?>
  22. <p style="color: red;">L'URL sélectionnée est déjà prise.</p>
  23. <? } ?>
  24. <textarea rows="30" name="content" id="content" placeholder="Contenu de l'article"><?=$blogArticle->content?></textarea>
  25. <? if(isset($new) AND $new==1) { ?>
  26. <input type="text" value="<?=$blogArticle->permalink?>" name="permalink" id="permalink" placeholder="URL">
  27. <? } ?>
  28. <label for="is_commentable">
  29. <input type="checkbox" name="is_commentable" id="is_commentable"
  30. <? if($blogArticle->is_commentable == 't') { ?>
  31. checked
  32. <? } ?>
  33. />
  34. <span>Autoriser les commentaires</span>
  35. </label>
  36. <input name="submit" id="submit" type="submit" value="Envoyer">
  37. </form>
  38. </section>
  39. <script type="text/javascript">
  40. $( "#name" ).keyup(function() {
  41. permalink = $( "#name" ).val();
  42. permalink = permalink.replace(/ /g,'_');
  43. permalink = permalink.toLowerCase();
  44. permalink = permalink.replace(/[^a-z0-9_]/g,'-');
  45. permalink = permalink.replace(/[_-]+$/g,'');
  46. $( "#permalink" ).val(permalink);
  47. });
  48. $( "#name" ).change(function() {
  49. permalink = $( "#name" ).val();
  50. permalink = permalink.replace(/ /g,'_');
  51. permalink = permalink.toLowerCase();
  52. permalink = permalink.replace(/[^a-z0-9_]/g,'-');
  53. permalink = permalink.replace(/[_-]+$/g,'');
  54. $( "#permalink" ).val(permalink);
  55. });
  56. </script>
  57. <? include('blocks/d.footer.html'); ?>
  58. </body>
  59. </html>