diff --git a/.gitignore b/.gitignore index f69273a08fe..e6172bed053 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ celerybeat.pid chatconfig/config.json # Sensitive environment files +.npmrc .env *.pem diff --git a/app/app/bundle_context.py b/app/app/bundle_context.py new file mode 100644 index 00000000000..be87622a344 --- /dev/null +++ b/app/app/bundle_context.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +"""Define additional context data to be passed to any request. + +Copyright (C) 2021 Gitcoin Core + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +""" + +from cacheops import cached_as +from perftools.models import JSONStore + +@cached_as(JSONStore.objects.filter(view='bundleTags', key='bundleTags'), timeout=60) +def templateTags(): + + # list any templateTags used inside bundle tags + return ['static'] + + +@cached_as(JSONStore.objects.filter(view='bundleContext', key='bundleContext'), timeout=60) +def context(): + context = {} + + # return constructed context + return context diff --git a/app/app/context.py b/app/app/context.py index 828ac8b447a..8e6bab596af 100644 --- a/app/app/context.py +++ b/app/app/context.py @@ -26,6 +26,7 @@ from django.utils import timezone import requests +from app.bundle_context import context as bundleContext from app.utils import get_location_from_ip from cacheops import cached_as from dashboard.models import Activity, Tip, UserAction @@ -213,4 +214,8 @@ def preprocess(request): context['unclaimed_tips'] = context['unclaimed_tips'].filter(network='mainnet').cache(timeout=60) context['unclaimed_kudos'] = context['unclaimed_kudos'].filter(network='mainnet').cache(timeout=60) + # add bundleContext to context in dev + if settings.DEBUG: + context.update(bundleContext()) + return context diff --git a/app/app/templates/shared/tip_dependancies.html b/app/app/templates/shared/tip_dependancies.html index fd209a76f74..f5a7b38d850 100644 --- a/app/app/templates/shared/tip_dependancies.html +++ b/app/app/templates/shared/tip_dependancies.html @@ -17,11 +17,12 @@ {% load static bundle %} - + {% bundle merge_js file tip_dependancies %} - - - + + + + + + {% endbundle %} - - diff --git a/app/assets/v2/js/base.js b/app/assets/v2/js/base.js index 8ece965b75a..cc677d403ee 100644 --- a/app/assets/v2/js/base.js +++ b/app/assets/v2/js/base.js @@ -1,7 +1,7 @@ /* eslint-disable no-loop-func */ /* eslint-disable no-console */ /* eslint-disable nonblock-statement-body-position */ -$(document).ready(function() { +document.addEventListener('DOMContentLoaded', function() { $.fn.isInViewport = function() { var elementTop = $(this).offset().top; diff --git a/app/dashboard/management/commands/bundle.py b/app/dashboard/management/commands/bundle.py index 2a297def1be..b32d6ba8cab 100644 --- a/app/dashboard/management/commands/bundle.py +++ b/app/dashboard/management/commands/bundle.py @@ -4,17 +4,29 @@ from django.conf import settings from django.core.management.base import BaseCommand +from django.template import Context, Template from django.template.loaders.app_directories import get_app_template_dirs from dashboard.templatetags.bundle import render +from app.bundle_context import context, templateTags -def rmdir(loc): + +def rmdir(loc, depth=1): # drop both the bundled and the bundles before recreating if os.path.exists(loc) and os.path.isdir(loc): - print('- Deleting assets from: %s' % loc) - shutil.rmtree(loc) + # list all dirs/paths in the loc + files = os.listdir(loc) + + print('%s Deleting %s assets from: %s' % ('-' * depth, len(files), loc)) + # delete files/dirs from the given loc leaving the loc dir intact + for path in files: + nextLoc = os.path.join(loc, path) + if os.path.isdir(nextLoc): + rmdir(nextLoc, depth+1) + else: + os.remove(nextLoc) def rmdirs(loc, kind): # base path of the assets @@ -29,6 +41,11 @@ class Command(BaseCommand): help = 'generates .js/.scss files from bundle template tags' def handle(self, *args, **options): + """ This command will collect templates, render them with the bundleContext and run them through the bundle procedure""" + + print('\nCollect template files from all apps:') + + # get a list of all templates (rather than views to avoid segfault error that django-compressor was giving us on production) template_dir_list = [] for template_dir in get_app_template_dirs('templates'): if settings.BASE_DIR in template_dir: @@ -41,29 +58,38 @@ def handle(self, *args, **options): if ".html" in filename: template_list.append(os.path.join(base_dir, filename)) + print('\n- %s templates discovered' % len(template_list)) + # using regex to grab the bundle tags content from html block_pattern = re.compile(r'({%\sbundle(.|\n)*?(?<={%\sendbundle\s%}))') open_pattern = re.compile(r'({%\s+bundle\s+(js|css|merge_js|merge_css)\s+?(file)?\s+?([^\s]*)?\s+?%})') close_pattern = re.compile(r'({%\sendbundle\s%})') - static_open_pattern = re.compile(r'({%\sstatic\s["|\'])') - static_close_pattern = re.compile(r'(\s?%}(\"|\')?\s?\/?>)') + + print('\nClear bundle directories:\n') # remove the previously bundled files for ext in ['js', 'scss', 'css']: rmdirs('assets', ext) rmdirs('static', ext) - print('\nStart generating bundle files\n') + print('\nStart generating bundled assets (using app.bundleContext as context):\n') # store unique entries for count rendered = dict() + # get the tags and context from bundleContext + tags = templateTags() + bundleContext = context() + # load the bundleContext into a Context instance so that it can be fed to Template.render + bundleContext = Context(bundleContext) + + # check every template for bundle tags for template in template_list: try: - f = open(('%s' % template).replace('/', os.sep), 'r', encoding='utf8') - - t = f.read() - if re.search(block_pattern, t) is not None: + # read the template file + t = open(('%s' % template).replace('/', os.sep), 'r', encoding='utf8').read() + # check for bundle tags + if re.search(block_pattern, t): for m in re.finditer(block_pattern, t): block = m.group(0) details = re.search(open_pattern, block) @@ -76,15 +102,22 @@ def handle(self, *args, **options): block = re.sub(open_pattern, '', block) block = re.sub(close_pattern, '', block) - # clean static helper if we havent ran this through parse - block = re.sub(static_open_pattern, '', block) - block = re.sub(static_close_pattern, '>', block) + # add static helper to the block + block = '{% ' + 'load %s' % ' '.join(tags) + ' %}\n' + block + + # create a template from the block + block = Template(block) + + # render the template with bundleContext + block = block.render(bundleContext) + + # clean static_url from the path (its not required but is included as legacy in most script/link inclusions) + block = block.replace(settings.STATIC_URL, "") # render the template (producing a bundle file) rendered[render(block, kind, 'file', name, True)] = True - except Exception as e: print('-- X - failed to parse %s: %s' % (template, e)) pass - print('\nGenerated %s bundle files' % len(rendered)) + print('\n\n------------------- Generated %s bundled assets ------------------- \n\n' % len(rendered)) diff --git a/app/dashboard/templates/bounty/details.html b/app/dashboard/templates/bounty/details.html index d9aab17a226..171a3ccc3ca 100644 --- a/app/dashboard/templates/bounty/details.html +++ b/app/dashboard/templates/bounty/details.html @@ -529,20 +529,23 @@

