django-cards 0.11.0__tar.gz → 0.11.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {django-cards-0.11.0/django_cards.egg-info → django-cards-0.11.2}/PKG-INFO +1 -1
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/base.py +15 -6
- {django-cards-0.11.0 → django-cards-0.11.2/django_cards.egg-info}/PKG-INFO +1 -1
- {django-cards-0.11.0 → django-cards-0.11.2}/setup.py +1 -1
- {django-cards-0.11.0 → django-cards-0.11.2}/LICENSE +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/MANIFEST.in +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/README.md +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/__init__.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/apps.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/card_list/__init__.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/card_list/base.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/card_list/main.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/card_list/tree.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/includes.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/standard.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default/32px.png +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default/40px.png +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default/style.css +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default/style.min.css +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default/throbber.gif +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default-dark/32px.png +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default-dark/40px.png +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default-dark/style.css +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default-dark/style.min.css +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default-dark/throbber.gif +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/30px.png +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/32px.png +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.eot +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.svg +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.ttf +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.woff +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.eot +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.svg +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.woff +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.eot +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.svg +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.ttf +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.woff +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/style.css +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/style.min.css +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/throbber.gif +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/js/jstree.js +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/js/jstree.min.js +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/groups/groups.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/blank.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/card_group.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/datatable.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/default.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/default_body.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/html.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/list_selection.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/message.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/table.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/table_body.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/tree_selection.html +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templatetags/__init__.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/templatetags/django_cards_tags.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/cards/url_converters.py +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/django_cards.egg-info/SOURCES.txt +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/django_cards.egg-info/dependency_links.txt +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/django_cards.egg-info/top_level.txt +0 -0
- {django-cards-0.11.0 → django-cards-0.11.2}/setup.cfg +0 -0
@@ -1,5 +1,6 @@
|
|
1
1
|
import datetime
|
2
2
|
import json
|
3
|
+
from collections import defaultdict
|
3
4
|
|
4
5
|
from ajax_helpers.utils import random_string
|
5
6
|
from django.core.exceptions import FieldDoesNotExist
|
@@ -134,7 +135,7 @@ class CardBase:
|
|
134
135
|
|
135
136
|
def add_boolean_entry(self, value, label=None, hidden=False, html_override=None,
|
136
137
|
entry_css_class=None, css_class=None,
|
137
|
-
menu=None, default_if=None, value_type=None, **kwargs):
|
138
|
+
menu=None, default_if=None, value_type=None, row_style=None, **kwargs):
|
138
139
|
if value:
|
139
140
|
entry = self._add_entry_internal(value='<i class="fas fa-check" style="color:green;"></i>',
|
140
141
|
label=label,
|
@@ -145,6 +146,7 @@ class CardBase:
|
|
145
146
|
menu=menu,
|
146
147
|
default_if=default_if,
|
147
148
|
value_type=value_type,
|
149
|
+
row_style=row_style,
|
148
150
|
**kwargs)
|
149
151
|
else:
|
150
152
|
entry = self._add_entry_internal(value='<i class="fas fa-times" style="color:red;"></i>',
|
@@ -156,11 +158,13 @@ class CardBase:
|
|
156
158
|
menu=menu,
|
157
159
|
default_if=default_if,
|
158
160
|
value_type=value_type,
|
161
|
+
row_style=row_style,
|
159
162
|
**kwargs)
|
160
163
|
return entry
|
161
164
|
|
162
165
|
def add_date_entry(self, value, label=None, hidden=False, html_override=None,
|
163
|
-
entry_css_class=None, css_class=None, menu=None, default_if=None,
|
166
|
+
entry_css_class=None, css_class=None, menu=None, default_if=None,
|
167
|
+
value_type=None, row_style=None, **kwargs):
|
164
168
|
new_value = value.strftime('%d/%m/%y')
|
165
169
|
return self._add_entry_internal(value=new_value,
|
166
170
|
label=label,
|
@@ -171,6 +175,7 @@ class CardBase:
|
|
171
175
|
menu=menu,
|
172
176
|
default_if=default_if,
|
173
177
|
value_type=value_type,
|
178
|
+
row_style=row_style,
|
174
179
|
**kwargs)
|
175
180
|
|
176
181
|
def add_row(self, *args, extra_row_kwargs=None):
|
@@ -284,7 +289,7 @@ class CardBase:
|
|
284
289
|
def _add_many_to_many_field(self, label, query, query_filter=None, m2m_field=None,
|
285
290
|
html_barge=None, default='N/A', html_override=None,
|
286
291
|
entry_css_class=None, css_class=None, menu=None,
|
287
|
-
default_if=None, value_type=None, **kwargs):
|
292
|
+
default_if=None, value_type=None, row_style=None, **kwargs):
|
288
293
|
if html_barge is None:
|
289
294
|
html_barge = '<span class="small badge badge-pill badge-primary"> %1% </span> '
|
290
295
|
|
@@ -313,6 +318,7 @@ class CardBase:
|
|
313
318
|
menu=menu,
|
314
319
|
default_if=default_if,
|
315
320
|
value_type=value_type,
|
321
|
+
row_style=row_style,
|
316
322
|
**kwargs)
|
317
323
|
|
318
324
|
def _add_entry_internal(self, value=None, field=None, label=None, default='N/A', link=None,
|
@@ -335,6 +341,7 @@ class CardBase:
|
|
335
341
|
menu=menu,
|
336
342
|
default_if=default_if,
|
337
343
|
value_type=value_type,
|
344
|
+
row_style=row_style,
|
338
345
|
**kwargs)
|
339
346
|
elif isinstance(value, datetime.date):
|
340
347
|
return self.add_date_entry(value=value,
|
@@ -344,6 +351,7 @@ class CardBase:
|
|
344
351
|
menu=menu,
|
345
352
|
default_if=default_if,
|
346
353
|
value_type=value_type,
|
354
|
+
row_style=row_style,
|
347
355
|
**kwargs)
|
348
356
|
elif hasattr(value, 'through'):
|
349
357
|
return self._add_many_to_many_field(label=label,
|
@@ -355,6 +363,7 @@ class CardBase:
|
|
355
363
|
menu=menu,
|
356
364
|
default_if=default_if,
|
357
365
|
value_type=value_type,
|
366
|
+
row_style=row_style,
|
358
367
|
**kwargs)
|
359
368
|
else:
|
360
369
|
if value is None or value == '' or default_if:
|
@@ -402,11 +411,11 @@ class CardBase:
|
|
402
411
|
|
403
412
|
value_dict = {'value': value,
|
404
413
|
'label': label,
|
405
|
-
'menu': menu,
|
406
414
|
'link': link,
|
407
415
|
**kwargs}
|
408
|
-
|
409
|
-
|
416
|
+
if menu is not None:
|
417
|
+
value_dict['menu'] = menu.render()
|
418
|
+
row_style_html = html_row_style.format_map(defaultdict(lambda: '', value_dict))
|
410
419
|
|
411
420
|
entry = {'label': label,
|
412
421
|
'html': value,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default/32px.png
RENAMED
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default/40px.png
RENAMED
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/default/style.css
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/30px.png
RENAMED
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/32px.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/style.css
RENAMED
File without changes
|
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/static/cards/jstree/css/themes/proton/throbber.gif
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/default_body.html
RENAMED
File without changes
|
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/list_selection.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{django-cards-0.11.0 → django-cards-0.11.2}/cards/templates/cards/standard/tree_selection.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|