Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tracks/genomes url rename #13

Merged
merged 1 commit into from
Dec 13, 2023
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: 3 additions & 3 deletions apollo_portal/tracks/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def _genome_name(self, track):
@admin.display(ordering="lab__name")
def _lab_name(self, genome):
return format_html(
'<a href="/admin/tracks/lab/{}/">{}</a>',
'<a href="/admin/genomes/lab/{}/">{}</a>',
genome.lab.id,
genome.lab.name,
)
Expand All @@ -27,15 +27,15 @@ class TrackAdmin(admin.ModelAdmin):
@admin.display(ordering="genome__name")
def _genome_name(self, track):
return format_html(
'<a href="/admin/tracks/genome/{}/">{}</a>',
'<a href="/admin/genomes/genome/{}/">{}</a>',
track.genome.id,
track.genome.name,
)

@admin.display(ordering="lab__name")
def _lab_name(self, track):
return format_html(
'<a href="/admin/tracks/lab/{}/">{}</a>',
'<a href="/admin/genomes/lab/{}/">{}</a>',
track.lab.id,
track.lab.name,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
'strain', and 'condition'.
e.g. hide_filters = ['lab']

filter_genomes_params: Object of GET params to pass to /tracks/api/genomes
filter_genomes_params: Object of GET params to pass to /genomes/api/genomes
e.g. filter_genomes_params="{group: 'my group', labs: 'my Lab,your lab'}"
-->

{% load static %}

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/vue-multiselect.min.css">
<link rel="stylesheet" href="{% static 'tracks/css/genome-cards.css' %}">
<link rel="stylesheet" href="{% static 'genomes/css/genome-cards.css' %}">

<!-- Use verbatim mode to prevent collision of Django and Vue template tags -->
{% verbatim %}
Expand Down Expand Up @@ -573,7 +573,7 @@ <h5 id="filterHelpTitle" class="modal-title">Filtering genome records</h5>
params = FILTER_GENOMES_PARAMS;
urlParams = "?" + new URLSearchParams(params);
}
return fetch('/tracks/api/genomes' + urlParams)
return fetch('/genomes/api/genomes' + urlParams)
.catch(error => {
alert(error);
})
Expand All @@ -590,7 +590,7 @@ <h5 id="filterHelpTitle" class="modal-title">Filtering genome records</h5>
});
},
fetchLab (name) {
return fetch(`/tracks/api/labs?labs=${name}`)
return fetch(`/genomes/api/labs?labs=${name}`)
.catch(error => {
alert(error);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
'strain', and 'condition'.
e.g. hide_filters = ['lab']

filter_tracks_params: Object of GET params to pass to /tracks/api/tracks
filter_tracks_params: Object of GET params to pass to /genomes/api/tracks
e.g. filter_tracks_params="{group: 'my group name', genome_id: genome_id <int>}"
-->

{% load static %}

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/vue-multiselect.min.css">
<link rel="stylesheet" href="{% static 'tracks/css/genome-cards.css' %}">
<link rel="stylesheet" href="{% static 'genomes/css/genome-cards.css' %}">

<!-- Use verbatim mode to prevent collision of Django and Vue template tags -->
{% verbatim %}
Expand Down Expand Up @@ -382,7 +382,7 @@ <h5 id="filterHelpTitle" class="modal-title">Filtering track records</h5>
const urlParams = params ?
'?' + new URLSearchParams(params)
: '';
return fetch('/tracks/api/tracks/' + urlParams)
return fetch('/genomes/api/tracks/' + urlParams)
.catch(error => {
alert(error);
})
Expand All @@ -399,7 +399,7 @@ <h5 id="filterHelpTitle" class="modal-title">Filtering track records</h5>
});
},
fetchLab (name) {
return fetch(`/tracks/api/labs?labs=${name}`)
return fetch(`/genomes/api/labs?labs=${name}`)
.catch(error => {
alert(error);
})
Expand Down
2 changes: 1 addition & 1 deletion apollo_portal/tracks/templates/tracks/tracks.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h1>Genome tracks: {{ genome.name }}</h1>
<hr class="my-3">

<section class="my-5">
{% include 'tracks/snippets/tracks-table.html' %}
{% include 'genomes/snippets/tracks-table.html' %}
</section>

</div>
Expand Down
4 changes: 2 additions & 2 deletions apollo_portal/tracks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

def genomes(request):
"""Genomes list/filter view."""
return render(request, 'tracks/genomes.html')
return render(request, 'genomes/genomes.html')


def tracks(request, genome_id):
"""Tracks table view."""
genome = Genome.objects.get(id=genome_id)
return render(request, 'tracks/tracks.html', {
return render(request, 'genomes/tracks.html', {
'genome': genome.as_json(),
})