Commit | Line | Data |
---|---|---|
320f4a6d MW |
1 | {include file='documentHeader'} |
2 | ||
3 | <head> | |
4 | <title>{lang}wcf.user.avatar.edit{/lang} - {lang}wcf.user.usercp{/lang} - {PAGE_TITLE|language}</title> | |
5 | ||
6 | {include file='headInclude'} | |
7 | </head> | |
8 | ||
9 | <body id="tpl{$templateName|ucfirst}"> | |
10 | ||
11 | {include file='userMenuSidebar'} | |
12 | ||
13 | {include file='header' sidebarOrientation='left'} | |
14 | ||
15 | <header class="boxHeadline"> | |
16 | <h1>{lang}wcf.user.avatar.edit{/lang}</h1> | |
17 | </header> | |
18 | ||
19 | {include file='userNotice'} | |
20 | ||
21 | {if $__wcf->user->disableAvatar} | |
22 | <p class="error">{lang}wcf.user.avatar.error.disabled{/lang}</p> | |
23 | {/if} | |
24 | ||
77329f86 | 25 | {include file='formError'} |
320f4a6d MW |
26 | |
27 | {if $success|isset} | |
28 | <p class="success">{lang}wcf.global.success.edit{/lang}</p> | |
29 | {/if} | |
30 | ||
31 | <div class="contentNavigation"> | |
32 | {hascontent} | |
33 | <nav> | |
34 | <ul> | |
35 | {content} | |
36 | {event name='contentNavigationButtons'} | |
37 | {/content} | |
38 | </ul> | |
39 | </nav> | |
40 | {/hascontent} | |
41 | </div> | |
42 | ||
43 | <form method="post" action="{link controller='AvatarEdit'}{/link}" id="avatarForm"> | |
44 | <div class="container containerPadding marginTop"> | |
45 | <fieldset> | |
46 | <legend>{lang}wcf.user.avatar{/lang}</legend> | |
47 | ||
48 | <dl> | |
77f70354 | 49 | <dt></dt> |
320f4a6d MW |
50 | <dd> |
51 | <label><input type="radio" name="avatarType" value="none" {if $avatarType == 'none'}checked="checked" {/if}/> {lang}wcf.user.avatar.type.none{/lang}</label> | |
52 | <small>{lang}wcf.user.avatar.type.none.description{/lang}</small> | |
53 | </dd> | |
54 | </dl> | |
55 | ||
56 | <dl class="jsOnly{if $errorField == 'custom'} formError{/if}" id="avatarUpload"> | |
57 | <dt class="framed"> | |
58 | {if $avatarType == 'custom'} | |
59 | {assign var='__customAvatar' value=$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(96)} | |
60 | {if $__wcf->getUserProfileHandler()->getAvatar()->canCrop()} | |
61 | {assign var='__customAvatar' value=$__customAvatar|substr:0:-2} | |
62 | {assign var='__customAvatarTitle' value='wcf.user.avatar.type.custom.crop'|language} | |
63 | {append var='__customAvatar' value='class="userAvatarCrop jsTooltip" title="'|concat:$__customAvatarTitle:'" />'} | |
64 | {/if} | |
65 | {@$__customAvatar} | |
66 | {else} | |
67 | <img src="{@$__wcf->getPath()}images/avatars/avatar-default.svg" alt="" class="icon96" /> | |
68 | {/if} | |
69 | </dt> | |
70 | <dd> | |
71 | <label><input type="radio" name="avatarType" value="custom" {if $avatarType == 'custom'}checked="checked" {/if}/> {lang}wcf.user.avatar.type.custom{/lang}</label> | |
72 | <small>{lang}wcf.user.avatar.type.custom.description{/lang}</small> | |
73 | ||
74 | {* placeholder for upload button: *} | |
75 | <div></div> | |
76 | ||
77 | {if $errorField == 'custom'} | |
78 | <small class="innerError"> | |
79 | {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if} | |
80 | </small> | |
81 | {/if} | |
82 | </dd> | |
83 | </dl> | |
84 | ||
85 | {if MODULE_GRAVATAR} | |
86 | <dl{if $errorField == 'gravatar'} class="formError"{/if}> | |
87 | <dt class="framed"><img src="http://www.gravatar.com/avatar/{@$__wcf->user->email|strtolower|md5}?s=96" alt="" class="icon96" /></dt> | |
88 | <dd> | |
89 | <label><input type="radio" name="avatarType" value="gravatar" {if $avatarType == 'gravatar'}checked="checked" {/if}/> {lang}wcf.user.avatar.type.gravatar{/lang}</label> | |
90 | {if $errorField == 'gravatar'} | |
91 | <small class="innerError"> | |
92 | {if $errorType == 'notFound'}{lang}wcf.user.avatar.type.gravatar.error.notFound{/lang}{/if} | |
93 | </small> | |
94 | {/if} | |
95 | <small>{lang}wcf.user.avatar.type.gravatar.description{/lang}</small> | |
96 | </dd> | |
97 | </dl> | |
98 | {/if} | |
99 | ||
100 | {event name='avatarFields'} | |
101 | </fieldset> | |
102 | ||
103 | {event name='fieldsets'} | |
104 | </div> | |
105 | ||
106 | {if !$__wcf->user->disableAvatar} | |
107 | <div class="formSubmit"> | |
108 | <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" /> | |
a6e379b4 | 109 | {@SECURITY_TOKEN_INPUT_TAG} |
320f4a6d MW |
110 | </div> |
111 | {/if} | |
112 | </form> | |
113 | ||
114 | {include file='footer'} | |
115 | ||
9543d9fe | 116 | <script data-relocate="true"> |
320f4a6d MW |
117 | //<![CDATA[ |
118 | $(function() { | |
119 | WCF.Language.addObject({ | |
120 | 'wcf.user.avatar.type.custom.crop': '{lang}wcf.user.avatar.type.custom.crop{/lang}', | |
121 | 'wcf.user.avatar.upload.error.invalidExtension': '{lang}wcf.user.avatar.upload.error.invalidExtension{/lang}', | |
122 | 'wcf.user.avatar.upload.error.tooSmall': '{lang}wcf.user.avatar.upload.error.tooSmall{/lang}', | |
123 | 'wcf.user.avatar.upload.error.tooLarge': '{lang}wcf.user.avatar.upload.error.tooLarge{/lang}', | |
124 | 'wcf.user.avatar.upload.error.uploadFailed': '{lang}wcf.user.avatar.upload.error.uploadFailed{/lang}', | |
125 | 'wcf.user.avatar.upload.error.badImage': '{lang}wcf.user.avatar.upload.error.badImage{/lang}', | |
126 | 'wcf.user.avatar.upload.success': '{lang}wcf.user.avatar.upload.success{/lang}', | |
127 | 'wcf.global.button.upload': '{lang}wcf.global.button.upload{/lang}' | |
128 | }); | |
129 | ||
130 | {if !$__wcf->user->disableAvatar} | |
131 | {if $__wcf->getUserProfileHandler()->getAvatar()->canCrop()} | |
132 | new WCF.User.Avatar.Upload(0, new WCF.User.Avatar.Crop({@$__wcf->getUserProfileHandler()->getAvatar()->avatarID})); | |
133 | {else} | |
134 | new WCF.User.Avatar.Upload(); | |
135 | {/if} | |
136 | {/if} | |
137 | }); | |
138 | //]]> | |
139 | </script> | |
140 | ||
141 | </body> | |
142 | </html> |