Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: open edit file popup from file widget (#1301)
* feat: open edit file popup from file widget * fix: rename popup_response.js to filer_popup_response.js to ensure not overriding django's file * fix: minor * chore: add edit from widget tests * fix: clean-up file widget style * fix: mobile devices styling * fix: hide edit file button when no file selected * fix: lookup icon hidden on recent djangocms * style: format * fix: missing updated compiled css * fix: jscs and jshint complaints * fix: legacyize code * fix: restore const * fix: legacyize code again * fix: better ellipsis cut width + simplify css * fix: change choose and replace buttons icon * test: add initial AdminFileWidget test * fix: consistent filer dropzone buttons margin left
- Loading branch information
1 parent
76c69f1
commit ed8f8a8
Showing
16 changed files
with
193 additions
and
44 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*global opener */ | ||
(function () { | ||
'use strict'; | ||
var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse); | ||
switch (initData.action) { | ||
case 'change': | ||
// Specific function for file editing popup opened from widget | ||
opener.dismissRelatedImageLookupPopup(window, initData.new_value, null, initData.obj, null); | ||
break; | ||
case 'delete': | ||
opener.dismissDeleteRelatedObjectPopup(window, initData.value); | ||
break; | ||
default: | ||
opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj); | ||
break; | ||
} | ||
})(); |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% extends "admin/filer/base_site.html" %} | ||
{% load static %} | ||
|
||
{% block extrahead %} | ||
{{ block.super }} | ||
<script id="django-admin-popup-response-constants" | ||
src="{% static "filer/js/addons/filer_popup_response.js" %}" | ||
data-popup-response="{{ popup_response_data }}"> | ||
</script> | ||
{% endblock %} |
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
Oops, something went wrong.