Skip to content

Commit

Permalink
Merge pull request #17 from djk2/issue_16
Browse files Browse the repository at this point in the history
Issue 16
  • Loading branch information
djk2 committed Jan 27, 2020
2 parents 54d7f55 + 97e7037 commit 1f1da4a
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python package
name: Lint by Flake

on: [push]

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
python: [2.7, 3.7]
python: [3.7]

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ matrix:
- { python: 3.6, env: TOXENV=py36-dj_2.1-latest_bootstraps-crispy_1.8-tests }
- { python: 3.6, env: TOXENV=py36-dj_2.2-latest_bootstraps-crispy_1.7-tests }
- { python: 3.6, env: TOXENV=py36-dj_2.2-latest_bootstraps-crispy_1.8-tests }
- { python: 3.6, env: TOXENV=py36-dj_2.1-latest_bootstraps-crispy_1.8-tests }
- { python: 3.6, env: TOXENV=py36-dj_2.2-latest_bootstraps-crispy_1.8-tests }
- { python: 3.6, env: TOXENV=py36-dj_3.0-latest_bootstraps-crispy_1.8-tests }

install:
- pip install tox>=2.5.0
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG for django-popup-view-field

## 0.6.1 (2020-01-27)

* Added support for Django 3.0 (demand django-crispy-forms >= 1.8.0 )

* Fixed javascript for bootstrap4.
In script was used incorrectly `id` attribute of dialog element.
Now `id` of `<div>` dialog for popup is different for bootstrap3 and bootstrap4.

## 0.6.0 (2020-01-23)

* Added support for Django 2.2
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can create normal django View and load this view in dialog for form field.
- Support:

* Python: 2.7, 3.6
* Django: 1.9, 1.10, 1.11, 2.0, 2.1
* Django: 1.9, 1.10, 1.11, 2.0, 2.1, 2.2, 3.0
* django-crispy-forms
* django-bootstrap3
* django-bootstrap4 (!Only for Django >= 2.1)
Expand Down
4 changes: 2 additions & 2 deletions demo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Django==2.2.9
Django==3.0.2
django-bootstrap3==12.0.3
django-bootstrap4==1.1.1
django-crispy-forms==1.7.2
django-crispy-forms==1.8.1
../.
2 changes: 1 addition & 1 deletion django_popup_view_field/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (0, 6, 0)
VERSION = (0, 6, 1)
__version__ = ".".join(str(i) for i in VERSION)
SUPPORTED_BOOTSTRAP_VER = ('bootstrap3', 'bootstrap4')
2 changes: 1 addition & 1 deletion django_popup_view_field/locale/pl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-04-19 13:46+0200\n"
"POT-Creation-Date: 2020-01-27 20:51+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
Binary file modified django_popup_view_field/locale/pl/LC_MESSAGES/djangojs.mo
Binary file not shown.
22 changes: 17 additions & 5 deletions django_popup_view_field/locale/pl/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-09 22:04+0100\n"
"POT-Creation-Date: 2020-01-27 20:45+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -19,9 +19,21 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"

#: static/django_popup_view_field/js/django_popup_view_field.js:100
msgid "Close"
msgstr "Zamknij"
#: static/django_popup_view_field/js/django_popup_view_field.js:99
#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap3.js:99
#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap3.min.js:1
#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap4.js:96
#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap4.min.js:1
msgid "Data is loading ..."
msgstr "Trwa ładowanie danych ..."

#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap3.js:100
#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap3.min.js:1
#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap4.js:97
#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap4.min.js:1
msgid "Close"
msgstr "Zamknij"

#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap4.js:89
#: django_popup_view_field/static/django_popup_view_field/js/django_popup_view_field_bootstrap4.min.js:1
msgid "Error on loading data."
msgstr "Błąd podczas ładowania danych."
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ $(document).ready(function(){
bind_events($dialog, $button);
});
request.fail(function(response){
$dialog.modal('dispose');
$dialog.find(".modal-body").html(gettext('Error on loading data.'));
throw new Error("django-popup-view-field - Ajax request to url: " + url);
});
};

var set_dialog = function($button){
var $dialog = $("#django-popup-view-field");
var $dialog = $("#django-popup-view-field-dialog");
var dial_body = gettext('Data is loading ...');
var dial_close = gettext('Close');
if ($button !== null) {
Expand All @@ -103,22 +103,19 @@ $(document).ready(function(){
$dialog.find(".modal-title").html(dial_title);
$dialog.find(".modal-body").html(dial_body);
$dialog.find(".modal-footer-close").html(dial_close);
return $dialog;
};

$(".popup-view-btn-load").on("click", function(){
var $button = $(this);
var url = get_url($button);
var $dialog = $("#django-popup-view-field");
set_dialog($button);
$dialog = set_dialog($button);
$dialog.modal('show');
get_content($dialog, $button, url, "GET", null);

$dialog.on('hidden.bs.modal', function (e) {
$dialog.modal('hide');
set_dialog(null);
});

$dialog.modal({});

});

$(".popup-view-btn-clear").on("click", function(){
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django==2.2.9
Django==3.0.2
tox>=2.5.0
django-bootstrap3>=12.0.3
django-bootstrap4>=1.1.1
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ envlist=
{py27,py36}-dj_1.10-bootstrap3_{7.1,8.1,8.2}-crispy_{1.5,1.6}-tests,
{py27,py36}-dj_1.11-bootstrap3_{8.2}-crispy_{1.6}-tests,
{py36}-dj_{2.0,2.1,2.2}-latest_bootstraps-crispy_{1.7,1.8}-tests,
{py36}-dj_{2.1,2.2}-latest_bootstraps-crispy_{1.8}-tests,
{py36}-dj_{2.1,2.2,3.0}-latest_bootstraps-crispy_{1.8}-tests,
{py27,py36}-flake

[testenv]
Expand All @@ -23,6 +23,7 @@ deps =
dj_2.0: Django>=2.0,<2.1
dj_2.1: Django>=2.1,<2.2
dj_2.2: Django>=2.2,<2.3
dj_3.0: Django>=3.0,<3.1
crispy_1.5: django-crispy-forms==1.5.1
crispy_1.6: django-crispy-forms==1.6.1
crispy_1.7: django-crispy-forms==1.7.2
Expand Down

0 comments on commit 1f1da4a

Please sign in to comment.