X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=bluechips%2Ftemplates%2Fbase.mako;h=43db6e4246c1871b543fc69aa83ca5a6c66c3618;hb=fed6d11d2cbd6d617d18bc01a78196865da4155b;hp=956a4eeb073c8f7618bacccbd3a9b5885d136b18;hpb=a87834811aead8d14d349c2a0fa7af6a4d57001d;p=bluechips.git diff --git a/bluechips/templates/base.mako b/bluechips/templates/base.mako index 956a4ee..43db6e4 100644 --- a/bluechips/templates/base.mako +++ b/bluechips/templates/base.mako @@ -4,62 +4,165 @@ ${self.title()} - ${h.stylesheet_link('/css/main.css')} + ${h.stylesheet_link('%s/css/main.css' % request.script_name)} + ${h.stylesheet_link('//ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/flick/jquery-ui.css')} + ${h.javascript_link('//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js')} + ${h.javascript_link('//ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js')} + ${h.javascript_link('%s/js/admin.js' % request.script_name)} -

${self.title()}

- <% messages = h.flash.pop_messages() %> - % if messages: - + % if c.mobile_client: +
+ Use mobile interface +
% endif + + % for message in h.flash.pop_messages(): +
${str(message) | n}
+ % endfor
${next.body()}
-<%def name="title()">BlueChips +<%def name="title()">BlueChips +% if c.title != '': + :: ${c.title} +% endif + + +<%def name="formatUser(user)"> + % if user == request.environ['user']: + Me + % else: + ${user.name} + % endif + -<%def name="listExpenditures(es)"> - +<%def name="listExpenditures(es, total=None, share=None)"> +
- - - - + + + + + + % for e in es: - - - - - - + <% + if e.involves(request.environ['user']): + klass = 'user-involved' + else: + klass = 'user-not-involved' + %> + + + + + + + + % endfor -
DateSpenderDescriptionAmountDateSpenderDescriptionAmount
${e.date}${e.spender.name}${e.description}$${h.round_currency(e.amount)}
${e.date}${formatUser(e.spender)}${e.description}${e.amount}
+ % if total is not None and share is not None: + + + ${total} + ${share} + + + + % endif + <%def name="listTransfers(ts)"> - +
- - - - - + + + + + + % for t in ts: - - - - - - - + <% + if t.involves(request.environ['user']): + klass = 'user-involved' + else: + klass = 'user-not-involved' + %> + + + + + + + + % endfor -
DateFromToDescriptionAmountDateFromToDescriptionAmount
${t.date}${t.debtor.name}${t.creditor.name}${t.description}$${h.round_currency(t.amount)}
${t.date}${formatUser(t.debtor)}${formatUser(t.creditor)}${t.description}${t.amount}
+ + + +<%def name="listTags()"> +<% +x = ',\n'.join([h.link_to(tag.name, h.url_for(controller='history', action='tag', id=tag.id)) for tag in c.tags]) +%> +${x|n} + + + +<%def name="expenditureIcon()"> +←→ + + +<%def name="transferIcon()"> +$$