Skip to content

Commit

Permalink
added best_name property for sequences
Browse files Browse the repository at this point in the history
proost committed Nov 9, 2017
1 parent b233327 commit fc23444
Showing 2 changed files with 27 additions and 12 deletions.
15 changes: 15 additions & 0 deletions conekt/models/sequences.py
Original file line number Diff line number Diff line change
@@ -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):
"""
24 changes: 12 additions & 12 deletions conekt/templates/export_condition.html
Original file line number Diff line number Diff line change
@@ -70,22 +70,22 @@ <h1>Export expression levels</h1>
$("#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($("<a/>").attr('href', pdata.url).attr('download', 'expression.tab').attr('id', 'download_ready_link').text("Click here"))
.append($("<span> if the download doesn't start automatically.</span>"));
$("#leafy_loader_close_btn").show();
}
$("#leafy_loader_text").append($("<a/>").attr('href', pdata.url).attr('download', 'expression.tab').attr('id', 'download_ready_link').text("Click here"))
.append($("<span> if the download doesn't start automatically.</span>"));
$("#leafy_loader_close_btn").show();
}
});
})
});

0 comments on commit fc23444

Please sign in to comment.