-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'userType' field to Meteor.user Collection, add createAdmin view
- Loading branch information
1 parent
76ae7a0
commit 6f6d4c2
Showing
14 changed files
with
389 additions
and
240 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,4 @@ aldeed:autoform | |
aldeed:collection2 | ||
yogiben:autoform-map | ||
momentjs:moment | ||
sergeyt:typeahead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ [email protected] | |
[email protected] | ||
[email protected] | ||
seba:[email protected] | ||
sergeyt:[email protected]_8 | ||
[email protected] | ||
[email protected] | ||
[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<head> | ||
<title>GT2</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
AutoForm.setDefaultTemplate('materialize'); | ||
AutoForm.setDefaultTemplate('materialize'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
<template name="createAdmin"> | ||
|
||
<div class="container"> | ||
<h3>Create Admin</h3> | ||
|
||
|
||
<div class="row"> | ||
<div class="col s8"> | ||
<input class="form-control typeahead" name="userID" type="text" | ||
placeholder="NIC" | ||
autocomplete="off" spellcheck="off" | ||
data-source="userIDs"/> | ||
</div> | ||
<div class="col s4"> | ||
<button id="makeAdmin" class="btn waves-effect waves-light" type="submit" name="action">Make Admin | ||
<i class="material-icons right">send</i> | ||
</button> | ||
</div> | ||
</div> | ||
|
||
|
||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import './createAdmin.html'; | ||
|
||
|
||
Template.createAdmin.helpers({ | ||
userIDs: function() { | ||
|
||
|
||
return Meteor.users.find().fetch().map(function(it){ return it.username; }); | ||
} | ||
}); | ||
|
||
Template.createAdmin.rendered = function() { | ||
Meteor.typeahead.inject(); | ||
}; | ||
|
||
|
||
Template.createAdmin.events({ | ||
'click #makeAdmin'(event) { | ||
// Prevent default browser form submit | ||
console.log("clicked!!"); | ||
Meteor.call('test',"111111111"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
Meteor.methods({ | ||
/*"test":function(userID) { | ||
"test":function(nic) { | ||
//should print the user details if logged in, undefined otherwise. | ||
console.log(userID); | ||
}*/ | ||
console.log("test passed!!"); | ||
var townsman = Meteor.users.findOne({username:nic}); | ||
console.log(townsman); | ||
console.log(townsman._id); | ||
|
||
|
||
|
||
Meteor.users.update({_id:townsman._id}, | ||
{$set: { username: "999999999" }}) | ||
console.log(Meteor.users.findOne({_id:townsman._id})); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters