No intercom on blogs.

master
Nick Sergeant 2012-06-04 20:59:05 -04:00
parent 57d9f699dd
commit dc65e74b32
2 changed files with 34 additions and 31 deletions

View File

@ -51,3 +51,4 @@
{% endblock %} {% endblock %}
{% block keyboard-shortcuts %}{% endblock %} {% block keyboard-shortcuts %}{% endblock %}
{% block header %}{% endblock %} {% block header %}{% endblock %}
{% block intercom %}{% endblock %}

View File

@ -307,37 +307,39 @@
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}
{% if not debug %} {% if not debug %}
<script id="IntercomSettingsScriptTag"> {% block intercom %}
var intercomSettings = { <script id="IntercomSettingsScriptTag">
app_id: 'sajf131y', var intercomSettings = {
email: '{{ request.user.email }}', app_id: 'sajf131y',
created_at: {{ request.user.date_joined|date:"U" }}, email: '{{ request.user.email }}',
widget: { created_at: {{ request.user.date_joined|date:"U" }},
activator: '#IntercomDefaultWidget', widget: {
label: 'Support Chat' activator: '#IntercomDefaultWidget',
}, label: 'Support Chat'
custom_data: { },
'snipts count': {% snipts_count_for_user %}, custom_data: {
'profile link': 'https://snipt.net/{{ request.user.username }}/' 'snipts count': {% snipts_count_for_user %},
} 'profile link': 'https://snipt.net/{{ request.user.username }}/'
}; }
</script> };
<script> </script>
(function() { <script>
function async_load() { (function() {
var s = document.createElement('script'); function async_load() {
s.type = 'text/javascript'; s.async = true; var s = document.createElement('script');
s.src = 'https://api.intercom.io/api/js/library.js'; s.type = 'text/javascript'; s.async = true;
var x = document.getElementsByTagName('script')[0]; s.src = 'https://api.intercom.io/api/js/library.js';
x.parentNode.insertBefore(s, x); var x = document.getElementsByTagName('script')[0];
} x.parentNode.insertBefore(s, x);
if (window.attachEvent) { }
window.attachEvent('onload', async_load); if (window.attachEvent) {
} else { window.attachEvent('onload', async_load);
window.addEventListener('load', async_load, false); } else {
} window.addEventListener('load', async_load, false);
})(); }
</script> })();
</script>
{% endblock %}
{% endif %} {% endif %}
{% endif %} {% endif %}
<div class="hidden"> <div class="hidden">