django-cards 0.9.7__tar.gz → 0.10.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. {django-cards-0.9.7 → django-cards-0.10.0}/PKG-INFO +1 -1
  2. {django-cards-0.9.7 → django-cards-0.10.0}/cards/base.py +7 -1
  3. {django-cards-0.9.7 → django-cards-0.10.0}/cards/card_list/base.py +0 -1
  4. {django-cards-0.9.7 → django-cards-0.10.0}/cards/standard.py +0 -2
  5. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/datatable.html +6 -1
  6. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/default.html +5 -0
  7. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/default_body.html +1 -1
  8. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/html.html +6 -1
  9. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/list_selection.html +17 -0
  10. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/table.html +5 -0
  11. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/table_body.html +4 -4
  12. {django-cards-0.9.7 → django-cards-0.10.0}/django_cards.egg-info/PKG-INFO +1 -1
  13. {django-cards-0.9.7 → django-cards-0.10.0}/setup.py +1 -1
  14. {django-cards-0.9.7 → django-cards-0.10.0}/LICENSE +0 -0
  15. {django-cards-0.9.7 → django-cards-0.10.0}/MANIFEST.in +0 -0
  16. {django-cards-0.9.7 → django-cards-0.10.0}/README.md +0 -0
  17. {django-cards-0.9.7 → django-cards-0.10.0}/cards/__init__.py +0 -0
  18. {django-cards-0.9.7 → django-cards-0.10.0}/cards/apps.py +0 -0
  19. {django-cards-0.9.7 → django-cards-0.10.0}/cards/card_list/__init__.py +0 -0
  20. {django-cards-0.9.7 → django-cards-0.10.0}/cards/card_list/main.py +0 -0
  21. {django-cards-0.9.7 → django-cards-0.10.0}/cards/card_list/tree.py +0 -0
  22. {django-cards-0.9.7 → django-cards-0.10.0}/cards/includes.py +0 -0
  23. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default/32px.png +0 -0
  24. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default/40px.png +0 -0
  25. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default/style.css +0 -0
  26. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default/style.min.css +0 -0
  27. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default/throbber.gif +0 -0
  28. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default-dark/32px.png +0 -0
  29. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default-dark/40px.png +0 -0
  30. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default-dark/style.css +0 -0
  31. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default-dark/style.min.css +0 -0
  32. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/default-dark/throbber.gif +0 -0
  33. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/30px.png +0 -0
  34. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/32px.png +0 -0
  35. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.eot +0 -0
  36. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.svg +0 -0
  37. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.ttf +0 -0
  38. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-bold-webfont.woff +0 -0
  39. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.eot +0 -0
  40. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.svg +0 -0
  41. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.ttf +0 -0
  42. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-extralight-webfont.woff +0 -0
  43. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.eot +0 -0
  44. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.svg +0 -0
  45. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.ttf +0 -0
  46. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/fonts/titillium/titilliumweb-regular-webfont.woff +0 -0
  47. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/style.css +0 -0
  48. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/style.min.css +0 -0
  49. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/css/themes/proton/throbber.gif +0 -0
  50. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/js/jstree.js +0 -0
  51. {django-cards-0.9.7 → django-cards-0.10.0}/cards/static/cards/jstree/js/jstree.min.js +0 -0
  52. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/groups/groups.html +0 -0
  53. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/blank.html +0 -0
  54. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/card_group.html +0 -0
  55. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/message.html +0 -0
  56. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templates/cards/standard/tree_selection.html +0 -0
  57. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templatetags/__init__.py +0 -0
  58. {django-cards-0.9.7 → django-cards-0.10.0}/cards/templatetags/django_cards_tags.py +0 -0
  59. {django-cards-0.9.7 → django-cards-0.10.0}/cards/url_converters.py +0 -0
  60. {django-cards-0.9.7 → django-cards-0.10.0}/django_cards.egg-info/SOURCES.txt +0 -0
  61. {django-cards-0.9.7 → django-cards-0.10.0}/django_cards.egg-info/dependency_links.txt +0 -0
  62. {django-cards-0.9.7 → django-cards-0.10.0}/django_cards.egg-info/top_level.txt +0 -0
  63. {django-cards-0.9.7 → django-cards-0.10.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-cards
3
- Version: 0.9.7
3
+ Version: 0.10.0
4
4
  Summary: Django app that allows you make cards
5
5
  Home-page: https://github.com/django-advance-utils/django-cards
6
6
  Author: Thomas Turner
@@ -1,6 +1,7 @@
1
1
  import datetime
2
2
  import json
3
3
 
4
+ from ajax_helpers.utils import random_string
4
5
  from django.core.exceptions import FieldDoesNotExist
5
6
  from django.template.loader import render_to_string
6
7
  from django.utils.safestring import mark_safe
@@ -74,7 +75,10 @@ class CardBase:
74
75
  menu=None, tab_menu=None, template_name=None, call_details_data=False,
75
76
  group_type=CARD_TYPE_STANDARD, show_created_modified_dates=False,
76
77
  footer=None, extra_card_context=None,
77
- is_empty=False, empty_template_name=None, empty_message='N/A', **kwargs):
78
+ is_empty=False, empty_template_name=None, empty_message='N/A', collapsed=None, **kwargs):
79
+
80
+ if code is None:
81
+ code = random_string()
78
82
 
