Skip to content

Change requests #25 #28 #30 #31 #32

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

Merged
merged 23 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0d9d9d9
The changes made in this commit include:
BrainIsDead Oct 17, 2023
ec90ba6
The changes made in this commit include:
BrainIsDead Oct 17, 2023
54061d8
The changes made in this commit include:
BrainIsDead Oct 17, 2023
3253f14
The changes made in this commit include:
BrainIsDead Oct 17, 2023
6cdfb4e
The changes made in this commit include:
BrainIsDead Oct 18, 2023
0bef843
The changes made in this commit include:
BrainIsDead Oct 18, 2023
dccdd3b
The changes made in this commit include:
BrainIsDead Oct 18, 2023
98a232f
The changes made in this commit include:
BrainIsDead Oct 18, 2023
6b3c4bf
To summarize the changes made in this commit:
BrainIsDead Oct 30, 2023
490e78e
The changes made in this commit include:
BrainIsDead Nov 1, 2023
80dd971
The changes made in this commit include:
BrainIsDead Nov 13, 2023
754990c
Fixed collapse filters
dmytrotsko Nov 14, 2023
1f8a28c
Replaced <button> with <a>
dmytrotsko Nov 15, 2023
bd2fb5f
added animations to filters
Nov 17, 2023
f444d8a
The changes made in this commit include:
Nov 17, 2023
aeeac2b
deleted django-bootstrap-v5
Nov 17, 2023
8ad9be9
The changes made in this commit include:
Nov 17, 2023
0f11250
Merge branch 'development' of https://github.com/cmu-delphi/signal_do…
Nov 17, 2023
dc29d42
updated dependencies
Nov 17, 2023
98d51b1
Merge branch 'development' of https://github.com/cmu-delphi/signal_do…
BrainIsDead Nov 30, 2023
42be422
updatet pip lock
BrainIsDead Nov 30, 2023
a43224a
Merge branch 'change-requests-#25-#28-#30-#31' of https://github.com/…
BrainIsDead Nov 30, 2023
dd4e414
updated lock file
BrainIsDead Nov 30, 2023
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: 6 additions & 0 deletions src/datasources/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class SourceSubdivision(TimeStampedModel):
on_delete=models.PROTECT
)

class Meta:
ordering: list[str] = ["name"]

def __str__(self) -> str:
"""
Returns the name of the source subdivision as a string.
Expand Down Expand Up @@ -80,6 +83,9 @@ class DataSource(TimeStampedModel):
related_name="data_sources"
)

class Meta:
ordering: list[str] = ["name"]

def __str__(self) -> str:
"""
Returns the name of the data source as a string.
Expand Down
1 change: 1 addition & 0 deletions src/signals/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Meta:
fields: list[str] = [
'search',
'pathogen',
'active',
'available_geography',
'signal_type',
'category',
Expand Down
1 change: 1 addition & 0 deletions src/signals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class SignalCategory(TimeStampedModel):
)

class Meta:
ordering: list[str] = ["name"]
verbose_name_plural: str = "signal categories"

def __str__(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion src/signals/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class SignalListViewTest(TestCase):

def setUp(self):
for i in range(fake.random_int(min=1, max=100)):
for _ in range(fake.random_int(min=1, max=100)):
SignalFactory()

def test_signal_list_view(self):
Expand Down
2 changes: 1 addition & 1 deletion src/signals/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

urlpatterns: list[URLPattern] = [
path('', SignalsListView.as_view(), name='signals'),
path('signals/<pk>/', SignalsDetailView.as_view(), name='signal'),
path('signals/<int:pk>/', SignalsDetailView.as_view(), name='signal'),
]
2 changes: 1 addition & 1 deletion src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
<header id="header" class="header fixed-top d-flex align-items-center">

<div class="d-flex align-items-center justify-content-between">
<i class="bi bi-list toggle-sidebar-btn"></i>
<a href="{% url 'signals' %}" class="logo d-flex align-items-center">
<img assets/img/logo.png" alt="">
<span class="d-none d-lg-block">Signal Documentation</span>
</a>
<i class="bi bi-list toggle-sidebar-btn"></i>
</div><!-- End Logo -->

<nav class="header-nav ms-auto">
Expand Down
23 changes: 20 additions & 3 deletions src/templates/signals/signal_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ <h5 class="card-title">Signals</h5>
<th scope="col">Signal Type</th>
<th scope="col">Format</th>
<th scope="col">Temporal Resolution</th>
<th scope="col">Signal</th>
<th scope="col">Link</th>
<th scope="col">Base Signal</th>
<th scope="col">Links</th>
</tr>
</thead>
<tbody>
Expand All @@ -65,7 +65,13 @@ <h5 class="card-title">Signals</h5>
</td>
<td>{{ signal.format }}</td>
<td>{{ signal.time_label }}</td>
<td>{{ signal.base }}</td>
<td>
{% if signal.base %}
<a href="{% url 'signal' pk=signal.base.id %}">{{ signal.base.id }}</a>
{% else %}
--/--
{% endif %}
</td>
<td>
{% for link in signal.links.all %}
<ul class="list-group list-group-flush">
Expand Down Expand Up @@ -102,12 +108,23 @@ <h5 class="card-title">Search</h5>
<div class="card-body">
<h5 class="card-title">{{ filter.form.pathogen.label }}</h5>
<select name="{{ filter.form.pathogen.name }}" class="form-select">
<option value="">---------</option>
{% for choice in filter.form.pathogen.field.choices %}
<option value="{{ choice.0 }}">{{ choice.1 }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-group">
<div class="card-body">
<h5 class="card-title">{{ filter.form.active.label }}</h5>
<select name="{{ filter.form.active.name }}" class="form-select" >
<option value="">---------</option>
<option value="True">True</option>
<option value="False">False</option>
</select>
</div>
</div>
<div class="form-group">
<div class="card-body">
<h5 class="card-title">{{ filter.form.available_geography.label }}</h5>
Expand Down