Skip to content

Commit beac655

Browse files
sartakmonken
authored andcommitted
First pass at wishlist support under donations
1 parent e57ed96 commit beac655

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

root/account/profile.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,16 @@
4242
<label><span>Feed</span><input type="text" name="blog.feed" value="<% author.blog.0.feed %>" /></label>
4343
<label><span>Avatar</span><input type="text" name="gravatar_url" value="<% author.gravatar_url %>" /></label>
4444
<%- donation = author.donation.0.id %>
45-
<label><input name="donations" type="checkbox"<% IF donation %> checked="checked"<% END %> onchange="$('.paypal').slideToggle()" /> Accept donations</label>
46-
<label class="paypal"<% UNLESS donation %> style="display: none"<% END %>>
47-
<span>PayPal</span>
48-
<input type="hidden" name="donation.name" value="paypal" />
49-
<input type="text" name="donation.id" value="<% donation %>" />
50-
</label>
45+
<label><input name="donations" type="checkbox"<% IF donation %> checked="checked"<% END %> onchange="$('#donations').slideToggle()" /> Accept donations</label>
46+
<div id="donations"<% UNLESS donation %> style="display: none"<% END %>>
47+
<% FOREACH system IN ['PayPal', 'Wishlist']; found = author.donation.grep(->(a){ a.id == system.lower }) %>
48+
<label class="<% system.lower %>">
49+
<span><% lower %></span>
50+
<input type="hidden" name="donation.name" value="<% system.lower %>" />
51+
<input type="text" name="donation.id"<% IF found.size %> value="<% found.0.name %>"<% END %> />
52+
</label>
53+
<% END %>
54+
</div>
5155
<label><span>Last update</span><strong class="relatize"><% author.updated.dt_http %></strong></label>
5256
</fieldset>
5357

root/author.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
<% IF blog.feed %><a href="<% blog.feed %>" target="_blank"><img src="/static/images/profile/feed.png" width=16 height=16 style="float: right"></a><% END %>
3333
<a href="<% blog.url %>" title="<% blog.url %>" target="_blank" class="ellipsis" style="width: 140px"><% blog.url.replace('^https?://', '') %></a>
3434
<% END; END %>
35-
<% IF author.donation.size; FOREACH donate IN author.donation; IF donate.name == 'paypal' %>
35+
<% IF author.donation.size; FOREACH donate IN author.donation %>
36+
<% IF donate.name == 'paypal' %>
3637
<br>
3738
<center><form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
3839
<input type="hidden" name="cmd" value="_donations">
@@ -45,6 +46,8 @@
4546
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
4647
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
4748
</form></center>
49+
<% ELSIF donate.name == 'wishlist' %>
50+
<a rel="me" href="<% donate.id %>" target="_blank">Wishlist</a><br>
4851
<% END; END; END %>
4952
<%
5053
i = 0;

0 commit comments

Comments
 (0)