79
83
  self.code = code
80
84
  self.view = view
@@ -94,6 +98,8 @@ class CardBase:
94
98
  tab_menu = HtmlMenu(self.request, self.tab_menu_type).add_items(*tab_menu)
95
99
  self.tab_menu = tab_menu
96
100
  self.call_details_data = call_details_data
101
+ self.enable_collapse = collapsed is not None
102
+ self.collapsed = collapsed
97
103
 
98
104
  if is_empty:
99
105
  self.group_type = CARD_TYPE_STANDARD
@@ -1,4 +1,3 @@
1
- from ajax_helpers.utils import random_string
2
1
  from django.shortcuts import get_object_or_404
3
2
  from django.template.loader import render_to_string
4
3
 
@@ -140,5 +140,3 @@ class CardMixin:
140
140
  getattr(self, field_setup_table_field)(table=table, details_object=self.cards[table_id].details_object)
141
141
  table.columns[kwargs['changed'][0]].alter_object(row_object, row_data[kwargs['changed'][0]])
142
142
  return table.refresh_row(self.request, kwargs['row_no'])
143
-
144
-
@@ -12,10 +12,15 @@
12
12
  <div class="d-flex align-items-center">
13
13
  <h5 class="mr-auto">{{ card.title }}</h5>
14
14
  {{ card.menu.render }}
15
+ {% if card.enable_collapse %}
16
+ <div class="section-header-right {% if card.collapsed %} collapsed{% endif %}" data-target="#{{ card.code }}_body" data-toggle="collapse">
17
+ <i class="expandicon"></i>
18
+ </div>
19
+ {% endif %}
15
20
  </div>
16
21
  </div>
17
22
  {{ card.tab_menu.render }}
18
- <div class="{{ card_body_css_class }}" id="{{ card.code }}_body"
23
+ <div class="{{ card_body_css_class }}{% if card.enable_collapse %} collapse{% if not card.collapsed %} show{% endif %}{% endif %}" id="{{ card.code }}_body"
19
24
  {% if card_body_css_style %}style="{{ card_body_css_style }}"{% endif %}>
20
25
  {% if show_search_bar and not show_pivot_table %}
21
26
  <div class="d-flex">
@@ -3,6 +3,11 @@
3
3
  <div class="d-flex align-items-center">
4
4
  <h5 class="mr-auto">{{ card.title }}</h5>
5
5
  {{ card.menu.render }}
6
+ {% if card.enable_collapse %}
7
+ <div class="section-header-right {% if card.collapsed %} collapsed{% endif %}" data-target="#{{ card.code }}_body" data-toggle="collapse">
8
+ <i class="expandicon"></i>
9
+ </div>
10
+ {% endif %}
6
11
  </div>
7
12
  </div>
8
13
  {% include 'cards/standard/default_body.html' %}
@@ -1,6 +1,6 @@
1
1
 
2
2
  {{ card.tab_menu.render }}
3
- <div class="{{ card_body_css_class }}">
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
  {% if row.type == 'html' %}<div class="{{ item_css_class }}">{{ row.html|safe }}</div>{% else %}
@@ -3,9 +3,14 @@
3
3
  <div class="d-flex align-items-center">
4
4
  <h5 class="mr-auto">{{ card.title }}</h5>
5
5
  {{ card.menu.render }}
6
+ {% if card.enable_collapse %}
7
+ <div class="section-header-right {% if card.collapsed %} collapsed{% endif %}" data-target="#{{ card.code }}_body" data-toggle="collapse">
8
+ <i class="expandicon"></i>
9
+ </div>
10
+ {% endif %}
6
11
  </div>
7
12
  </div>
8
- <div class="{{ card_body_css_class }}" id="{{ card.code }}_body" {% if card_body_css_style %}style="{{ card_body_css_style }}"{% endif %}>
13
+ <div class="{{ card_body_css_class }}{% if card.enable_collapse %} collapse{% if not card.collapsed %} show{% endif %}{% endif %}" id="{{ card.code }}_body" {% if card_body_css_style %}style="{{ card_body_css_style }}"{% endif %}>
9
14
  {{ card.extra_card_info.html|safe }}
10
15
  </div>
11
16
  {% if card.footer %}
@@ -1,5 +1,9 @@
1
1
  <script>
