Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanandrews committed Feb 2, 2021
2 parents 8ef291c + 49e6d03 commit e1d4c09
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .envs.example/.production/.django
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ DJANGO_SU_PASSWORD=admin
# Site Domain
RDB_SITE_URL=https://yourdomain.com

# Google Analytics option
RDB_GOOGLE_ANALYTICS_ID=

# Settings for RDB serial number generation functions
# ------------------------------------------------------------------------------
# Default pattern - "1, 2, 3, ... etc."
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Django application to manage Part, Location, and Assembly Templates, and Invento
Requirements
============

Django 2.2
Django 3.1
------------------
- Based on Django Cookiecutter template and included apps (http://cookiecutter-django.readthedocs.io/en/latest/index.html)
- django-mptt - Django app to use Modified Preorder Tree Traversal for hierarchical data models
Expand Down
1 change: 1 addition & 0 deletions roundabout/core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
def template_get_env_variables(request):
data = {}
data['rdb_site_url'] = env('RDB_SITE_URL', default='')
data['rdb_google_analytics_id'] = env('RDB_GOOGLE_ANALYTICS_ID', default=None)
return data

# Set sitewide template variable for headings/labels display
Expand Down
15 changes: 14 additions & 1 deletion roundabout/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@
<html lang="en">

<head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- Optional, add a "Measurement ID" in environmental variables to use -->
{% if rdb_google_analytics_id %}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ rdb_google_analytics_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{{ rdb_google_analytics_id }}');
</script>
{% endif %}

<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{% block title %}Roundabout DB{% endblock title %}</title>
Expand Down Expand Up @@ -184,7 +197,7 @@ <h5><span class="badge badge-pill badge-success">Editing Templates</span></h5>

<!--Copyright-->
<div class="footer-copyright py-3 text-center">
&copy; OOI-CGSN | Roundabout DB | <a href="https://github.com/WHOIGit/ooicgsn-roundabout" target="_blank">v1.6.2</a>
&copy; OOI-CGSN | Roundabout DB | <a href="https://github.com/WHOIGit/ooicgsn-roundabout" target="_blank">v1.6.2</a>
</div>
<!--/.Copyright-->

Expand Down

0 comments on commit e1d4c09

Please sign in to comment.