From 937449b1cd1a584a6b048bf36cd6dbcfb4d4958c Mon Sep 17 00:00:00 2001 From: ibrahimtamimi Date: Sat, 30 Jul 2016 11:40:34 +0300 Subject: [PATCH 1/4] edit comment desgin --- public/app/mygarden/garden.js | 2 +- public/app/mygarden/mygarden.html | 30 +++++++++++----------------- public/styles/style.css | 22 ++++++++++---------- server/comments/commentController.js | 5 +++-- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/public/app/mygarden/garden.js b/public/app/mygarden/garden.js index 266ca00..977d084 100644 --- a/public/app/mygarden/garden.js +++ b/public/app/mygarden/garden.js @@ -16,7 +16,7 @@ angular.module('iGrow.mygarden', []) Plants.getAllComment() .then(function (resp) { $scope.data.comment=resp; - $location.path('/mygarden') + $location.path('/mygarden'); }) }) diff --git a/public/app/mygarden/mygarden.html b/public/app/mygarden/mygarden.html index e34074a..f72716b 100644 --- a/public/app/mygarden/mygarden.html +++ b/public/app/mygarden/mygarden.html @@ -11,18 +11,14 @@

-

- - - - - +
@@ -49,23 +45,21 @@

-<<<<<<< HEAD -
- - -======= -
-
-
-

{{comment.friendid}}

-

{{comment.text}}

+
+
+
+

{{comment.friendid}}

+
+

+

{{comment.text}}

