Skip to content

Commit 0dcfc08

Browse files
authored
Merge pull request #68 from vitorfs/dev
Release v2.0.2
2 parents 495b834 + 922dc5c commit 0dcfc08

File tree

7 files changed

+42
-14
lines changed

7 files changed

+42
-14
lines changed

parsifal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from parsifal.utils.version import get_version
22

3-
VERSION = (2, 0, 1, "final", 0)
3+
VERSION = (2, 0, 2, "final", 0)
44

55
__version__ = get_version(VERSION)
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
from django.conf import settings as django_settings
22

3+
import parsifal
4+
35

46
def settings(request):
57
return {
6-
"environment": django_settings.PARSIFAL_ENVIRONMENT,
8+
"parsifal_version": parsifal.__version__,
9+
"parsifal_release": django_settings.PARSIFAL_RELEASE,
10+
"parsifal_environment": django_settings.PARSIFAL_ENVIRONMENT,
711
"recaptcha_enabled": django_settings.GOOGLE_RECAPTCHA_ENABLED,
812
"recaptcha_site_key": django_settings.GOOGLE_RECAPTCHA_SITE_KEY,
913
"google_analytics_ua": django_settings.GOOGLE_ANALYTICS_UA,
14+
"sentry_dsn": django_settings.SENTRY_DSN,
1015
}

parsifal/settings/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
199199
GOOGLE_RECAPTCHA_SITE_KEY = config("GOOGLE_RECAPTCHA_SITE_KEY", default="")
200200
GOOGLE_RECAPTCHA_SECRET_KEY = config("GOOGLE_RECAPTCHA_SECRET_KEY", default="")
201201

202+
SENTRY_DSN = config("SENTRY_DSN", default="")
202203

203204
# ==============================================================================
204205
# FIRST-PARTY APP

parsifal/settings/production.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# ==============================================================================
4242

4343
sentry_sdk.init(
44-
dsn=config("SENTRY_DSN", default=""),
44+
dsn=SENTRY_DSN,
4545
environment=PARSIFAL_ENVIRONMENT,
4646
release=PARSIFAL_RELEASE,
4747
integrations=[DjangoIntegration()],

parsifal/templates/base.html

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,33 @@
4040
<link href="{% static 'css/parsifal.css' %}" rel="stylesheet">
4141
{% endcompress %}
4242
{% block stylesheet %}{% endblock %}
43-
{% if environment == "production" and google_analytics_ua %}
44-
<!-- Global site tag (gtag.js) - Google Analytics -->
45-
<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_ua }}"></script>
46-
<script>
47-
window.dataLayer = window.dataLayer || [];
48-
function gtag(){dataLayer.push(arguments);}
49-
gtag('js', new Date());
50-
gtag('config', '{{ google_analytics_ua }}'{% if user.is_authenticated %}, {'user_id': '{{ user.pk }}'}{% endif %});
51-
</script>
43+
44+
{% if parsifal_environment == "production" %}
45+
{% if google_analytics_ua %}
46+
<!-- Google Analytics -->
47+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ google_analytics_ua }}"></script>
48+
<script>
49+
window.dataLayer = window.dataLayer || [];
50+
function gtag(){dataLayer.push(arguments);}
51+
gtag('js', new Date());
52+
gtag('config', '{{ google_analytics_ua }}'{% if user.is_authenticated %}, {'user_id': '{{ user.pk }}'}{% endif %});
53+
</script>
54+
{% endif %}
55+
56+
{% if sentry_dsn %}
57+
<!-- Sentry -->
58+
<script src="https://browser.sentry-cdn.com/6.12.0/bundle.min.js" integrity="sha384-S3qfdh3AsT1UN84WIYNuOX9vVOoFg3nB17Jp5/pTFGDBGBt+dtz7MGAV845efkZr" crossorigin="anonymous"></script>
59+
<script>
60+
Sentry.init({
61+
dsn: "{{ sentry_dsn }}",
62+
release: "{{ parsifal_release }}",
63+
environment: "{{ parsifal_environment }}",
64+
integrations: [new Sentry.Integrations.BrowserTracing()]
65+
});
66+
</script>
67+
{% endif %}
5268
{% endif %}
69+
5370
</head>
5471
<body>
5572
<div class="wrapper">

parsifal/templates/includes/footer.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,10 @@
1010
<a href="https://youtube.com/ParsifalReviews/" target="_blank" data-toggle="tooltip" title="Youtube" data-placement="top"><span class="fa fa-youtube"></span></a>
1111
</div>
1212
</div>
13+
<div class="row">
14+
<div class="col-xs-12" style="text-align: center; margin-top: -25px;">
15+
<small class="text-muted">v{{ parsifal_version }}</small>
16+
</div>
17+
</div>
1318
</div>
1419
</footer>

requirements/base.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
bleach==4.1.0
22
bibtexparser==1.2.0
3-
Django==3.2.6
3+
Django==3.2.7
44
django-compressor==2.4.1
55
django-crispy-forms==1.12.0
66
dj-database-url==0.5.0
77
requests==2.26.0
8-
Pillow==8.3.1
8+
Pillow==8.3.2
99
psycopg2-binary==2.9.1
1010
python-decouple==3.4
1111
python-docx==0.8.11

0 commit comments

Comments
 (0)