Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/models/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ module.exports = function(sequelize, DataTypes) {
content: DataTypes.TEXT,
isPrivate: DataTypes.BOOLEAN,

school: DataTypes.STRING,
date: DataTypes.DATE,
time: DataTypes.TIME,
location: DataTypes.STRING,
catogory: DataTypes.STRING,
category: DataTypes.STRING,
rewardCoins: DataTypes.INTEGER


Expand Down
18 changes: 18 additions & 0 deletions public/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
}
2 changes: 1 addition & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
@@ -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', []);
Expand Down
6 changes: 6 additions & 0 deletions public/js/controllers/articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down
1 change: 0 additions & 1 deletion public/js/controllers/index.js
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
4 changes: 4 additions & 0 deletions public/js/controllers/users.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
angular.module('mean.users').controller('UsersController', ['$scope', 'Global', 'Users',function ($scope, Global, Users) {


}]);
37 changes: 37 additions & 0 deletions public/views/articles/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,43 @@
<textarea data-ng-model="content" id="content" cols="30" rows="10" placeholder="Content"></textarea>
</div>
</div>

<div class="control-group">
<label class="control-label" for="school">School</label>
<div class="controls">
<input type="text" data-ng-model="school" id="school" placeholder="School" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="rewardCoins">CUNYcoins</label>
<div class="controls">
<input type="text" data-ng-model="rewardCoins" id="coins" placeholder="CUNYcoins" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="Category">Category</label>
<div class="controls">
<input type="text" data-ng-model="category" id="category" placeholder="Category" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="location">Location</label>
<div class="controls">
<input type="text" data-ng-model="location" id="location" placeholder="Location" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="date">Date</label>
<div class="controls">
<input type="text" data-ng-model="date" id="date" placeholder="Date" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="time"> Time </label>
<div class="controls">
<input type="text" data-ng-model="time" id="time" placeholder="Time" required>
</div>
</div>
<div class="control-group">
<label class="control-label">Private Event?</label>
<div class="controls">
Expand Down
42 changes: 41 additions & 1 deletion public/views/articles/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,49 @@
</textarea>
</div>
</div>
<div class="control-group">
<label class="control-label" for="school">School </label>

<div class="controls">
<input type="text" data-ng-model="article.school" id="title" placeholder="School" required>
</input>
</div>
<div class="control-group">
<label class="control-label" for="rewardCoins">rewardCoins</label>
<div class="controls">
<input type="text" data-ng-model="article.rewardCoins" id="rewardCoins" placeholder="rewardCoins" required>
</input>
</div>

<div class="control-group">
<label class="control-label" for="category"> Category</label>
<div class="controls">
<input type="text" data-ng-model="article.category" id="category" placeholder="category" required>
</input>
</div>

<div class="control-group">
<label class="control-label" for="category"> Location</label>
<div class="controls">
<input type="text" data-ng-model="article.location" id="location" placeholder="location" required>
</input>
</div>

<div class="control-group">
<label class="control-label" for="date"> Date </label>
<div class="controls">
<input type="text" data-ng-model="article.date" id="date" placeholder="Date" required>
</input>
</div>
<div class="control-group">
<label class="control-label" for="time"> Time </label>
<div class="controls">
<input type="text" data-ng-model="article.time" id="time" placeholder="Time" required>
</input>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn">
<button type="submit" class="btn"> Submit
</div>
</div>
</form>
Expand Down
5 changes: 2 additions & 3 deletions public/views/articles/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<h2>Events You Created</h2>
<ul class="articles unstyled">
<li data-ng-show="global.user.id == article.User.id" data-ng-repeat="article in articles">
<span>{{article.User.name}}</span>
<div> <h2><a data-ng-href="#/articles/{{article.id}}">{{article.title}}</a></h2>
</div>
<!-- <span>{{article.User.name}}</span> -->
<div> <h2><a data-ng-href="#/articles/{{article.id}}">{{article.title}}</a></h2></div>
<div>{{article.content}}</div>
</li>
</ul>
Expand Down
6 changes: 6 additions & 0 deletions public/views/articles/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<span>{{article.User.name}}</span>
<h2>{{article.title}}</h2>
<div>{{article.content}}</div>
<div>School : {{article.school}}</div>
<div>reward Coins: {{article.rewardCoins}}</div>
<div>Category: {{article.category}}</div>
<div>Location : {{article.location}}</div>
<div>Date : {{article.date}}</div>
<div>Time : {{article.time}}</div>
<div data-ng-show="global.user.id == article.User.id">
<a class="btn" href="/#/articles/{{article.id}}/edit">
Edit
Expand Down
12 changes: 9 additions & 3 deletions public/views/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<section data-ng-controller="ArticlesController" data-ng-init="find()">
<h1>Here are some events that are going on!</h1><br>
<ul class="articles unstyled">
<li data-ng-repeat="article in articles">
<h3><a data-ng-href="#/articles/{{article.id}}">{{article.title}}</a></h3>
<ul class="articles unstyled" id="list">
<li data-ng-repeat="article in articles" data-ng-hide="article.isPrivate==true">
<div class="article">
<h3><a data-ng-href="#/articles/{{article.id}}">{{article.title}}</a></h3>
<h5>School : {{article.school}} &nbsp;&nbsp; Category : {{article.category}} </h5>
<h5>CUNYcoins: {{article.rewardCoins}}
<img src="./img/cunycode/coins.png" alt="cunycoins" style="height:10%;width: 10%;"></h5>
<h5> Date : {{article.date}} </h5>
<p>Hosted by {{article.User.name}}</p>
</div>
</li>
</ul>
<div data-ng-show="global.authenticated">
Expand Down
13 changes: 9 additions & 4 deletions public/views/profile/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@
</div>
<br>
<br>
<h3> CUNY coins earned from: </h3>
<div>
<img class="logo" src ="./img/cunycode/research.png"> <img class="logo" src ="./img/cunycode/jobfair.png"> <img class="logo" src ="./img/cunycode/seminar.png"> <img class="logo" src ="./img/cunycode/club.png"> <img class="logo" src ="./img/cunycode/STEM_Research.png">
<img class="logo" src ="./img/cunycode/research.png"> 200
<img class="logo" src ="./img/cunycode/jobfair.png"> 100
<img class="logo" src ="./img/cunycode/seminar.png"> 300
<img class="logo" src ="./img/cunycode/club.png"> 500
<img class="logo" src ="./img/cunycode/STEM_Research.png"> 200
<br>
<img class="logo" src ="./img/cunycode/Volunteer.png">
<img class="logo" src ="./img/cunycode/study_group.png">
<img class="logo" src ="./img/cunycode/Hackathon.png">
<img class="logo" src ="./img/cunycode/Volunteer.png"> 150
<img class="logo" src ="./img/cunycode/study_group.png"> 350
<img class="logo" src ="./img/cunycode/Hackathon.png"> 300
</div>
</div>