Unverified Commit 652c3d7e authored by Carlos Eduardo Ribas's avatar Carlos Eduardo Ribas Committed by GitHub
Browse files

Show SVG using R2DT-web (#529)

* Use R2DT-Web to show secondary structure
* Use local r2dt-web
* Check if r2dt-web is installed
parent 5931d221
......@@ -414,7 +414,15 @@ limitations under the License.
<uib-tab-heading>
2D structure <span class="label label-success">New</span>
</uib-tab-heading>
<secondary-structures upi="upi" taxid="taxid" show-secondary-structure-tab="true"></secondary-structures>
<r2dt-web
search='{"urs": "{{ context.upi }}"}'
customStyle='{"fixCss": "true", "titleColor": "#BF8E3E"}'
/>
{% if context.plugin_installed %}
<script type="text/javascript" src="{% static "r2dt-web/dist/r2dt-web.js" %}"></script>
{% else %}
<script type="text/javascript" src="https://rnacentral.github.io/r2dt-web/dist/r2dt-web.js"></script>
{% endif %}
</uib-tab>
{% endif %}
......
......@@ -141,7 +141,14 @@ def rna_view(request, upi, taxid=None):
except AttributeError:
summary_so_terms = ''
# Check if r2dt-web is installed
path = os.path.join(
settings.PROJECT_PATH, 'rnacentral', 'portal', 'static', 'r2dt-web', 'dist', 'r2dt-web.js'
)
plugin_installed = True if os.path.isfile(path) else False
context = {
'upi': upi,
'symbol_counts': symbol_counts,
'non_canonical_base_counts': non_canonical_base_counts,
'taxid': taxid,
......@@ -155,6 +162,7 @@ def rna_view(request, upi, taxid=None):
'mirna_regulators': rna.get_mirna_regulators(taxid=taxid),
'annotations_from_other_species': rna.get_annotations_from_other_species(taxid=taxid),
'intact': rna.get_intact(taxid),
'plugin_installed': plugin_installed,
}
response = render(request, 'portal/sequence.html', {'rna': rna, 'context': context})
# define canonical URL for Google
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment