Skip to content

Commit

Permalink
Merge pull request #42 from YashdalfTheGray/master
Browse files Browse the repository at this point in the history
Merging master into stable for alpha 3 release
  • Loading branch information
YashdalfTheGray committed Jun 4, 2015
2 parents 1a31d5c + 92db2ed commit 74e5370
Show file tree
Hide file tree
Showing 33 changed files with 449 additions and 102 deletions.
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,50 @@
# flintandsteel

![Rok-Starter](https://raw.githubusercontent.com/YashdalfTheGray/flintandsteel/master/src/assets/Logo2.PNG)

## Installation

After cloning the git repo run `npm install` from a terminal window.

**Note**: On unix based platforms, this will need to be run with `sudo` and on Windows, the command prompt will require administrative privileges.
You will likely also have to run `npm install gulp -g` in order to run gulp. This command installs `gulp` globally so it can be used in the command line.

**Note**: On unix based platforms, this will need to be run with `sudo` and on Windows, the command prompt will require administrative privileges.

## Updating

`gulp clean:modules` will make sure that all the modules are the latest versions and ascertain that there are no unneeded modules downloaded. This clears out noth npm and bower modules.
`gulp clean:modules` will make sure that all the modules are the latest versions and ascertain that there are no unneeded modules downloaded. This clears out noth npm and bower modules.

This will reduce the ammount of conflicts rising from versioning and previous experiments.
This will reduce the amount of conflicts rising from versioning and previous experiments.

## Running

To run the website server, execute `gulp start` from a terminal window. Then navigate to http://localhost:8080.
To run the website server, execute `gulp start` from a terminal window. Then navigate to http://localhost:8080.

## Testing

To run the client side tests, execute `gulp test:client` from a terminal window.
To run the client side tests, execute `gulp test:client` from a terminal window.

## Linting

Running `gulp jshint` will lint any Javascript file under the `src` folder excluding `src/lib`.
Running `gulp jshint` will lint any JavaScript file under the `src` folder excluding `src/lib`.

## Clearing Persistent storage

The express server app uses [docstore](https://www.npmjs.com/package/docstore) to store users and ideas in JSON format. If this storage location gets messy, `gulp clean:db` can be used to clear up the datastore.
The express server app uses [docstore](https://www.npmjs.com/package/docstore) to store users and ideas in JSON format. If this storage location gets messy, `gulp clean:db` can be used to clear up the datastore.

## Generating Canned Idea datastore

To start with some predefined data, `gulp generate:data` populates the datastore with pre-populated ideas.

## Contributing

Before commiting code, make sure
Before committing code, make sure
* you run `gulp jshint` to lint the code and solve any issues presented
* change `package.json` and `bower.json` if a new module was installed using the `--save` command line switch, i.e. `[npm|bower] install --save {module_name}`
* Add `package.json` or `bower.json` to a separate commit with a reason to pull that module into the build
* Update the unit tests in the corresponding .spec.js file in the same folder. If one doesn't exist, create a file with the same name as the folder followed by ".spec.js". This marks the file as a unit test file.
* Update the unit tests in the corresponding .spec.js file in the same folder. If one doesn't exist, create a file with the same name as the folder followed by ".spec.js". This marks the file as a unit test file.

**Note**: Do not push to the stable branch, commiting to the stable branch will result in code being lost. The stable branch is created for milestone releases.
**Note**: Do not push to the stable branch, committing to the stable branch will result in code being lost. The stable branch is created for milestone releases.

## Useful links

Expand All @@ -51,4 +59,3 @@ Before commiting code, make sure
[List of Material Icons](https://klarsys.github.io/angular-material-icons/)

[Material Design color guide](http://www.google.com/design/spec/style/color.html#)

8 changes: 4 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"license": "MIT",
"private": true,
"dependencies": {
"angular": "~1.3.15",
"angular-mocks": "~1.3.15",
"angular-animate": "~1.3.15",
"angular-material": "~0.9.4",
"angular": "~1.4.0",
"angular-mocks": "~1.4.0",
"angular-animate": "~1.4.0",
"angular-material": "~0.9.6",
"angular-ui-router": "~0.2.13",
"lodash": "~3.8.0",
"moment": "~2.10.2"
Expand Down
38 changes: 33 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ var gulp = require('gulp'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish-ex'),
nodemon = require('gulp-nodemon'),
karma = require('karma').server;
karma = require('karma').server,
fs = require('fs'),
ideas = require('./ideas').ideas;

gulp.task('default', ['usage']);

Expand All @@ -28,7 +30,7 @@ gulp.task('usage', function() {
'',
chalk.green('clean:modules'),
'\tDeletes the npm_modules and the src/lib directories.',
'\t' + chalk.magenta('NOTE:') + ' ' + chalk.green('npm install') +
'\t' + chalk.magenta('NOTE:') + ' ' + chalk.green('npm install') +
' will be required before running the app.',
'',
chalk.green('clean:db'),
Expand All @@ -39,9 +41,9 @@ gulp.task('usage', function() {
});

gulp.task('start', ['_cleanUp', 'test:client'], function() {
nodemon({
nodemon({
script: 'server/server.js',
'ignore': ['spec/*']
'ignore': ['spec/*']
});
});

Expand Down Expand Up @@ -86,4 +88,30 @@ gulp.task('_cleanUp', ['_createDataDirs'], function() {
'server/datastore/users/README.md',
'server/datastore/ideas/README.md'
]);
});
});

gulp.task('generate:data', function() {
filePattern = "server/datastore/ideas/idea_X.json";
fileName = filePattern.replace("X", "0");

fs.stat(fileName, function(err, stat) {
var id = 0;

if (err === null) {
// File exists
console.error("ERROR: Please delete the ideas in 'server/datastore/ideas' to continue");
} else if (err.code == 'ENOENT') {
// File does not exist, generate ideas
ideas.forEach(function(idea, index, arr) {
fs.writeFile(filePattern.replace("X", index), JSON.stringify(idea), function(err) {
if (err) throw err;
});
});

} else {
// Something went very wrong.
console.error("ERROR: ", err.code);
throw err;
}
});
});
114 changes: 114 additions & 0 deletions ideas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
var ideas = [
{
"key":0,
"_id":"idea_0",
"ideaId":0,
"title":"ROKStarter",
"description":"A Web-based Platform for Innovation that promotes collaboration by providing visibility and interaction capabilities to employee ideas.",
"author":"The Cleveland Innovation Challenge Team",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":1,
"_id":"idea_1",
"ideaId":1,
"title":"Incubator for Manufacturing",
"description":"Use space at MKE campus to incubate local startup manufacturing companies.",
"author":"Joe Balistrieri and Team",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":2,
"_id":"idea_2",
"ideaId":2,
"title":"Short-Term Embedded Project (STEP)",
"description":"Establish a semi-formal process for granting Employees time with another business unit to assist in the completion of a small-scale project, with allotted hours per-week, clearly defined objectives, and a set end date.",
"author":"Melinda Green and Team",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":3,
"_id":"idea_3",
"ideaId":3,
"title":"Multimedia Documentation",
"description":"Include multimedia elements such as videos and 3D models in PDF documentation to enhance user experience.",
"author":"​Oliver Haya and Team",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":4,
"_id":"idea_4",
"ideaId":4,
"title":"RA Panel",
"description":"Panel optimization tool.",
"author":"Tom McCullough",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":5,
"_id":"idea_5",
"ideaId":5,
"title":"Senior Design Pipeline",
"description":"Central location for business units to propose projects to campus managers.",
"author":"Mike Cymerman and Team",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":6,
"_id":"idea_6",
"ideaId":6,
"title":"Enterprise Search",
"description":"Enterprise Search by Team Spock",
"author":"Team Spock",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":7,
"_id":"idea_7",
"ideaId":7,
"title":"XT Drive",
"description":"Extra-tough low voltage drive.",
"author":"Andy Gagnon and Team",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":8,
"_id":"idea_8",
"ideaId":8,
"title":"One-Click Project Convertor",
"description":"One-Click Project Convertor by Team China.",
"author":"Team China",
"likes":0,
"comments":[],
"backs":[]
},
{
"key":9,
"_id":"idea_9",
"ideaId":9,
"title":"RA Project E-Room",
"description":"RA Project E-Room by Team India.",
"author":"Team India",
"likes":0,
"comments":[],
"backs":[]
}
];

exports.ideas = ideas;
25 changes: 24 additions & 1 deletion server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,16 @@ app.get('/ideaheaders', function(req, res) {
res.status(200).send('NO_IDEAS_IN_STORAGE');
}
else {
docs.sort(function(a,b) {
return a.key - b.key;
});
var headers = [];
for(var i = 0; i < docs.length; i++) {
headers.push({
id: docs[i].ideaId,
title: docs[i].title,
author: docs[i].author,
likes: docs[i].likes + docs[i].managerLikes
likes: docs[i].likes
});
}
res.status(200).json(headers);
Expand Down Expand Up @@ -226,6 +229,26 @@ app.get('/uniqueid', function(req, res) {
});
}
});
app.get('/isuniqueuser', function(req, res) {
userDb.scan(filter, function(err, docs) {
if (err) {
res.sendStatus(500);
}
else {
var userFound = false;
var matcher = function matcher(item) {
return item === req.query.user;
};
for (var i = 0; i < docs.length; i++) {
userFound = (docs[i].username === req.query.user);
if (userFound) {
break;
}
}
res.status(200).json(!userFound);
}
});
});

external(function (err, ipExternal) {
if (err) {
Expand Down
29 changes: 26 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,35 @@ angular.module('flintAndSteel', [
.iconSet('social', './assets/icons/social-icons.svg', 24)
.iconSet('toggle', './assets/icons/toggle-icons.svg', 24);

var rockstarterRedMap = $mdThemingProvider.extendPalette('red', {
'900': '650100'
});
var rockstarterGrayMap = $mdThemingProvider.extendPalette('grey', {
'900': '464b51'
});

$mdThemingProvider.definePalette('rokstarter-red', rockstarterRedMap);
$mdThemingProvider.definePalette('rokstarter-gray', rockstarterGrayMap);

$mdThemingProvider.theme('default')
.primaryPalette('blue')
.primaryPalette('rokstarter-gray', {
'default': '900'
})
.accentPalette('rokstarter-red', {
'default': '900',
'hue-1': 'A700'
})
.warnPalette('red');

/*$mdThemingProvider.theme('default')
.primaryPalette('gray')
.accentPalette('green', {
'default': 'A200',
'hue-1': '600'
})
.warnPalette('red');
.warnPalette('red');*/
}
]);
]);

// red #650100
// gray #464b51
Binary file added src/assets/Logo2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Logo2.xcf
Binary file not shown.
19 changes: 15 additions & 4 deletions src/assets/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ body {
margin-left: 10px;
}

.user-authenticated {
fill: #b9f6ca;
}

.scroll-container {
overflow: scroll;
}
Expand Down Expand Up @@ -53,4 +49,19 @@ body {
background-color: #e0e0e0;
color: #424242;
border-radius: 10px;
}
.idea-pointer {
cursor: pointer;
}

.extra-padding-left-sm {
padding-left: 5px;
}

.extra-padding-left-md {
padding-left: 10px;
}

.accent-text {
color: #650100;
}
Binary file added src/assets/bald27.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/fire.jpg
Binary file not shown.
Binary file added src/assets/socialnetwork12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/winners4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/favicon.ico
Binary file not shown.
Loading

0 comments on commit 74e5370

Please sign in to comment.