[16347] | 1 | {combine_css path=$GUESTBOOK_PATH|@cat:"template/style.css"} |
---|
[20181] | 2 | {combine_script id="livevalidation" load="footer" path=$GUESTBOOK_PATH|@cat:"template/livevalidation.min.js"} |
---|
| 3 | |
---|
[25214] | 4 | {footer_script require='jquery,livevalidation'} |
---|
[20181] | 5 | {if !$comment_add.IS_LOGGED} |
---|
| 6 | var author = new LiveValidation('author', {ldelim} onlyOnSubmit: true }); |
---|
| 7 | author.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter your username'|@translate}" }); |
---|
[17717] | 8 | {/if} |
---|
[16347] | 9 | |
---|
[25786] | 10 | {if $comment_add.EMAIL_MANDATORY and (!$comment_add.IS_LOGGED or empty($comment_add.EMAIL))} |
---|
[20181] | 11 | var email = new LiveValidation('email', {ldelim} onlyOnSubmit: true }); |
---|
| 12 | email.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter your e-mail'|@translate}" }); |
---|
| 13 | email.add(Validate.Email, {ldelim} failureMessage: "{'mail address must be like xxx@yyy.eee (example : jack@altern.org)'|@translate}" }); |
---|
| 14 | {/if} |
---|
| 15 | |
---|
| 16 | var website = new LiveValidation('website', {ldelim} onlyOnSubmit: true }); |
---|
[25214] | 17 | website.add(Validate.Format, {ldelim} pattern: /^https?:\/\/[^\s\/$.?#].[^\s]*$/i, |
---|
[20181] | 18 | failureMessage: "{'invalid website address'|@translate}"}); |
---|
| 19 | |
---|
| 20 | var content = new LiveValidation('contentid', {ldelim} onlyOnSubmit: true }); |
---|
| 21 | content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|@translate}" }); |
---|
| 22 | |
---|
| 23 | jQuery("#addComment").hide(); |
---|
| 24 | jQuery("#guestbookAdd").css('width','180px'); |
---|
| 25 | jQuery("#expandForm").click(function() {ldelim} |
---|
| 26 | jQuery("#guestbookAdd").animate({ldelim}"width": "550px"}, function() {ldelim} |
---|
| 27 | jQuery("#expandForm").slideUp(); |
---|
| 28 | jQuery("#addComment").slideDown("slow"); |
---|
| 29 | }); |
---|
| 30 | }); |
---|
[25214] | 31 | |
---|
[25215] | 32 | jQuery("#website").on('blur', function() {ldelim} |
---|
[25214] | 33 | var val = $(this).val(); |
---|
[25215] | 34 | if (val.substr(0, 4) != 'http') {ldelim} |
---|
[25214] | 35 | $(this).val('http://'+ val); |
---|
| 36 | } |
---|
| 37 | }); |
---|
[20181] | 38 | {/footer_script} |
---|
| 39 | |
---|
[16347] | 40 | {if $comment_add.ACTIVATE_RATING} |
---|
| 41 | {combine_script id="jquery.raty" path=$GUESTBOOK_PATH|@cat:"template/jquery.raty/jquery.raty.min.js"} |
---|
| 42 | {footer_script} |
---|
| 43 | jQuery("#comment_rate").raty({ldelim} |
---|
[17317] | 44 | path: "{$ROOT_URL}{$GUESTBOOK_PATH}template/jquery.raty/", |
---|
[16347] | 45 | half: true |
---|
| 46 | }); |
---|
| 47 | {/footer_script} |
---|
| 48 | {/if} |
---|
| 49 | |
---|
| 50 | |
---|
[17495] | 51 | {* <!-- Menubar & titrePage --> *} |
---|
| 52 | {if $themeconf.name == "stripped" or $themeconf.parent == "stripped"} |
---|
| 53 | {include file=$ABS_GUESTBOOK_PATH|@cat:'template/themes/stripped.tpl'} |
---|
| 54 | {assign var="clear" value="true"} |
---|
| 55 | {elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"} |
---|
| 56 | {include file=$ABS_GUESTBOOK_PATH|@cat:'template/themes/simple.tpl'} |
---|
| 57 | {assign var="clear" value="true"} |
---|
| 58 | {else} |
---|
| 59 | {include file=$ABS_GUESTBOOK_PATH|@cat:'template/themes/default.tpl'} |
---|
| 60 | {/if} |
---|
[16347] | 61 | |
---|
| 62 | {if isset($errors) or not empty($infos)} |
---|
| 63 | {include file='infos_errors.tpl'} |
---|
| 64 | {/if} |
---|
| 65 | |
---|
[17495] | 66 | |
---|
[16347] | 67 | {if isset($comment_add)} |
---|
| 68 | <div id="guestbookAdd"> |
---|
[20181] | 69 | <h4 id="expandForm">{'Sign the guestbook'|@translate}</h4> |
---|
| 70 | <form method="post" action="{$comment_add.F_ACTION}" id="addComment" class="contact"> |
---|
| 71 | <table> |
---|
| 72 | {if not $comment_add.IS_LOGGED or empty($comment_add.EMAIL)} |
---|
| 73 | <tr> |
---|
| 74 | <td> |
---|
| 75 | <label for="author">{'Author'|@translate}* :</label> |
---|
| 76 | {if $comment_add.IS_LOGGED} |
---|
| 77 | {$comment_add.AUTHOR} |
---|
| 78 | <input type="hidden" name="author" value="{$comment_add.AUTHOR}"> |
---|
| 79 | {else} |
---|
| 80 | <input type="text" name="author" id="author" value="{$comment_add.AUTHOR}"> |
---|
| 81 | {/if} |
---|
| 82 | </td> |
---|
| 83 | <td> |
---|
| 84 | <label for="email">{'Email address'|@translate}{if $comment_add.EMAIL_MANDATORY}*{/if} ({'not publicly visible'|@translate}) :</label> |
---|
| 85 | <input type="text" name="email" id="email" value="{$comment_add.EMAIL}"> |
---|
| 86 | </td> |
---|
| 87 | </tr> |
---|
| 88 | {/if} |
---|
| 89 | <tr> |
---|
| 90 | {if $comment_add.ACTIVATE_RATING} |
---|
| 91 | <td> |
---|
| 92 | <label>{'Rate'|@translate} :</label> |
---|
| 93 | <span id="comment_rate"></span> |
---|
| 94 | </td> |
---|
| 95 | {/if} |
---|
| 96 | <td> |
---|
| 97 | <label for="website">{'Website'|@translate} :</label> |
---|
| 98 | <input type="text" name="website" id="website" value="{$comment_add.WEBSITE}"> |
---|
| 99 | </td> |
---|
| 100 | </tr> |
---|
| 101 | <tr> |
---|
| 102 | <td colspan="2"> |
---|
| 103 | <label for="contentid">{'Comment'|@translate}* :</label> |
---|
| 104 | <textarea name="content" id="contentid" rows="7">{$comment_add.CONTENT}</textarea> |
---|
| 105 | </td> |
---|
| 106 | </tr> |
---|
| 107 | <tr> |
---|
| 108 | <td colspan="2"> |
---|
| 109 | <input type="submit" value="{'Send'|@translate}"> |
---|
| 110 | {'* : mandatory fields'|@translate} |
---|
| 111 | </td> |
---|
| 112 | </tr> |
---|
| 113 | </table> |
---|
| 114 | |
---|
| 115 | <input type="hidden" name="key" value="{$comment_add.KEY}"> |
---|
| 116 | </form> |
---|
[16347] | 117 | </div> |
---|
| 118 | {/if} |
---|
| 119 | |
---|
| 120 | <p class="comment_count">{'There are %d messages'|@translate|@sprintf:$COMMENT_COUNT}</p> |
---|
| 121 | |
---|
| 122 | {if isset($comments)} |
---|
| 123 | <div id="guestbookCommentList"> |
---|
| 124 | {if !empty($navbar)} |
---|
| 125 | <div id="pictureCommentNavBar"> |
---|
| 126 | {include file='navigation_bar.tpl'|@get_extent:'navbar'} |
---|
| 127 | </div> |
---|
| 128 | {/if} |
---|
| 129 | {include file=$ABS_GUESTBOOK_PATH|@cat:'template/comment_list.tpl'} |
---|
| 130 | </div> |
---|
| 131 | {/if} |
---|
| 132 | |
---|
[17495] | 133 | {if $clear}<div style="clear: both;"></div> |
---|
| 134 | </div>{/if} |
---|
[16347] | 135 | </div>{* <!-- content --> *} |
---|