mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 09:12:11 +01:00 
			
		
		
		
	Overflow on collapsing tables and Bootstrap4 style
This commit is contained in:
		@@ -10,11 +10,10 @@ from .models import Club
 | 
			
		||||
class ClubTable(tables.Table):
 | 
			
		||||
    class Meta:
 | 
			
		||||
        attrs = {
 | 
			
		||||
            'class':
 | 
			
		||||
            'table table-bordered table-condensed table-striped table-hover'
 | 
			
		||||
            'class': 'table table-condensed table-striped table-hover'
 | 
			
		||||
        }
 | 
			
		||||
        model = Club
 | 
			
		||||
        template_name = 'django_tables2/bootstrap.html'
 | 
			
		||||
        template_name = 'django_tables2/bootstrap4.html'
 | 
			
		||||
        fields = ('id', 'name', 'email')
 | 
			
		||||
        row_attrs = {
 | 
			
		||||
            'class': 'table-row',
 | 
			
		||||
@@ -28,9 +27,8 @@ class UserTable(tables.Table):
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        attrs = {
 | 
			
		||||
            'class':
 | 
			
		||||
            'table table-bordered table-condensed table-striped table-hover'
 | 
			
		||||
            'class': 'table table-condensed table-striped table-hover'
 | 
			
		||||
        }
 | 
			
		||||
        template_name = 'django_tables2/bootstrap.html'
 | 
			
		||||
        template_name = 'django_tables2/bootstrap4.html'
 | 
			
		||||
        fields = ('last_name', 'first_name', 'username', 'email')
 | 
			
		||||
        model = User
 | 
			
		||||
 
 | 
			
		||||
@@ -11,10 +11,10 @@ class HistoryTable(tables.Table):
 | 
			
		||||
    class Meta:
 | 
			
		||||
        attrs = {
 | 
			
		||||
            'class':
 | 
			
		||||
            'table table-bordered table-condensed table-striped table-hover'
 | 
			
		||||
            'table table-condensed table-striped table-hover'
 | 
			
		||||
        }
 | 
			
		||||
        model = Transaction
 | 
			
		||||
        template_name = 'django_tables2/bootstrap.html'
 | 
			
		||||
        template_name = 'django_tables2/bootstrap4.html'
 | 
			
		||||
        sequence = ('...', 'total', 'valid')
 | 
			
		||||
 | 
			
		||||
    total = tables.Column()  # will use Transaction.total() !!
 | 
			
		||||
 
 | 
			
		||||
@@ -47,36 +47,31 @@
 | 
			
		||||
    <div class="col-md-9">
 | 
			
		||||
        <div class="accordion" id="accordionProfile">
 | 
			
		||||
            <div class="card">
 | 
			
		||||
                <div class="card-header" id="headingOne">
 | 
			
		||||
                    <h5 class="mb-0">
 | 
			
		||||
                        <button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
 | 
			
		||||
                <div class="card-header position-relative" id="clubListHeading">
 | 
			
		||||
                    <a class="btn btn-link stretched-link font-weight-bold"
 | 
			
		||||
                       data-toggle="collapse" data-target="#clubListCollapse"
 | 
			
		||||
                       aria-expanded="true" aria-controls="clubListCollapse">
 | 
			
		||||
                        <i class="fa fa-users"></i> {% trans "View my memberships" %}
 | 
			
		||||
                        </button>
 | 
			
		||||
                </h5>
 | 
			
		||||
                    </a>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionProfile">
 | 
			
		||||
                    <div class="card-body">
 | 
			
		||||
                <div id="clubListCollapse" class="collapse overflow-auto show" aria-labelledby="clubListHeading" data-parent="#accordionProfile">
 | 
			
		||||
                    {% render_table club_list %}
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="card">
 | 
			
		||||
                <div class="card-header" id="headingTwo">
 | 
			
		||||
                    <h5 class="mb-0">
 | 
			
		||||
                        <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
 | 
			
		||||
                <div class="card-header position-relative" id="historyListHeading">
 | 
			
		||||
                    <a class="btn btn-link stretched-link collapsed font-weight-bold"
 | 
			
		||||
                       data-toggle="collapse" data-target="#historyListCollapse"
 | 
			
		||||
                       aria-expanded="false" aria-controls="historyListCollapse">
 | 
			
		||||
                        <i class="fa fa-euro"></i> Historique des transactions
 | 
			
		||||
                        </button>
 | 
			
		||||
                    </h5>
 | 
			
		||||
                    </a>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionProfile">
 | 
			
		||||
                    <div class="card-body">
 | 
			
		||||
                <div id="historyListCollapse" class="collapse overflow-auto" aria-labelledby="historyListHeading" data-parent="#accordionProfile">
 | 
			
		||||
                    {% render_table history_list %}
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user