source: extensions/ContactForm/template/contact_form.tpl @ 25872

Revision 25872, 3.8 KB checked in by mistic100, 6 years ago (diff)

update for 2.6

Line 
1{combine_css path=$CONTACT_FORM_PATH|cat:"template/style.css"}
2{combine_script id="livevalidation" load="footer" path=$CONTACT_FORM_PATH|cat:"template/livevalidation.min.js"}
3
4{footer_script require='livevalidation'}
5{if $contact.mandatory_name and !$contact.is_logged}
6var author = new LiveValidation('author', {ldelim} onlyOnSubmit: true });
7author.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a name'|translate}" });
8{/if}
9
10{if $contact.mandatory_mail and (!$contact.is_logged or empty($contact.email))}
11var email = new LiveValidation('email', {ldelim} onlyOnSubmit: true });
12email.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter an e-mail'|translate}" });
13email.add(Validate.Email, {ldelim} failureMessage: "{'mail address must be like xxx@yyy.eee (example : jack@altern.org)'|translate}" });
14{/if}
15
16{if $GROUPS}
17var group = new LiveValidation('group', {ldelim} onlyOnSubmit: true })
18group.add(Validate.Exclusion, {ldelim} within: ['-1'], failureMessage: "{'Please choose a category'|translate}" });
19{/if}
20
21var subject = new LiveValidation('subject', {ldelim} onlyOnSubmit: true });
22subject.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a subject'|translate}" });
23subject.add(Validate.Length, {ldelim} maximum: 100,
24  tooLongMessage: "{'%s must not be more than %d characters long'|translate:'':100}"
25  });
26
27var content = new LiveValidation('cf_content', {ldelim} onlyOnSubmit: true });
28content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|translate}" });
29content.add(Validate.Length, {ldelim} maximum: 2000,
30  tooLongMessage: "{'%s must not be more than %d characters long'|translate:'':2000}",
31  });
32{/footer_script}
33
34
35{if $ContactForm_before}
36<div class="contact desc">{$ContactForm_before}</div>
37{/if}
38
39<div class="contact">
40  <form  method="post" action="{$F_ACTION}">
41    <table>
42      <tr>
43        <td class="title"><label for="author">{'Your name'|translate}</label></td>
44        <td>
45        {if $contact.is_logged}
46          {$contact.author}
47          <input type="hidden" name="author" value="{$contact.author}">
48        {else}
49          <input type="text" name="author" id="author" size="40" value="{$contact.author}">
50        {/if}
51        </td>
52      </tr>
53      <tr>
54        <td class="title"><label for="email">{'Your e-mail'|translate}</label></td>
55        <td>
56        {if $contact.is_logged and !empty($contact.email)}
57          {$contact.email}
58          <input type="hidden" name="email" value="{$contact.email}">
59        {else}
60          <input type="text" name="email" id="email" size="40" value="{$contact.email}">
61        {/if}
62        </td>
63      </tr>
64      {if $GROUPS}
65      <tr>
66        <td class="title"><label for="group">{'Category'|translate}</label></td>
67        <td>
68          <select name="group" id="group">
69            <option value="-1">------------</option>
70            {html_options options=$GROUPS selected=$contact.group}
71          </select>
72        </td>
73      </tr>
74      {/if}
75      <tr>
76        <td class="title"><label for="subject">{'Subject'|translate}</label></td>
77        <td><input type="text" name="subject" id="subject" style="width:400px;" value="{$contact.subject}"></td>
78      </tr>
79      <tr>
80        <td class="title"><label for="cf_content">{'Message'|translate}</label></td>
81        <td><textarea name="content" id="cf_content" rows="10" style="width:400px;">{$contact.content}</textarea></td>
82      </tr>
83      <tr>
84        <td class="title">&nbsp;</td>
85        <td>
86          <input class="submit" type="submit" name="send_mail" value="{'Send'|translate}">
87          <label><input type="checkbox" name="send_copy"> {'Send copy to my email'|translate}</label>
88        </td>
89      </tr>
90    </table>
91
92    <input type="hidden" name="key" value="{$KEY}" />
93  </form>
94</div>
95
96{if $ContactForm_after}
97<div class="contact desc">{$ContactForm_after}</div>
98{/if}
Note: See TracBrowser for help on using the repository browser.