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

Last change on this file since 18814 was 18814, checked in by mistic100, 11 years ago

remove minimum characters limit, don't display user ip by default

File size: 4.4 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
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|@sprintf:'':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 %d characters long'|@translate|@sprintf:'':2000}",
31  });
32{/footer_script}
33
34
35{* <!-- Menubar & titrePage --> *}
36{if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}
37  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/stripped.tpl'}
38  {assign var="clear" value="true"}
39{elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}
40  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/simple.tpl'}
41  {assign var="clear" value="true"}
42{else}
43  {include file=$CONTACT_FORM_ABS_PATH|@cat:'template/themes/default.tpl'}
44{/if}
45
46
47{if isset($errors) or not empty($infos)}
48{include file='infos_errors.tpl'}
49{/if}
50
51{if $ContactForm_before}
52<div class="contact desc">{$ContactForm_before}</div>
53{/if}
54
55<div class="contact">
56  <form  method="post" action="{$F_ACTION}" class="filter">
57    <table>
58      <tr>
59        <td class="title"><label for="author">{'Your name'|@translate}</label></td>
60        <td>
61        {if $contact.is_logged}
62          {$contact.author}
63          <input type="hidden" name="author" value="{$contact.author}">
64        {else}
65          <input type="text" name="author" id="author" size="40" value="{$contact.author}">
66        {/if}
67        </td>
68      </tr>
69      <tr>
70        <td class="title"><label for="email">{'Your e-mail'|@translate}</label></td>
71        <td>
72        {if $contact.is_logged and !empty($contact.email)}
73          {$contact.email}
74          <input type="hidden" name="email" value="{$contact.email}">
75        {else}
76          <input type="text" name="email" id="email" size="40" value="{$contact.email}">
77        {/if}
78        </td>
79      </tr>
80      {if $GROUPS}
81      <tr>
82        <td class="title"><label for="group">{'Category'|@translate}</label></td>
83        <td>
84          <select name="group" id="group">
85            <option value="-1">------------</option>
86            {html_options options=$GROUPS selected=$contact.group}
87          </select>
88        </td>
89      </tr>
90      {/if}
91      <tr>
92        <td class="title"><label for="subject">{'Subject'|@translate}</label></td>
93        <td><input type="text" name="subject" id="subject" style="width:400px;" value="{$contact.subject}"></td>
94      </tr>
95      <tr>
96        <td class="title"><label for="cf_content">{'Message'|@translate}</label></td>
97        <td><textarea name="content" id="cf_content" rows="10" style="width:400px;">{$contact.content}</textarea></td>
98      </tr>
99      <tr>
100        <td class="title">&nbsp;</td>
101        <td><input class="submit" type="submit" name="send_mail" value="{'Send'|@translate}"></td>
102      </tr>
103    </table>
104   
105    <input type="hidden" name="key" value="{$KEY}" />
106  </form>
107</div>
108
109{if $ContactForm_after}
110<div class="contact desc">{$ContactForm_after}</div>
111{/if}
112
113{if $clear}<div style="clear: both;"></div>
114</div>{/if}
115</div>{* <!-- content --> *}
Note: See TracBrowser for help on using the repository browser.