esta added to schema and updated admin interface

This commit is contained in:
Finn 2017-12-08 12:30:49 +00:00
parent 95398d2790
commit af7dcde7aa
4 changed files with 22 additions and 2 deletions

View file

@ -2,6 +2,9 @@
# Next Release # Next Release
* **Admin Feature** Improved links in relevant places to automatically open in
a new tab
# v0.9.7 # v0.9.7
* **Admin Fix**: Fix error in Importing under Postgres * **Admin Fix**: Fix error in Importing under Postgres

View file

@ -88,6 +88,7 @@ sub valid_read {
my $associations = $valid_org->entity->associations; my $associations = $valid_org->entity->associations;
my $assoc = { my $assoc = {
lis => defined $associations ? $associations->lis : 0, lis => defined $associations ? $associations->lis : 0,
esta => defined $associations ? $associations->esta : 0,
}; };
$c->stash( $c->stash(
@ -109,6 +110,7 @@ sub valid_edit {
$validation->optional('pending'); $validation->optional('pending');
$validation->optional('is_local'); $validation->optional('is_local');
$validation->optional('is_lis'); $validation->optional('is_lis');
$validation->optional('is_esta');
if ( $validation->has_error ) { if ( $validation->has_error ) {
$c->flash( error => 'The validation has failed' ); $c->flash( error => 'The validation has failed' );
@ -130,6 +132,7 @@ sub valid_edit {
}); });
$valid_org->entity->update_or_create_related( 'associations', { $valid_org->entity->update_or_create_related( 'associations', {
lis => $validation->param('is_lis'), lis => $validation->param('is_lis'),
esta => $validation->param('is_esta')
}); });
} ); } );
} finally { } finally {

View file

@ -23,6 +23,11 @@ __PACKAGE__->add_columns(
default => undef, default => undef,
is_nullable => 1, is_nullable => 1,
}, },
"esta" => {
data_type => 'boolean',
default => undef,
is_nullable => 1,
},
); );
__PACKAGE__->set_primary_key("id"); __PACKAGE__->set_primary_key("id");

View file

@ -103,8 +103,17 @@ function initMap() {
<label for="lis" class="col-md-4 col-form-label">Part of LIS</label> <label for="lis" class="col-md-4 col-form-label">Part of LIS</label>
<div class="col-md-8"> <div class="col-md-8">
<select id="lis" class="form-control" name="is_lis"> <select id="lis" class="form-control" name="is_lis">
<option value="0"<%= !$associations->{lis} ? '' : ' selected' %>>Not In Story</option> <option value="0"<%= !$associations->{lis} ? '' : ' selected' %>>Not In Association</option>
<option value="1"<%= $associations->{lis} ? ' selected' : '' %>>In Story</option> <option value="1"<%= $associations->{lis} ? ' selected' : '' %>>In Association</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="lis" class="col-md-4 col-form-label">Part of Esta</label>
<div class="col-md-8">
<select id="lis" class="form-control" name="is_esta">
<option value="0"<%= !$associations->{esta} ? '' : ' selected' %>>Not In Association</option>
<option value="1"<%= $associations->{esta} ? ' selected' : '' %>>In Association</option>
</select> </select>
</div> </div>
</div> </div>