Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds the blocks analytics anad javascripts in the base template, allo… #1580

Merged
merged 1 commit into from
Sep 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
### 0.12.0 (Major Release)

#### Misc Changes
* Adds the {% block analytics %} in the base template (opal/templates/base.html) that by default contains the google analytics code.

* Adds the block {% block javascripts %} in the base template (opal/templates/base.html) that will compress all javascripts.

* Adds a method `.demographics()` to `opal.models.Patient` which returns the relevant demographics instance.

Expand Down
34 changes: 19 additions & 15 deletions opal/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
</script>

{% compress js %}
{% block javascripts %}
{% core_javascripts 'opal.upstream.deps' %}
{% block opal_js %}
{% plugin_javascripts 'opal.upstream.deps' %}
Expand All @@ -47,11 +48,12 @@
{% block angularapp %}
<script type="text/javascript" src="{% static "js/opal/app.js" %}"></script>
<script type="text/javascript" src="{% static "js/opal/routes.js" %}"></script>
{% endblock %}
{% endblock angularapp %}

{% application_javascripts %}
<script type="text/javascript" src="{% static "js/opal/timer.js" %}"></script>
{% endblock opal_js %}
{% endblock javascripts %}
{% endcompress %}

<link href="{% static "js/lib/c3-0.4.10/c3.css" %}" rel="stylesheet" media="all">
Expand Down Expand Up @@ -101,20 +103,22 @@ <h4 class="growl-title" ng-show="message.title" ng-bind="message.title"></h4>
</script>

<!-- google analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

{% if OPAL_ANALYTICS_NODOMAIN %}
ga('create', '{{ OPAL_ANALYTICS_ID }}', {
'cookieDomain': 'none'
});
{% else %}
ga('create', '{{ OPAL_ANALYTICS_ID }}', 'auto');
{% endif %}
</script>
{% block analytics %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

{% if OPAL_ANALYTICS_NODOMAIN %}
ga('create', '{{ OPAL_ANALYTICS_ID }}', {
'cookieDomain': 'none'
});
{% else %}
ga('create', '{{ OPAL_ANALYTICS_ID }}', 'auto');
{% endif %}
</script>
{% endblock analytics %}
</body>

</html>