small UI cleanups. sqrt for diameter.

This commit is contained in:
Geoff Schmidt
2012-10-15 20:25:57 -07:00
parent 5b3293192f
commit 4e7246320e
2 changed files with 13 additions and 5 deletions

View File

@@ -30,6 +30,10 @@ Template.details.party = function () {
return Parties.findOne(Session.get("selected"));
};
Template.details.anyParties = function () {
return Parties.find().count() > 0;
};
Template.details.creatorName = function () {
var owner = Meteor.users.findOne(this.owner);
if (owner._id === Meteor.userId())
@@ -173,7 +177,7 @@ Template.map.rendered = function () {
// XXX match area
// (duplicated below)
.attr("r", function (party) {
return 10 + attending(party) * 10;
return 10 + Math.sqrt(attending(party)) * 10;
})
.style("fill", function (party) {
return party.public ? 'red' : 'blue';
@@ -191,7 +195,7 @@ Template.map.rendered = function () {
return party.y * 500;
})
.attr("r", function (party) {
return 10 + attending(party) * 10;
return 10 + Math.sqrt(attending(party)) * 8;
})
.style("fill", function (party) {
return party.public ? 'red' : 'blue';
@@ -256,7 +260,7 @@ Template.createDialog.events = {
}, function (error, party) {
if (! error) {
Session.set("selected", party);
if (! public)
if (! public && Meteor.users.find().count() > 1)
Session.set("showInviteDialog", true);
}
});

View File

@@ -104,7 +104,7 @@
{{displayName}}
</div>
{{else}}
Everyone on the site has been invited.
Everyone on the site has already been invited.
{{/each}}
</div>
@@ -161,7 +161,11 @@
{{/with}}
{{else}}
<h1 class="muted pagination-centered">
Click a party to select it
{{#if anyParties}}
Click a party to select it
{{else}}
Sign in and double click the map to post a party
{{/if}}
</h1>
{{/if}}
</div>