Ignore:
Timestamp:
05/01/25 21:17:02 (2 weeks ago)
Author:
ManuelTrajcev <manueltrajcev7@…>
Branches:
master
Children:
ac66823
Parents:
4abe330
Message:

querry mostr popular artist per customer for each genre

File:
1 edited

Legend:

Unmodified
Added
Removed
  • templates/genres_per_customer.html

    r4abe330 r59b2e9c  
    3232        </div>
    3333    </form>
    34 
     34    {% if customer %}
     35        <div class="row display-5">
     36            <div class="col-3 bg-light-subtle m-1 pb-3 border border-secondary-subtle rounded-3">
     37                {{ customer }}
     38            </div>
     39        </div>
     40    {% endif %}
    3541    {% if not data %}
    3642        <div class="alert alert-warning" role="alert">
     
    3844        </div>
    3945    {% else %}
    40         <div class="table-responsive">
    41             <table class="table table-striped">
    42                 <thead>
    43                 <tr>
    44                     <th scope="col">First Name</th>
    45                     <th scope="col">Last Name</th>
    46                     <th scope="col">Genre</th>
    47                     <th scope="col">Number of Tracks</th>
    48                 </tr>
    49                 </thead>
    50                 <tbody>
     46        <div class="container">
     47            <div class="row col-6 justify-content-between mb-3">
     48                <div class="col-6 font-weight-bold">
     49                    <strong>Genre</strong>
     50                </div>
     51                <div class="col-6 font-weight-bold px-4">
     52                    <strong>Number of tracks</strong>
     53                </div>
     54            </div>
     55            <ul class="row list-group col-6">
    5156                {% for row in data %}
    52                     <tr>
    53                         <td>{{ row.first_name }}</td>
    54                         <td>{{ row.last_name }}</td>
    55                         <td>{{ row.genre }}</td>
    56                         <td>{{ row.track_count }}</td>
    57                     </tr>
     57                    <li class="list-group-item d-flex justify-content-between align-items-center">
     58                        <div class="col-6">
     59                            <span>{{ row.genre }}</span>
     60                        </div>
     61                        <div class="col-6">
     62                             <span>Number of Tracks: {{ row.track_count }}</span>
     63                        </div>
     64                    </li>
     65                {% empty %}
     66                    <li class="list-group-item">No data available for this customer.</li>
    5867                {% endfor %}
    59                 </tbody>
    60             </table>
     68            </ul>
    6169        </div>
    6270    {% endif %}
Note: See TracChangeset for help on using the changeset viewer.