Skip to content

Commit

Permalink
Merge pull request #63 from biocore/st_dh_cool_results_page
Browse files Browse the repository at this point in the history
WIP: Cool Results Page
  • Loading branch information
wasade authored Mar 2, 2021
2 parents 55fd127 + 0ec6f76 commit c5780d3
Show file tree
Hide file tree
Showing 99 changed files with 51,612 additions and 24 deletions.
28 changes: 28 additions & 0 deletions microsetta_interface/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,34 @@ def get_sample_results(*, account_id=None, source_id=None, sample_id=None):
)


@prerequisite([SOURCE_PREREQS_MET])
def get_sample_results_experimental(*, account_id=None, source_id=None,
sample_id=None):
has_error, source_output, _ = ApiRequest.get(
'/accounts/%s/sources/%s' %
(account_id, source_id)
)
if has_error:
return source_output

has_error, sample_output, _ = ApiRequest.get(
'/accounts/%s/sources/%s/samples/%s' %
(account_id, source_id, sample_id))
if has_error:
return sample_output

return _render_with_defaults('new_results_page.jinja2',
account_id=account_id,
source_id=source_id,
sample=sample_output,
source_name=source_output['source_name'],
taxonomy=SERVER_CONFIG["taxonomy_resource"],
alpha_metric=SERVER_CONFIG["alpha_metric"],
beta_metric=SERVER_CONFIG["beta_metric"],
barcode_prefix=SERVER_CONFIG["barcode_prefix"]
)


# Note: ideally this would be represented as a DELETE, not as a POST
# However, it is used as a form submission action, and HTML forms do not
# support delete as an action
Expand Down
17 changes: 17 additions & 0 deletions microsetta_interface/routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,23 @@ paths:
schema:
type: string

'/accounts/{account_id}/sources/{source_id}/samples/{sample_id}/results-experimental':
get:
operationId: microsetta_interface.implementation.get_sample_results_experimental
tags:
- Sample
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/source_id'
- $ref: '#/components/parameters/sample_id'
responses:
'200':
description: Display of sample results
content:
text/html:
schema:
type: string

# Note: ideally this would be represented as a DELETE, not as a POST
# However, it is used as a form submission action, and HTML forms do not support
# delete as an action
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
@keyframes dtb-spinner {
100% {
transform: rotate(360deg);
}
}
@-o-keyframes dtb-spinner {
100% {
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-ms-keyframes dtb-spinner {
100% {
-ms-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-webkit-keyframes dtb-spinner {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@-moz-keyframes dtb-spinner {
100% {
-moz-transform: rotate(360deg);
transform: rotate(360deg);
}
}
div.dt-button-info {
position: fixed;
top: 50%;
left: 50%;
width: 400px;
margin-top: -100px;
margin-left: -200px;
background-color: white;
border: 2px solid #111;
box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
border-radius: 3px;
text-align: center;
z-index: 21;
}
div.dt-button-info h2 {
padding: 0.5em;
margin: 0;
font-weight: normal;
border-bottom: 1px solid #ddd;
background-color: #f3f3f3;
}
div.dt-button-info > div {
padding: 1em;
}

div.dt-button-collection-title {
text-align: center;
padding: 0.3em 0 0.5em;
font-size: 0.9em;
}

div.dt-button-collection-title:empty {
display: none;
}

div.dt-button-collection {
position: absolute;
}
div.dt-button-collection ul.dropdown-menu {
display: block;
z-index: 2002;
min-width: 100%;
}
div.dt-button-collection div.dt-button-collection-title {
background-color: white;
}
div.dt-button-collection.fixed {
position: fixed;
top: 50%;
left: 50%;
margin-left: -75px;
border-radius: 0;
}
div.dt-button-collection.fixed.two-column {
margin-left: -200px;
}
div.dt-button-collection.fixed.three-column {
margin-left: -225px;
}
div.dt-button-collection.fixed.four-column {
margin-left: -300px;
}
div.dt-button-collection > :last-child {
display: block !important;
-webkit-column-gap: 8px;
-moz-column-gap: 8px;
-ms-column-gap: 8px;
-o-column-gap: 8px;
column-gap: 8px;
}
div.dt-button-collection > :last-child > * {
-webkit-column-break-inside: avoid;
break-inside: avoid;
}
div.dt-button-collection.two-column {
width: 400px;
}
div.dt-button-collection.two-column > :last-child {
padding-bottom: 1px;
-webkit-column-count: 2;
-moz-column-count: 2;
-ms-column-count: 2;
-o-column-count: 2;
column-count: 2;
}
div.dt-button-collection.three-column {
width: 450px;
}
div.dt-button-collection.three-column > :last-child {
padding-bottom: 1px;
-webkit-column-count: 3;
-moz-column-count: 3;
-ms-column-count: 3;
-o-column-count: 3;
column-count: 3;
}
div.dt-button-collection.four-column {
width: 600px;
}
div.dt-button-collection.four-column > :last-child {
padding-bottom: 1px;
-webkit-column-count: 4;
-moz-column-count: 4;
-ms-column-count: 4;
-o-column-count: 4;
column-count: 4;
}
div.dt-button-collection .dt-button {
border-radius: 0;
}

div.dt-button-background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2001;
}

@media screen and (max-width: 767px) {
div.dt-buttons {
float: none;
width: 100%;
text-align: center;
margin-bottom: 0.5em;
}
div.dt-buttons a.btn {
float: none;
}
}
div.dt-buttons button.btn.processing,
div.dt-buttons div.btn.processing,
div.dt-buttons a.btn.processing {
color: rgba(0, 0, 0, 0.2);
}
div.dt-buttons button.btn.processing:after,
div.dt-buttons div.btn.processing:after,
div.dt-buttons a.btn.processing:after {
position: absolute;
top: 50%;
left: 50%;
width: 16px;
height: 16px;
margin: -8px 0 0 -8px;
box-sizing: border-box;
display: block;
content: ' ';
border: 2px solid #282828;
border-radius: 50%;
border-left-color: transparent;
border-right-color: transparent;
animation: dtb-spinner 1500ms infinite linear;
-o-animation: dtb-spinner 1500ms infinite linear;
-ms-animation: dtb-spinner 1500ms infinite linear;
-webkit-animation: dtb-spinner 1500ms infinite linear;
-moz-animation: dtb-spinner 1500ms infinite linear;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c5780d3

Please sign in to comment.