From 4e7246320e6fa1cd46afe360908a78b63dc68a25 Mon Sep 17 00:00:00 2001 From: Geoff Schmidt Date: Mon, 15 Oct 2012 20:25:57 -0700 Subject: [PATCH] small UI cleanups. sqrt for diameter. --- examples/parties/client/client.js | 10 +++++++--- examples/parties/parties.html | 8 ++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/examples/parties/client/client.js b/examples/parties/client/client.js index 214fdf6bd8..c4c0f97cd9 100644 --- a/examples/parties/client/client.js +++ b/examples/parties/client/client.js @@ -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); } }); diff --git a/examples/parties/parties.html b/examples/parties/parties.html index a78b07bcb4..4b07e8d6b6 100644 --- a/examples/parties/parties.html +++ b/examples/parties/parties.html @@ -104,7 +104,7 @@ {{displayName}} {{else}} - Everyone on the site has been invited. + Everyone on the site has already been invited. {{/each}} @@ -161,7 +161,11 @@ {{/with}} {{else}}

- 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}}

{{/if}}