From 9014baab92007fcdd624be9e81e45ba92dce97ae Mon Sep 17 00:00:00 2001 From: rr- Date: Wed, 17 Aug 2016 13:01:17 +0200 Subject: [PATCH] client/snapshots: add snapshots browser --- client/css/snapshots.styl | 44 ++++++ client/html/home_featured_post.tpl | 2 +- client/html/home_footer.tpl | 4 + client/html/snapshots_page.tpl | 31 +++++ client/js/controllers/history_controller.js | 16 --- client/js/controllers/home_controller.js | 1 + client/js/controllers/snapshots_controller.js | 41 ++++++ client/js/main.js | 2 +- client/js/models/snapshot.js | 40 ++++++ client/js/models/snapshot_list.js | 25 ++++ client/js/util/views.js | 28 ++-- client/js/views/snapshots_page_view.js | 131 ++++++++++++++++++ 12 files changed, 338 insertions(+), 27 deletions(-) create mode 100644 client/css/snapshots.styl create mode 100644 client/html/snapshots_page.tpl delete mode 100644 client/js/controllers/history_controller.js create mode 100644 client/js/controllers/snapshots_controller.js create mode 100644 client/js/models/snapshot.js create mode 100644 client/js/models/snapshot_list.js create mode 100644 client/js/views/snapshots_page_view.js diff --git a/client/css/snapshots.styl b/client/css/snapshots.styl new file mode 100644 index 00000000..dc94bd0b --- /dev/null +++ b/client/css/snapshots.styl @@ -0,0 +1,44 @@ +$snapshot-created-background-color = #E0F5E0 +$snapshot-modified-background-color = #E0F5FF +$snapshot-deleted-background-color = #FDE5E5 +$snapshot-merged-background-color = #FEC + +.snapshot-list + text-align: left + + ul + margin: 0 auto + width: 100% + max-width: 35em + list-style-type: none + + li + .time + float: right + + div + padding: 0.1em 0.5em + .thumbnail + margin-left: 0 + &:empty + padding: 0 + + div.operation-created + background: $snapshot-created-background-color + &+.details + background: lighten($snapshot-created-background-color, 50%) + div.operation-modified + background: $snapshot-modified-background-color + &+.details + background: lighten($snapshot-modified-background-color, 50%) + div.operation-deleted + background: $snapshot-deleted-background-color + &+.details + background: lighten($snapshot-deleted-background-color, 50%) + div.operation-merged + background: $snapshot-merged-background-color + &+.details + background: lighten($snapshot-merged-background-color, 50%) + + div.details + margin-bottom: 2em diff --git a/client/html/home_featured_post.tpl b/client/html/home_featured_post.tpl index 90851d79..33b9c3c8 100644 --- a/client/html/home_featured_post.tpl +++ b/client/html/home_featured_post.tpl @@ -1,7 +1,7 @@
<% if (ctx.featuredPost) { %>