2
+
3
+ var last_loaded_entry_id = null;
4
+
2
5
  function load_details(entry_id) {
6
+ last_loaded_entry_id = entry_id;
3
7
  $('.cards-list-group-item.active').removeClass('active');
4
8
  $('#list_' + entry_id).addClass('active');
5
9
  $(document).ready(function () {
@@ -12,6 +16,7 @@
12
16
  }
13
17
 
14
18
  function load_empty_details() {
19
+ last_loaded_entry_id = null;
15
20
  $('.cards-list-group-item.active').removeClass('active');
16
21
  $(document).ready(function () {
17
22
  {% if modal %}
@@ -25,6 +30,18 @@
25
30
  $(document).ready(function () {
26
31
  $( "#list_{{ selected_id }}" ).focus();
27
32
  });
33
+
34
+ ajax_helpers.command_functions.load_details = function (command) {
35
+ var entry_id = last_loaded_entry_id;
36
+ if (typeof command.entry_id !== "undefined") {
37
+ entry_id = command.entry_id;
38
+ }
39
+ if(entry_id == null) {
40
+ load_empty_details(entry_id);
41
+ } else {
42
+ load_details(entry_id);
43
+ }
44
+ }
28
45
  </script>
29
46
  <div class="{{ card_css_class }}" id="{{ card.code }}" data-title="">
30
47
  <div class="card-header">
@@ -4,6 +4,11 @@
4
4
  <div class="d-flex align-items-center">
5
5
  <h5 class="mr-auto">{{ card.title }}</h5>
6
6
  {{ card.menu.render }}
7
+ {% if card.enable_collapse %}
8
+ <div class="section-header-right {% if card.collapsed %} collapsed{% endif %}" data-target="#{{ card.code }}_body" data-toggle="collapse">
9
+ <i class="expandicon"></i>
10
+ </div>
11
+ {% endif %}
7
12
  </div>
8
13
  </div>
9
14
 
@@ -1,13 +1,13 @@
1
1
  {{ card.tab_menu.render }}
2
- <div class="{{ card_body_css_class }}">
2
+ <div class="{{ card_body_css_class }}{% if card.enable_collapse %} collapse{% if not card.collapsed %} show{% endif %}{% endif %}" id="{{ card.code }}_body">
3
3
  <div class="list-group">
4
4
  <table class="{{ table_css_class }}">
5
5
  {% for row in card.rows %}
6
6
  <tr>
7
7
  {% if row.type == 'html' %}{% if not row.exclude_td %}<td class="{{ table_td_css_class }}"{% if row.colspan %} colspan="{{ row.colspan }}"{% endif %} {% if row.rowspan %} rowspan="{{ row.rowspan }}"{% endif %}>{{ row.html|safe }}</td>{% else %}{{ row.html|safe }}{% endif %}{% else %}
8
8
  {% for entry in row.entries %}
9
- {% if forloop.first %}<th class="{{ table_th_css_class }}">{{ entry.label|safe }}</th>{% endif %}
10
- <td class="{{ table_td_css_class }}"{% if entry.colspan %} colspan="{{ entry.colspan }}"{% endif %}{% if entry.rowspan %} rowspan="{{ entry.rowspan }}"{% endif %}>{% if entry.link %}
9
+ {% if forloop.first %}{% if entry.label_td %}<td>{{ entry.label|safe }}</td>{% else %}<th class="{{ table_th_css_class }}">{{ entry.label|safe }}</th>{% endif %}{% endif %}
10
+ {% if entry.value_th %}<th{% else %}<td class="{{ table_td_css_class }}"{% endif %}{% if entry.colspan %} colspan="{{ entry.colspan }}"{% endif %}{% if entry.rowspan %} rowspan="{{ entry.rowspan }}"{% endif %}>{% if entry.link %}
11
11
  <a class="list-group-item cards-list-group-item" href="{{ entry.link }}">{% endif %}
12
12
  {% if entry.multiple_lines %}
13
13
  {% for x in entry.html %}
@@ -16,7 +16,7 @@
16
16
  {% else %}
17
17
  {{ entry.html|safe }}
18
18
  {% endif %}
19
- {% if entry.link %}</a>{% endif %}</td>
19
+ {% if entry.link %}</a>{% endif %}{% if entry.value_th %}</th>{% else %}</td>{% endif %}
20
20
  {% endfor %}{% endif %}</tr>
21
21
  {% endfor %}
22
22
  </table>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-cards
3
- Version: 0.9.7
3
+ Version: 0.10.0
4
4
  Summary: Django app that allows you make cards
5
5
  Home-page: https://github.com/django-advance-utils/django-cards
6
6
  Author: Thomas Turner
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="django-cards",
8
- version="0.9.7",
8
+ version="0.10.0",
9
9
  author="Thomas Turner",
10
10
  description="Django app that allows you make cards",
11
11
  long_description=long_description,
File without changes
File without changes
File without changes
File without changes