summaryrefslogtreecommitdiff
path: root/templates/pages/show.mako
blob: 054c2877c07de1cc347e99707ec1990c97f69cf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<%inherit file="/page.mako" />

% for e in exps:
    % if len(exps) > 1:
        <h2>${get_d(e)}</h2>
    % endif
    % for c in e.catexps:
        <%self:detail name="${c.cat.name}" sum="${c.expense}" set="${c.all}" args="exp">
            <a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}</a>
        </%self:detail>
    % endfor

    <%self:detail name="Constant" sum="${e.constsum}" set="${e.consts}" args="exp">
        ${exp.monthly} -- ${exp.description}
    </%self:detail>
    
    <%self:detail name="In Summa" sum="${e.sum}" set="${e.all}" args="exp">
        <a href=${"/edit/%s" % exp.id | url}>${exp.day}.${exp.month}. -- ${exp.description}: ${exp.expense}</a>
    </%self:detail>
    <br/>
% endfor

<%def name="heading()">
    % if len(exps) > 1:
        Current expenses
    % else:
        Expenses for ${get_d(exps[0])}
    % endif

</%def>

<%def name="get_d(e)">
    ${e.date.year}/${e.date.month}
</%def>

<%def name="js()">
    ${parent.js()}
    <script type="text/javascript" src=${"/static/js/show.js" | url}></script>
</%def>

<%def name="detail(name, sum, set)">
    <div class="detail">
        <img class="mark" src=${"/static/images/closed.png" | url} />
        <span class="heading">${name}:</span>    <span class="sum">${sum}</span><br/>
        <div class="details">
            <ul>
                % for exp in set:
                    <li class="expense">${caller.body(exp)}</li>
                % endfor
            </ul>
        </div>
    </div>
</%def>