mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fixed broken column header links, closes #1011
This commit is contained in:
parent
6fe30c348c
commit
7239175f63
3 changed files with 9 additions and 9 deletions
|
|
@ -8,9 +8,9 @@
|
||||||
{{ column.name }}
|
{{ column.name }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if column.name == sort %}
|
{% if column.name == sort %}
|
||||||
<a href="{{ base_url }}{{ path_with_replaced_args(request, {'_sort_desc': column.name, '_sort': None, '_next': None}) }}" rel="nofollow">{{ column.name }} ▼</a>
|
<a href="{{ path_with_replaced_args(request, {'_sort_desc': column.name, '_sort': None, '_next': None}) }}" rel="nofollow">{{ column.name }} ▼</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{ base_url }}{{ path_with_replaced_args(request, {'_sort': column.name, '_sort_desc': None, '_next': None}) }}" rel="nofollow">{{ column.name }}{% if column.name == sort_desc %} ▲{% endif %}</a>
|
<a href="{{ path_with_replaced_args(request, {'_sort': column.name, '_sort_desc': None, '_next': None}) }}" rel="nofollow">{{ column.name }}{% if column.name == sort_desc %} ▲{% endif %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</th>
|
</th>
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ def test_sort_links(app_client):
|
||||||
attrs_and_link_attrs = [
|
attrs_and_link_attrs = [
|
||||||
{
|
{
|
||||||
"attrs": th.attrs,
|
"attrs": th.attrs,
|
||||||
"a_href": (th.find("a")["href"].split("/")[-1] if th.find("a") else None),
|
"a_href": (th.find("a")["href"] if th.find("a") else None),
|
||||||
}
|
}
|
||||||
for th in ths
|
for th in ths
|
||||||
]
|
]
|
||||||
|
|
@ -403,7 +403,7 @@ def test_sort_links(app_client):
|
||||||
"data-column-not-null": "0",
|
"data-column-not-null": "0",
|
||||||
"data-is-pk": "0",
|
"data-is-pk": "0",
|
||||||
},
|
},
|
||||||
"a_href": "sortable?_sort_desc=sortable",
|
"a_href": "/fixtures/sortable?_sort_desc=sortable",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"attrs": {
|
"attrs": {
|
||||||
|
|
@ -414,7 +414,7 @@ def test_sort_links(app_client):
|
||||||
"data-column-not-null": "0",
|
"data-column-not-null": "0",
|
||||||
"data-is-pk": "0",
|
"data-is-pk": "0",
|
||||||
},
|
},
|
||||||
"a_href": "sortable?_sort=sortable_with_nulls",
|
"a_href": "/fixtures/sortable?_sort=sortable_with_nulls",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"attrs": {
|
"attrs": {
|
||||||
|
|
@ -425,7 +425,7 @@ def test_sort_links(app_client):
|
||||||
"data-column-not-null": "0",
|
"data-column-not-null": "0",
|
||||||
"data-is-pk": "0",
|
"data-is-pk": "0",
|
||||||
},
|
},
|
||||||
"a_href": "sortable?_sort=sortable_with_nulls_2",
|
"a_href": "/fixtures/sortable?_sort=sortable_with_nulls_2",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"attrs": {
|
"attrs": {
|
||||||
|
|
@ -436,7 +436,7 @@ def test_sort_links(app_client):
|
||||||
"data-column-not-null": "0",
|
"data-column-not-null": "0",
|
||||||
"data-is-pk": "0",
|
"data-is-pk": "0",
|
||||||
},
|
},
|
||||||
"a_href": "sortable?_sort=text",
|
"a_href": "/fixtures/sortable?_sort=text",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -497,9 +497,9 @@ def test_hook_register_output_renderer_can_render(app_client):
|
||||||
.find("p", {"class": "export-links"})
|
.find("p", {"class": "export-links"})
|
||||||
.findAll("a")
|
.findAll("a")
|
||||||
)
|
)
|
||||||
actual = [l["href"].split("/")[-1] for l in links]
|
actual = [l["href"] for l in links]
|
||||||
# Should not be present because we sent ?_no_can_render=1
|
# Should not be present because we sent ?_no_can_render=1
|
||||||
assert "facetable.testall?_labels=on" not in actual
|
assert "/fixtures/facetable.testall?_labels=on" not in actual
|
||||||
# Check that it was passed the values we expected
|
# Check that it was passed the values we expected
|
||||||
assert hasattr(app_client.ds, "_can_render_saw")
|
assert hasattr(app_client.ds, "_can_render_saw")
|
||||||
assert {
|
assert {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue