Skip to content

Commit

Permalink
Merge pull request #74 from Pear-Trading/Release-v0.9.6
Browse files Browse the repository at this point in the history
Release v0.9.6
  • Loading branch information
TBSliver authored Nov 21, 2017
2 parents 18d2237 + d4ad360 commit 6309d44
Show file tree
Hide file tree
Showing 82 changed files with 12,222 additions and 96 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

# Next Release

# v0.9.6

* **Admin Feature** Merged organisation lists into one list
* **Admin Feature** Paginated Organisation listings
* **Admin Feature** Added flags to Organisations listings
* **Admin Feature** Added `is_local` flag to Organisations to start categorising odd stores
* **Admin Feature** Feedback items now word wrap
* **Admin Feature** Rework transaction viewing
* **Admin Feature** Implemented import method for importing previous data from csv
* **Admin Feature** Added badges for various organisation flags eg. local, user, validated
* **Admin Feature** Enabled merging of organisations to reduce duplicates
* **Admin Feature** Added badges to user listing to show whether customer or organisation
* **Admin Feature** Added pagination to user listings
* Improved logging for debugging issues with login

# v0.9.5

* Added leaderboard api for web-app with pagination
Expand Down
2 changes: 2 additions & 0 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ requires 'Module::Runtime';
requires 'DBIx::Class::DeploymentHandler';
requires 'DBIx::Class::Fixtures';
requires 'GIS::Distance';
requires 'Text::CSV';
requires 'Try::Tiny';

feature 'schema-graph', 'Draw diagrams of Schema' => sub {
requires 'GraphViz';
Expand Down
14 changes: 14 additions & 0 deletions lib/Pear/LocalLoop.pm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ sub startup {
$self->plugin('Pear::LocalLoop::Plugin::BootstrapPagination', { bootstrap4 => 1 } );
$self->plugin('Pear::LocalLoop::Plugin::Validators');
$self->plugin('Pear::LocalLoop::Plugin::Datetime');
$self->plugin('Pear::LocalLoop::Plugin::Currency');
$self->plugin('Pear::LocalLoop::Plugin::Postcodes');
$self->plugin('Pear::LocalLoop::Plugin::TemplateHelpers');

Expand Down Expand Up @@ -189,9 +190,13 @@ sub startup {
$admin_routes->post('/organisations/add')->to('admin-organisations#add_org_submit');
$admin_routes->get('/organisations/:id')->to('admin-organisations#valid_read');
$admin_routes->post('/organisations/:id')->to('admin-organisations#valid_edit');
$admin_routes->get('/organisations/:id/merge')->to('admin-organisations#merge_list');
$admin_routes->get('/organisations/:id/merge/:target_id')->to('admin-organisations#merge_detail');
$admin_routes->post('/organisations/:id/merge/:target_id')->to('admin-organisations#merge_confirm');

$admin_routes->get('/feedback')->to('admin-feedback#index');
$admin_routes->get('/feedback/:id')->to('admin-feedback#read');
$admin_routes->get('/feedback/:id/actioned')->to('admin-feedback#actioned');

$admin_routes->get('/transactions')->to('admin-transactions#index');
$admin_routes->get('/transactions/:id')->to('admin-transactions#read');
Expand All @@ -200,6 +205,15 @@ sub startup {

$admin_routes->get('/reports/transactions')->to('admin-reports#transaction_data');

$admin_routes->get('/import')->to('admin-import#index');
$admin_routes->get('/import/add')->to('admin-import#get_add');
$admin_routes->post('/import/add')->to('admin-import#post_add');
$admin_routes->get('/import/:set_id')->to('admin-import#list');
$admin_routes->get('/import/:set_id/user')->to('admin-import#get_user');
$admin_routes->get('/import/:set_id/org')->to('admin-import#get_org');

$admin_routes->get('/import/:set_id/ignore/:value_id')->to('admin-import#ignore_value');
$admin_routes->get('/import/:set_id/import')->to('admin-import#run_import');
# my $user_routes = $r->under('/')->to('root#under');

# $user_routes->get('/home')->to('root#home');
Expand Down
9 changes: 9 additions & 0 deletions lib/Pear/LocalLoop/Controller/Admin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -26,15 +28,22 @@ sub home {
},
pending_orgs => $pending_orgs_rs->count,
pending_trans => $pending_transaction_rs->count,
feedback => {
total => $feedback_rs->count,
pending => $pending_feedback_rs->count,
},
);
}

sub auth_login {
my $c = shift;

$c->app->log->debug( __PACKAGE__ . " admin login attempt for [" . $c->param('email') . "]" );

if ( $c->authenticate($c->param('email'), $c->param('password')) ) {
$c->redirect_to('/admin/home');
} else {
$c->app->log->info( __PACKAGE__ . " failed admin login for [" . $c->param('email') . "]" );
$c->redirect_to('/admin');
}
}
Expand Down
15 changes: 15 additions & 0 deletions lib/Pear/LocalLoop/Controller/Admin/Feedback.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Loading

0 comments on commit 6309d44

Please sign in to comment.