Skip to content

Commit

Permalink
live coding session with @jbuget
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jun 20, 2023
1 parent 92a9374 commit af2643d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 24 deletions.
4 changes: 2 additions & 2 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,13 @@
# CSP
# ---------------------------------------
CSP_DEFAULT_SRC = ("'self'",)
CSP_STYLE_SRC = ("'self'", "https://fonts.googleapis.com")
CSP_STYLE_SRC = ("'self'", "https://fonts.googleapis.com", "'unsafe-inline'")
CSP_STYLE_SRC_ELEM = CSP_STYLE_SRC
CSP_FONT_SRC = ("'self'", "https://fonts.gstatic.com/", "data:")
CSP_SCRIPT_SRC = ("'self'", "https://cdn.jsdelivr.net", "https://tally.so")
CSP_SCRIPT_SRC_ELEM = CSP_SCRIPT_SRC
CSP_IMG_SRC = ("'self'", "data:")
CSP_INCLUDE_NONCE_IN = ["script-src", "script-src-elem", "style-src", "style-src-elem"]
CSP_INCLUDE_NONCE_IN = ["script-src", "script-src-elem"]

# HSTS
# ---------------------------------------
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/static/vendor/htmx-1.8.4/htmx.min.js

This file was deleted.

1 change: 1 addition & 0 deletions lacommunaute/static/vendor/htmx-1.9.2/htmx.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,7 @@
{% endif %}

{% if posts_count > 1 %}
<a hx-get="{% url 'forum_conversation_extension:showmore_posts' topic.forum.slug topic.forum.pk topic.slug topic.pk %}"
id="showmoreposts-button{{topic.pk}}"
hx-target="#showmorepostsarea{{topic.pk}}"
hx-swap="outerHTML"
class="btn btn-secondary btn-sm btn-ico matomo-event justify-content-center w-100 w-sm-auto mr-sm-1 mb-2 mb-sm-0"
data-matomo-category="engagement"
data-matomo-action="showmore"
data-matomo-option="post"
onclick=DisabledMe("showmoreposts-button{{topic.pk}}")
aria-label="{% trans "Show me the comment" %}"
role="button"
>
<a hx-get="{% url 'forum_conversation_extension:showmore_posts' topic.forum.slug topic.forum.pk topic.slug topic.pk %}" id="showmoreposts-button{{topic.pk}}" hx-target="#showmorepostsarea{{topic.pk}}" hx-swap="outerHTML" class="btn btn-secondary btn-sm btn-ico matomo-event justify-content-center w-100 w-sm-auto mr-sm-1 mb-2 mb-sm-0 showmoreposts-button" data-matomo-category="engagement" data-matomo-action="showmore" data-matomo-option="post" aria-label="{% trans " Show me the comment" %}" role="button">
<i class="ri-eye-line font-weight-normal" aria-hidden="true"></i>
<span>
{% if posts_count > 2 %}
Expand Down Expand Up @@ -67,7 +56,8 @@


<script nonce="{{ request.csp_nonce }}">
function DisabledMe(id) {
document.getElementById(id).classList.add('disabled');
}
var showmorepostsButtons = document.querySelectorAll('.showmoreposts-button')
showmorepostsButtons.forEach((button) => button.addEventListener('click', function () {
button.classList.add('disabled');
}));
</script>
2 changes: 1 addition & 1 deletion lacommunaute/templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
{% if COMMU_ENVIRONMENT == 'PROD' %}
<script type="text/javascript" src="{% static 'javascripts/matomo.js' %}" defer></script>
{% endif %}
<script type="text/javascript" src="{% static 'vendor/htmx-1.8.4/htmx.min.js' %}" defer></script>
<script type="text/javascript" src="{% static 'vendor/htmx-1.9.2/htmx.min.js' %}"></script>
{% endblock %}
</body>
</html>
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ django-js-asset==2.0.0 ; python_version >= "3.10" and python_version < "4.0"
django-libsass==0.9 ; python_version >= "3.10" and python_version < "4.0"
django-machina==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
django-mptt==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
django-permissions-policy==4.15.0 ; python_version >= "3.10" and python_version < "4.0"
django-permissions-policy==4.16.0 ; python_version >= "3.10" and python_version < "4.0"
django-social-share==2.3.0 ; python_version >= "3.10" and python_version < "4.0"
django-storages==1.13.2 ; python_version >= "3.10" and python_version < "4.0"
django-taggit==3.1.0 ; python_version >= "3.10" and python_version < "4.0"
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ django-js-asset==2.0.0 ; python_version >= "3.10" and python_version < "4.0"
django-libsass==0.9 ; python_version >= "3.10" and python_version < "4.0"
django-machina==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
django-mptt==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
django-permissions-policy==4.15.0 ; python_version >= "3.10" and python_version < "4.0"
django-permissions-policy==4.16.0 ; python_version >= "3.10" and python_version < "4.0"
django-social-share==2.3.0 ; python_version >= "3.10" and python_version < "4.0"
django-storages==1.13.2 ; python_version >= "3.10" and python_version < "4.0"
django-taggit==3.1.0 ; python_version >= "3.10" and python_version < "4.0"
Expand Down

0 comments on commit af2643d

Please sign in to comment.