sky wheel: element contributor display; sign + house tooltips — TDD
sky_save now re-fetches from PySwiss server-side on save so stored chart_data always carries enriched element format (contributors/stellia/ parades). New sky/data endpoint serves fresh PySwiss data to the My Sky applet on load, replacing the stale inline json_script approach. natus-wheel.js: sign ring slices (data-sign-name) and house ring slices (data-house) now have click handlers with _activateSign/_activateHouse; em-dash fallback added for classic elements with empty contributor lists. Action URLs sky/preview, sky/save, sky/data lose trailing slashes. Jasmine: T12 sign tooltip, T13 house tooltip, T14 enriched element contributor display (symbols, Stellium/Parade formations, em-dash fallback). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,9 +85,17 @@
|
||||
|
||||
{% if request.user.sky_chart_data %}
|
||||
|
||||
// Sky already saved — draw the stored wheel immediately.
|
||||
const data = JSON.parse(document.getElementById('id_my_sky_data').textContent);
|
||||
NatusWheel.preload().then(function () { NatusWheel.draw(svgEl, data); });
|
||||
// Sky already saved — fetch fresh enriched data from server then draw.
|
||||
fetch('{% url "sky_natus_data" %}')
|
||||
.then(function (r) { return r.ok ? r.json() : Promise.reject(r.status); })
|
||||
.then(function (data) {
|
||||
NatusWheel.preload().then(function () { NatusWheel.draw(svgEl, data); });
|
||||
})
|
||||
.catch(function () {
|
||||
// Fallback: draw from inline stale data if endpoint fails.
|
||||
var stale = JSON.parse(document.getElementById('id_my_sky_data').textContent);
|
||||
NatusWheel.preload().then(function () { NatusWheel.draw(svgEl, stale); });
|
||||
});
|
||||
|
||||
{% else %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user