Skip to content

Commit cd8932b

Browse files
committed
Finished main view.
1 parent 61041c9 commit cd8932b

File tree

11 files changed

+89
-15
lines changed

11 files changed

+89
-15
lines changed

.meteor/packages

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ [email protected] # Server-side component of the `meteor shell` comm
1919

2020
[email protected] # Publish all data to the clients (for prototyping)
2121
[email protected] # Allow all DB writes from clients (for prototyping)
22+
reactive-dict

.meteor/versions

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ [email protected]
5757
5858
5959
60+
6061
6162
6263

client/blobs/components/blob.html

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<template name="singlenumber">
2+
<div class="item singleitem">
3+
<i class="phone icon"></i>
4+
<div class="content">
5+
<h4 class="header">{{document.phone}}</h4>
6+
<div class="list">
7+
{{#each blob in blobs}}
8+
{{> blobview blob=blob}}
9+
{{/each}}
10+
</div>
11+
</div>
12+
</div>
13+
{{#if opened}}
14+
<a id="showMore" class="ui button primary basic">View More</a>
15+
{{else}}
16+
<a id="showMore" class="ui primary basic button">View Less</a>
17+
{{/if}}
18+
</template>
19+
20+
<template name="blobview">
21+
<div class="item" id="blob-">
22+
<i class="circle outline icon"></i>
23+
<div class="content">
24+
<div class="header">{{blob.content}}</div>
25+
<div class="description">Location</div>
26+
</div>
27+
</div>
28+
</template>

client/blobs/components/blob.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import './blob.html'
2+
import { Template } from 'meteor/templating';
3+
import { ReactiveDict } from 'meteor/reactive-dict';
4+
5+
Template.singlenumber.onCreated(function singlenumberOnCreated() {
6+
this.state = new ReactiveDict();
7+
this.state.set('buttonClosed', true);
8+
});
9+
10+
Template.singlenumber.onRendered(function() {
11+
this.$('.singleitem').transition('fade in up');
12+
})
13+
14+
Template.singlenumber.helpers({
15+
blobs: function() {
16+
const instance = Template.instance();
17+
if (instance.state.get('buttonClosed')) {
18+
return this.document.blobs.sort(function(a, b) { return b.lastEdited - a.lastEdited }).slice(0, 3);
19+
}
20+
else return this.document.blobs.sort(function(a, b) { return b.lastEdited - a.lastEdited });
21+
},
22+
opened: function() {
23+
return Template.instance().state.get('buttonClosed');
24+
}
25+
});
26+
27+
Template.singlenumber.events({
28+
'click #showMore': function(e) {
29+
e.preventDefault();
30+
const instance = Template.instance();
31+
instance.state.set('buttonClosed', !instance.state.get('buttonClosed'));
32+
}
33+
});
34+
35+
Template.blobview.onRendered(function() {
36+
this.$('.item').transition('fade in up');
37+
});

client/blobs/showBlobs.html

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
<template name="showblobs">
2-
<div class="ui items">
3-
<h2 class="ui dividing header">Info</h2>
2+
<h2 class="ui dividing header">Inbox</h2>
3+
<div class="ui list">
44
{{#each document in blobs}}
5-
<div class="item">
6-
<div class="middle aligned content">
7-
<div class="header">{{document.phone}}</div>
8-
{{#each blob in document.blobs}}
9-
<p>{{blob}}</p>
10-
{{/each}}
11-
</div>
5+
<div class="ui raised segment">
6+
{{> singlenumber document=document}}
127
</div>
138
{{/each}}
149
</div>

client/blobs/showBlobs.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import './showBlobs.html';
2+
import './components/blob.js';
23
import { Template } from 'meteor/templating';
34
import { Conversations } from '../collections.js';
45

56
Template.showblobs.helpers({
67
blobs: function() {
7-
return Conversations.find({state: {$gte: 2}});
8+
return Conversations.find({state: {$gte: 2}}, {sort: { lastEdited: -1 }});
89
}
9-
})
10+
});

client/main.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.ui#content {
2-
padding-top: 55px;
2+
padding-top: 95px;
33
}

client/main.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,23 @@
33
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css">
44
</head>
55
<body>
6-
<div class="ui top red icon inverted fixed menu">
6+
<div class="ui top red icon inverted labeled fixed menu">
77
<div class="ui container">
88
<div class="item">
9-
bAware
9+
<img src="/emergency.png">
1010
</div>
1111
<div class="right menu">
1212
<a class="item">
1313
<i class="icon home"></i>
14+
Home
1415
</a>
1516
<a class="item">
1617
<i class="plus square icon"></i>
18+
Add Citizens
1719
</a>
1820
<a class="item">
1921
<i class="bullhorn icon"></i>
22+
Send Alerts
2023
</a>
2124
</div>
2225
</div>

client/stats/received.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ Template.received.helpers({
66
numReceived: function() {
77
return Conversations.find({state: { "$gte": 3 }}).count();
88
}
9-
})
9+
})
10+
11+
Template.received.onRendered(function() {
12+
this.$('.segment').transition('fade in up');
13+
});

client/stats/sent.js

+4
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ Template.sent.helpers({
66
numSent: function() {
77
return Conversations.find({}).count();
88
}
9+
});
10+
11+
Template.sent.onRendered(function() {
12+
this.$('.segment').transition('fade in up');
913
})

public/emergency.png

6.38 KB
Loading

0 commit comments

Comments
 (0)