Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #183 from jbarrett/IA-filtering
Browse files Browse the repository at this point in the history
Filter ideas view in similar fashion to threads.
  • Loading branch information
jbarrett committed Jul 21, 2014
2 parents 3f1e1c9 + ce3bb23 commit e3fa6c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/DDGC/DB/Result/Idea.pm
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ before insert => sub {
unless ($self->key) {
$self->key($self->get_url);
}
if ($self->user->ignore) {
$self->checked(32532); # Checked is a UID, this is johnthespamkiller
}
};

sub set_user_vote {
Expand Down
3 changes: 3 additions & 0 deletions lib/DDGC/DB/Result/Thread.pm
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ before insert => sub {
unless ($self->key) {
$self->key($self->get_url);
}
if ($self->user->ignore) {
$self->checked(32532); # Checked is a UID, this is johnthespamkiller
}
};

after insert => sub {
Expand Down
7 changes: 7 additions & 0 deletions lib/DDGC/Web/Controller/Ideas.pm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ sub idea_id : Chained('base') PathPart('idea') CaptureArgs(1) {
$c->response->redirect($c->chained_uri('Ideas','index',{ idea_notfound => 1 }));
return $c->detach;
}

if ($c->stash->{idea}->ghosted && $c->stash->{idea}->checked &&
(!$c->user || (!$c->user->admin && $c->stash->{idea}->users_id != $c->user->id))) {
$c->response->redirect($c->chained_uri('Ideas','index',{ idea_notfound => 1 }));
}


$c->add_bc($c->stash->{idea}->title,$c->chained_uri(@{$c->stash->{idea}->u}));
$self->add_latest_ideas($c);
}
Expand Down

0 comments on commit e3fa6c4

Please sign in to comment.