mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
parties: can create private parties
This commit is contained in:
@@ -209,6 +209,7 @@ Template.createDialog.events = {
|
||||
'click .save': function (event, template) {
|
||||
var title = template.find(".title").value;
|
||||
var description = template.find(".description").value;
|
||||
var public = !template.find(".private").checked;
|
||||
|
||||
if (title.length && description.length) {
|
||||
var coords = Session.get("createCoords");
|
||||
@@ -217,7 +218,10 @@ Template.createDialog.events = {
|
||||
description: description,
|
||||
x: coords.x,
|
||||
y: coords.y,
|
||||
public: true // XXX
|
||||
public: public
|
||||
}, function(error, party) {
|
||||
if (!error)
|
||||
Session.set("selected", party);
|
||||
});
|
||||
Session.set("showCreateDialog", false);
|
||||
} else {
|
||||
|
||||
@@ -57,7 +57,7 @@ Meteor.methods({
|
||||
if (! this.userId)
|
||||
throw new Meteor.Error(403, "You must be logged in");
|
||||
|
||||
Parties.insert({
|
||||
return Parties.insert({
|
||||
owner: this.userId,
|
||||
x: options.x,
|
||||
y: options.y,
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
Title: <input type="text" class="title"><br>
|
||||
|
||||
Description<br><textarea class="description"></textarea><br>
|
||||
<input type="checkbox" class="private">Private party?</input><br>
|
||||
|
||||
<input type="button" value="Add" class="save">
|
||||
<input type="button" value="Cancel" class="cancel">
|
||||
|
||||
@@ -7,5 +7,5 @@ Meteor.publish("directory", function () {
|
||||
|
||||
Meteor.publish("parties", function () {
|
||||
return Parties.find(
|
||||
{$or: [{"public": true}, {canSee: this.userId}]});
|
||||
{$or: [{"public": true}, {canSee: this.userId}, {owner: this.userId}]});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user