Mercurial > libervia-web
comparison libervia/pages/photos/album/_browser/__init__.py @ 1351:2c3bc7284992
browser (photos/album): fixed notifications
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 05 Sep 2020 21:59:23 +0200 |
parents | cda5537c71d6 |
children | d100d3a07dd7 |
comparison
equal
deleted
inserted
replaced
1350:a32f3f47e4a8 | 1351:2c3bc7284992 |
---|---|
36 photo_elt.select_one('.action_delete').bind("click", on_delete) | 36 photo_elt.select_one('.action_delete').bind("click", on_delete) |
37 print(f"file {file_.name} uploaded correctly") | 37 print(f"file {file_.name} uploaded correctly") |
38 | 38 |
39 | 39 |
40 def on_error(failure, file_, photo_elt): | 40 def on_error(failure, file_, photo_elt): |
41 dialog.notification( | 41 dialog.notification.show( |
42 f"can't upload {file_.name}: failure", | 42 f"can't upload {file_.name}: failure", |
43 level="error" | 43 level="error" |
44 ) | 44 ) |
45 | 45 |
46 | 46 |
61 xhr.setRequestHeader('Xmpp-File-No-Http', "true") | 61 xhr.setRequestHeader('Xmpp-File-No-Http', "true") |
62 xhr.send(file_) | 62 xhr.send(file_) |
63 | 63 |
64 | 64 |
65 def on_slot_eb(file_, failure, photo_elt): | 65 def on_slot_eb(file_, failure, photo_elt): |
66 dialog.notification( | 66 dialog.notification.show( |
67 f"Can't get upload slot: {failure}", | 67 f"Can't get upload slot: {failure}", |
68 level="error" | 68 level="error" |
69 ) | 69 ) |
70 | 70 |
71 | 71 |
128 item_elt.bind("transitionend", lambda evt: item_elt.remove()) | 128 item_elt.bind("transitionend", lambda evt: item_elt.remove()) |
129 print(f"deleted {item['name']}") | 129 print(f"deleted {item['name']}") |
130 | 130 |
131 | 131 |
132 def file_delete_eb(failure, item_elt, item): | 132 def file_delete_eb(failure, item_elt, item): |
133 dialog.notification( | 133 dialog.notification.show( |
134 f"error while deleting {item['name']}: failure", | 134 f"error while deleting {item['name']}: failure", |
135 level="error" | 135 level="error" |
136 ) | 136 ) |
137 | 137 |
138 | 138 |