Project

General

Profile

« Previous | Next » 

Revision 2c6641c8

Added by Serghei Mihai almost 10 years ago

dossiers: print all quotations

font-awesome styles added for icons effects

Closes #5012

View differences:

calebasse/dossiers/templates/dossiers/quotations.html
4 4
{% block appbar %}
5 5
<h2>Dossiers</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 %}
......
46 46
  </div>
47 47
</div>
48 48
<div class="content">
49
  <table id="dossiers" class="main">
49
  <table id="dossiers" class="main screen-only">
50 50
    <thead>
51 51
      <tr>
52 52
        <th colspan="2">N° dossier
......
72 72
        <td>{{ patient_record.object.id }}</td>
73 73
        <td><span class="lastname">{{ patient_record.object.last_name }}</span></td>
74 74
        <td>{{ patient_record.object.first_name }}</td>
75
        <td>{{ patient_record.object.birthdate|date:"SHORT_DATE_FORMAT" }}</td>
75
        <td>{{ patient_record.object.birthdate|date:"d-m-Y" }}</td>
76 76
        <td class="{{ patient_record.state_class }}">{{ patient_record.state }}</td>
77 77
        <td>{% if patient_record.next_rdv_date %}
78
          {{ patient_record.next_rdv_date|date:"DATETIME_FORMAT" }}
78
          {{ patient_record.next_rdv_date|date:"d-m-Y, H:i" }}
79 79
          {% endif %}
80 80
        </td>
81 81
        <td>{% if patient_record.last_rdv_date %}
82
          {{ patient_record.last_rdv_date|date:"DATETIME_FORMAT" }}
82
          {{ patient_record.last_rdv_date|date:"d-m-Y, H:i" }}
83 83
          {% endif %}</td>
84 84
        <td>{% if patient_record.mises %}<span class="icon-ok"></span>{% endif %}</td>
85 85
        <td>{% if patient_record.anap %}<span class="icon-ok"></span>{% endif %}</td>
......
90 90
  </table>
91 91

  
92 92
  {% if request.GET %}
93
  <div class="pagination">
93
  <div class="pagination screen-only">
94 94
    <span class="step-links">
95 95
      {% if paginate_patient_records.has_previous %}
96 96
      <a href="?{{ query }}&page={{ paginate_patient_records.previous_page_number }}">««</a>
calebasse/dossiers/views.py
909 909
                service=self.service)
910 910
        patient_records = []
911 911
        page = self.request.GET.get('page')
912
        paginator = Paginator(ctx['object_list'].filter(), 50)
913
        try:
914
            paginate_patient_records = paginator.page(page)
915
        except PageNotAnInteger:
916
            paginate_patient_records = paginator.page(1)
917
        except EmptyPage:
918
            paginate_patient_records = paginator.page(paginator.num_pages)
919

  
920
        ctx['patient_records'] = self._get_search_result(paginate_patient_records)
921
        ctx['paginate_patient_records'] = paginate_patient_records
912
        all = 'all' in self.request.GET
913
        if all:
914
            patient_records = ctx['object_list']
915
            ctx['all'] = all
916
            self.template_name = 'dossiers/quotations_print.html'
917
        else:
918
            paginator = Paginator(ctx['object_list'].filter(), 50)
919
            try:
920
                patient_records = paginator.page(page)
921
            except PageNotAnInteger:
922
                patient_records = paginator.page(1)
923
            except EmptyPage:
924
                patient_records = paginator.page(paginator.num_pages)
925
            ctx['paginate_patient_records'] = patient_records
926

  
927
        ctx['patient_records'] = self._get_search_result(patient_records)
922 928

  
923 929
        query = self.request.GET.copy()
924 930
        if 'page' in query:
calebasse/static/css/print.css
89 89

  
90 90
div#activity .header {
91 91
    display: block;
92
}
93

  
94
/* quotations printing */
95

  
96
table.main {
97
    border-collapse: collapse;
98
}
99

  
100
table.main td, table.main th {
101
    border: 1px solid #555;
102
    padding: 0 .5em;
92 103
}
calebasse/static/css/style.css
1288 1288
.icon-uncheck:before {content: "\f096";margin-right: 5px;}
1289 1289
.icon-car:before {content: "\f1b9";margin-right: 5px;}
1290 1290
.icon-phone:before { content: "\f095"; margin-right: 3px;}
1291
.icon-wip:before {
1292
    content: "\f110";
1293
    margin-right: 3px;
1294
    -webkit-animation: spin 2s infinite linear;
1295
    -moz-animation: spin 2s infinite linear;
1296
    -o-animation: spin 2s infinite linear;
1297
    animation: spin 2s infinite linear;
1298
}
1291 1299

  
1292 1300
/* periodic event search form */
1293 1301

  
calebasse/static/js/calebasse.dossiers.js
375 375
        window.location.href = window.location.pathname;
376 376
        return false;
377 377
    });
378
    $('#print-button').click(function() { window.print(); });
378
    $('#print-button').click(function() {
379
        var button = $(this);
380
        var title = button.html();
381
        button.html('Préparation de l\'impression en cours');
382
        button.attr({disabled: 'disabled'});
383
        button.toggleClass('icon-wip');
384
        $('.pagination').next().remove();
385
        $.get(window.location + '&all', function(data) {
386
            button.toggleClass('icon-wip');
387
            button.removeAttr('disabled');
388
            button.html(title);
389
            $('.content').append(data);
390
            window.print();
391
        });
392
    });
379 393

  
380 394
    $('#new-patientrecord').click(function() {
381 395
        generic_ajaxform_dialog('new', 'Nouveau dossier',
calebasse/templates/calebasse/base.html
6 6
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7 7
    <title>{% block title %}{{ service_name }}{% endblock %}</title>
8 8
    <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/style.css"/>
9
    <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/font-awesome.min.css" />
9 10
    <link rel="stylesheet" type="text/css" media="print" href="{{ STATIC_URL }}css/print.css"/>
10 11
    <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/smoothness/jquery-ui-1.8.21.custom.css"/>
11 12
    <link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}css/ajax_select.css"/>

Also available in: Unified diff