{% load staticfiles %}
{% if DEBUG_STATIC %}
<script src="{% static "lib/js/bootstrap-datetimepicker.min.js" %}" type="text/javascript"></script>
{% endif %}
<script type="text/javascript">
{% autoescape off %}
    $(function() {
      var pickerOptions = {
          format: 'YYYY-MM-DD hh:mm A',
          pickDate: true,
          pickTime: true,
          language: 'en',
          icons: {
              time: 'fa fa-clock-o',
              date: 'fa fa-calendar',
              up: 'fa fa-chevron-up',
              down: 'fa fa-chevron-down'
          }
      };
      $('#id_resource-date_picker').datetimepicker(pickerOptions);
      $('#id_resource-temporal_extent_start_picker').datetimepicker(pickerOptions);
      $('#id_resource-temporal_extent_end_picker').datetimepicker(pickerOptions);
    });

    $('.modal-forms').css('max-height', '500px').css('overflow-y', 'scroll');    
    $('.modal-cloose-btn').css('margin','20px');

    $('.modal-cloose-btn').click(function(){
      $('.modal-forms').modal('hide');
    });

    $('#id_resource-poc').change(function(){
      if($(this).val() === ''){
        $('#poc_form').modal();
      }
    });

    $('#id_resource-metadata_author').change(function(){
      if($(this).val() === ''){
        $('#metadata_form').modal();
      }
    });

    $(document).ready(function() {
        $('.has-popover').popover({'trigger':'hover'});
    });
{% endautoescape %}
</script>
