{% load geogig_tags %}

{% if DEBUG_STATIC %}
    <script src="{{ STATIC_URL }}lib/js/jquery.min.js"></script>
    <script src="{{ STATIC_URL }}lib/js/angular.js"></script>
    <script src="{{ STATIC_URL }}lib/js/bootstrap.min.js"></script>
    <script src="{{ STATIC_URL }}lib/js/ZeroClipboard.min.js"></script>
    <script src="{{ STATIC_URL }}lib/js/moment.min.js"></script>
{% endif %}
<script src="{{ STATIC_URL }}geogig/geogig.js"></script>
<link href="{{ STATIC_URL }}geogig/css/geogig.css" rel="stylesheet"/>

<script type="text/javascript">
  var module = angular.module('g', ['geogig']);
  module.constant('geogigConfig', {
    workspace: '{{ resource.workspace }}',
    store: '{{ resource.store }}',
    typename: '{{ resource.alternate }}',
    geoserverURL: '{{ GEOSERVER_BASE_URL }}',
    statisticsURL: '{%  geogig_statistics_url resource %}',
    logURL: '{% geogig_log_url resource %}',
    repoURL: '{% geogig_repo_url resource %}'
  });
  angular.bootstrap(document, ['g']);

  ZeroClipboard.config( { swfPath: '/static/lib/img/ZeroClipboard.swf' } );
    var client = new ZeroClipboard( document.getElementById("copy-button") );

    client.on( 'ready', function( readyEvent ) {
      client.on( 'aftercopy', function( event ) {
        alert('Copied ' +  event.data['text/plain'] + ' to the clipboard.');
      } );
    } );

  moment.lang('en', {
    calendar : {
        lastDay : '[Yesterday at] LT',
        sameDay : '[Today at] LT',
        nextDay : '[Tomorrow at] LT',
        lastWeek : '[last] dddd [at] LT',
        nextWeek : 'dddd [at] LT',
        sameElse : '[on] D MMM YYYY'
    }
});
</script>
