<script>
  var addthis_config = {
    {% if addthis.USERNAME %}
      username: "{{ addthis.USERNAME }}",
    {% endif %}

    {% if addthis.SERVICES_EXCLUDE %}
      services_exclude: "{{ addthis.SERVICES_EXCLUDE }}",
    {% endif %}
    {% if addthis.SERVICES_COMPACT %}
      services_compact: "{{ addthis.SERVICES_COMPACT }}",
    {% endif %}
    {% if addthis.SERVICES_EXPANDED %}
      services_expanded: "{{ addthis.SERVICES_EXPANDED }}",
    {% endif %}
    {# TODO: Review {{ addthis.SERVICES_CUSTOM|safe }} #}
    {% if addthis.SERVICES_CUSTOM %}
      services_custom: "{{ addthis.SERVICES_CUSTOM|safe }}",
    {% endif %}

    ui_click: {{ addthis.UI_CLICK|yesno:"true,false" }},
    {% if addthis.UI_DELAY %}
      ui_delay: {{ addthis.UI_DELAY }},
    {% endif %}
    {% if addthis.UI_HOVER_DIRECTION %}
      ui_hover_direction: {{ addthis.UI_HOVER_DIRECTION }},
    {% endif %}
    {% if addthis.UI_LANGUAGE %}
      ui_language: "{{ addthis.UI_LANGUAGE }}",
    {% endif %}
    {% if addthis.UI_OFFSET_TOP %}
      ui_offset_top: {{ addthis.UI_OFFSET_TOP }},
    {% endif %}
    {% if addthis.UI_OFFSET_LEFT %}
      ui_offset_left: {{ addthis.UI_OFFSET_LEFT }},
    {% endif %}
    {% if addthis.UI_HEADER_COLOR %}
      ui_header_color: "{{ addthis.UI_HEADER_COLOR }}",
    {% endif %}
    {% if addthis.UI_HEADER_BACKGROUND %}
      ui_header_background: "{{ addthis.UI_HEADER_BACKGROUND }}",
    {% endif %}
    {% if addthis.UI_COBRAND %}
      ui_cobrand: "{{ addthis.UI_COBRAND }}",
    {% endif %}
    ui_use_css: {{ addthis.UI_USE_CSS|yesno:"true,false" }},
    ui_use_addressbook: {{ addthis.UI_USE_ADDRESSBOOK|yesno:"true,false" }},
    ui_508_compliant: {{ addthis.UI_508_COMPLIANT|yesno:"true,false" }},

    data_track_clickback: {{ addthis.DATA_TRACK_CLICKBACK|yesno:"true,false" }},
    {% if addthis.DATA_GA_TRACKER %}
      data_ga_tracker: "{{ addthis.DATA_GA_TRACKER }}",
    {% endif %}
  };
</script>

<script src="//s7.addthis.com/js/300/addthis_widget.js#pubid={{ pub_id }}"></script>
