Changeset 17197a9 in Klonkt


Ignore:
Timestamp:
06/22/2026 01:51:51 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
c9d48fc
Parents:
1ce1ffe
Message:

fix(download): track var 't' shadowed the i18n t() -> 500 on /download/:id

The download capture view had 'var t = dlTrack' at the top level, which
corrupted the shared EJS locals -> chrome/topnav called t() = 't is not a
function'. Renamed to 'tr'. (Same class of bug as the earlier search.ejs issue.)

Co-Authored-By: Claude <noreply@…>
EOF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/download.ejs

    r1ce1ffe r17197a9  
    88%>
    99<%
    10   var t = (typeof dlTrack !== 'undefined') ? dlTrack : {};
     10  var tr = (typeof dlTrack !== 'undefined') ? dlTrack : {};
    1111  var st = (typeof dlState !== 'undefined') ? dlState : 'form';
    12   var fileUrl = siteUrlBase + '/download/' + t.id + '/bestand';
     12  var fileUrl = siteUrlBase + '/download/' + tr.id + '/bestand';
    1313%>
    1414<section class="dl">
    1515  <div class="dl-card">
    1616    <div class="dl-head">
    17       <% if (t.cover_url) { %><span class="dl-cover" style="background-image:url('<%= t.cover_url %>')"></span><% } else { %><span class="dl-cover dl-cover-empty">♪</span><% } %>
     17      <% if (tr.cover_url) { %><span class="dl-cover" style="background-image:url('<%= tr.cover_url %>')"></span><% } else { %><span class="dl-cover dl-cover-empty">♪</span><% } %>
    1818      <div>
    19         <div class="dl-title"><%= t.title %></div>
    20         <% if (t.artist) { %><div class="dl-artist"><%= t.artist %></div><% } %>
     19        <div class="dl-title"><%= tr.title %></div>
     20        <% if (tr.artist) { %><div class="dl-artist"><%= tr.artist %></div><% } %>
    2121      </div>
    2222    </div>
     
    3131      </script>
    3232    <% } else { %>
    33       <h1 class="dl-h1"><%= _download_btn %> <%= t.title %></h1>
     33      <h1 class="dl-h1"><%= _download_btn %> <%= tr.title %></h1>
    3434      <p class="dl-sub"><%= _capture_sub %></p>
    3535      <% if (typeof dlError !== 'undefined' && dlError) { %><p class="dl-err"><%= dlError %></p><% } %>
    36       <form method="POST" action="<%= siteUrlBase %>/download/<%= t.id %>" class="dl-form">
     36      <form method="POST" action="<%= siteUrlBase %>/download/<%= tr.id %>" class="dl-form">
    3737        <input type="email" name="email" required placeholder="<%= _email_ph %>" value="<%= (typeof dlPrefill!=='undefined')?dlPrefill:'' %>" autocomplete="email">
    3838        <button type="submit" class="dl-go">⬇ <%= _download_btn %></button>
Note: See TracChangeset for help on using the changeset viewer.