Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion api/src/Page/DC.php
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ function _dc_strategies($id)
global $strat_align;

$rows = $this->db->pq("SELECT s.programversion, s.comments,
st.rankingresolution as rankres,
st.rankingresolution as rankres, sssw.dosetotal, st.screeningstrategyid,
ssw.wedgenumber, ssw.chi, ssw.kappa, ssw.phi, ssw.comments as sswcomments,
sssw.subwedgenumber, sssw.axisstart as st, sssw.exposuretime as time, sssw.transmission as tran,
sssw.oscillationrange as oscran, sssw.resolution as res, sssw.numberofimages as nimg, sssw.rotationaxis,
Expand Down Expand Up @@ -1199,6 +1199,7 @@ function _dc_strategies($id)
$output[$t] = array('CELL' => array(), 'STRATS' => array());

$r['ATRAN'] = $r['TRAN'] / 100.0 * $r['DCTRN'];
$r['ROTATION'] = $r['NIMG'] * $r['OSCRAN'];
foreach ($nf as $nff => $cols) {
foreach ($cols as $c) {
$r[$c] = number_format($r[$c], $nff);
Expand Down
5 changes: 5 additions & 0 deletions client/src/css/partials/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,11 @@ li:last-child .visit_users {
table {
tr {
cursor: pointer;

&.highlight {
background-color: #f7f7f7;
}

&:hover {
background: $content-sub-hover-background;
}
Expand Down
31 changes: 24 additions & 7 deletions client/src/js/templates/dc/dc_strategy.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ <h2><%-TYPE%></h2>
var showRankingRes = _.some(STRATS, function(r) {
return r.RANKRES && parseFloat(r.RANKRES) !== 0
})
var showExposure = _.some(STRATS, function(r) {
return r.TIME && parseFloat(r.TIME) !== 0
})
var showDose = _.some(STRATS, function(r) {
return r.DOSETOTAL && parseFloat(r.DOSETOTAL) !== 0
})

var displayAxis = "Axis"
if (STRATS && STRATS.length > 0 && STRATS[0].ROTATIONAXIS) {
Expand Down Expand Up @@ -66,15 +72,25 @@ <h2><%-TYPE%></h2>
<% if (showKappa) { %> <th>Kappa (°)</th> <% } %>
<th>Res (&#197;)</th>
<% if (showRankingRes) { %> <th>Ranking Res (&#197;)</th> <% } %>
<th>Rel Trn (%)</th>
<th>Abs Trn (%)</th>
<th>Exposure (s)</th>
<th><% if (showDose) { %> Max <% } %>Transmission (%)</th>
<% if (showExposure) { %> <th>Exposure (s)</th> <% } %>
<th>No. Images</th>
<th>Total Rotation (°)</th>
<% if (showDose) { %> <th>Dose (MGy)</th> <% } %>
</tr>
</thead>

<% _.each(STRATS, function(r, i) { %>
<tr class="stratrow" draggable="true" sid="<%-i%>">
<%
var highlight = true;
var lastId = null;

_.each(STRATS, function(r, i) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we rewrite this with map or a native function? Just so we don't add any more things using underscore and make updating it harder

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good idea.

if (r.SCREENINGSTRATEGYID !== lastId) {
highlight = !highlight;
lastId = r.SCREENINGSTRATEGYID;
}
%>
<tr class="stratrow <%= highlight ? 'highlight' : '' %>" draggable="true" sid="<%-i%>">
<td><%-r.COM%></td>
<td><%-r.COMMENTS%></td>
<td><%-r.ST%></td>
Expand All @@ -84,10 +100,11 @@ <h2><%-TYPE%></h2>
<% if (showKappa) { %> <td><%-r.KAPPA%></td> <% } %>
<td><%-r.RES%></td>
<% if (showRankingRes) { %> <td><%-r.RANKRES%></td> <% } %>
<td><%-r.TRAN%></td>
<td><%-r.ATRAN%></td>
<td><%-r.TIME%></td>
<% if (showExposure) { %> <td><%-r.TIME%></td> <% } %>
<td><%-r.NIMG%></td>
<td><%-r.ROTATION%></td>
<% if (showDose) { %> <td><%-r.DOSETOTAL%></td> <% } %>
</tr>
<% }) %>
</table>
Expand Down
Loading