{{ noscript.keywords }}

{% include 'shared/current_profile.html' %} - - + + + {% bundle merge_js file libs %} + + + + + {% endbundle %} - - - diff --git a/app/dashboard/templates/bounty/details2.html b/app/dashboard/templates/bounty/details2.html index c685b78ab8b..bab4f7eb686 100644 --- a/app/dashboard/templates/bounty/details2.html +++ b/app/dashboard/templates/bounty/details2.html @@ -1097,15 +1097,21 @@

{{ noscript.keywords }}

{% include 'shared/footer.html' %} {% include 'shared/current_profile.html' %} - - - + {% bundle merge_js file libs %} + + + {% endbundle %} + + - + + {% bundle merge_js file qrcode %} + + {% endbundle %} {% elif web3_type == 'web3_modal' %} - - - - - + {% bundle merge_js file web3_modal %} + + + + {% endbundle %} {% endif %} + {% bundle merge_js file details %} + + + + + + + + {% endbundle %} - - - - - - - diff --git a/app/dashboard/templates/bounty/fulfill.html b/app/dashboard/templates/bounty/fulfill.html index 30d972862d7..efe1b0eda14 100644 --- a/app/dashboard/templates/bounty/fulfill.html +++ b/app/dashboard/templates/bounty/fulfill.html @@ -227,13 +227,16 @@

