{% extends "admin/change_form.html" %}
{% load i18n admin_urls admin_static admin_modify %}

{% block extrastyle %}{{ block.super }}
<link href="//netdna.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.css" rel="stylesheet" />
{% endblock %}

{% block after_related_objects %}
<script>
	var url = "https://api.instagram.com/oauth/authorize/?client_id={{ client_id }}&redirect_uri={{ redirect_uri }}&response_type=code";
	var style = "top=50, left=50, width=800, height=600, status=no, menubar=no, toolbar=no scrollbars=no";

	function django_instagram_popup()
	{
  		var win = window.open(url, "{% trans 'Get Access Token' %}", style);
  		win.focus();
	}
</script>
{% endblock %}

{% block submit_buttons_bottom %}
<div class="submit-row">
	<input class="default" type="submit" value="{% trans 'Save' %}" name="_save" />
	<input class="default" type="button" value="{% trans 'Get Access Token' %}" onclick="django_instagram_popup()" />
</div>
{% endblock %}
