Fix blog view page using new sql scheme
This commit is contained in:
parent
19b5cec9b5
commit
1f7a77e0d6
|
@ -12,31 +12,31 @@
|
||||||
<form class="form" action="<?=$config['rel_root_folder']?>blog/new" method="post">
|
<form class="form" action="<?=$config['rel_root_folder']?>blog/new" method="post">
|
||||||
<? }
|
<? }
|
||||||
else { ?>
|
else { ?>
|
||||||
<form class="form" action="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->url?>/edit" method="post">
|
<form class="form" action="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/edit" method="post">
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
||||||
<h1>
|
<h1>
|
||||||
<select name="locale" id="locale">
|
<select name="locale" id="locale">
|
||||||
<? foreach($config['locales'] as $locale) { ?>
|
<? foreach($locales->objs as $locale) { ?>
|
||||||
<option <?=$blogArticle->locale==$locale[0]?'selected':''?> value="<?=$locale[0]?>"><?=$locale[5]?></option>
|
<option <?=$blogArticle->locale==$locale->name?'selected':''?> value="<?=$locale->name?>"><?=$locale->display_name?></option>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</select>
|
</select>
|
||||||
<input type="text" value="<?=$blogArticle->title?>" name="title" id="title" placeholder="Titre">
|
<input type="text" value="<?=$blogArticle->name?>" name="name" id="name" placeholder="Titre">
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<? if(isset($error) AND $error=="url") { ?>
|
<? if(isset($error) AND $error=="permalink") { ?>
|
||||||
<p style="color: red;">L'URL sélectionnée est déjà prise.</p>
|
<p style="color: red;">L'URL sélectionnée est déjà prise.</p>
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
||||||
<textarea rows="30" name="content" id="content" placeholder="Contenu de la page"><?=$blogArticle->content?></textarea>
|
<textarea rows="30" name="content" id="content" placeholder="Contenu de la page"><?=$blogArticle->content?></textarea>
|
||||||
|
|
||||||
<? if(isset($new) AND $new==1) { ?>
|
<? if(isset($new) AND $new==1) { ?>
|
||||||
<input type="text" value="<?=$blogArticle->url?>" name="url" id="url" placeholder="URL">
|
<input type="text" value="<?=$blogArticle->permalink?>" name="permalink" id="permalink" placeholder="URL">
|
||||||
<? } ?>
|
<? } ?>
|
||||||
|
|
||||||
<label for="comments">
|
<label for="comments">
|
||||||
<input type="checkbox" name="comments" id="comments" value="comments"
|
<input type="checkbox" name="comments" id="comments" value="comments"
|
||||||
<? if($blogArticle->comments == 't') { ?>
|
<? if($blogArticle->is_commentable == 't') { ?>
|
||||||
checked
|
checked
|
||||||
<? } ?>
|
<? } ?>
|
||||||
/>
|
/>
|
||||||
|
@ -48,21 +48,21 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$( "#title" ).keyup(function() {
|
$( "#name" ).keyup(function() {
|
||||||
url = $( "#title" ).val();
|
permalink = $( "#name" ).val();
|
||||||
url = url.replace(/ /g,'_');
|
permalink = permalink.replace(/ /g,'_');
|
||||||
url = url.toLowerCase();
|
permalink = permalink.toLowerCase();
|
||||||
url = url.replace(/[^a-z0-9_]/g,'-');
|
permalink = permalink.replace(/[^a-z0-9_]/g,'-');
|
||||||
url = url.replace(/[_$]/g,'-');
|
permalink = permalink.replace(/[_$]/g,'-');
|
||||||
$( "#url" ).val(url);
|
$( "#permalink" ).val(permalink);
|
||||||
});
|
});
|
||||||
$( "#title" ).change(function() {
|
$( "#name" ).change(function() {
|
||||||
url = $( "#title" ).val();
|
permalink = $( "#name" ).val();
|
||||||
url = url.replace(/ /g,'_');
|
permalink = permalink.replace(/ /g,'_');
|
||||||
url = url.toLowerCase();
|
permalink = permalink.toLowerCase();
|
||||||
url = url.replace(/[^a-z0-9_]/g,'-');
|
permalink = permalink.replace(/[^a-z0-9_]/g,'-');
|
||||||
url = url.replace(/[_$]/g,'-');
|
permalink = permalink.replace(/[_$]/g,'-');
|
||||||
$( "#url" ).val(url);
|
$( "#permalink" ).val(permalink);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue