diff --git a/db.js b/db.js index ad1b365..ecebe77 100644 --- a/db.js +++ b/db.js @@ -546,9 +546,14 @@ function cloneStructure( cloneDbs = [], ) { const transaction = db.transaction(() => { + // Carry over the source's head_injection (viewport meta, PWA tags, favicons, + // mobile-hardening CSS). Without this a clone renders unstyled/unscaled on + // mobile even though its templates are identical. + const source = getStructure(structId); + const cloneStructure = db.prepare(` - INSERT INTO structures (name, user_id, route_prefix, cloned_from) - VALUES (?, ?, ?, ?); + INSERT INTO structures (name, user_id, route_prefix, cloned_from, head_injection) + VALUES (?, ?, ?, ?, ?); `); const newStructId = cloneStructure.run( @@ -556,6 +561,7 @@ function cloneStructure( userId, routePrefix, structId, + source ? source.head_injection : null, ).lastInsertRowid; const dbIds = db diff --git a/views/auth/login.eta b/views/auth/login.eta index 2e19e76..1125e07 100644 --- a/views/auth/login.eta +++ b/views/auth/login.eta @@ -1,13 +1,82 @@ -