Permalink
Browse files

prettier

  • Loading branch information...
1 parent 9dbc186 commit 4c47dff7abcd108659188efd125227713077acca @bradfitz committed Dec 1, 2008
Showing with 32 additions and 7 deletions.
  1. +10 −1 addressbooker.py
  2. +20 −4 google-merge.html
  3. +1 −1 index.html
  4. +1 −1 page.html
View
@@ -397,11 +397,11 @@ def out(str):
updater = Updater(client=client, noop_mode=preview_mode);
+ no_change_contacts = []
for contact in contacts:
contact_change = {
"contact": contact,
}
- contact_changes.append(contact_change)
merge_entry = FindEntryToMergeInto(contact, feed)
if merge_entry:
@@ -418,6 +418,14 @@ def out(str):
contact_change["changes"] = ["Create new contact."]
updater.AddInsert(NewContactEntry(contact, group=group))
+ if contact_change["action"] == "none":
+ no_change_contacts.append(contact_change)
+ else:
+ contact_changes.append(contact_change)
+
+ # Put the boring ones at bottom.
+ contact_changes.extend(no_change_contacts)
+
render_google_list = False
if render_google_list:
out("<hr />")
@@ -446,6 +454,7 @@ def out(str):
"preview_mode": preview_mode,
"body": "".join(body),
"session_token": str(session_token),
+ "key": key,
"changes": contact_changes
})
View
@@ -1,18 +1,33 @@
{% if preview_mode %}
-<b>Preview mode.</b> See if the changes below look good. If so, press submit at bottom.
-{% endif %}
+<b>Preview mode.</b> See if the changes below look good. If so, press the button:</p>
+<form method='POST' style='margin-top: 1em'>
+ <center><input type='submit' value='Do it.' style='font-size: 30pt;' /></center>
+</form>
+{% else %}
+
+<p>All done! You can <a href='gcontacts?key={{ key|urlencode }}'>go
+back</a> and verify the delta is now zero. Or go check
+out <a href="http://mail.google.com/mail/contacts/ui/ContactManager">your
+Google Contacts</a>.</p>
+
+ {% endif %}
+<center>
<table cellpadding='5' border='3' style='margin-top: 2em'>
<tr>
<td colspan='2'><b>Submitted Contact</b></td>
<td><b>Action</b></td>
-<td><b>Changes</b></td>
+<td><b>
+ {% if preview_mode %}Proposed {% endif %}Changes
+</b></td>
</tr>
{% for change in changes %}
<tr>
<td>
{% if change.contact.img %}
- <div class='image'><img src="{{ change.contact.img|escape }}" /></div>
+ {% ifnotequal change.action "none" %}
+ <div class='image'><img src="{{ change.contact.img|escape }}" /></div>
+ {% endifnotequal %}
{% endif %}
</td>
<td>
@@ -41,6 +56,7 @@
</tr>
{% endfor %}
</table>
+</center>
{% if body %}
<hr>
View
@@ -1,4 +1,4 @@
-<p>... a stupid hack that aims to be be a swiss-army knife for contact
+<p>... aims to be a swiss-army knife for contact
management, but right now doesn't do very much.</p>
<p>Currently it can just take a submitted form POST w/ JSON contacts
View
@@ -15,7 +15,7 @@
<br clear='both' />
<hr>
-<i><a href="http://addressbooker.appspot.com/">AddressBooker</a> is a dumb little hack by Brad Fitzpatrick &lt;brad@danga.com&gt;. It comes with <b>no warranty of any kind</b>.</i>
+<i><a href="http://addressbooker.appspot.com/">AddressBooker</a> is a little hack by Brad Fitzpatrick &lt;brad@danga.com&gt;. It comes with <b>no warranty of any kind</b>.</i>
</body>
</html>

0 comments on commit 4c47dff

Please sign in to comment.