diff --git a/conekt/models/sequences.py b/conekt/models/sequences.py
index 211a58c..5904aa6 100644
--- a/conekt/models/sequences.py
+++ b/conekt/models/sequences.py
@@ -124,6 +124,21 @@ def display_name(self):
return t[0] if len(t) > 0 else self.name
+ @property
+ def best_name(self):
+ """
+ Checks if there is a display name, if not checks the shortest alias, otherwise returns name. To be used in e.g.
+ graphs
+
+ :return: string with best name to show in graphs, ...
+ """
+ if self.display_name is not self.name:
+ return self.display_name
+ elif self.shortest_alias is not None:
+ return self.shortest_alias
+ else:
+ return self.name
+
@property
def readable_type(self):
"""
diff --git a/conekt/templates/export_condition.html b/conekt/templates/export_condition.html
index 55f5eb3..03dddf7 100644
--- a/conekt/templates/export_condition.html
+++ b/conekt/templates/export_condition.html
@@ -70,22 +70,22 @@
Export expression levels
$("#loaderModal").modal("show");
},
success: function(data) {
- $("#leafy_loader_text").html("Your Download is ready ! ");
+ $("#leafy_loader_text").html("Your Download is ready ! ");
- pdata = JSON.parse(data);
+ pdata = JSON.parse(data);
- var element = document.createElement('a');
- element.setAttribute('href', pdata.url);
- element.setAttribute('download', 'expression.tab');
+ var element = document.createElement('a');
+ element.setAttribute('href', pdata.url);
+ element.setAttribute('download', 'expression.tab');
- document.body.appendChild(element);
- element.click();
- document.body.removeChild(element);
+ document.body.appendChild(element);
+ element.click();
+ document.body.removeChild(element);
- $("#leafy_loader_text").append($("").attr('href', pdata.url).attr('download', 'expression.tab').attr('id', 'download_ready_link').text("Click here"))
- .append($(" if the download doesn't start automatically."));
- $("#leafy_loader_close_btn").show();
- }
+ $("#leafy_loader_text").append($("").attr('href', pdata.url).attr('download', 'expression.tab').attr('id', 'download_ready_link').text("Click here"))
+ .append($(" if the download doesn't start automatically."));
+ $("#leafy_loader_close_btn").show();
+ }
});
})
});