{combine_css path=$GUESTBOOK_PATH|cat:'template/style.css'} {combine_script id='livevalidation' load='footer' path=$GUESTBOOK_PATH|cat:'template/livevalidation.min.js'} {footer_script require='jquery,livevalidation'} (function() { {if !$comment_add.IS_LOGGED} var author = new LiveValidation('author', {ldelim} onlyOnSubmit: true }); author.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter your username'|translate}" }); {/if} {if $comment_add.EMAIL_MANDATORY and (!$comment_add.IS_LOGGED or empty($comment_add.EMAIL))} var email = new LiveValidation('email', {ldelim} onlyOnSubmit: true }); email.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter your e-mail'|translate}" }); email.add(Validate.Email, {ldelim} failureMessage: "{'mail address must be like xxx@yyy.eee (example : jack@altern.org)'|translate}" }); {/if} var website = new LiveValidation('website', {ldelim} onlyOnSubmit: true }); website.add(Validate.Format, {ldelim} pattern: /^https?:\/\/[^\s\/$.?#].[^\s]*$/i, failureMessage: "{'invalid website address'|translate}"}); var content = new LiveValidation('contentid', {ldelim} onlyOnSubmit: true }); content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|translate}" }); {if $themeconf.mobile} var width = $(document).width()-30; {else} var width = jQuery('#guestbookAdd').parent().width(); {/if} {if !isset($GB_OPEN)} jQuery('#addComment').hide(); jQuery('#guestbookAdd').css('width', '180px'); jQuery('#expandForm').click(function() {ldelim} jQuery('#guestbookAdd').animate({ 'width': Math.min(width, 580) }, function() {ldelim} jQuery('#expandForm').slideUp(); jQuery('#addComment').slideDown('slow'); }); }); {else} jQuery('#guestbookAdd').css({ 'width': Math.min(width, 580) }); {/if} jQuery('#website').on('blur', function() {ldelim} var val = $(this).val(); if (val.substr(0, 4) != 'http') {ldelim} $(this).val('http://'+ val); } }); }()); {/footer_script} {if $comment_add.ACTIVATE_RATING} {combine_script id='jquery.raty' path=$GUESTBOOK_PATH|cat:'template/jquery.raty/jquery.raty.min.js'} {footer_script} jQuery('#comment_rate').raty({ldelim} path: '{$ROOT_URL}{$GUESTBOOK_PATH}template/jquery.raty/', half: true }); {/footer_script} {/if} {if isset($comment_add)}

{'Sign the guestbook'|translate}

{if not $comment_add.IS_LOGGED or empty($comment_add.EMAIL)}
{if $comment_add.IS_LOGGED} {$comment_add.AUTHOR} {else} {/if}
{/if} {if $comment_add.ACTIVATE_RATING}
{/if}
{if isset($CRYPTO)} {$CRYPTO.parsed_content} {/if} {if isset($EASYCAPTCHA)} {$EASYCAPTCHA.parsed_content} {/if}
{'* : mandatory fields'|translate}
{/if}

{'There are %d messages'|translate:$COMMENT_COUNT}

{if isset($comments)}
{if !empty($navbar)}
{include file='navigation_bar.tpl'|get_extent:'navbar'}
{/if} {include file=$ABS_GUESTBOOK_PATH|cat:'template/comment_list.tpl'}
{/if}