Skip to content

Commit

Permalink
Merge pull request #857 from plural/fix-format-faction-decklist-searc…
Browse files Browse the repository at this point in the history
…h-links

Fix faction links for decklist from formats page.
  • Loading branch information
plural authored Oct 10, 2024
2 parents f2a3346 + aba3c8e commit 27123a2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/Resources/views/Formats/formats.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ async function buildFormatsView() {
// TODO(plural): Wire up current restriction in the decklist search after making a legacy code for that as well.
const packs = format.attributes.card_set_ids.map(s => setsById.get(s).attributes.legacy_code).sort();
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'corp', 'packs': packs})}">Any Corp</a></li>`);
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'h', 'packs': packs})}"><span class="icon icon-haas-bioroid influence-haas-bioroid"></span> Haas-Bioroid</a></li>`);
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'j', 'packs': packs})}"><span class="icon icon-jinteki influence-jinteki"></span> Jinteki</a></li>`);
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'n', 'packs': packs})}"><span class="icon icon-nbn influence-nbn"></span> NBN</a></li>`);
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'w', 'packs': packs})}"><span class="icon icon-weyland-consortium influence-weyland-consortium"></span> Weyland Consortium</a></li>`);
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'haas-bioroid', 'packs': packs})}"><span class="icon icon-haas-bioroid influence-haas-bioroid"></span> Haas-Bioroid</a></li>`);
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'jinteki', 'packs': packs})}"><span class="icon icon-jinteki influence-jinteki"></span> Jinteki</a></li>`);
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'nbn', 'packs': packs})}"><span class="icon icon-nbn influence-nbn"></span> NBN</a></li>`);
$(`#${format.id}_corp_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'weyland-consortium', 'packs': packs})}"><span class="icon icon-weyland-consortium influence-weyland-consortium"></span> Weyland Consortium</a></li>`);
$(`#${format.id}`).append(`<h4>Runner Decklists</h4>`);
$(`#${format.id}`).append(`<ul id="${format.id}_runner_decklists"></ul>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'runner', 'packs': packs})}">Any Runner</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'a', 'packs': packs})}"><span class="icon icon-anarch influence-anarch"></span> Anarch</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'c', 'packs': packs})}"><span class="icon icon-criminal influence-criminal"></span> Criminal</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'s', 'packs': packs})}"><span class="icon icon-shaper influence-shaper"></span> Shaper</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'anarch', 'packs': packs})}"><span class="icon icon-anarch influence-anarch"></span> Anarch</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'criminal', 'packs': packs})}"><span class="icon icon-criminal influence-criminal"></span> Criminal</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'shaper', 'packs': packs})}"><span class="icon icon-shaper influence-shaper"></span> Shaper</a></li>`);
// Even though there are mini-faction cards in other sets, the IDs are only in Data & Destiny.
if (legalCycleIds.has('data_and_destiny')) {
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'d', 'packs': packs})}"><span class="icon icon-adam influence-adam"></span> Adam</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'p', 'packs': packs})}"><span class="icon icon-apex influence-apex"></span> Apex</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'u', 'packs': packs})}"><span class="icon icon-sunny-lebeau influence-sunny-lebeau"></span> Sunny Lebeau</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'adam', 'packs': packs})}"><span class="icon icon-adam influence-adam"></span> Adam</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'apex', 'packs': packs})}"><span class="icon icon-apex influence-apex"></span> Apex</a></li>`);
$(`#${format.id}_runner_decklists`).append(`<li><a href="${Routing.generate('decklists_list', {type:'find', 'faction':'sunny-lebeau', 'packs': packs})}"><span class="icon icon-sunny-lebeau influence-sunny-lebeau"></span> Sunny Lebeau</a></li>`);
}
$(`#${format.id}`).append(`<h4>Legal Card Cycles - <a href="${Routing.generate('cards_find', {q: 'e:' + packs.join('|') } )}">${format.attributes.num_cards} Unique Cards</a></h4>`);
Expand Down

0 comments on commit 27123a2

Please sign in to comment.