+
+
- + ->>>>>>> 5f8e438235e7071900eb69e4364899d323d1258f
diff --git a/public/styles/style.css b/public/styles/style.css index 09ef1db..2877c17 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -38,9 +38,11 @@ body { margin-right: 10px; background-color: gray; opacity:0.7 ; - color: white; + border-radius: 4px; + /*color: white;*/ } -.commentStyle{ + +.commentDiv{ margin-top: 10px; margin-bottom: 10px; margin-left: 10px; @@ -49,24 +51,24 @@ body { opacity:0.7 } -.commntDIV{ - background-color: white; -} -#comment{ - background-color: gray; - opacity:0.7 ; -} + + #comment{ + background-color: gray; + opacity:0.7 ; + border-radius: 4px; + } + -} .button { background-color:green; font-weight: bold; border: none; color: white; + border-radius: 4px; padding: 15px 32px; text-align: center; text-decoration: none; diff --git a/server/comments/commentController.js b/server/comments/commentController.js index 1deabe9..fa50117 100644 --- a/server/comments/commentController.js +++ b/server/comments/commentController.js @@ -23,7 +23,6 @@ module.exports = { // console.log(friendid,"this is the friend name") findOneUser({username:username}) .then(function (user){ - //console.log(user,"inside userttttttttttttttttttttttttttttttttt") if (user){ return user } @@ -36,7 +35,8 @@ module.exports = { .then(function(newComment){ user.comments.push(newComment._id); user.save(); - res.json(newComment); + console.log(user) + res.json(newComment,user); }) .catch(function(error){ res.send(204) @@ -44,6 +44,7 @@ module.exports = { }) } }, + getAllComments:function(req,res,next){ var token = req.headers['x-access-token']; if (!token) { From a453dd6c58588526de335563bc09fcfabdae118f Mon Sep 17 00:00:00 2001 From: ibrahimtamimi Date: Sat, 30 Jul 2016 14:20:55 +0300 Subject: [PATCH 2/4] comment desgin --- public/app/mygarden/garden.js | 24 +++++++++++++++++++----- public/app/mygarden/mygarden.html | 6 +++--- public/app/services/services.js | 1 - public/styles/style.css | 8 +++++++- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/public/app/mygarden/garden.js b/public/app/mygarden/garden.js index 977d084..c1f6523 100644 --- a/public/app/mygarden/garden.js +++ b/public/app/mygarden/garden.js @@ -4,27 +4,29 @@ angular.module('iGrow.mygarden', []) - Plants.getGarden() .then(function(resp){ $scope.data.plants=resp; window.user=$window.localStorage['com.username']; $scope.username=$window.localStorage['com.username']; }) + $scope.addComment=function ( comment) { - Plants.addNewComment(comment,$scope.username,function (data) { + Plants.addNewComment(comment,$scope.username) + .then(function () { Plants.getAllComment() .then(function (resp) { $scope.data.comment=resp; $location.path('/mygarden'); }) - - }) - + }) + $scope.gotoBottom(); } + Plants.getAllComment() .then(function (resp) { $scope.data.comment=resp; + console.log(resp) $location.path('/mygarden') }) @@ -45,4 +47,16 @@ angular.module('iGrow.mygarden', []) $location.path('/mygarden') }) } + + $scope.gotoBottom = function() { + // set the location.hash to the id of + // the element you wish to scroll to. + $location.hash('bottom'); + console.log("going down !!!!") + // call $anchorScroll() + $anchorScroll(); + } + + + }); \ No newline at end of file diff --git a/public/app/mygarden/mygarden.html b/public/app/mygarden/mygarden.html index f72716b..69acc02 100644 --- a/public/app/mygarden/mygarden.html +++ b/public/app/mygarden/mygarden.html @@ -50,7 +50,7 @@

-

{{comment.friendid}}

+

{{username}}

{{comment.text}}

@@ -59,9 +59,9 @@

- +
- +
diff --git a/public/app/services/services.js b/public/app/services/services.js index 62910e6..c21b622 100644 --- a/public/app/services/services.js +++ b/public/app/services/services.js @@ -62,7 +62,6 @@ angular.module('iGrow.services', []) }; var addNewComment = function(text,username){ - console.log(text); return $http({ method:'POST', url:'/api/users/addcomments/'+ username, diff --git a/public/styles/style.css b/public/styles/style.css index 2877c17..5ed5055 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -59,8 +59,14 @@ body { border-radius: 4px; } +#scrollArea { + overflow: auto; +} - +#bottom { + display: block; + margin-top: 2000px; +} .button { From 494624c0a4ea8241da524ec82b31bac359d86bba Mon Sep 17 00:00:00 2001 From: ibrahimtamimi Date: Sat, 30 Jul 2016 16:06:53 +0300 Subject: [PATCH 3/4] garden design --- public/app/mygarden/garden.js | 12 +++++++ public/app/mygarden/mygarden.html | 59 ++++++++++++++++++++++--------- public/styles/style.css | 35 +++++++++++++++++- 3 files changed, 89 insertions(+), 17 deletions(-) diff --git a/public/app/mygarden/garden.js b/public/app/mygarden/garden.js index c1f6523..bf449dd 100644 --- a/public/app/mygarden/garden.js +++ b/public/app/mygarden/garden.js @@ -2,6 +2,18 @@ angular.module('iGrow.mygarden', []) .controller('GardenController', function ($window, $location, $scope, Plants) { $scope.data = {} + Plants.getFriends() + .then(function(resp){ + var user=$window.localStorage.getItem('com.username'); + for(var i=0;i -
- - - -
-
-

{{data.description}}

- -

- - + +

+
+ +
+ + +
+ +
+
+ + +
+
+
+

{{data.description}}

+

+ +

-
+
+ + + +
+ + + + + + +
+ +
+
+
+ + +
diff --git a/public/styles/style.css b/public/styles/style.css index 5ed5055..7b01f2e 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -36,7 +36,7 @@ body { margin-bottom: 10px; margin-left: 10px; margin-right: 10px; - background-color: gray; + background-color: white; opacity:0.7 ; border-radius: 4px; /*color: white;*/ @@ -87,3 +87,36 @@ body { margin: 30px; float: center; } + + .Fbutton { + background-color: #4CAF50; /* Green */ + padding: 32px 16px; + border: none; + color: white; + width: 250px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + -webkit-transition-duration: 0.4s; /* Safari */ + transition-duration: 0.4s; + border: 2px solid #4CAF50; /* Green */ + border-radius: 4px; +} +.Fbutton:hover { + background-color: white; /* Green */ + color: black; +} + +.friendsbutton { + background-color: #e7e7e7; color: black;; /* Green */ + border: none; + color: black; + padding: 15px 32px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 16px; + border-radius: 4px; + margin-right: 20px; +} \ No newline at end of file From fee86d4e32ad6f069cd7504ffb6b350dc7f86a72 Mon Sep 17 00:00:00 2001 From: ibrahimtamimi Date: Sat, 30 Jul 2016 18:40:13 +0300 Subject: [PATCH 4/4] final design --- public/app/mygarden/mygarden.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/app/mygarden/mygarden.html b/public/app/mygarden/mygarden.html index 450493d..a99468d 100644 --- a/public/app/mygarden/mygarden.html +++ b/public/app/mygarden/mygarden.html @@ -1,5 +1,4 @@ -
- +
@@ -76,7 +75,7 @@

-
+

{{username}}