This repository has been archived by the owner on Jul 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* release/3.2: updates lint code updates pep8 fix warnings updates
- Loading branch information
Showing
16 changed files
with
182 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
NAME = "django-admin-extra-urls" | ||
VERSION = __version__ = "3.1" | ||
VERSION = __version__ = "3.2" | ||
__author__ = 'sax' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .config import ButtonAction, ChangeFormButton, ChangeListButton | ||
from .decorators import action, link, try_catch | ||
from .mixins import ExtraUrlMixin | ||
from .config import ButtonAction, ChangeFormButton, ChangeListButton # noqa: F401 | ||
from .decorators import action, link, try_catch # noqa: F401 | ||
from .mixins import ExtraUrlMixin # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import warnings | ||
|
||
from .api import * # noqa: F403, F401 | ||
|
||
warnings.warn("extras is deprecated. Please use `from admon_extra_urls import api`", DeprecationWarning) | ||
from .api import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/admin_extra_urls/templates/admin_extra_urls/action_page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% extends "admin_extra_urls/change_form.html" %}{% load i18n static extra_urls admin_list admin_urls %} | ||
{% block breadcrumbs %} | ||
<div class="breadcrumbs"> | ||
{% block breadcrumbs-items %} | ||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> | ||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a> | ||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a> | ||
› <a href="{% url opts|admin_urlname:'change' original.pk %}">{{ original }}</a> | ||
{% block breadcrumbs-active %} | ||
› {{ action|default_if_empty:title }} | ||
{% endblock %} | ||
{% endblock %} | ||
</div> | ||
{% endblock %} | ||
{% block content_title %}<h1>{{ title|default_if_empty:" " }}</h1>{% endblock %} | ||
{% block content %}<div id="content-main"> | ||
{% block object-tools %} | ||
<ul class="object-tools"> | ||
{% block object-tools-items %} | ||
{% include "admin_extra_urls/includes/change_form_buttons.html" %} | ||
{% endblock %} | ||
</ul> | ||
{% endblock %}{% block action-content %}{% endblock %} | ||
{% block document_ready %}{% endblock %} | ||
{% endblock %} | ||
|
||
{#{% block object-tools-items %}#} | ||
{# {{ block.super }}#} | ||
{# {% include "admin_extra_urls/includes/change_form_buttons.html" %}#} | ||
{#{% endblock %}#} | ||
|
28 changes: 26 additions & 2 deletions
28
src/admin_extra_urls/templates/admin_extra_urls/change_form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
{% extends "admin/change_form.html" %} | ||
{% load i18n static admin_list admin_urls %} | ||
{% extends "admin/change_form.html" %}{% load i18n static admin_list admin_urls %} | ||
{% block extrastyle %}{{ block.super }}<style> | ||
.object-tools a.extra-link.disabled { | ||
background: #ece8e8; | ||
cursor: not-allowed; | ||
} | ||
</style>{% endblock %} | ||
|
||
{% block object-tools-items %} | ||
{{ block.super }} | ||
{% include "admin_extra_urls/includes/change_form_buttons.html" %} | ||
{% endblock %} | ||
{% block admin_change_form_document_ready %}{{ block.super }} | ||
|
||
<script> | ||
(function ($) { | ||
window.AdminExtraUrl = {update: function(){ | ||
var changes = $mainForm.serialize() | ||
if (changes !== $mainForm.data('serialized')) { | ||
$('.object-tools').find('a.auto-disable').addClass('disabled'); | ||
} else { | ||
$('.object-tools').find('a.auto-disable').removeClass('disabled'); | ||
} | ||
} | ||
} | ||
var $mainForm = $('#{{ opts.model_name }}_form'); | ||
$mainForm.data('serialized', $mainForm.serialize()); | ||
$mainForm.on('change input', AdminExtraUrl.update); | ||
})(django.jQuery) | ||
</script> | ||
{% endblock %} |
Oops, something went wrong.