Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
f1nality committed Jul 24, 2016
2 parents 13596a8 + faca801 commit c7ef82d
Show file tree
Hide file tree
Showing 45 changed files with 694 additions and 128 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
- DJANGO=1.6.11
- DJANGO=1.7.7
- DJANGO=1.8.3
- DJANGO=1.9.8
before_install:
- export DJANGO_SETTINGS_MODULE=jet.tests.settings
install:
Expand All @@ -28,3 +29,9 @@ matrix:
env: DJANGO=1.7.7
- python: 2.6
env: DJANGO=1.8.3
- python: 2.6
env: DJANGO=1.9.8
- python: 3.2
env: DJANGO=1.9.8
- python: 3.3
env: DJANGO=1.9.8
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
=========

0.1.5
-----
* Add inlines.min.js
* Specify IE compatibility version
* Add previous/next buttons to change form
* Add preserving filters when returning to changelist
* Add opened tab remembering
* Fix breadcrumbs text overflow
* PR-65: Fixed Django 1.8+ compatibility issues (thanks to hanuprateek, SalahAdDin, cdrx for pull requests)
* PR-73: Added missing safe template tag on the change password page (thanks to JensAstrup for pull request)


0.1.4
-----
* [Feature] Side bar compact mode (lists all models without opening second menu)
Expand Down
8 changes: 2 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Django JET

Django JET has two kinds of licenses: open-source (GPLv2) and commercial. Please note that using GPLv2
code in your programs make them GPL too. So if you don't want to comply with that we can provide you a commercial
license (in this case please email at [email protected]). The commercial license
is designed for using Django JET in commercial products and applications without the provisions of the GPLv2.
license (visit Home page). The commercial license is designed for using Django JET in commercial products
and applications without the provisions of the GPLv2.

.. image:: https://raw.githubusercontent.com/geex-arts/jet/static/logo.png
:width: 500px
Expand Down Expand Up @@ -43,10 +43,6 @@ Screenshots
:align: center
:target: https://raw.githubusercontent.com/geex-arts/jet/static/screen3.png

Beta
====
Current version is still in beta phase. Use it at your own risk (though may be already enough workable).

License
=======
Django JET is licensed under a
Expand Down
4 changes: 0 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ About
:height: 500px
:scale: 50%

Beta
====
Current version is still in beta phase. Use it at your own risk (though may be already enough workable).

Getting started
===============

Expand Down
2 changes: 1 addition & 1 deletion jet/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '0.1.4'
VERSION = '0.1.5'
5 changes: 4 additions & 1 deletion jet/dashboard/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
from django.template.loader import render_to_string
from jet.dashboard import modules
from jet.dashboard.models import UserDashboardModule
from django.core.context_processors import csrf
from django.utils.translation import ugettext_lazy as _
from jet.ordered_set import OrderedSet
from jet.utils import get_admin_site_name
try:
from django.template.context_processors import csrf
except ImportError:
from django.core.context_processors import csrf


class Dashboard(object):
Expand Down
2 changes: 2 additions & 0 deletions jet/dashboard/templates/jet.dashboard/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
</div>

<div class="dashboard-item-content{% if module.contrast %} contrast{% endif %}"{% if module.style %} style="{{ module.style }}"{% endif %}>
{{ module.pre_contenta|default_if_none:"" }}
{% if module.ajax_load %}
<div class="loading-indicator-wrapper">
<span class="icon-refresh loading-indicator"></span>
</div>
{% else %}
{{ module.render }}
{% endif %}
{{ module.post_content|default_if_none:"" }}
</div>
</div>
9 changes: 6 additions & 3 deletions jet/dashboard/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import django
from django.conf.urls import patterns, url
from django.views.i18n import javascript_catalog
from jet.dashboard import dashboard
from jet.dashboard.views import update_dashboard_modules_view, add_user_dashboard_module_view, \
update_dashboard_module_collapse_view, remove_dashboard_module_view, UpdateDashboardModuleView, \
load_dashboard_module_view, reset_dashboard_view

urlpatterns = patterns(
'',
urlpatterns = [
url(
r'^module/(?P<pk>\d+)/$',
UpdateDashboardModuleView.as_view(),
Expand Down Expand Up @@ -48,6 +48,9 @@
{'packages': ('jet',)},
name='jsi18n'
),
)
]

urlpatterns += dashboard.urls.get_urls()

if django.VERSION[:2] < (1, 8):
urlpatterns = patterns('', *urlpatterns)
23 changes: 16 additions & 7 deletions jet/filters.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
from django.contrib.admin import RelatedFieldListFilter
from django.contrib.admin.utils import get_model_from_relation
from django.core.urlresolvers import reverse
from django.forms.utils import flatatt
from django.utils.encoding import smart_text
from django.utils.html import format_html
from django.core.urlresolvers import reverse

try:
from django.contrib.admin.utils import get_model_from_relation
except ImportError: # Django 1.6
from django.contrib.admin.util import get_model_from_relation

try:
from django.forms.utils import flatatt
except ImportError: # Django 1.6
from django.forms.util import flatatt


class RelatedFieldAjaxListFilter(RelatedFieldListFilter):
Expand All @@ -13,10 +21,11 @@ def has_output(self):
return True

