source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/applications/admin/views/debug/breakpoints.html

main
Last change on this file was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100755
File size: 6.4 KB
Line 
1{{extend 'layout.html'}}
2{{block sectionclass}}debug{{end}}
3{{
4frm_trs = form.elements('tr')
5    tbl_rows = []
6    for frm_tr in frm_trs:
7        if frm_tr['_id'] != 'submit_record__row':
8            fld_label = frm_tr.element('td.w2p_fl')
9            fld_widget = frm_tr.element('td.w2p_fw')[0]
10            fld_comment = frm_tr.element('td.w2p_fc')[0]
11            lbls = fld_label.elements('label')
12            lbl = ''
13            if len(lbls) > 0:
14                lbl = fld_label.elements('label')[0]
15                lbl['_class'] = 'control-label'
16            pass
17            if fld_widget['_type'] == 'checkbox':
18                fld_widget = LABEL(fld_widget, _class='checkbox')
19            else:
20                fld_widget = CAT(fld_widget, SPAN('', _class='help-inline'))
21            pass
22            if isinstance(fld_widget, SPAN):
23                fld_widget['_role'] = 'asinput'
24            pass
25            tbl_row = DIV(lbl, DIV(fld_widget,
26                                   TAG['SMALL'](fld_comment,
27                                                _class='help-block'),
28                                   _class='controls'), _class='control-group')
29            tbl_rows.append(tbl_row)
30        else:
31            smt_btn = frm_tr.element('td.w2p_fw')
32            btn = smt_btn.elements('input')[0]
33            btn['_class'] = 'btn btn-primary'
34            tbl_rows.append(DIV(btn, _class='controls'))
35        pass
36    pass
37    form.element('table', replace=CAT(*tbl_rows))
38    form['_class'] = 'form-horizontal well well-small'
39    import re
40    if form.errors:
41        for key, value in form.errors.iteritems():
42            inpt = form.element(_name=key)
43            inpt_wrapper = inpt.parent
44            if inpt_wrapper['_class'] == None or \
45                                      not "controls" in inpt_wrapper['_class']:
46                inpt_wrapper = inpt_wrapper.parent
47            pass
48            inpt_wrapper.parent['_class'] += ' error'
49            inpt_wrapper.element(_class=re.compile('help-inline'),
50                            replace=lambda me:SPAN(value, _class=me['_class']))
51        pass
52        form.errors.clear()
53    pass
54}}
55<!-- begin "debug" block -->
56<div class="row-fluid">
57    <div class="applist f60 span7" style="padding-bottom:20px;">
58        <div class="applist_inner">
59            <h2>{{=T("Breakpoints")}}</h2>
60            <div class="errorform">
61                <form name="myform" method="post">
62                    <div class="tablebar">
63                        <input value="{{=T('delete all checked')}}" type="submit" class="btn"/>
64                    </div>
65                    <div class="row-fluid">
66                        <div class="span12 errors">
67                            <table id="trck_breakpoints" class="sortable table table-hover table-condensed">
68                                <thead>
69                                    <tr>
70                                        <th class="column1 cbcentered"><input type="checkbox" name="delete_all}" /></th>
71                                        <th class="column2">{{=T("Filename")}}</th>
72                                        <th class="column3">{{=T("Line Nr")}}</th>
73                                        <th>{{=T("Temporary")}}</th>
74                                        <th>{{=T("Condition")}}</th>
75                                        <th class="columnN">{{=T("Hits")}}</th>
76                                    </tr>
77                                </thead>
78                                <tbody>
79                                    {{for bp in breakpoints:}}
80                                    <tr class="breakpoint">
81                                        <td class="cbcentered"><input type="checkbox" name="delete_{{=bp['number']}}" /></td>
82                                        <td>{{=bp['filename']}}</td>
83                                        <td>{{=A(bp['lineno'],_href="#",_onclick="collapse('%s');" % bp['number'])}}</td>
84                                        <td>{{=bp['temporary']}}</td>
85                                        <td>{{=bp['condition']}}</td>
86                                        <td>{{=bp['hits']}}</td>
87                                    </tr>
88                                    <tr id="{{=bp['number']}}" class="sourcecode traceback">
89                                        <td colspan="6">
90                                            <div class="ticket_code">
91                                            {{=CODE(open(bp['path']).read(), language='python',
92                                                link=None, highlight_line=bp['lineno'], context_lines=10)}}
93                                            </div>
94                                        </td>
95                                    </tr>
96                                    {{pass}}
97                                </tbody>
98                            </table>
99                        </div>
100                    </div>
101                </form><!-- /errorform -->
102            </div>
103        </div>
104    </div><!-- /applist -->
105    <div class="sidebar fl60 span5">
106        <div class="sidebar_inner controls" style="margin:0;">
107            <div class="box">
108                <h3>{{=T("Add breakpoint")}}</h3>
109                {{=form}}
110                <div class="row-fluid">
111                    <div class="help span12 alert alert-block alert-info">
112                        <ul class="unstyled">
113                            <li>{{=T("You can also set and remove breakpoint in the edit window, using the Toggle Breakpoint button")}}</li>
114                        </ul>
115                    </div>
116                </div>
117            </div>
118        </div>
119    </div>
120</div>
121 
122<script type="text/javascript">
123    jQuery(document).ready(function() {
124        jQuery('.sourcecode').hide();
125        jQuery("#trck_breakpoints thead tr th:first input[type=checkbox]").click(function() {
126            var checkedStatus = this.checked;
127            jQuery("#trck_breakpoints tbody tr td:first-child input[type=checkbox]").each(function() {
128                this.checked = checkedStatus;
129            });
130        });
131        jQuery("#trck_breakpoints tbody tr td:first-child input[type=checkbox]").change(function() {
132            var allchecked = jQuery("#trck_breakpoints tbody tr td:first-child input[type=checkbox]:checked").length == jQuery("#trck_breakpoints tbody tr td:first-child input[type=checkbox]").length;
133            jQuery("#trck_breakpoints thead tr th:first input[type=checkbox]").prop('checked', allchecked);
134        });
135    });
136</script>
137<!-- end "debug" block -->
Note: See TracBrowser for help on using the repository browser.