{% trans "Submit Work" %}

{% if is_bounties_network %} - - - - - - + + {% bundle merge_js file bounty_fullfill %} + + + + + + + {% endbundle %} {% else %} {% endif %} diff --git a/app/dashboard/templates/bounty/increase.html b/app/dashboard/templates/bounty/increase.html index 8b12c091d4a..4342201689c 100644 --- a/app/dashboard/templates/bounty/increase.html +++ b/app/dashboard/templates/bounty/increase.html @@ -169,30 +169,21 @@
{% trans "Total"%}
{% include 'shared/footer.html' %} - + + {% include 'shared/tip_dependancies.html' %} - - - - - - - - - - - - - - - + + + + + diff --git a/app/dashboard/templates/bounty/new_bounty.html b/app/dashboard/templates/bounty/new_bounty.html index fcbad620975..3b7b89b040a 100644 --- a/app/dashboard/templates/bounty/new_bounty.html +++ b/app/dashboard/templates/bounty/new_bounty.html @@ -730,10 +730,14 @@
Total
{% endfor %} ] - - - - + + {% bundle merge_js file libs %} + + + + + {% endbundle %} + diff --git a/app/dashboard/templates/bulk_payout_bounty.html b/app/dashboard/templates/bulk_payout_bounty.html index f6d8e8a6b94..7b85fa0eb03 100644 --- a/app/dashboard/templates/bulk_payout_bounty.html +++ b/app/dashboard/templates/bulk_payout_bounty.html @@ -256,22 +256,18 @@
{% trans 'Payout Prev {% include 'shared/footer.html' %} + {% include 'shared/tip_dependancies.html' %} + + + + + + + + - - - - - - - - - - - - - - + diff --git a/app/dashboard/templates/dashboard/hackathon/new_bounty.html b/app/dashboard/templates/dashboard/hackathon/new_bounty.html index 6ab40b0b899..0e09f894531 100644 --- a/app/dashboard/templates/dashboard/hackathon/new_bounty.html +++ b/app/dashboard/templates/dashboard/hackathon/new_bounty.html @@ -15,7 +15,7 @@ along with this program. If not, see . {% endcomment %} -{% load i18n static email_obfuscator add_url_schema avatar_tags %} +{% load i18n static email_obfuscator add_url_schema avatar_tags bundle %} @@ -518,11 +518,14 @@
Total
{% include 'shared/footer_scripts.html' with slim=1 %} {% include 'shared/current_profile.html' %} - - - - - + + {% bundle merge_js file new_bounty %} + + + + + + {% endbundle %} {{hackathon.name|json_script:"hackathon_name"}} diff --git a/app/dashboard/templates/dashboard/hackathon/project_page.html b/app/dashboard/templates/dashboard/hackathon/project_page.html index f9e653a3dd9..feab3aaa5cc 100644 --- a/app/dashboard/templates/dashboard/hackathon/project_page.html +++ b/app/dashboard/templates/dashboard/hackathon/project_page.html @@ -180,8 +180,11 @@ {{project_obj|json_script:"project-object"}} {{currentProfile|json_script:"current-profile"}} - - + {% bundle merge_js file plyr %} + + + {% endbundle %} + {% include 'shared/activity_scripts.html' %} diff --git a/app/dashboard/templates/dashboard/index-vue.html b/app/dashboard/templates/dashboard/index-vue.html index 2c1e4a4eb96..d3c86d059c3 100644 --- a/app/dashboard/templates/dashboard/index-vue.html +++ b/app/dashboard/templates/dashboard/index-vue.html @@ -786,7 +786,9 @@

[[hackathon.name]] Wall of Fame< - + {% bundle merge_js file new_bounty %} + + {% endbundle %} {{orgs|json_script:"sponsor-list"}} {{hackathon_obj|json_script:"hackathon-object"}} {{prize_founders|json_script:"prize-founders"}} diff --git a/app/dashboard/templates/onepager/receive.html b/app/dashboard/templates/onepager/receive.html index 8de91b9cd2a..bf5b1742f28 100644 --- a/app/dashboard/templates/onepager/receive.html +++ b/app/dashboard/templates/onepager/receive.html @@ -15,16 +15,19 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . {% endcomment %} -{% load i18n static %} +{% load i18n static bundle %} {% block 'scripts' %} - - - - - - - - + + {% bundle merge_js file receive %} + + + + + + + + + {% endbundle %} {% endblock %} diff --git a/app/dashboard/templates/onepager/send2.html b/app/dashboard/templates/onepager/send2.html index aa39a694bd9..d7fa29fa0c2 100644 --- a/app/dashboard/templates/onepager/send2.html +++ b/app/dashboard/templates/onepager/send2.html @@ -18,18 +18,22 @@ {% load i18n static bundle %} {% block 'scripts' %} {% include 'shared/current_profile.html' %} - - - - - - - - - - - + + {% bundle merge_js file send %} + + + + + + + + + + + + {% endbundle %} + - - - - - - - - - - - + {% include 'shared/tip_dependancies.html' %} - + + + + + + diff --git a/app/dashboard/templates/process_bounty.html b/app/dashboard/templates/process_bounty.html index cae3e63810d..af413fd45ba 100644 --- a/app/dashboard/templates/process_bounty.html +++ b/app/dashboard/templates/process_bounty.html @@ -143,42 +143,36 @@

Suggested Kudos

{% include 'shared/footer_scripts.html' %} {% include 'shared/footer.html' %} - + - {% for fulfillment in open_fulfillments %} - fulfillers.push('{{ fulfillment.fulfiller_github_username }}'); + {% include 'shared/tip_dependancies.html' %} - {% endfor %} - sessionStorage['fulfillers'] = fulfillers; - {% endif %} - + + + + + + + + + + - - - - - - - - - - - - - - - - - - + diff --git a/app/dashboard/templates/profiles/profile.html b/app/dashboard/templates/profiles/profile.html index da9134da66f..ec4e592cf7a 100644 --- a/app/dashboard/templates/profiles/profile.html +++ b/app/dashboard/templates/profiles/profile.html @@ -153,18 +153,23 @@ document.current_hodling = {{ available_to_redeem|default:0 }}; {% endif %} + + {% bundle merge_js file jitsi %} + + {% endbundle %} + {% bundle merge_js file profile %} + + + - - - diff --git a/app/dashboard/templates/profiles/tribes-vue.html b/app/dashboard/templates/profiles/tribes-vue.html index a3fdbb190c3..22a76a77983 100644 --- a/app/dashboard/templates/profiles/tribes-vue.html +++ b/app/dashboard/templates/profiles/tribes-vue.html @@ -1502,8 +1502,10 @@

{% trans "Top id {{currentProfile|json_script:"current-profile"}} + {% bundle merge_js file jitsi %} + + {% endbundle %} - {% include 'shared/tip_dependancies.html' %} diff --git a/app/dashboard/templates/request_payment.html b/app/dashboard/templates/request_payment.html index 563b80de2e2..575ebce88b2 100644 --- a/app/dashboard/templates/request_payment.html +++ b/app/dashboard/templates/request_payment.html @@ -18,15 +18,9 @@ {% load i18n static bundle %} {% block 'scripts' %} {% include 'shared/current_profile.html' %} - - - + {% include 'shared/tip_dependancies.html' %} - - - - diff --git a/app/dashboard/templatetags/bundle.py b/app/dashboard/templatetags/bundle.py index a414b82a0f3..37617e677b9 100644 --- a/app/dashboard/templatetags/bundle.py +++ b/app/dashboard/templatetags/bundle.py @@ -153,8 +153,18 @@ def get_bundled(elems, attr, kind, merge): for el in elems: # is inclusion or inline block? if el.get(attr): + + # check if we're loading an alternative source in production + file = el[attr] + if isProduction and el.get('prod'): + file = el['prod'] + # absolute path of the given asset - asset = '%s/assets/%s' % (settings.BASE_DIR, el[attr]) + if not el.get('base-dir'): + asset = '%s/assets/%s' % (settings.BASE_DIR, file) + else: + asset = os.path.normpath(os.path.join(settings.BASE_DIR, '../', el['base-dir'].strip('/'), file.strip('/'))) + # merged content is read from file and concatenated if merge: f = open(asset.replace('/', os.sep), 'r', encoding='utf8') @@ -273,9 +283,7 @@ def bundle(parser, token): mode = 'file' # file name for the output - if len(args) == 4: - name = args[3] - else: - name = None + name = args[3] if len(args) == 4 else None + return CompressorNode(nodelist, kind, mode, name) diff --git a/app/dataviz/templates/cohort.html b/app/dataviz/templates/cohort.html index 8e51e979ba4..1c4c7e870fc 100644 --- a/app/dataviz/templates/cohort.html +++ b/app/dataviz/templates/cohort.html @@ -1,5 +1,5 @@ {% extends "admin/base_site.html" %} -{% load humanize %} +{% load humanize bundle %} {% comment %} Copyright (C) 2021 Gitcoin Core @@ -48,7 +48,9 @@ - + {% bundle merge_js file jquery %} + + {% endbundle %} diff --git a/app/dataviz/templates/dataviz/admin_graph.html b/app/dataviz/templates/dataviz/admin_graph.html index 18c77871913..d7bec668f33 100644 --- a/app/dataviz/templates/dataviz/admin_graph.html +++ b/app/dataviz/templates/dataviz/admin_graph.html @@ -38,7 +38,9 @@ {% block content %} - + {% bundle merge_js file jquery %} + + {% endbundle %} - +{% bundle merge_js file jquery %} + +{% endbundle %} + {% bundle merge_js file jquery %} + + {% endbundle %} + {% bundle merge_js file jquery %} + + {% endbundle %} diff --git a/app/dataviz/templates/dataviz/steamgraph.html b/app/dataviz/templates/dataviz/steamgraph.html index f24e35946ef..03f5ae966e3 100644 --- a/app/dataviz/templates/dataviz/steamgraph.html +++ b/app/dataviz/templates/dataviz/steamgraph.html @@ -74,7 +74,9 @@

Bounties by repo volume that were in status at this time

{% include "dataviz/shared/nav.html" %} - +{% bundle merge_js file jquery %} + +{% endbundle %}


diff --git a/app/dataviz/templates/dataviz/sunburst.html b/app/dataviz/templates/dataviz/sunburst.html index 3c213472283..727856ce881 100644 --- a/app/dataviz/templates/dataviz/sunburst.html +++ b/app/dataviz/templates/dataviz/sunburst.html @@ -35,7 +35,9 @@ - + {% bundle merge_js file jquery %} + + {% endbundle %} {% bundle css file dataviz_sunburst %} diff --git a/app/dataviz/templates/funnel.html b/app/dataviz/templates/funnel.html index 36553f5ec27..26e0248ec81 100644 --- a/app/dataviz/templates/funnel.html +++ b/app/dataviz/templates/funnel.html @@ -1,5 +1,5 @@ {% extends "admin/base_site.html" %} -{% load humanize %} +{% load humanize bundle %} {% comment %} Copyright (C) 2021 Gitcoin Core @@ -48,7 +48,9 @@ - + {% bundle merge_js file jquery %} + + {% endbundle %} diff --git a/app/dataviz/templates/stats.html b/app/dataviz/templates/stats.html index 37de9934c91..3624f00bf6c 100644 --- a/app/dataviz/templates/stats.html +++ b/app/dataviz/templates/stats.html @@ -51,7 +51,9 @@ - + {% bundle merge_js file jquery %} + + {% endbundle %} {% if format == 'chart' %} {% load chartit %} diff --git a/app/grants/templates/grants/cart-vue.html b/app/grants/templates/grants/cart-vue.html index a4eb2fec533..361777bde0d 100644 --- a/app/grants/templates/grants/cart-vue.html +++ b/app/grants/templates/grants/cart-vue.html @@ -148,12 +148,14 @@

Grants Cart

document.authenticated = {{ authenticated | yesno:"true,false" }}; document.isFullyVerified = '{{is_fully_verified}}' === 'True'; + {% bundle merge_js file qrcode %} + + {% endbundle %} - +{% endbundle %} - - +{% bundle merge_js file collage %} + +{% endbundle %} diff --git a/app/grants/templates/grants/detail/_index.html b/app/grants/templates/grants/detail/_index.html index 5e3d5c9831e..01c7528e002 100644 --- a/app/grants/templates/grants/detail/_index.html +++ b/app/grants/templates/grants/detail/_index.html @@ -415,8 +415,15 @@

{{ele.0}}: (avg {{ele.1.1|floatformat:2}})

{% include 'shared/footer_scripts.html' with slim=1 ignore_inject_web3=1 %} - - + {% bundle js file quill-image-extend-module %} + + {% endbundle %} {{verification_tweet|json_script:"verification_tweet"}} {{user_code|json_script:"user_code"}} - - + {% bundle js file quill-image-extend-module %} + + {% endbundle %} - + {% bundle merge_js file ingest %} + + + + + + + + {% endbundle %} - - - - - - - - diff --git a/app/grants/templates/grants/landingpage.html b/app/grants/templates/grants/landingpage.html index 8fa11df5008..0fecd056057 100644 --- a/app/grants/templates/grants/landingpage.html +++ b/app/grants/templates/grants/landingpage.html @@ -116,8 +116,15 @@

Collections

{{grant_bg.inline_css|json_script:"inline_css"}} - - + {% bundle js file quill-image-extend-module %} + + {% endbundle %} - + {% bundle merge_js file new_match %} + + + + + + + + {% endbundle %} - - - - - - - - diff --git a/app/kudos/templates/kudos_details.html b/app/kudos/templates/kudos_details.html index d83253d8a5f..7630758eaba 100644 --- a/app/kudos/templates/kudos_details.html +++ b/app/kudos/templates/kudos_details.html @@ -195,7 +195,9 @@

{{ kudos.ui_name }} {% if kudos. {% include 'shared/footer.html' %} - + {% bundle merge_js file tweenlite %} + + {% endbundle %} {% include 'shared/footer_scripts.html' with slim=1 %} diff --git a/app/kudos/templates/transaction/receive.html b/app/kudos/templates/transaction/receive.html index 8ea71100d0d..c42ed7e10af 100644 --- a/app/kudos/templates/transaction/receive.html +++ b/app/kudos/templates/transaction/receive.html @@ -15,20 +15,22 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . {% endcomment %} -{% load i18n static %} -{% load kudos_extras %} +{% load i18n static kudos_extras bundle %} {% block 'scripts' %} - - - - - - - - + {% bundle merge_js file receive %} + + + + + + + + {% endbundle %} + + {% endblock %} diff --git a/app/kudos/templates/transaction/receive_bulk.html b/app/kudos/templates/transaction/receive_bulk.html index 428a9eea18d..59b6c00e82c 100644 --- a/app/kudos/templates/transaction/receive_bulk.html +++ b/app/kudos/templates/transaction/receive_bulk.html @@ -17,9 +17,11 @@ {% endcomment %} {% load i18n static kudos_extras bundle %} {% block 'scripts' %} + {% bundle merge_js file tweenlite %} + + {% endbundle %} - - - - - - - + + + {% bundle merge_js file send %} + + + + + + + + {% endbundle %} + +{% bundle merge_js file jquery %} + +{% endbundle %} + +{% bundle merge_js file bootstrap %} + +{% endbundle %} diff --git a/app/ptokens/templates/shared/ptokens_make_faq.html b/app/ptokens/templates/shared/ptokens_make_faq.html index 0074486fcf4..1595bf2590b 100644 --- a/app/ptokens/templates/shared/ptokens_make_faq.html +++ b/app/ptokens/templates/shared/ptokens_make_faq.html @@ -79,4 +79,11 @@

Play Gitcoin Quests Now.

{% endblock %} {% block 'scripts' %} - + {% bundle merge_js file unveil %} + + {% endbundle %} - +{% bundle merge_js file unveil %} + +{% endbundle %} - +{% bundle merge_js file jquery %} + +{% endbundle %} + +{% bundle merge_js file bootstrap %} + + +{% endbundle %} + diff --git a/app/retail/templates/gas.html b/app/retail/templates/gas.html index 9a709da6c3d..0f56a56445e 100644 --- a/app/retail/templates/gas.html +++ b/app/retail/templates/gas.html @@ -1,8 +1,10 @@ {% extends 'onepager/base.html' %} -{% load i18n static %} +{% load i18n static bundle %} {% block 'scripts' %} - +{% bundle merge_js file jquery %} + +{% endbundle %} diff --git a/app/retail/templates/gas_calculator.html b/app/retail/templates/gas_calculator.html index 0bcadcf462a..85519c87209 100644 --- a/app/retail/templates/gas_calculator.html +++ b/app/retail/templates/gas_calculator.html @@ -1,9 +1,12 @@ {% extends 'onepager/base.html' %} -{% load i18n static %} +{% load i18n static bundle %} {% block 'scripts' %} - - - + +{% bundle merge_js file gas %} + + + +{% endbundle %} {% endblock %} diff --git a/app/retail/templates/gas_guzzler.html b/app/retail/templates/gas_guzzler.html index b264bccac38..3d56cd74f6d 100644 --- a/app/retail/templates/gas_guzzler.html +++ b/app/retail/templates/gas_guzzler.html @@ -1,7 +1,11 @@ {% extends 'onepager/base.html' %} -{% load i18n static %} +{% load i18n static bundle %} {% block 'scripts' %} - + +{% bundle merge_js file jquery %} + +{% endbundle %} + {% endblock %} diff --git a/app/retail/templates/gas_heatmap.html b/app/retail/templates/gas_heatmap.html index 0a5c56fd06f..faf3fb0be6a 100644 --- a/app/retail/templates/gas_heatmap.html +++ b/app/retail/templates/gas_heatmap.html @@ -1,12 +1,13 @@ {% extends 'onepager/base.html' %} -{% load i18n static %} +{% load i18n static bundle %} {% block 'scripts' %} - - +{% bundle merge_js file jquery-gas %} + + +{% endbundle %} + - {% if gas_histories != '[]' %} +{% bundle merge_js file jquery %} + +{% endbundle %} {% endblock %} diff --git a/app/retail/templates/home/index2021.html b/app/retail/templates/home/index2021.html index 8fb82226bca..c499a8674d9 100644 --- a/app/retail/templates/home/index2021.html +++ b/app/retail/templates/home/index2021.html @@ -699,7 +699,7 @@
Ethan Chiasson
scrollElements.forEach((element) => { element.addEventListener('click', function (e) { e.preventDefault(); - if (e.target && document.querySelector(e.target.hash)) { + if (e.target && document.querySelector(e.target.hash)) { document.querySelector(e.target.hash).scrollIntoView({ behavior: 'smooth' }); diff --git a/app/retail/templates/leaderboard.html b/app/retail/templates/leaderboard.html index f2bc6fa18ae..7306f8629db 100644 --- a/app/retail/templates/leaderboard.html +++ b/app/retail/templates/leaderboard.html @@ -208,11 +208,13 @@

{% trans "None found" %}

+ {% bundle merge_js file unveil %} + + {% endbundle %} - + {% bundle merge_js file unveil %} + + {% endbundle %} diff --git a/app/retail/templates/shared/activity_scripts.html b/app/retail/templates/shared/activity_scripts.html index 8a269bcee53..dcfc3ba31fe 100644 --- a/app/retail/templates/shared/activity_scripts.html +++ b/app/retail/templates/shared/activity_scripts.html @@ -15,8 +15,10 @@ along with this program. If not, see . {% endcomment %} -{% load static %} - +{% load static bundle %} +{% bundle merge_js file jitsi %} + +{% endbundle %} - {% if not ignore_inject_web3 %} {% include 'grants/shared/shared_scripts.html' %} {% endif %} -{% include 'shared/onboard.html' %} - -{% if env == 'prod' %} - -{% else %} - -{% endif %} +{% include 'shared/onboard.html' %} {% include 'shared/sentry.html' %} - +{% bundle merge_js file core %} + + + + + + +{% endbundle %} {% bundle merge_js file libs %} - - - - - - - - - + + + + {% endbundle %} @@ -63,39 +57,41 @@ + {% bundle merge_js file jquery-extras %} - - - - + + + + {% endbundle %} {% if not slim %} {% bundle merge_js file jquery-old %} - - - - + + + {% endbundle %} {% endif %} {% bundle merge_js file main %} - - - - - - - - - - - - - + + + + + + + + + + + + + + + {% endbundle %} {% if not onepager %} @@ -105,10 +101,11 @@ {% endif %} {% if user.is_authenticated %} - - + {% bundle merge_js file authed %} + + + {% endbundle %} {% endif %} - diff --git a/app/townsquare/templates/townsquare/new.html b/app/townsquare/templates/townsquare/new.html index 11391d46044..f5c15c2f240 100644 --- a/app/townsquare/templates/townsquare/new.html +++ b/app/townsquare/templates/townsquare/new.html @@ -149,7 +149,9 @@

$('[data-toggle="tooltip"]').bootstrapTooltip(); - +{% bundle merge_js file unveil %} + +{% endbundle %}