django-cards 0.10.3__tar.gz → 0.11.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {django-cards-0.10.3/django_cards.egg-info → django-cards-0.11.0}/PKG-INFO +1 -1
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/base.py +32 -2
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/default_body.html +3 -1
- {django-cards-0.10.3 → django-cards-0.11.0/django_cards.egg-info}/PKG-INFO +1 -1
- {django-cards-0.10.3 → django-cards-0.11.0}/setup.py +1 -1
- {django-cards-0.10.3 → django-cards-0.11.0}/LICENSE +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/MANIFEST.in +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/README.md +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/__init__.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/apps.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/card_list/__init__.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/card_list/base.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/card_list/main.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/card_list/tree.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/includes.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/standard.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default/32px.png +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default/40px.png +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default/style.css +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default/style.min.css +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default/throbber.gif +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default-dark/32px.png +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default-dark/40px.png +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default-dark/style.css +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default-dark/style.min.css +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default-dark/throbber.gif +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/30px.png +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/32px.png +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.eot +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.svg +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.ttf +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.woff +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.eot +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.svg +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.woff +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.eot +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.svg +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.ttf +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.woff +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/style.css +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/style.min.css +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/throbber.gif +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/js/jstree.js +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/js/jstree.min.js +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/groups/groups.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/blank.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/card_group.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/datatable.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/default.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/html.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/list_selection.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/message.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/table.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/table_body.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/tree_selection.html +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templatetags/__init__.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/templatetags/django_cards_tags.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/cards/url_converters.py +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/django_cards.egg-info/SOURCES.txt +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/django_cards.egg-info/dependency_links.txt +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/django_cards.egg-info/top_level.txt +0 -0
- {django-cards-0.10.3 → django-cards-0.11.0}/setup.cfg +0 -0
@@ -89,6 +89,8 @@ class CardBase:
|
|
89
89
|
self.footer = footer
|
90
90
|
|
91
91
|
self.rows = []
|
92
|
+
self._row_styles = {}
|
93
|
+
self._default_row_styles = None
|
92
94
|
self.title = title
|
93
95
|
self.created_modified_dates = self.get_created_modified_dates(details_object=details_object)
|
94
96
|
if isinstance(menu, (list, tuple)):
|
@@ -199,7 +201,7 @@ class CardBase:
|
|
199
201
|
|
200
202
|
def add_entry(self, value=None, field=None, label=None, entry_css_class=None, css_class=None,
|
201
203
|
default='N/A', link=None, hidden=False, hidden_if_blank_or_none=False,
|
202
|
-
html_override=None, value_method=None, value_type=None, default_if=None, **kwargs):
|
204
|
+
html_override=None, value_method=None, value_type=None, default_if=None, row_style=None, **kwargs):
|
203
205
|
|
204
206
|
entry = self._add_entry_internal(value=value,
|
205
207
|
field=field,
|
@@ -214,6 +216,7 @@ class CardBase:
|
|
214
216
|
value_method=value_method,
|
215
217
|
value_type=value_type,
|
216
218
|
default_if=default_if,
|
219
|
+
row_style=row_style,
|
217
220
|
**kwargs)
|
218
221
|
if entry is not None:
|
219
222
|
self.rows.append({'type': 'standard', 'entries': [entry]})
|
@@ -225,6 +228,17 @@ class CardBase:
|
|
225
228
|
html = render_to_string(template_name=template_name, context=context)
|
226
229
|
self.rows.append({'type': 'html', 'html': html, **kwargs})
|
227
230
|
|
231
|
+
def add_row_style(self, name, html, is_default=False):
|
232
|
+
if not isinstance(html, str) and hasattr(html, 'render'):
|
233
|
+
html = html.render()
|
234
|
+
self._row_styles[name] = html
|
235
|
+
if is_default:
|
236
|
+
self._default_row_styles = name
|
237
|
+
|
238
|
+
def set_default_style(self, name=None):
|
239
|
+
if name in self._row_styles:
|
240
|
+
self._default_row_styles = name
|
241
|
+
|
228
242
|
def get_field_value(self, value, field, label):
|
229
243
|
field_type = None
|
230
244
|
if value is None and field is not None:
|
@@ -304,7 +318,7 @@ class CardBase:
|
|
304
318
|
def _add_entry_internal(self, value=None, field=None, label=None, default='N/A', link=None,
|
305
319
|
hidden=False, hidden_if_blank_or_none=False, html_override=None,
|
306
320
|
value_method=None, value_type=None,
|
307
|
-
entry_css_class=None, css_class=None, menu=None, default_if=None,
|
321
|
+
entry_css_class=None, css_class=None, menu=None, default_if=None, row_style=None,
|
308
322
|
**kwargs):
|
309
323
|
|
310
324
|
value, label, field_type = self.get_field_value(value=value, field=field, label=label)
|
@@ -378,6 +392,21 @@ class CardBase:
|
|
378
392
|
|
379
393
|
if menu is not None and isinstance(menu, (list, tuple)):
|
380
394
|
menu = HtmlMenu(self.request, self.button_menu_type).add_items(*menu)
|
395
|
+
row_style_html = None
|
396
|
+
if (row_style is not None and row_style in self._row_styles) or self._default_row_styles is not None:
|
397
|
+
|
398
|
+
if row_style is not None:
|
399
|
+
html_row_style = self._row_styles[row_style]
|
400
|
+
else:
|
401
|
+
html_row_style = self._row_styles[self._default_row_styles]
|
402
|
+
|
403
|
+
value_dict = {'value': value,
|
404
|
+
'label': label,
|
405
|
+
'menu': menu,
|
406
|
+
'link': link,
|
407
|
+
**kwargs}
|
408
|
+
|
409
|
+
row_style_html = html_row_style.format(**value_dict)
|
381
410
|
|
382
411
|
entry = {'label': label,
|
383
412
|
'html': value,
|
@@ -386,6 +415,7 @@ class CardBase:
|
|
386
415
|
'multiple_lines': multiple_parts,
|
387
416
|
'link': link,
|
388
417
|
'menu': menu,
|
418
|
+
'row_style_html': row_style_html,
|
389
419
|
**kwargs}
|
390
420
|
return entry
|
391
421
|
|
{django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/default_body.html
RENAMED
@@ -3,9 +3,11 @@
|
|
3
3
|
<div class="{{ card_body_css_class }}{% if card.enable_collapse %} collapse{% if not card.collapsed %} show{% endif %}{% endif %}" id="{{ card.code }}_body">
|
4
4
|
<div class="list-group">
|
5
5
|
{% for row in card.rows %}
|
6
|
+
|
6
7
|
{% if row.type == 'html' %}<div class="{{ item_css_class }}">{{ row.html|safe }}</div>{% else %}
|
7
8
|
{% if row.type == 'multiple' %}<div class="{{ item_css_class }}"><div class="row">{% endif %}
|
8
9
|
{% for entry in row.entries %}
|
10
|
+
{% if entry.row_style_html %}{{ entry.row_style_html|safe }}{% else %}
|
9
11
|
{% if entry.entry_css_class %}<div class="{{ entry.entry_css_class }}">{% endif %}
|
10
12
|
{% if entry.link %}<a class="{{ item_css_class }} cards-list-group-item" href="{{ entry.link }}" style="{{ item_css }}">{% elif row.type != 'multiple' %}<div class="{{ item_css_class }}" style="{{ item_css }}">{% endif %}
|
11
13
|
{% if entry.label %}
|
@@ -21,7 +23,7 @@
|
|
21
23
|
{{ entry.html|safe }}
|
22
24
|
{% endif %}
|
23
25
|
{% if entry.link %}</a>{% elif row.type != 'multiple' %}</div>{% endif %}
|
24
|
-
{% if entry.entry_css_class %}</div>{% endif %}
|
26
|
+
{% if entry.entry_css_class %}</div>{% endif %}{% endif %}
|
25
27
|
{% endfor %}
|
26
28
|
{% if row.type == 'multiple' %}</div></div>{% endif %}
|
27
29
|
{% endif %}
|
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.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default/32px.png
RENAMED
File without changes
|
{django-cards-0.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/default/40px.png
RENAMED
File without changes
|
{django-cards-0.10.3 → django-cards-0.11.0}/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.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/30px.png
RENAMED
File without changes
|
{django-cards-0.10.3 → django-cards-0.11.0}/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.10.3 → django-cards-0.11.0}/cards/static/cards/jstree/css/themes/proton/style.css
RENAMED
File without changes
|
File without changes
|
{django-cards-0.10.3 → django-cards-0.11.0}/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
|
{django-cards-0.10.3 → django-cards-0.11.0}/cards/templates/cards/standard/list_selection.html
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{django-cards-0.10.3 → django-cards-0.11.0}/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
|