From 07fddf95cabb809433dc6225da1ff1319b24721a Mon Sep 17 00:00:00 2001 From: susanjiang03 Date: Tue, 19 Apr 2016 21:22:08 -0400 Subject: [PATCH 1/4] add attributes for creating event and view event --- app/models/article.js | 1 + public/js/controllers/articles.js | 6 +++++ public/views/articles/create.html | 37 +++++++++++++++++++++++++++ public/views/articles/edit.html | 42 ++++++++++++++++++++++++++++++- public/views/articles/list.html | 3 +-- public/views/articles/view.html | 6 +++++ 6 files changed, 92 insertions(+), 3 deletions(-) diff --git a/app/models/article.js b/app/models/article.js index ee3151d..daa65ff 100644 --- a/app/models/article.js +++ b/app/models/article.js @@ -7,6 +7,7 @@ module.exports = function(sequelize, DataTypes) { content: DataTypes.TEXT, isPrivate: DataTypes.BOOLEAN, + school: DataTypes.STRING, date: DataTypes.DATE, time: DataTypes.TIME, location: DataTypes.STRING, diff --git a/public/js/controllers/articles.js b/public/js/controllers/articles.js index b74bf21..d33f543 100644 --- a/public/js/controllers/articles.js +++ b/public/js/controllers/articles.js @@ -5,8 +5,14 @@ angular.module('mean.articles').controller('ArticlesController', ['$scope', '$ro $scope.create = function() { var article = new Articles({ + school: this.school, title: this.title, content: this.content, + rewardCoins: this.rewardCoins, + category: this.category, + location: this.location, + date: this.date, + time: this.time, isPrivate: $scope.theBoolean }); diff --git a/public/views/articles/create.html b/public/views/articles/create.html index 4d3874f..6c80370 100644 --- a/public/views/articles/create.html +++ b/public/views/articles/create.html @@ -13,6 +13,43 @@ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
diff --git a/public/views/articles/edit.html b/public/views/articles/edit.html index f99657f..cf15eb2 100644 --- a/public/views/articles/edit.html +++ b/public/views/articles/edit.html @@ -16,9 +16,49 @@
+
+ + +
+ + +
+
+ +
+ + +
+ +
+ +
+ + +
+ +
+ +
+ + +
+ +
+ +
+ + +
+
+ +
+ + +
-
diff --git a/public/views/articles/list.html b/public/views/articles/list.html index c1b16b0..2891a79 100644 --- a/public/views/articles/list.html +++ b/public/views/articles/list.html @@ -3,8 +3,7 @@

Events You Created

diff --git a/public/views/articles/view.html b/public/views/articles/view.html index 038a8e9..b5ec57d 100644 --- a/public/views/articles/view.html +++ b/public/views/articles/view.html @@ -2,6 +2,12 @@ {{article.User.name}}

{{article.title}}

{{article.content}}
+
School : {{article.school}}
+
reward Coins: {{article.rewardCoins}}
+
Category: {{article.category}}
+
Location : {{article.location}}
+
Date : {{article.date}}
+
Time : {{article.time}}
Edit From 3eed8988a5544b4bfe2c6b336ce3ae60837a395c Mon Sep 17 00:00:00 2001 From: susanjiang03 Date: Tue, 19 Apr 2016 21:38:04 -0400 Subject: [PATCH 2/4] fix category in articles table --- app/models/article.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/article.js b/app/models/article.js index daa65ff..e5da210 100644 --- a/app/models/article.js +++ b/app/models/article.js @@ -11,7 +11,7 @@ module.exports = function(sequelize, DataTypes) { date: DataTypes.DATE, time: DataTypes.TIME, location: DataTypes.STRING, - catogory: DataTypes.STRING, + category: DataTypes.STRING, rewardCoins: DataTypes.INTEGER From 99b34bda98e92da926e68d290494d73b61d1d5dc Mon Sep 17 00:00:00 2001 From: susanjiang03 Date: Tue, 19 Apr 2016 23:09:58 -0400 Subject: [PATCH 3/4] change style of home page for listing event, 3 events in a row --- public/css/common.css | 18 ++++++++++++++++++ public/views/articles/create.html | 4 ++-- public/views/articles/list.html | 2 +- public/views/index.html | 10 ++++++++-- public/views/profile/profile.html | 12 ++++++++---- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/public/css/common.css b/public/css/common.css index 582c311..bfa36fb 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -30,4 +30,22 @@ footer p { width: 10%; border-radius: 50%; +} + + +ul#list{ + padding: 0%; +} + +ul#list li{ + + width: 30%; + margin-top:3%; + margin-left:3%; + display: inline-block; +} + +.article{ + border-style: ridge; + height: 50%; } \ No newline at end of file diff --git a/public/views/articles/create.html b/public/views/articles/create.html index 6c80370..4cd6622 100644 --- a/public/views/articles/create.html +++ b/public/views/articles/create.html @@ -41,13 +41,13 @@
- +
- +
diff --git a/public/views/articles/list.html b/public/views/articles/list.html index 2891a79..8aeeb9d 100644 --- a/public/views/articles/list.html +++ b/public/views/articles/list.html @@ -2,7 +2,7 @@

Events You Created

  • - {{article.User.name}} +
    {{article.content}}
  • diff --git a/public/views/index.html b/public/views/index.html index 3c202bb..d2de550 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -1,9 +1,15 @@

    Here are some events that are going on!


    -
      +
      • -

        {{article.title}}

        +
        +

        {{article.title}}

        +
        School : {{article.school}}    Category : {{article.category}}
        +
        CUNYcoins: {{article.rewardCoins}} + cunycoins
        +
        Date : {{article.date}}

        Hosted by {{article.User.name}}

        +
      diff --git a/public/views/profile/profile.html b/public/views/profile/profile.html index 238602e..d56b417 100644 --- a/public/views/profile/profile.html +++ b/public/views/profile/profile.html @@ -45,10 +45,14 @@

      - + 200 + 100 + 300 + 500 + 200
      - - - + 150 + 350 + 300
      From 89bcedd0651cd398357320f3d50370a4422a9e9f Mon Sep 17 00:00:00 2001 From: susanjiang03 Date: Wed, 20 Apr 2016 21:05:53 -0400 Subject: [PATCH 4/4] fix private event --- public/js/app.js | 2 +- public/js/controllers/index.js | 1 - public/js/controllers/users.js | 4 ++++ public/views/index.html | 2 +- public/views/profile/profile.html | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 public/js/controllers/users.js diff --git a/public/js/app.js b/public/js/app.js index de77637..e81a02e 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,4 +1,4 @@ -angular.module('mean', ['ngCookies', 'ngResource', 'ngRoute', 'ui.bootstrap', 'ui.route', 'mean.system', 'mean.articles','mean.users']); +angular.module('mean', ['ngCookies', 'ngResource', 'ngRoute', 'ui.bootstrap', 'ui.route', 'mean.system', 'mean.articles', 'mean.users']); angular.module('mean.system', []); angular.module('mean.articles', []); diff --git a/public/js/controllers/index.js b/public/js/controllers/index.js index 67e92ec..77b2132 100644 --- a/public/js/controllers/index.js +++ b/public/js/controllers/index.js @@ -1,4 +1,3 @@ -//angular.module('mean.articles').controller('IndexController', ['$scope', '$location', 'Global', 'Users',function ($scope, $location, Global, Users) { angular.module('mean.system').controller('IndexController', ['$scope', 'Global', function ($scope, Global) { $scope.global = Global; diff --git a/public/js/controllers/users.js b/public/js/controllers/users.js new file mode 100644 index 0000000..93ae9d7 --- /dev/null +++ b/public/js/controllers/users.js @@ -0,0 +1,4 @@ +angular.module('mean.users').controller('UsersController', ['$scope', 'Global', 'Users',function ($scope, Global, Users) { + + + }]); \ No newline at end of file diff --git a/public/views/index.html b/public/views/index.html index d2de550..c112614 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -1,7 +1,7 @@

      Here are some events that are going on!


        -
      • +
      • {{article.title}}

        School : {{article.school}}    Category : {{article.category}}
        diff --git a/public/views/profile/profile.html b/public/views/profile/profile.html index d56b417..f551f65 100644 --- a/public/views/profile/profile.html +++ b/public/views/profile/profile.html @@ -44,6 +44,7 @@


        +

        CUNY coins earned from:

        200 100