diff --git a/.meteor/packages b/.meteor/packages index 4221036..6c745e0 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -19,3 +19,4 @@ shell-server@0.4.0 # Server-side component of the `meteor shell` comm autopublish@1.0.7 # Publish all data to the clients (for prototyping) insecure@1.0.7 # Allow all DB writes from clients (for prototyping) +reactive-dict diff --git a/.meteor/versions b/.meteor/versions index dcf0b35..1446733 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -57,6 +57,7 @@ observe-sequence@1.0.16 ordered-dict@1.1.0 promise@0.11.2 random@1.1.0 +reactive-dict@1.2.1 reactive-var@1.0.11 reload@1.2.0 retry@1.1.0 diff --git a/client/blobs/components/blob.html b/client/blobs/components/blob.html new file mode 100644 index 0000000..44bc353 --- /dev/null +++ b/client/blobs/components/blob.html @@ -0,0 +1,28 @@ + + + + + {{document.phone}} + + {{#each blob in blobs}} + {{> blobview blob=blob}} + {{/each}} + + + + {{#if opened}} + View More + {{else}} + View Less + {{/if}} + + + + + + + {{blob.content}} + Location + + + \ No newline at end of file diff --git a/client/blobs/components/blob.js b/client/blobs/components/blob.js new file mode 100644 index 0000000..140d809 --- /dev/null +++ b/client/blobs/components/blob.js @@ -0,0 +1,37 @@ +import './blob.html' +import { Template } from 'meteor/templating'; +import { ReactiveDict } from 'meteor/reactive-dict'; + +Template.singlenumber.onCreated(function singlenumberOnCreated() { + this.state = new ReactiveDict(); + this.state.set('buttonClosed', true); +}); + +Template.singlenumber.onRendered(function() { + this.$('.singleitem').transition('fade in up'); +}) + +Template.singlenumber.helpers({ + blobs: function() { + const instance = Template.instance(); + if (instance.state.get('buttonClosed')) { + return this.document.blobs.sort(function(a, b) { return b.lastEdited - a.lastEdited }).slice(0, 3); + } + else return this.document.blobs.sort(function(a, b) { return b.lastEdited - a.lastEdited }); + }, + opened: function() { + return Template.instance().state.get('buttonClosed'); + } +}); + +Template.singlenumber.events({ + 'click #showMore': function(e) { + e.preventDefault(); + const instance = Template.instance(); + instance.state.set('buttonClosed', !instance.state.get('buttonClosed')); + } +}); + +Template.blobview.onRendered(function() { + this.$('.item').transition('fade in up'); +}); \ No newline at end of file diff --git a/client/blobs/showBlobs.html b/client/blobs/showBlobs.html index e62f20b..d23398e 100644 --- a/client/blobs/showBlobs.html +++ b/client/blobs/showBlobs.html @@ -1,14 +1,9 @@ - - Info + Inbox + {{#each document in blobs}} - - - {{document.phone}} - {{#each blob in document.blobs}} - {{blob}} - {{/each}} - + + {{> singlenumber document=document}} {{/each}} diff --git a/client/blobs/showBlobs.js b/client/blobs/showBlobs.js index 699e6b9..40e386d 100644 --- a/client/blobs/showBlobs.js +++ b/client/blobs/showBlobs.js @@ -1,9 +1,10 @@ import './showBlobs.html'; +import './components/blob.js'; import { Template } from 'meteor/templating'; import { Conversations } from '../collections.js'; Template.showblobs.helpers({ blobs: function() { - return Conversations.find({state: {$gte: 2}}); + return Conversations.find({state: {$gte: 2}}, {sort: { lastEdited: -1 }}); } -}) \ No newline at end of file +}); \ No newline at end of file diff --git a/client/main.css b/client/main.css index 15b2d32..3296933 100644 --- a/client/main.css +++ b/client/main.css @@ -1,3 +1,3 @@ .ui#content { - padding-top: 55px; + padding-top: 95px; } \ No newline at end of file diff --git a/client/main.html b/client/main.html index a857a8a..d7cd7d8 100644 --- a/client/main.html +++ b/client/main.html @@ -3,20 +3,23 @@ - + - bAware + + Home + Add Citizens + Send Alerts diff --git a/client/stats/received.js b/client/stats/received.js index 2cab96d..9df623f 100644 --- a/client/stats/received.js +++ b/client/stats/received.js @@ -6,4 +6,8 @@ Template.received.helpers({ numReceived: function() { return Conversations.find({state: { "$gte": 3 }}).count(); } -}) \ No newline at end of file +}) + +Template.received.onRendered(function() { + this.$('.segment').transition('fade in up'); +}); \ No newline at end of file diff --git a/client/stats/sent.js b/client/stats/sent.js index 1b62944..9b8c6f7 100644 --- a/client/stats/sent.js +++ b/client/stats/sent.js @@ -6,4 +6,8 @@ Template.sent.helpers({ numSent: function() { return Conversations.find({}).count(); } +}); + +Template.sent.onRendered(function() { + this.$('.segment').transition('fade in up'); }) \ No newline at end of file diff --git a/public/emergency.png b/public/emergency.png new file mode 100644 index 0000000..1fc63d2 Binary files /dev/null and b/public/emergency.png differ
{{blob}}