Projet

Général

Profil

« Précédent | Suivant » 

Révision affeff87

Ajouté par Mikaël Ates il y a plus de 9 ans

dossiers: manage printing for the waiting queue and shorter paginated pages.

  • Waiting queue page is similar to the quotation page. Since commit
    2c6641c8 printing is done differently. So it has been adapted to
    the waiting queue page.
  • Pages quotations and waiting queue paginated for 25 lines instead of
    50 (mainly done for a faster page display).

Voir les différences:

calebasse/dossiers/templates/dossiers/waiting_queue.html
4 4
{% block appbar %}
5 5
    <h2>Dossiers sur liste d'attente{% if len_patient_records %} : {{ len_patient_records }}{% endif %}</h2>
6 6
    <a href=".">Retourner aux dossiers</a>
7
    <button id='print-button'>Imprimer</button>
7
    <button id='print-button' class='icon-print'>Imprimer</button>
8 8
{% endblock %}
9 9

  
10 10
{% block content %}
......
30 30
    </div>
31 31
</div>
32 32
<div class="content">
33
  <table id="dossiers" class="main">
34
    <thead>
35
      <tr>
36
        <th colspan="2">N° dossier
37
        </th><th rowspan="2">Nom</th>
38
        <th rowspan="2">Prénom</th>
39
        <th rowspan="2">Position</th>
40
        <th rowspan="2">Date d'accueil</th>
41
        <th rowspan="2">Prochain rendez-vous</th>
42
        <th rowspan="2">Intervenant(s)</th>
43
        <th rowspan="2">Commentaire</th>
44
      </tr>
45
      <tr>
46
        <th>papier</th>
47
        <th>inform.</th>
48
      </tr>
49
    </thead>
50
    <tbody>
51

  
52
      {% for patient_record in patient_records %}
53
      <tr style="display: table-row;" class="pr-line {{ patient_record.state_class }}" data-link="{{ patient_record.object.id }}/view">
54
          <td>{{ patient_record.object.paper_id|default_if_none:"" }}</td>
55
          <td>{{ patient_record.object.id }}</td>
56
          <td><span class="lastname">{{ patient_record.object.last_name }}</span></td>
57
          <td>{{ patient_record.object.first_name }}</td>
58
          <td>{{ patient_record.position }}</td>
59
          <td>{{ patient_record.object.last_state.date_selected|date:"SHORT_DATE_FORMAT" }}</td>
60
          <td>{{ patient_record.object.get_next_rdv.start_datetime|date:"d/m/Y H:i" }} {{ patient_record.object.get_next_rdv.act_type }}</td>
61
          <td>{% for participant in patient_record.object.get_next_rdv.participants.all %}{{ participant.last_name }} {% endfor %}</td>
62
          <td>{{ patient_record.object.last_state.comment|default_if_none:"" }}</td>
63
      </tr>
64
      {% endfor %}
65

  
66
    </tbody>
33
  <table id="dossiers" class="main screen-only">
34
  {% include "dossiers/waiting_queue_table_content.html" %}
67 35
  </table>
68 36

  
69
<div class="pagination">
37
<div class="pagination screen-only">
70 38
    <span class="step-links">
71 39
        {% if paginate_patient_records.has_previous %}
72 40
            <a href="?{{ query }}&page={{ paginate_patient_records.previous_page_number }}">««</a>
calebasse/dossiers/templates/dossiers/waiting_queue_print.html
1
<table class="main print-only">
2
  {% include "dossiers/waiting_queue_table_content.html" %}
3
</table>
calebasse/dossiers/templates/dossiers/waiting_queue_table_content.html
1
<thead>
2
  <tr>
3
    <th colspan="2">N° dossier
4
    </th><th rowspan="2">Nom</th>
5
    <th rowspan="2">Prénom</th>
6
    <th rowspan="2">Position</th>
7
    <th rowspan="2">Date d'accueil</th>
8
    <th rowspan="2">Prochain rendez-vous</th>
9
    <th rowspan="2">Intervenant(s)</th>
10
    <th rowspan="2">Commentaire</th>
11
  </tr>
12
  <tr>
13
    <th>papier</th>
14
    <th>inform.</th>
15
  </tr>
16
</thead>
17
<tbody>
18

  
19
  {% for patient_record in patient_records %}
20
  <tr style="display: table-row;" class="pr-line {{ patient_record.state_class }}" data-link="{{ patient_record.object.id }}/view">
21
      <td>{{ patient_record.object.paper_id|default_if_none:"" }}</td>
22
      <td>{{ patient_record.object.id }}</td>
23
      <td><span class="lastname">{{ patient_record.object.last_name }}</span></td>
24
      <td>{{ patient_record.object.first_name }}</td>
25
      <td>{{ patient_record.position }}</td>
26
      <td>{{ patient_record.object.last_state.date_selected|date:"SHORT_DATE_FORMAT" }}</td>
27
      <td>{{ patient_record.object.get_next_rdv.start_datetime|date:"d/m/Y H:i" }} {{ patient_record.object.get_next_rdv.act_type }}</td>
28
      <td>{% for participant in patient_record.object.get_next_rdv.participants.all %}{{ participant.last_name }} {% endfor %}</td>
29
      <td>{{ patient_record.object.last_state.comment|default_if_none:"" }}</td>
30
  </tr>
31
  {% endfor %}
32

  
33
</tbody>
calebasse/dossiers/views.py
933 933
            ctx['all'] = all
934 934
            self.template_name = 'dossiers/quotations_print.html'
935 935
        else:
936
            paginator = Paginator(ctx['object_list'].filter(), 50)
936
            paginator = Paginator(ctx['object_list'].filter(), 25)
937 937
            try:
938 938
                patient_records = paginator.page(page)
939 939
            except PageNotAnInteger:
......
1038 1038
                service=self.service)
1039 1039
        patient_records = []
1040 1040
        page = self.request.GET.get('page')
1041
        paginator = Paginator(ctx['object_list'].filter(), 50)
1042
        try:
1043
            paginate_patient_records = paginator.page(page)
1044
        except PageNotAnInteger:
1045
            paginate_patient_records = paginator.page(1)
1046
        except EmptyPage:
1047
            paginate_patient_records = paginator.page(paginator.num_pages)
1041

  
1042
        all = 'all' in self.request.GET
1043
        if all:
1044
            paginate_patient_records = ctx['object_list']
1045
            ctx['all'] = all
1046
            self.template_name = 'dossiers/waiting_queue_print.html'
1047
        else:
1048
            paginator = Paginator(ctx['object_list'].filter(), 25)
1049
            try:
1050
                paginate_patient_records = paginator.page(page)
1051
            except PageNotAnInteger:
1052
                paginate_patient_records = paginator.page(1)
1053
            except EmptyPage:
1054
                paginate_patient_records = paginator.page(paginator.num_pages)
1055
            ctx['paginate_patient_records'] = paginate_patient_records
1048 1056

  
1049 1057
        all_patient_records = PatientRecord.objects.filter(
1050 1058
                service=self.service,
......
1052 1060
                'last_state__date_selected', 'created')
1053 1061
        ctx['patient_records'] = self._get_search_result(
1054 1062
            paginate_patient_records, all_patient_records)
1055
        ctx['paginate_patient_records'] = paginate_patient_records
1056 1063
        ctx['len_patient_records'] = all_patient_records.count()
1057 1064

  
1058 1065
        query = self.request.GET.copy()

Formats disponibles : Unified diff