Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Commit

Permalink
show all
Browse files Browse the repository at this point in the history
  • Loading branch information
risufaj committed Sep 18, 2018
1 parent caec1c1 commit faf3199
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions pooling/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ def download_benchtop_protocol(self, request):
response = HttpResponse(content_type='application/ms-excel')
libraries = json.loads(request.data.get('libraries', '[]'))
samples = json.loads(request.data.get('samples', '[]'))
bp = json.loads(request.data.get('bp','[]'))

pool_id = request.POST.get('pool_id', '')
pool = Pool.objects.get(pk=pool_id)

Expand Down Expand Up @@ -245,14 +247,15 @@ def download_benchtop_protocol(self, request):
ws.write(row_num, i, column, font_style_bold)
ws.col(i).width = 7000 # Set column width

for record in records:
for index,record in enumerate(records):
row_num += 1
row_idx = str(row_num + 1)
req = record.request.get()

if isinstance(record, Library):
concentration = record.concentration_facility
mean_fragment_size = record.mean_fragment_size
#mean_fragment_size = record.mean_fragment_size
mean_fragment_size = bp[index]
else:
concentration = record.librarypreparation.concentration_library
mean_fragment_size = \
Expand Down
8 changes: 6 additions & 2 deletions static/main-hub/app/view/pooling/PoolingController.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Ext.define('MainHub.view.pooling.PoolingController', {
var libraries = selectedRecords.filter(function (item) {
return item.record_type === 'Library';
});

var samples = selectedRecords.filter(function (item) {
return item.record_type === 'Sample';
});
Expand All @@ -174,9 +175,11 @@ Ext.define('MainHub.view.pooling.PoolingController', {
params: {
pool_id: selectedRecords[0].pool,
samples: Ext.JSON.encode(Ext.Array.pluck(samples, 'pk')),
libraries: Ext.JSON.encode(Ext.Array.pluck(libraries, 'pk'))
libraries: Ext.JSON.encode(Ext.Array.pluck(libraries, 'pk')),
bp: Ext.JSON.encode(Ext.Array.pluck(libraries,'bp'))
}
});

},

downloadPoolingTemplate: function (btn) {
Expand Down Expand Up @@ -220,7 +223,8 @@ Ext.define('MainHub.view.pooling.PoolingController', {
records.push({
pk: item.get('pk'),
record_type: item.get('record_type'),
pool: item.get('pool')
pool: item.get('pool'),
bp: item.get('mean_fragment_size')
});
}
});
Expand Down

0 comments on commit faf3199

Please sign in to comment.