-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added extra table classes to support responsive tables. Fixes #28. * Added extra table classes to support responsive tables. Fixes #28. * Added extra table classes to support responsive tables. Fixes #28. * Added extra table classes to support responsive tables. Fixes #28. * Added extra table classes to support responsive tables. Fixes #28. * Added extra table classes to support responsive tables. Fixes #28. * Implemented extra classes for support of responsive tables in Bootstrap v4 and v5. Fixes #28. * remove whitespace Co-authored-by: K2 <[email protected]> * Remove blank line Co-authored-by: K2 <[email protected]> * Remove blank line Co-authored-by: K2 <[email protected]> * Removed white space. Co-authored-by: K2 <[email protected]> * Bumped version to 2.2.0 and documented changes. * Added responsive versions of the tables to the test project. * Changed the layout of the table choose buttons in the test project. * Update django_tables2_column_shifter/tests/test_base.py Co-authored-by: K2 <[email protected]> * Update django_tables2_column_shifter/tests/test_base.py Co-authored-by: K2 <[email protected]> * Update django_tables2_column_shifter/tests/test_base.py Co-authored-by: K2 <[email protected]> * Update django_tables2_column_shifter/tables.py Co-authored-by: K2 <[email protected]> * Update django_tables2_column_shifter/tables.py Co-authored-by: K2 <[email protected]> * Update django_tables2_column_shifter/tables.py Co-authored-by: K2 <[email protected]> * Update django_tables2_column_shifter/tables.py Co-authored-by: K2 <[email protected]> * Solved linting issue. * Bumped version. * Fixed whitespace. * Added description about responsive table usage. * Solved linting issues. * Re-defined test cases. * Changed import of dt_version. Updated test cases to support major, minor and sub-minor version. * Moved import of dt_version. --------- Co-authored-by: K2 <[email protected]>
- Loading branch information
1 parent
e80b34d
commit 92a49e6
Showing
16 changed files
with
393 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
VERSION = (2, 1, 1) | ||
VERSION = (2, 2, 0) | ||
__version__ = ".".join(str(i) for i in VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...umn_shifter/templates/django_tables2_column_shifter/_partials/bootstrap4_table_block.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{% load trans from i18n %} | ||
{% load static %} | ||
|
||
|
||
|
||
|
||
|
||
<div class="btn-group"> | ||
<button type="button" class="{{ table.get_dropdown_button_css }} dropdown-toggle" | ||
data-toggle="dropdown" | ||
aria-haspopup="true" | ||
aria-expanded="false" | ||
> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/cols.png" %}" | ||
alt="Columns" | ||
style=" | ||
width:20px; | ||
height:16px; | ||
margin-right:5px; | ||
opacity:0.7;" | ||
/> | ||
{% trans "Visible columns" %} | ||
<span class="caret"></span> | ||
</button> | ||
<ul class="dropdown-menu" style="min-width:350px; padding:5px; cursor:pointer;"> | ||
{% for column in table.columns %} | ||
{% if column.attrs.td.class not in table.get_column_excluded %} | ||
{% if column.attrs.td.class in table.get_column_default_show %} | ||
<li class="btn-shift-column" | ||
data-td-class="{{ column.attrs.td.class }}" | ||
data-state="on" | ||
{% if not forloop.last %} style="border-bottom:1px solid #ccc;" {%endif %} | ||
data-table-class-container="{{ table.uniq_table_class_name }}"> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/check.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; opacity:0.7;" | ||
class="ico check" | ||
/> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/uncheck.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; display: none; opacity:0.7;" | ||
class="ico uncheck" | ||
/> | ||
{{ column.header }} | ||
</li> | ||
{% else %} | ||
<li class="btn-shift-column" | ||
data-td-class="{{ column.attrs.td.class }}" | ||
data-state="off" | ||
{% if not forloop.last %} style="border-bottom:1px solid #ccc;" {%endif %} | ||
data-table-class-container="{{ table.uniq_table_class_name }}"> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/check.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; display:none; opacity:0.7;" | ||
class="ico check" | ||
/> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/uncheck.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; opacity:0.7;" | ||
class="ico uncheck" | ||
/> | ||
{{ column.header }} | ||
</li> | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</div> {# End btn-group#} | ||
|
||
{# Loader default is show #} | ||
<div class="loader" style="text-align:center;" > | ||
<img src="{% static "django_tables2_column_shifter/img/loader.gif" %}" style="margin:5px auto;" alt="loader"/> | ||
{% trans "Table content is loading..."%} | ||
</div> {# End loader #} | ||
|
79 changes: 79 additions & 0 deletions
79
...umn_shifter/templates/django_tables2_column_shifter/_partials/bootstrap5_table_block.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{% load trans from i18n %} | ||
{% load static %} | ||
|
||
<div class="btn-group"> | ||
<button type="button" class="{{ table.get_dropdown_button_css }} dropdown-toggle" | ||
data-bs-toggle="dropdown" | ||
aria-haspopup="true" | ||
aria-expanded="false" | ||
id="btn_{{ table.uniq_table_class_name }}" | ||
> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/cols.png" %}" | ||
alt="Columns" | ||
style=" | ||
width:20px; | ||
height:16px; | ||
margin-right:5px; | ||
opacity:0.7;" | ||
/> | ||
{% trans "Visible columns" %} | ||
<span class="caret"></span> | ||
</button> | ||
<ul class="dropdown-menu" | ||
style="min-width:350px; padding:5px; cursor:pointer;" | ||
aria-labelledby="btn_{{ table.uniq_table_class_name }}" | ||
> | ||
{% for column in table.columns %} | ||
{% if column.attrs.td.class not in table.get_column_excluded %} | ||
{% if column.attrs.td.class in table.get_column_default_show %} | ||
<li class="btn-shift-column" | ||
data-td-class="{{ column.attrs.td.class }}" | ||
data-state="on" | ||
{% if not forloop.last %} style="border-bottom:1px solid #ccc;" {%endif %} | ||
data-table-class-container="{{ table.uniq_table_class_name }}"> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/check.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; opacity:0.7;" | ||
class="ico check" | ||
/> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/uncheck.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; display: none; opacity:0.7;" | ||
class="ico uncheck" | ||
/> | ||
{{ column.header }} | ||
</li> | ||
{% else %} | ||
<li class="btn-shift-column" | ||
data-td-class="{{ column.attrs.td.class }}" | ||
data-state="off" | ||
{% if not forloop.last %} style="border-bottom:1px solid #ccc;" {%endif %} | ||
data-table-class-container="{{ table.uniq_table_class_name }}"> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/check.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; display:none; opacity:0.7;" | ||
class="ico check" | ||
/> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/uncheck.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; opacity:0.7;" | ||
class="ico uncheck" | ||
/> | ||
{{ column.header }} | ||
</li> | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</div> {# End btn-group#} | ||
|
||
{# Loader default is show #} | ||
<div class="loader" style="text-align:center;" > | ||
<img src="{% static "django_tables2_column_shifter/img/loader.gif" %}" style="margin:5px auto;" alt="loader"/> | ||
{% trans "Table content is loading..."%} | ||
</div> {# End loader #} |
17 changes: 17 additions & 0 deletions
17
...tables2_column_shifter/templates/django_tables2_column_shifter/bootstrap4-responsive.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% extends "django_tables2/bootstrap4-responsive.html" %} | ||
|
||
{% block table %} | ||
{% if table.shift_table_column %} | ||
<div id="{{ table.uniq_table_class_name }}" class="column-shifter-container"> | ||
{% include 'django_tables2_column_shifter/_partials/bootstrap4_table_block.html' %} | ||
|
||
{# Wrapper default is hide #} | ||
<div class="table-wrapper" style="display:none;"> | ||
{# Load default table content #} | ||
{{ block.super }} | ||
</div> {# End table-wrapper #} | ||
</div> {# End column-shifter-container #} | ||
{% else %} | ||
{{ block.super }} | ||
{% endif %} | ||
{% endblock table %} |
84 changes: 3 additions & 81 deletions
84
django_tables2_column_shifter/templates/django_tables2_column_shifter/bootstrap4.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,17 @@ | ||
{% extends "django_tables2/bootstrap4.html" %} | ||
{% load trans from i18n %} | ||
{% load static %} | ||
|
||
{% block table %} | ||
|
||
{% if table.shift_table_column %} | ||
|
||
<div id="{{ table.uniq_table_class_name }}" class="column-shifter-container"> | ||
{% include 'django_tables2_column_shifter/_partials/bootstrap4_table_block.html' %} | ||
|
||
<div class="btn-group"> | ||
<button type="button" class="{{ table.get_dropdown_button_css }} dropdown-toggle" | ||
data-toggle="dropdown" | ||
aria-haspopup="true" | ||
aria-expanded="false" | ||
> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/cols.png" %}" | ||
alt="Columns" | ||
style=" | ||
width:20px; | ||
height:16px; | ||
margin-right:5px; | ||
opacity:0.7;" | ||
/> | ||
{% trans "Visible columns" %} | ||
<span class="caret"></span> | ||
</button> | ||
<ul class="dropdown-menu" style="min-width:350px; padding:5px; cursor:pointer;"> | ||
{% for column in table.columns %} | ||
{% if column.attrs.td.class not in table.get_column_excluded %} | ||
{% if column.attrs.td.class in table.get_column_default_show %} | ||
<li class="btn-shift-column" | ||
data-td-class="{{ column.attrs.td.class }}" | ||
data-state="on" | ||
{% if not forloop.last %} style="border-bottom:1px solid #ccc;" {%endif %} | ||
data-table-class-container="{{ table.uniq_table_class_name }}"> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/check.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; opacity:0.7;" | ||
class="ico check" | ||
/> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/uncheck.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; display: none; opacity:0.7;" | ||
class="ico uncheck" | ||
/> | ||
{{ column.header }} | ||
</li> | ||
{% else %} | ||
<li class="btn-shift-column" | ||
data-td-class="{{ column.attrs.td.class }}" | ||
data-state="off" | ||
{% if not forloop.last %} style="border-bottom:1px solid #ccc;" {%endif %} | ||
data-table-class-container="{{ table.uniq_table_class_name }}"> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/check.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; display:none; opacity:0.7;" | ||
class="ico check" | ||
/> | ||
<img | ||
src="{% static "django_tables2_column_shifter/img/uncheck.png" %}" | ||
alt="loader" | ||
style="width:20px; height:20px; margin-right:5px; opacity:0.7;" | ||
class="ico uncheck" | ||
/> | ||
{{ column.header }} | ||
</li> | ||
{% endif %} | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</div> {# End btn-group#} | ||
|
||
{# Loader default is show #} | ||
<div class="loader" style="text-align:center;" > | ||
<img src="{% static "django_tables2_column_shifter/img/loader.gif" %}" style="margin:5px auto;" alt="loader"/> | ||
{% trans "Table content is loading..."%} | ||
</div> {# End loader #} | ||
|
||
{# Wrapper degault is hide #} | ||
{# Wrapper default is hide #} | ||
<div class="table-wrapper" style="display:none;"> | ||
{# Load default table content #} | ||
{{ block.super }} | ||
</div> {# End table-wrapper #} | ||
|
||
</div> {# End column-shifter-container #} | ||
</div> {# End column-shifter-container #} | ||
{% else %} | ||
{{ block.super }} | ||
{% endif %} | ||
|
||
{% endblock table %} |
Oops, something went wrong.