Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion rnacentral/apiv1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,9 +930,13 @@ class LitSummSerializer(serializers.Serializer):

rna_id = serializers.CharField()
display_id = serializers.CharField()
summary = serializers.CharField()
summary = serializers.SerializerMethodField()
primary_id = serializers.CharField()

def get_summary(self, obj):
"""Prefix the summary with a warning that it is AI-generated"""
return f"WARNING: This summary was generated by AI. {obj.summary}"


class RnaGenomeLocationsSerializer(serializers.Serializer):
"""Serializer class for Genome Locations"""
Expand Down
45 changes: 45 additions & 0 deletions rnacentral/portal/templates/portal/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,51 @@
(function(d, t) {
var g = d.createElement(t);g.id = 'doorbellScript';g.type = 'text/javascript';g.async = true;g.src = 'https://embed.doorbell.io/button/2991?t='+(new Date().getTime());(d.getElementsByTagName('head')[0]||d.getElementsByTagName('body')[0]).appendChild(g);
}(document, 'script'));

// Wait for doorbell to load
(function() {
var ALLOWED_DOCBOT_ORIGINS = [
'https://wwwdev.ebi.ac.uk/docbot',
'http://localhost:8000' // dev
];

var params = new URLSearchParams(window.location.search);
if (params.get('source') !== 'docbot') return;

var conversation = params.get('conversation') || '';
if (!conversation) return;

// Referrer origin
var referrer = document.referrer;
if (referrer) {
try {
var referrerOrigin = new URL(referrer).origin;
if (ALLOWED_DOCBOT_ORIGINS.indexOf(referrerOrigin) === -1) return;
} catch (e) {
return;
}
}

// Poll until doorbell is available
var attempts = 0;
var interval = setInterval(function() {
if (++attempts > 50) { clearInterval(interval); return; }
if (typeof doorbell === 'undefined') return;
clearInterval(interval);

doorbell.setOption('onShow', function() {
var textarea = document.getElementById('doorbell-feedback');
if (textarea) {
textarea.value = conversation;
textarea.dispatchEvent(new Event('input', { bubbles: true }));
textarea.setSelectionRange(0, 0);
textarea.focus();
}
});

doorbell.show();
}, 100);
})();
$(function(){
$('.doorbell-feedback').on('click', function(){
doorbell.show();
Expand Down
4 changes: 4 additions & 0 deletions rnacentral/portal/templates/portal/docs/training.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ RNAcentral has been described in several papers:
<a href="http://www.ncbi.nlm.nih.gov/pubmed/21940779">Pubmed</a>
</blockquote>

### Other resources <a style="cursor: pointer" id="other-resources" ng-click="scrollTo('other-resources')" name="other-resources" class="text-muted smaller"><i class="fa fa-link"></i></a>

Explore community-contributed educational resources including tutorials, slides, and lecture materials: [Educational Resources Repository](https://github.com/RNAcentral/rna-educational-resources).

### Feedback <a style="cursor: pointer" id="feedback" ng-click="scrollTo('feedback')" name="feedback" class="text-muted smaller"><i class="fa fa-link"></i></a>

Let us know what you think by getting in touch on [Twitter](https://twitter.com/rnacentral),
Expand Down