django-cards 0.8.6__tar.gz → 0.8.8__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {django-cards-0.8.6/django_cards.egg-info → django-cards-0.8.8}/PKG-INFO +1 -1
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/base.py +31 -18
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/standard.py +0 -1
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/table_body.html +4 -4
- {django-cards-0.8.6 → django-cards-0.8.8/django_cards.egg-info}/PKG-INFO +1 -1
- {django-cards-0.8.6 → django-cards-0.8.8}/setup.py +1 -1
- {django-cards-0.8.6 → django-cards-0.8.8}/LICENSE +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/MANIFEST.in +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/README.md +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/__init__.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/apps.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/card_list/__init__.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/card_list/base.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/card_list/main.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/card_list/tree.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/includes.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/32px.png +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/40px.png +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/style.css +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/style.min.css +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/throbber.gif +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default-dark/32px.png +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default-dark/40px.png +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default-dark/style.css +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default-dark/style.min.css +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default-dark/throbber.gif +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/30px.png +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/32px.png +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.eot +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.svg +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.ttf +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.woff +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.eot +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.svg +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.woff +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.eot +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.svg +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.ttf +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.woff +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/style.css +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/style.min.css +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/throbber.gif +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/js/jstree.js +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/js/jstree.min.js +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/groups/groups.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/blank.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/card_group.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/datatable.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/default.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/default_body.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/html.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/list_selection.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/message.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/table.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/tree_selection.html +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templatetags/__init__.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/templatetags/django_cards_tags.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/cards/url_converters.py +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/django_cards.egg-info/SOURCES.txt +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/django_cards.egg-info/dependency_links.txt +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/django_cards.egg-info/top_level.txt +0 -0
- {django-cards-0.8.6 → django-cards-0.8.8}/setup.cfg +0 -0
@@ -124,7 +124,7 @@ class CardBase:
|
|
124
124
|
extra_info['html'] = kwargs.get('html')
|
125
125
|
|
126
126
|
def add_boolean_entry(self, value, label=None, hidden=False, html_override=None,
|
127
|
-
entry_css_class=None, css_class=None, menu=None, default_if=None):
|
127
|
+
entry_css_class=None, css_class=None, menu=None, default_if=None, **kwargs):
|
128
128
|
if value:
|
129
129
|
entry = self._add_entry_internal(value='<i class="fas fa-check" style="color:green;"></i>',
|
130
130
|
label=label,
|
@@ -133,7 +133,8 @@ class CardBase:
|
|
133
133
|
entry_css_class=entry_css_class,
|
134
134
|
css_class=css_class,
|
135
135
|
menu=menu,
|
136
|
-
default_if=default_if
|
136
|
+
default_if=default_if,
|
137
|
+
**kwargs)
|
137
138
|
else:
|
138
139
|
entry = self._add_entry_internal(value='<i class="fas fa-times" style="color:red;"></i>',
|
139
140
|
label=label,
|
@@ -142,11 +143,12 @@ class CardBase:
|
|
142
143
|
entry_css_class=entry_css_class,
|
143
144
|
css_class=css_class,
|
144
145
|
menu=menu,
|
145
|
-
default_if=default_if
|
146
|
+
default_if=default_if,
|
147
|
+
**kwargs)
|
146
148
|
return entry
|
147
149
|
|
148
150
|
def add_date_entry(self, value, label=None, hidden=False, html_override=None,
|
149
|
-
entry_css_class=None, css_class=None, menu=None, default_if=None):
|
151
|
+
entry_css_class=None, css_class=None, menu=None, default_if=None, **kwargs):
|
150
152
|
new_value = value.strftime('%d/%m/%y')
|
151
153
|
return self._add_entry_internal(value=new_value,
|
152
154
|
label=label,
|
@@ -155,15 +157,18 @@ class CardBase:
|
|
155
157
|
entry_css_class=entry_css_class,
|
156
158
|
css_class=css_class,
|
157
159
|
menu=menu,
|
158
|
-
default_if=default_if
|
160
|
+
default_if=default_if,
|
161
|
+
**kwargs)
|
159
162
|
|
160
|
-
def add_row(self, *args):
|
163
|
+
def add_row(self, *args, extra_row_kwargs=None):
|
164
|
+
if extra_row_kwargs is None:
|
165
|
+
extra_row_kwargs = {}
|
161
166
|
entries = []
|
162
167
|
for arg in args:
|
163
168
|
if isinstance(arg, str):
|
164
|
-
entry = self._add_entry_internal(field=arg)
|
169
|
+
entry = self._add_entry_internal(field=arg, **extra_row_kwargs)
|
165
170
|
else:
|
166
|
-
entry = self._add_entry_internal(**arg)
|
171
|
+
entry = self._add_entry_internal(**arg, **extra_row_kwargs)
|
167
172
|
if entry is not None:
|
168
173
|
entries.append(entry)
|
169
174
|
|
@@ -246,7 +251,7 @@ class CardBase:
|
|
246
251
|
|
247
252
|
def _add_many_to_many_field(self, label, query, query_filter, m2m_field,
|
248
253
|
html_barge, default='N/A', html_override=None,
|
249
|
-
entry_css_class=None, css_class=None, menu=None, default_if=None):
|
254
|
+
entry_css_class=None, css_class=None, menu=None, default_if=None, **kwargs):
|
250
255
|
if html_barge is None:
|
251
256
|
html_barge = '<span class="small badge badge-pill badge-primary"> %1% </span> '
|
252
257
|
|
@@ -273,7 +278,8 @@ class CardBase:
|
|
273
278
|
entry_css_class=entry_css_class,
|
274
279
|
css_class=css_class,
|
275
280
|
menu=menu,
|
276
|
-
default_if=default_if
|
281
|
+
default_if=default_if,
|
282
|
+
**kwargs)
|
277
283
|
|
278
284
|
def _add_entry_internal(self, value=None, field=None, label=None, default='N/A', link=None,
|
279
285
|
hidden=False, hidden_if_blank_or_none=False, html_override=None,
|
@@ -293,14 +299,16 @@ class CardBase:
|
|
293
299
|
entry_css_class=entry_css_class,
|
294
300
|
css_class=entry_css_class,
|
295
301
|
menu=menu,
|
296
|
-
default_if=default_if
|
302
|
+
default_if=default_if,
|
303
|
+
**kwargs)
|
297
304
|
elif isinstance(value, datetime.date):
|
298
305
|
return self.add_date_entry(value=value,
|
299
306
|
label=label,
|
300
307
|
hidden=hidden,
|
301
308
|
html_override=html_override,
|
302
309
|
menu=menu,
|
303
|
-
default_if=default_if
|
310
|
+
default_if=default_if,
|
311
|
+
**kwargs)
|
304
312
|
elif hasattr(value, 'through'):
|
305
313
|
return self._add_many_to_many_field(label=label,
|
306
314
|
query=value,
|
@@ -312,7 +320,8 @@ class CardBase:
|
|
312
320
|
entry_css_class=entry_css_class,
|
313
321
|
css_class=entry_css_class,
|
314
322
|
menu=menu,
|
315
|
-
default_if=default_if
|
323
|
+
default_if=default_if,
|
324
|
+
**kwargs)
|
316
325
|
else:
|
317
326
|
if value is None or value == '' or default_if:
|
318
327
|
value = default
|
@@ -332,7 +341,8 @@ class CardBase:
|
|
332
341
|
value = [self.get_value_from_type(v, value_type, ft, is_default, **kwargs)
|
333
342
|
for v, ft in zip(value, field_type)]
|
334
343
|
else:
|
335
|
-
value = [self.get_value_from_type(v, value_type, field_type,
|
344
|
+
value = [self.get_value_from_type(v, value_type, field_type,
|
345
|
+
is_default, **kwargs) for v in value]
|
336
346
|
else:
|
337
347
|
value = self.get_value_from_type(value, value_type, field_type, is_default, **kwargs)
|
338
348
|
if html_override is not None:
|
@@ -355,7 +365,8 @@ class CardBase:
|
|
355
365
|
'css_class': css_class,
|
356
366
|
'multiple_lines': multiple_parts,
|
357
367
|
'link': link,
|
358
|
-
'menu': menu
|
368
|
+
'menu': menu,
|
369
|
+
**kwargs}
|
359
370
|
return entry
|
360
371
|
|
361
372
|
def get_value_from_type(self, value, value_type, field_type, is_default, **kwargs):
|
@@ -443,16 +454,18 @@ class CardBase:
|
|
443
454
|
title += letter
|
444
455
|
return title
|
445
456
|
|
446
|
-
def add_rows(self, *args, default='N/A', hidden=False):
|
457
|
+
def add_rows(self, *args, default='N/A', hidden=False, extra_row_kwargs=None):
|
458
|
+
if extra_row_kwargs is None:
|
459
|
+
extra_row_kwargs = {}
|
447
460
|
for arg in args:
|
448
461
|
if isinstance(arg, str):
|
449
|
-
self.add_entry(field=arg, default=default, hidden=hidden)
|
462
|
+
self.add_entry(field=arg, default=default, hidden=hidden, **extra_row_kwargs)
|
450
463
|
elif isinstance(arg, dict):
|
451
464
|
if 'default' not in arg:
|
452
465
|
arg['default'] = default
|
453
466
|
if 'hidden' not in arg:
|
454
467
|
arg['hidden'] = hidden
|
455
|
-
self.add_entry(**arg)
|
468
|
+
self.add_entry(**arg, **extra_row_kwargs)
|
456
469
|
elif isinstance(arg, (list, tuple)):
|
457
470
|
self.add_row(*arg)
|
458
471
|
|
@@ -5,8 +5,8 @@
|
|
5
5
|
{% for row in card.rows %}
|
6
6
|
<tr>
|
7
7
|
{% for entry in row.entries %}
|
8
|
-
<th class="{{ table_th_css_class }}">{{ entry.label|safe }}</th>
|
9
|
-
<td class="{{ table_td_css_class }}">{% if entry.link %}
|
8
|
+
{% if forloop.first %}<th class="{{ table_th_css_class }}">{{ entry.label|safe }}</th>{% endif %}
|
9
|
+
<td class="{{ table_td_css_class }}"{% if entry.colspan %} colspan="{{ entry.colspan }}"{% endif %}{% if entry.rowspan %} rowspan="{{ entry.rowspan }}"{% endif %}>{% if entry.link %}
|
10
10
|
<a class="list-group-item cards-list-group-item" href="{{ entry.link }}">{% endif %}
|
11
11
|
{% if entry.multiple_lines %}
|
12
12
|
{% for x in entry.html %}
|
@@ -15,8 +15,8 @@
|
|
15
15
|
{% else %}
|
16
16
|
{{ entry.html|safe }}
|
17
17
|
{% endif %}
|
18
|
-
{% if entry.link %}</a>{% endif %}</td
|
19
|
-
{% endfor %}
|
18
|
+
{% if entry.link %}</a>{% endif %}</td>
|
19
|
+
{% endfor %}</tr>
|
20
20
|
{% endfor %}
|
21
21
|
</table>
|
22
22
|
</div>
|
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.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/32px.png
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/40px.png
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/style.css
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/style.min.css
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default/throbber.gif
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default-dark/32px.png
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/default-dark/40px.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/30px.png
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/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.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/style.css
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/static/cards/jstree/css/themes/proton/style.min.css
RENAMED
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/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
|
File without changes
|
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/cards/templates/cards/standard/list_selection.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
{django-cards-0.8.6 → django-cards-0.8.8}/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
|