Projet

Général

Profil

0001-backoffice-make-the-summary-and-history-sections-fol.patch

Frédéric Péters, 03 janvier 2014 14:55

Télécharger (3,21 ko)

Voir les différences:

Subject: [PATCH] backoffice: make the summary and history sections foldable
 (#3094)

 wcs/backoffice/root.py               |  1 +
 wcs/forms/common.py                  |  8 ++++++--
 wcs/qommon/static/css/dc2/admin.css  | 15 +++++++++++++++
 wcs/qommon/static/js/qommon.admin.js |  4 ++++
 4 files changed, 26 insertions(+), 2 deletions(-)
wcs/backoffice/root.py
716 716
        return html_top('forms', title)
717 717

  
718 718
    def _q_index(self):
719
        get_response().add_javascript(['jquery.js', 'qommon.admin.js'])
719 720
        return self.status()
wcs/forms/common.py
205 205
            return
206 206
        r = TemplateIO(html=True)
207 207
        r += htmltext('<div class="bo-block" id="evolution-log">')
208
        r += htmltext('<h2>%s</h2>') % _('Log')
208
        r += htmltext('<h2 class="foldable">%s</h2>') % _('Log')
209 209
        r += htmltext('<dl id="evolutions">')
210 210
        hidden = False
211 211
        for evo in self.filled.evolution:
......
295 295
                break
296 296

  
297 297
        r = TemplateIO(html=True)
298
        r += htmltext('<div class="bo-block">')
299
        r += htmltext('<h2 class="foldable">%s</h2>') % _('Summary')
298 300
        r += htmltext('<div class="dataview">')
301

  
299 302
        if self.formdef.signing and not self.filled.signature:
300 303
            r += htmltext('<div class="errornotice">%s</div>') % \
301 304
                    _("Warning form not signed")
......
378 381
                r += htmltext('<p><span class="label">%s</span> ') % _('Status')
379 382
                r += htmltext('<span class="value">%s</span></p>') % wf_status.name
380 383

  
381
        r += htmltext('</div>')
384
        r += htmltext('</div>') # .dataview
385
        r += htmltext('</div>') # .bo-block
382 386
        return r.getvalue()
383 387

  
384 388

  
wcs/qommon/static/css/dc2/admin.css
757 757
svg .page-subject path {
758 758
	stroke: #91a9b2;
759 759
}
760

  
761
.foldable {
762
	cursor: pointer;
763
}
764

  
765
.foldable:after {
766
	content: "▼";
767
	font-size: 80%;
768
	text-align: right;
769
	float: right;
770
}
771

  
772
.foldable.folded:after {
773
	content: "▶";
774
}
wcs/qommon/static/js/qommon.admin.js
10 10
        $(dialog).css('height', ($(window).height() - 80) + 'px');
11 11
        return false;
12 12
    });
13
    $('.foldable').click(function() {
14
       $(this).toggleClass('folded').next().toggle();
15
    });
16
    $('.foldable.folded').next().hide();
13 17
});
14
-