def field_choices(self, field, request, model_admin):
app_label = field.related_model._meta.app_label
model_name = field.related_model._meta.object_name
model = field.remote_field.model if hasattr(field, 'remote_field') else field.related_field.model
app_label = model._meta.app_label
model_name = model._meta.object_name

self.ajax_attrs = format_html('{}', flatatt({
self.ajax_attrs = format_html('{0}', flatatt({
'data-app-label': app_label,
'data-model': model_name,
'data-ajax--url': reverse('jet:model_lookup'),
Expand All @@ -32,5 +41,5 @@ def field_choices(self, field, request, model_admin):
else:
rel_name = other_model._meta.pk.name

queryset = field.related_model._default_manager.filter(**{rel_name: self.lookup_val}).all()
queryset = model._default_manager.filter(**{rel_name: self.lookup_val}).all()
return [(x._get_pk_val(), smart_text(x)) for x in queryset]
3 changes: 3 additions & 0 deletions jet/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
# Side menu
JET_SIDE_MENU_COMPACT = getattr(settings, 'JET_SIDE_MENU_COMPACT', False)
JET_SIDE_MENU_CUSTOM_APPS = getattr(settings, 'JET_SIDE_MENU_CUSTOM_APPS', None)

# Improved usability
JET_CHANGE_FORM_SIBLING_LINKS = getattr(settings, 'JET_CHANGE_FORM_SIBLING_LINKS', True)
28 changes: 27 additions & 1 deletion jet/static/admin/js/admin/RelatedObjectLookups.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,30 @@ function showRelatedPopup(name, href) {
function closeRelatedPopup(win) {
jet.jQuery('select').trigger('select:init');
jet.jQuery(win.parent).trigger('related-popup:close');
}
}

django.jQuery(document).ready(function() {
jet.jQuery(function($){
function updateLinks() {
var $this = $(this);
var siblings = $this.nextAll('.change-related, .delete-related');
if (!siblings.length) return;
var value = $this.val();
if (value) {
siblings.each(function(){
var elm = $(this);
elm.attr('href', elm.attr('data-href-template').replace('__fk__', value));
});
} else siblings.removeAttr('href');
}
var container = $(document);
container.on('change', '.related-widget-wrapper select', updateLinks);
container.find('.related-widget-wrapper select').each(updateLinks);
container.on('click', '.related-widget-wrapper-link', function(event){
if (this.href) {
showRelatedObjectPopup(this);
}
event.preventDefault();
});
});
});
1 change: 1 addition & 0 deletions jet/static/admin/js/admin/RelatedObjectLookups.min.js

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

1 change: 1 addition & 0 deletions jet/static/admin/js/inlines.min.js

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

25 changes: 0 additions & 25 deletions jet/static/admin/js/related-widget-wrapper.js
Original file line number Diff line number Diff line change
@@ -1,25 +0,0 @@
django.jQuery(document).ready(function() {
jet.jQuery(function($){
function updateLinks() {
var $this = $(this);
var siblings = $this.nextAll('.change-related, .delete-related');
if (!siblings.length) return;
var value = $this.val();
if (value) {
siblings.each(function(){
var elm = $(this);
elm.attr('href', elm.attr('data-href-template').replace('__fk__', value));
});
} else siblings.removeAttr('href');
}
var container = $(document);
container.on('change', '.related-widget-wrapper select', updateLinks);
container.find('.related-widget-wrapper select').each(updateLinks);
container.on('click', '.related-widget-wrapper-link', function(event){
if (this.href) {
showRelatedObjectPopup(this);
}
event.preventDefault();
});
});
});
1 change: 1 addition & 0 deletions jet/static/admin/js/related-widget-wrapper.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 5 additions & 0 deletions jet/static/jet/css/_changeform.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@
border-radius: 4px;
min-width: 800px;

&-navigation {
float: left;
margin-bottom: 20px;
}

&-tabs {
@extend .clear-list;
border-bottom: 2px solid $background-color;
Expand Down
40 changes: 39 additions & 1 deletion jet/static/jet/css/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,45 @@
}
}

a.button {
.segmented-button {
&, &:visited, &:hover {
@extend .base_input;
font-size: 12px;
text-align: center;
background-color: $button-background-color;
color: $button-text-color;
padding: 0 10px;
display: inline-block;
text-transform: none;
border-radius: 0;
}

&:hover {
background-color: $button-hover-background-color;
color: $button-hover-text-color;
}

&:active {
background-color: $button-active-background-color;
color: $button-active-text-color;
}

&.disabled {
background-color: $button-background-color !important;
color: $button-text-color;
opacity: 0.5;
}

&.left {
border-radius: 4px 0 0 4px;
}

&.right {
border-radius: 0 4px 4px 0;
}
}

a.button, a.segmented-button {
line-height: 32px;
}

Expand Down
7 changes: 7 additions & 0 deletions jet/static/jet/css/_top.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
@import "globals";

.breadcrumbs {
white-space: nowrap;
text-overflow: ellipsis;
padding-right: 200px;
overflow: hidden;
}

.top {
padding: 20px;

Expand Down
Loading

0 comments on commit c7ef82d

Please sign in to comment.