Implemented an extended user profile based on a patch from Jethro Carr (issue 510).
Changes with respect to the original patch: - use Gconf instead of separate table / data scheme - better form validation for URLs and emails - no htmlentity-encoded contents in the database (pluf automatically safe-encodes stuff before it writes out contents into templates) - add visual separators in the form views to have a distinct view of basic (important) data and other data which are only displayed in the public profile - give a hint about the maximum display size of 60x60 px^2 and use max-width and max-height in the templates to avoid nasty distortions by the browser - use target=_blank and rel=nofollow on the twitter and website links in the profile - some whitespace / formatting / code style fixes
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<form method="post" action=".">
|
||||
<form method="post" enctype="multipart/form-data" action=".">
|
||||
<table class="form" summary="">
|
||||
<tr>
|
||||
<th>{trans 'Login:'}</th>{aurl 'url', 'IDF_Views_User::view', array($cuser.login)}
|
||||
@@ -51,7 +51,48 @@
|
||||
<td>{if $form.f.password2.errors}{$form.f.password2.fieldErrors}{/if}
|
||||
{$form.f.password2|unsafe}
|
||||
</td>
|
||||
</tr>{if $user.administrator}
|
||||
</tr>
|
||||
<tr><td colspan="2" class="separator">{trans "Public Profile"}</td></tr>
|
||||
<tr>
|
||||
<th>{$form.f.description.labelTag}:</th>
|
||||
<td>{if $form.f.description.errors}{$form.f.description.fieldErrors}{/if}
|
||||
{$form.f.description|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.twitter.labelTag}:</th>
|
||||
<td>{if $form.f.twitter.errors}{$form.f.twitter.fieldErrors}{/if}
|
||||
{$form.f.twitter|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.public_email.labelTag}:</th>
|
||||
<td>{if $form.f.public_email.errors}{$form.f.public_email.fieldErrors}{/if}
|
||||
{$form.f.public_email|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.website.labelTag}:</th>
|
||||
<td>{if $form.f.website.errors}{$form.f.website.fieldErrors}{/if}
|
||||
{$form.f.website|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.custom_avatar.labelTag}:</th>
|
||||
<td>{if $form.f.custom_avatar.errors}{$form.f.custom_avatar.fieldErrors}{/if}
|
||||
{$form.f.custom_avatar|unsafe}<br />
|
||||
<span class="helptext">{$form.f.custom_avatar.help_text}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{if $form.f.remove_custom_avatar.errors}{$form.f.remove_custom_avatar.fieldErrors}{/if}
|
||||
{$form.f.remove_custom_avatar|unsafe}
|
||||
</th>
|
||||
<td>{$form.f.remove_custom_avatar.labelTag}<br />
|
||||
<span class="helptext">{$form.f.remove_custom_avatar.help_text}</span></td>
|
||||
</tr>
|
||||
{if $user.administrator}
|
||||
<tr><td colspan="2" class="separator">{trans "Administrative"}</td></tr>
|
||||
<tr>
|
||||
<th>{if $form.f.staff.errors}{$form.f.staff.fieldErrors}{/if}
|
||||
{$form.f.staff|unsafe}
|
||||
@@ -69,7 +110,7 @@
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="submit" value="{trans 'Update User'}" name="submit" />
|
||||
<input type="submit" value="{trans 'Update User'}" name="submit" />
|
||||
| <a href="{url 'IDF_Views_Admin::users'}">{trans 'Cancel'}</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
@@ -3,8 +3,15 @@
|
||||
{block body}
|
||||
{assign $i = 0}
|
||||
{assign $nc = $comments.count()}
|
||||
{foreach $comments as $c}{ashowuser 'submitter', $c.get_submitter(), $request}{assign $who = $c.get_submitter()}
|
||||
<div class="issue-comment{if $i == 0} issue-comment-first{/if}{if $i == ($nc-1)} issue-comment-last{/if}" id="ic{$c.id}"><img style="float:right; position: relative;" src="http://www.gravatar.com/avatar/{$who.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt=" " />
|
||||
{foreach $comments as $c}{ashowuser 'submitter', $c.get_submitter(), $request}
|
||||
{assign $submitter = $c.get_submitter()}
|
||||
{assign $submitter_data = $c.get_submitter_data()}
|
||||
<div class="issue-comment{if $i == 0} issue-comment-first{/if}{if $i == ($nc-1)} issue-comment-last{/if}" id="ic{$c.id}">
|
||||
{if $submitter_data.avatar != ''}
|
||||
<img style="float:right; position: relative; max-height: 60px; max-width: 60px;" src="{media}/upload/avatars/{$submitter_data.avatar}" alt=" " />
|
||||
{else}
|
||||
<img style="float:right; position: relative; max-height: 60px; max-width: 60px;" src="http://www.gravatar.com/avatar/{$submitter.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt=" " />
|
||||
{/if}
|
||||
{if $i == 0}
|
||||
<p>{blocktrans}Reported by {$submitter}, {$c.creation_dtime|date}{/blocktrans}</p>
|
||||
{else}
|
||||
|
@@ -79,9 +79,9 @@ to propose more contributions</strong>.
|
||||
</tbody>
|
||||
</table>
|
||||
{assign $fcomments = $def[2]}
|
||||
{assign $nc = $fcomments.count()}
|
||||
{assign $nc = $fcomments.count()}
|
||||
{assign $i = 1}
|
||||
{foreach $fcomments as $c}
|
||||
{foreach $fcomments as $c}
|
||||
<div class="issue-comment{if $i == 1} issue-comment-first{/if}{if $i == $nc} issue-comment-last{/if}" id="ic{$c.id}">{assign $who = $c.get_comment().get_submitter()}{aurl 'whourl', 'IDF_Views_User::view', array($who.login)}
|
||||
{aurl 'url', 'IDF_Views_Review::view', array($project.shortname, $review.id)}
|
||||
{assign $id = $c.id}
|
||||
@@ -101,13 +101,18 @@ to propose more contributions</strong>.
|
||||
</tr></table>{/if}
|
||||
{/foreach}
|
||||
|
||||
{assign $i = 1}
|
||||
{assign $nc = $comments.count()}
|
||||
{assign $i = 1}
|
||||
{assign $nc = $comments.count()}
|
||||
{if $nc}<hr align="left" class="attach" />
|
||||
<h2>{trans 'General Comments'}</h2>
|
||||
{/if}
|
||||
{foreach $comments as $c}{ashowuser 'submitter', $c.get_submitter(), $request}{assign $who = $c.get_submitter()}
|
||||
<div class="issue-comment{if $i == 1} issue-comment-first{/if}{if $i == ($nc)} issue-comment-last{/if}" id="ic{$c.id}"><img style="float:right; position: relative;" src="http://www.gravatar.com/avatar/{$who.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt=" " />
|
||||
{foreach $comments as $c}{ashowuser 'submitter', $c.get_submitter(), $request}{assign $submitter = $c.get_submitter()}{assign $submitter_data = $c.get_submitter_data()}
|
||||
<div class="issue-comment{if $i == 1} issue-comment-first{/if}{if $i == ($nc)} issue-comment-last{/if}" id="ic{$c.id}">
|
||||
{if $submitter_data.avatar != ''}
|
||||
<img style="float:right; position: relative; max-height: 60px; max-width: 60px;" src="{media}/upload/avatars/{$submitter_data.avatar}" alt=" " />
|
||||
{else}
|
||||
<img style="float:right; position: relative;" src="http://www.gravatar.com/avatar/{$submitter.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt=" " />
|
||||
{/if}
|
||||
{aurl 'url', 'IDF_Views_Review::view', array($project.shortname, $review.id)}
|
||||
{assign $id = $c.id}
|
||||
{assign $url = $url~'#ic'~$c.id}
|
||||
@@ -118,11 +123,11 @@ to propose more contributions</strong>.
|
||||
{if strlen($c.content) > 0}<pre class="issue-comment-text">{issuetext $c.content, $request}</pre>{/if}
|
||||
|
||||
{if $c.changedReview()}
|
||||
<div class="issue-changes">
|
||||
<div class="issue-changes">
|
||||
{foreach $c.changes as $w => $v}
|
||||
<strong>{if $w == 'su'}{trans 'Summary:'}{/if}{if $w == 'st'}{trans 'Status:'}{/if}</strong> {$v}<br />
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>{assign $i = $i + 1}{if $i == $nc+1 and $user.isAnonymous()}
|
||||
<div class="issue-comment-signin">
|
||||
|
@@ -9,7 +9,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<form method="post" action=".">
|
||||
<form method="post" enctype="multipart/form-data" action=".">
|
||||
<table class="form" summary="">
|
||||
<tr>
|
||||
<th>{trans 'Login:'}</th>{aurl 'url', 'IDF_Views_User::view', array($user.login)}
|
||||
@@ -53,6 +53,46 @@
|
||||
{$form.f.password2|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" class="separator">{trans "Public Profile"}</td></tr>
|
||||
<tr>
|
||||
<th>{$form.f.description.labelTag}:</th>
|
||||
<td>{if $form.f.description.errors}{$form.f.description.fieldErrors}{/if}
|
||||
{$form.f.description|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.twitter.labelTag}:</th>
|
||||
<td>{if $form.f.twitter.errors}{$form.f.twitter.fieldErrors}{/if}
|
||||
{$form.f.twitter|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.public_email.labelTag}:</th>
|
||||
<td>{if $form.f.public_email.errors}{$form.f.public_email.fieldErrors}{/if}
|
||||
{$form.f.public_email|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.website.labelTag}:</th>
|
||||
<td>{if $form.f.website.errors}{$form.f.website.fieldErrors}{/if}
|
||||
{$form.f.website|unsafe}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$form.f.custom_avatar.labelTag}:</th>
|
||||
<td>{if $form.f.custom_avatar.errors}{$form.f.custom_avatar.fieldErrors}{/if}
|
||||
{$form.f.custom_avatar|unsafe}<br />
|
||||
<span class="helptext">{$form.f.custom_avatar.help_text}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{if $form.f.remove_custom_avatar.errors}{$form.f.remove_custom_avatar.fieldErrors}{/if}
|
||||
{$form.f.remove_custom_avatar|unsafe}
|
||||
</th>
|
||||
<td>{$form.f.remove_custom_avatar.labelTag}<br />
|
||||
<span class="helptext">{$form.f.remove_custom_avatar.help_text}</span></td>
|
||||
</tr>
|
||||
<tr><td colspan="2" class="separator">{trans "Key Management"}</td></tr>
|
||||
<tr>
|
||||
<th>{$form.f.public_key.labelTag}:</th>
|
||||
<td>{if $form.f.public_key.errors}{$form.f.public_key.fieldErrors}{/if}
|
||||
|
@@ -2,9 +2,39 @@
|
||||
{block body}
|
||||
<table class="form" summary="">
|
||||
<tr>
|
||||
<th></th>
|
||||
<th style="text-align: right">{if $user_data.avatar != ''}
|
||||
<img style="max-height: 60px; max-width: 60px;" src="{media}/upload/avatars/{$user_data.avatar}" alt=" " />
|
||||
{else}
|
||||
<img src="http://www.gravatar.com/avatar/{$member.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt=" " />
|
||||
{/if}
|
||||
</th>
|
||||
<td>{$member}</td>
|
||||
</tr>
|
||||
{if $user_data.description != ''}
|
||||
<tr>
|
||||
<th>{trans 'Description:'}</th>
|
||||
<td>{$user_data.description}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $user_data.twitter != ''}
|
||||
<tr>
|
||||
<th>{trans 'Twitter:'}</th>
|
||||
<td><a rel="nofollow" target="_blank" href='http://twitter.com/{$user_data.twitter}'>{$user_data.twitter}</a></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $user_data.public_email != ''}
|
||||
<tr>
|
||||
<th>{trans 'Public Email:'}</th>
|
||||
<td><a href='mailto:{$user_data.public_email}'>{$user_data.public_email}</a></td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $user_data.website != ''}
|
||||
<tr>
|
||||
<th>{trans 'Website:'}</th>
|
||||
<td><a rel="nofollow" target="_blank" href='{$user_data.website}'>{$user_data.website}</a></td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr>
|
||||
<th>{trans 'Last time seen:'}</th>
|
||||
<td>{$member.last_login|dateago}</td>
|
||||
|
Reference in New Issue
Block a user