Merge pull request #15843 from totten/master-simplehead
[civicrm-core.git] / templates / CRM / common / CMSUser.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10 {if $showCMS }{*true if is_cms_user field is set *}
11 <fieldset class="crm-group crm_user-group">
12 <div class="messages help cms_user_help-section">
13 {if !$isCMS}
14 {ts}If you would like to create an account on this site, check the box below and enter a Username{/ts}{if $form.cms_pass} {ts}and a password{/ts}.{/if}
15 {else}
16 {ts}Please enter a Username to create an account.{/ts}
17 {/if}
18 {ts 1=$loginURL}If you already have an account <a href='%1'>please login</a> before completing this form.{/ts}
19 </div>
20 <div>{$form.cms_create_account.html} {$form.cms_create_account.label}</div>
21 <div id="details" class="crm_user_signup-section">
22
23 <div class="form-layout-compressed">
24 <div class="crm-section cms_name-section">
25 <div class="label">
26 <label for="cms_name">{$form.cms_name.label}</label>
27 </div>
28 <div class="content">
29 {$form.cms_name.html} <a id="checkavailability" href="#" onClick="return false;">{ts}<strong>Check Availability</strong>{/ts}</a>
30 <span id="msgbox" style="display:none"></span><br />
31 <span class="description">{ts}Punctuation is not allowed in a Username with the exception of periods, hyphens and underscores.{/ts}</span>
32 </div>
33 </div>
34
35 {if $form.cms_pass}
36 <div class="crm-section cms_pass-section">
37 <div class="label">
38 <label for="cms_pass">{$form.cms_pass.label}</label>
39 </div>
40 <div class="content">
41 {$form.cms_pass.html}
42 </div>
43 <div class="clear"></div>
44 <div class="label">
45 <label for="crm_confirm_pass-section">{$form.cms_confirm_pass.label}</label>
46 </div>
47 <div class="content">
48 {$form.cms_confirm_pass.html}<br/>
49 <span class="description">{ts}Provide a password for the new account in both fields.{/ts}</span>
50 </div>
51 </div>
52 {/if}
53 </div>
54
55 </div>
56 </fieldset>
57
58 {literal}
59 <script type="text/javascript">
60 {/literal}
61 {if !$isCMS}
62 {literal}
63 if ( document.getElementsByName("cms_create_account")[0].checked ) {
64 cj('#details').show();
65 } else {
66 cj('#details').hide();
67 }
68 {/literal}
69 {/if}
70 {literal}
71 function showMessage( frm )
72 {
73 var cId = {/literal}'{$cId}'{literal};
74 if ( cId ) {
75 alert('{/literal}{ts escape="js"}You are logged-in user{/ts}{literal}');
76 frm.checked = false;
77 } else {
78 var siteName = {/literal}'{$config->userFrameworkBaseURL}'{literal};
79 alert('{/literal}{ts escape="js"}Please login if you have an account on this site with the link{/ts}{literal} ' + siteName );
80 }
81 }
82 {/literal}
83 {include file="CRM/common/checkUsernameAvailable.tpl"}
84 {literal}
85 </script>
86 {/literal}
87 {if !$isCMS}
88 {include file="CRM/common/showHideByFieldValue.tpl"
89 trigger_field_id ="cms_create_account"
90 trigger_value =""
91 target_element_id ="details"
92 target_element_type ="block"
93 field_type ="radio"
94 invert = 0
95 }
96 {/if}
97 {/if}