Added toggling of actioned on feedback, and view change for lists
This commit is contained in:
parent
0302a3d299
commit
de90fe1f77
6 changed files with 50 additions and 5 deletions
|
@ -18,6 +18,8 @@ sub home {
|
|||
my $token_rs = $c->schema->resultset('AccountToken');
|
||||
my $pending_orgs_rs = $c->schema->resultset('Organisation')->search({ pending => 1 });
|
||||
my $pending_transaction_rs = $pending_orgs_rs->entity->sales;
|
||||
my $feedback_rs = $c->schema->resultset('Feedback');
|
||||
my $pending_feedback_rs = $feedback_rs->search({ actioned => 0 });
|
||||
$c->stash(
|
||||
user_count => $user_rs->count,
|
||||
tokens => {
|
||||
|
@ -26,6 +28,10 @@ sub home {
|
|||
},
|
||||
pending_orgs => $pending_orgs_rs->count,
|
||||
pending_trans => $pending_transaction_rs->count,
|
||||
feedback => {
|
||||
total => $feedback_rs->count,
|
||||
pending => $pending_feedback_rs->count,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,4 +33,19 @@ sub read {
|
|||
}
|
||||
}
|
||||
|
||||
sub actioned {
|
||||
my $c = shift;
|
||||
|
||||
my $id = $c->param('id');
|
||||
|
||||
if ( my $feedback = $c->result_set->find($id) ) {
|
||||
$feedback->actioned( ! $feedback->actioned );
|
||||
$feedback->update;
|
||||
$c->redirect_to( '/admin/feedback/' . $id );
|
||||
} else {
|
||||
$c->flash( error => 'No Feedback found' );
|
||||
$c->redirect_to( '/admin/feedback' );
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Reference in a new issue