Permalink
Browse files

Fixed more references to profile, added token comment search for tran…

…slation managers
  • Loading branch information...
1 parent 12ca643 commit bd8eb378ea22bb91f69c38afc054712038cd59fa @Getty Getty committed Dec 25, 2012
@@ -120,6 +120,15 @@ sub domain :Chained('logged_in') :PathPart('') :CaptureArgs(1) {
sub admin :Chained('domain') :Args(0) {
my ( $self, $c ) = @_;
+
+ if ($c->req->params->{search_token_comments}) {
+ $c->stash->{search_token_comments_result} = $c->stash->{token_domain}->tokens->search({
+ notes => { -like => '%'.$c->req->params->{search_token_comments}.'%' },
+ },{
+ group_by => 'notes',
+ });
+ }
+
$c->pager_init($c->action.$c->stash->{token_domain}->id,20);
$c->stash->{latest_comments} = $c->stash->{token_domain}->comments($c->stash->{page},$c->stash->{pagesize});
$c->add_bc('Token management', '');
View
@@ -158,9 +158,9 @@
<tr>
<td>
<@ IF c.user.public @>
- <@ l('Your %s is publicly visible','<a href="'_ u('Profile','home',c.user.username) _'">' _ l('profile') _ '</a>') @>
+ <@ l('Your %s is publicly visible','<a href="'_ u('Userpage','home',c.user.username) _'">' _ l('account') _ '</a>') @>
<@ ELSE @>
- <@ l('Your profile is not publicly visible yet') @>
+ <@ l('Your account is not publicly visible yet') @>
<@ END @>
</td>
<td class="account-table_BTNS">
View
@@ -2,9 +2,9 @@
<fieldset>
<@ IF c.user.public @>
- <h4><@ l('Make your profile private') @></h4>
+ <h4><@ l('Make your account private') @></h4>
<@ ELSE @>
- <h4><@ l('Make your profile public') @></h4>
+ <h4><@ l('Make your account public') @></h4>
<@ END @>
<@ IF wrong_captcha @>
@@ -1,9 +1,30 @@
-<h1>Latest comments over all languages</h2>
+<form action="<@ u('Translate','admin',token_domain.key) @>" method="post" id="formSearchTokenCOmments">
+<@ IF search_token_comments_result @>
+<h1>Token comments search results</h1>
+<div class="box" style="padding:5px">
+ <input type="text" name="search_token_comments" value="<@ search_token_comments @>"/>
+ <input type="submit" />
+</div>
+<@ FOR token IN search_token_comments_result.all @>
+ <div class="box" style="padding:5px">
+ <@ token.notes | html @>
+ </div>
+<@ END @>
+<h2><a href="<@ u('Translate','admin',token_domain.key) @>">Back to translation management</a></h2>
+<@ ELSE @>
+<h2>Search through token comments</h2>
+<div class="box" style="padding:5px">
+ <input type="text" name="search_token_comments" />
+ <input type="submit" />
+</div>
+<h2>Latest comments over all languages</h2>
<@ FOR comment IN latest_comments.all @>
<img src="<@ comment.get_context_obj.token_domain_language.language.flag_url @>" />
<@ comment.get_context_obj.token_domain_language.language.name_in_english @>
<@ INCLUDE comment/teaser.tt @>
<@ END @>
<div class="box" style="text-align:center">
<@ INCLUDE pager.tt pager=latest_comments.pager url=u('Translate','admin',token_domain.key,{ page => 'PAGE_NO' }) @>
-</div>
+</div>
+<@ END @>
+</form>
@@ -1,7 +1,7 @@
<@ IF user @>
<@ INCLUDE user/userpic.tt userpic_size=userpic_size || 16 @>
<@ IF user.public @>
- <a href="<@ u('Profile','home',user.username) @>">
+ <a href="<@ u('Userpage','home',user.username) @>">
<@ END @>
<@ IF user.admin @><span style="color:green"><@ END @>
<@ IF c.user && c.user.admin @>
View
@@ -2,7 +2,7 @@
<div id="logreg" style="width:170px"<@ IF c.user @> class="user"<@ END @>>
<@ IF c.user @>
<@ IF c.user.public @>
- <a class="profile" href="<@ u('Profile','home',c.user.username) @>">
+ <a class="userpage" href="<@ u('Userpage','home',c.user.username) @>">
<@ END @>
<img src="<@ IF c.user.profile_picture @><@ c.user.profile_picture(48) @><@ ELSE @>/static/images/profile.male.png<@ END @>" width="48" height="48" alt="profile image" style="float:left; margin-right:15px">
<strong><@ c.user.username @></strong>

0 comments on commit bd8eb37

Please sign in to comment.