Browse Source

Step 1: users can register and login. More file refactoring.

Frederic G. MARAND 9 years ago
parent
commit
a82d6395c0

+ 2 - 0
.meteor/packages

@@ -19,3 +19,5 @@ ecmascript              # Enable ECMAScript2015+ syntax in app code
 autopublish             # Publish all data to the clients (for prototyping)
 insecure                # Allow all DB writes from clients (for prototyping)
 twbs:bootstrap
+accounts-ui
+accounts-password

+ 13 - 0
.meteor/versions

@@ -1,3 +1,7 @@
+accounts-base@1.2.2
+accounts-password@1.1.4
+accounts-ui@1.1.6
+accounts-ui-unstyled@1.1.8
 autopublish@1.0.4
 autoupdate@1.2.4
 babel-compiler@5.8.24_1
@@ -15,12 +19,14 @@ check@1.1.0
 ddp@1.2.2
 ddp-client@1.2.1
 ddp-common@1.2.2
+ddp-rate-limiter@1.0.0
 ddp-server@1.2.2
 deps@1.0.9
 diff-sequence@1.0.1
 ecmascript@0.1.6
 ecmascript-runtime@0.2.6
 ejson@1.0.7
+email@1.0.8
 es5-shim@4.1.14
 fastclick@1.0.7
 geojson-utils@1.0.4
@@ -32,7 +38,9 @@ id-map@1.0.4
 insecure@1.0.4
 jquery@1.11.4
 launch-screen@1.0.4
+less@2.5.1
 livedata@1.0.15
+localstorage@1.0.5
 logging@1.0.8
 meteor@1.1.10
 meteor-base@1.0.1
@@ -42,19 +50,24 @@ mobile-experience@1.0.1
 mobile-status-bar@1.0.6
 mongo@1.1.3
 mongo-id@1.0.1
+npm-bcrypt@0.7.8_2
 npm-mongo@1.4.39_1
 observe-sequence@1.0.7
 ordered-dict@1.0.4
 promise@0.5.1
 random@1.0.5
+rate-limit@1.0.0
 reactive-dict@1.1.3
 reactive-var@1.0.6
 reload@1.1.4
 retry@1.0.4
 routepolicy@1.0.6
+service-configuration@1.0.5
 session@1.1.1
+sha@1.0.4
 spacebars@1.0.7
 spacebars-compiler@1.0.7
+srp@1.0.4
 standard-minifiers@1.0.2
 templating@1.1.5
 templating-tools@1.0.0

+ 7 - 0
client/client.js

@@ -1,3 +1,10 @@
+/**
+ * Configure accounts-ui.
+ */
+Accounts.ui.config({
+  passwordSignupFields: "USERNAME_ONLY"
+});
+
 /**
  * Template helpers.
  */

+ 12 - 0
client/layout.html

@@ -0,0 +1,12 @@
+<head>
+  <title>siteace</title>
+</head>
+
+<body>
+  {{> navbar }}
+
+  <div class="container">
+    {{> website_form}}
+    {{> website_list}}
+  </div>
+</body>

+ 17 - 0
client/navbar.html

@@ -0,0 +1,17 @@
+<!-- navbar  - you will be putting the login functions here -->
+<template name="navbar">
+  <nav class="navbar navbar-default">
+    <div class="container-fluid">
+      <div class="navbar-header">
+        <a class="navbar-brand" href="#">
+          Site Ace
+        </a>
+      </div>
+      <div id="navbar" class="navbar-collapse collapse">
+        <ul class="nav navbar-nav navbar-right">
+          <li class="active"><a name="login-buttons">{{> loginButtons align="right" }}</a></li>
+        </ul>
+      </div>
+    </div>
+  </nav>
+</template>

+ 0 - 72
client/siteace.html

@@ -1,72 +0,0 @@
-<head>
-  <title>siteace</title>
-</head>
-
-<body>
-	<!-- navbar  - you will be putting the login functions here -->
-	<nav class="navbar navbar-default">
-	  <div class="container-fluid">
-	    <div class="navbar-header">
-	      <a class="navbar-brand" href="#">
-	        Site Ace
-	      </a>
-	    </div>
-	  </div>
-	</nav>
-
-	<div class="container">
-		{{> website_form}}
-		{{> website_list}}
-	</div>
-</body>
-
-
-<template name="website_form">
-	<a class="btn btn-default js-toggle-website-form" href="#">
-  		<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
-	</a>
-	<div id="website_form" class="hidden_div">
-		<form class="js-save-website-form">
-		  <div class="form-group">
-		    <label for="url">Site address</label>
-		    <input type="text" class="form-control" id="url" placeholder="http://www.mysite.com">
-		  </div>
-		  <div class="form-group">
-		    <label for="title">Title</label>
-		    <input type="text" class="form-control" id="title" placeholder="Mysite">
-		  </div>
-		    <div class="form-group">
-		    <label for="description">Description</label>
-		    <input type="text" class="form-control" id="description" placeholder="I found this site really useful for ...">
-		  </div>
-
-		  <button type="submit" class="btn btn-default">Submit</button>
-		</form>
-	</div>
-</template>
-
-<!-- template that displays several website items -->
-<template name="website_list">
-	<ol>
-	{{#each websites}}
-	{{>website_item}}
-	{{/each}}
-	</ol>
-</template>
-
-<!-- template that displays individual website entries -->
-<template name="website_item">
-<li>
-	<a href="{{url}}">{{title}}</a>
-	<p>
-		{{description}}
-	</p>
-	<a href="#" class="btn btn-default js-upvote">
-		<span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>
-	</a>
-	<a href="#" class="btn btn-default js-downvote">
-		<span class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span>
-	</a>
-	<!-- you will be putting your up and down vote buttons in here! -->
-</li>
-</template>

+ 23 - 0
client/website_form.html

@@ -0,0 +1,23 @@
+<template name="website_form">
+  <a class="btn btn-default js-toggle-website-form" href="#">
+    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
+  </a>
+  <div id="website_form" class="hidden_div">
+    <form class="js-save-website-form">
+      <div class="form-group">
+        <label for="url">Site address</label>
+        <input type="text" class="form-control" id="url" placeholder="http://www.mysite.com">
+      </div>
+      <div class="form-group">
+        <label for="title">Title</label>
+        <input type="text" class="form-control" id="title" placeholder="Mysite">
+      </div>
+      <div class="form-group">
+        <label for="description">Description</label>
+        <input type="text" class="form-control" id="description" placeholder="I found this site really useful for ...">
+      </div>
+
+      <button type="submit" class="btn btn-default">Submit</button>
+    </form>
+  </div>
+</template>

+ 16 - 0
client/website_item.html

@@ -0,0 +1,16 @@
+<!-- template that displays individual website entries -->
+<template name="website_item">
+  <li>
+    <a href="{{url}}">{{title}}</a>
+    <p>
+      {{description}}
+    </p>
+    <a href="#" class="btn btn-default js-upvote">
+      <span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>
+    </a>
+    <a href="#" class="btn btn-default js-downvote">
+      <span class="glyphicon glyphicon-arrow-down" aria-hidden="true"></span>
+    </a>
+    <!-- you will be putting your up and down vote buttons in here! -->
+  </li>
+</template>

+ 9 - 0
client/website_list.html

@@ -0,0 +1,9 @@
+<!-- template that displays several website items -->
+<template name="website_list">
+	<ol>
+	{{#each websites}}
+	{{>website_item}}
+	{{/each}}
+	</ol>
+</template>
+