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

Last change on this file since 17483 was 17483, checked in by mistic100, 12 years ago

entirely rewrite the plugin

  • send mail in html format (configurable to plain)
  • fully configurable email list
  • more...
File size: 4.1 KB
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
16var subject = new LiveValidation('subject', {ldelim} onlyOnSubmit: true });
17subject.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a subject'|@translate}" });
18subject.add(Validate.Length, {ldelim} minimum: 4, maximum: 100,
19  tooShortMessage: "{'%s must not be less than %d characters long'|@translate|@sprintf:'':4}",
20  tooLongMessage: "{'%s must not be more than %d characters long'|@translate|@sprintf:'':100}"
21  });
22
23var content = new LiveValidation('cf_content', {ldelim} onlyOnSubmit: true });
24content.add(Validate.Presence, {ldelim} failureMessage: "{'Please enter a message'|@translate}" });
25content.add(Validate.Length, {ldelim} minimum: 20, maximum: 2000,
26  tooShortMessage: "{'%s must not be less than %d characters long'|@translate|@sprintf:'':20}",
27  tooLongMessage: "{'%s must not be more %d characters long'|@translate|@sprintf:'':2000}",
28  });
29{/footer_script}
30
31
32{* <!-- Menubar & titrePage --> *}
33{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
34  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/stripped.tpl'}
35  {assign var="clear" value="true"}
36{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
37  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/simple.tpl'}
38  {assign var="clear" value="true"}
39{else}
40  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/default.tpl'}
41{/if}
42
43
44{if isset($errors) or not empty($infos)}
45{include file='infos_errors.tpl'}
46{/if}
47
48{if $ContactForm_before}
49<div class="contact desc">{$ContactForm_before}</div>
50{/if}
51
52<div class="contact">
53  <form  method="post" action="{$F_ACTION}" class="filter">
54    <table>
55      <tr>
56        <td class="title"><label for="author">{'Your name'|@translate}</label></td>
57        <td>
58        {if $contact.is_logged}
59          {$contact.author}
60          <input type="hidden" name="author" value="{$contact.author}">
61        {else}
62          <input type="text" name="author" id="author" size="40" value="{$contact.author}">
63        {/if}
64        </td>
65      </tr>
66      <tr>
67        <td class="title"><label for="email">{'Your e-mail'|@translate}</label></td>
68        <td>
69        {if $contact.is_logged and !empty($contact.email)}
70          {$contact.email}
71          <input type="hidden" name="email" value="{$contact.email}">
72        {else}
73          <input type="text" name="email" id="email" size="40" value="{$contact.email}">
74        {/if}
75        </td>
76      </tr>
77      <tr>
78        <td class="title"><label for="subject">{'Subject'|@translate}</label></td>
79        <td><input type="text" name="subject" id="subject" style="width:400px;" value="{$contact.subject}"></td>
80      </tr>
81      <tr>
82        <td class="title"><label for="cf_content">{'Message'|@translate}</label></td>
83        <td><textarea name="content" id="cf_content" rows="10" style="width:400px;">{$contact.content}</textarea></td>
84      </tr>
85      <tr>
86        <td class="title">&nbsp;</td>
87        <td><input class="submit" type="submit" name="send_mail" value="{'Send'|@translate}"></td>
88      </tr>
89    </table>
90   
91    <input type="hidden" name="key" value="{$KEY}" />
92  </form>
93</div>
94
95{if $ContactForm_after}
96<div class="contact desc">{$ContactForm_after}</div>
97{/if}
98
99{if $clear}<div style="clear: both;"></div>{/if}
100</div>{* <!-- content --> *}
Note: See TracBrowser for help on using the repository browser.