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: 3 additions & 0 deletions lab-kaylyn/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
2 changes: 2 additions & 0 deletions lab-kaylyn/.coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service_name: travis-ci
repo_token: UZF6NYyHYhqQjOFw7vdYhJchfWBZIrCZU
5 changes: 5 additions & 0 deletions lab-kaylyn/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/node_modules/*
**/vendor/*
**/*.min.js
**/coverage/*
**/build/*
23 changes: 23 additions & 0 deletions lab-kaylyn/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"rules": {
"comma-dangle": ["error", "always-multiline"],
"no-console": "off",
"indent": [ "error", 2 ],
"quotes": [ "error", "single" ],
"linebreak-style": [ "error", "unix" ]
},
"env": {
"es6": true,
"node": true,
"mocha": true,
"jasmine": true
},
"globals": {
},
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true,
"impliedStrict": true
},
"extends": "eslint:recommended"
}
132 changes: 132 additions & 0 deletions lab-kaylyn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# slugram ignore
db
.env
data/*
coverage
html-report
# Created by https://www.gitignore.io/api/osx,vim,linux,windows,node

### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Vim ###
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags


### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*


### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk


### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz
20 changes: 20 additions & 0 deletions lab-kaylyn/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: node_js
node_js:
- '4.4.3'
services:
- mongodb
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-4.8
- g++-4.8
env:
- CXX=g++-4.8
sudo: required
before_script: npm i
after_success: 'npm run coveralls'
script:
- npm test
- npm run lint
4 changes: 4 additions & 0 deletions lab-kaylyn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SLUGRAM BACKEND
[![Build Status](https://travis-ci.org/slugbyte/slugram-backend.svg?branch=stageing)](https://travis-ci.org/slugbyte/slugram-backend)
[![Coverage Status](https://coveralls.io/repos/github/slugbyte/slugram-backend/badge.svg?branch=stageing)](https://coveralls.io/github/slugbyte/slugram-backend?branch=stageing)

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "theme";
28 changes: 28 additions & 0 deletions lab-kaylyn/app/component/gallery/create-gallery/gallery.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<section class="gallery-container">
<form name="galleryForm"
class="form-inline"
novalidate
ng-submit="galleryCtrl.createGallery()">
<div class="form-group">
<input name="name"
class="form-control"
type="text"
uib-tooltip="name required"
ng-model="galleryCtrl.gallery.name"
placeholder="gallery name"
required>
</div>

<div class="form-group">
<input name="desc"
class="form-control"
type="text"
uib-tooltip="description required"
ng-model="galleryCtrl.gallery.desc"
placeholder="gallery description"
required>
</div>
<h3>create gallery
<button class="btn btn-primary" type="submit">+</button>
</h3>
</section>
23 changes: 23 additions & 0 deletions lab-kaylyn/app/component/gallery/create-gallery/gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

module.exports = {
template: require('./gallery.html'),
controller: ['$log', 'galleryService', GalleryController],
controllerAs: 'galleryCtrl',
};

function GalleryController($log, galleryService){
$log.debug('init GalleryController');

this.gallery = {};

this.createGallery = function(){
galleryService.createGallery(this.gallery)
.then( () => {
// upon success, reset the form
// clear the inputs after they have been assigned values via ng-model from gallery.html
this.gallery.name = null;
this.gallery.desc = null;
});
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div>
<form class="edit-gallery" name="editGallery" novalidate>
<div class="form-group">
<input name="name" placeholder="name" class="form-control input-md" ng-model="editGalleryCtrl.gallery.name">
<input name="desc" placeholder="desc" class="form-control input-mid" ng-model="editGalleryCtrl.gallery.desc">
</div>
<button ng-click="editGalleryCtrl.updateGallery(this.gallery._id)" class="btn btn-warning btn-xs">Update</button>
</form>
</div>
17 changes: 17 additions & 0 deletions lab-kaylyn/app/component/gallery/edit-gallery/edit-gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

module.exports = {
template: require('./edit-gallery.html'),
controller: ['$log', 'galleryService', EditGalleryController],
controllerAs: 'editGalleryCtrl',
bindings: {
gallery: '<',
},
};

function EditGalleryController($log, galleryService){
$log.debug('init editGalleryCtrl');
this.updateGallery = function(){
galleryService.updateGallery(this.gallery._id, this.gallery);
};
}
Empty file.
9 changes: 9 additions & 0 deletions lab-kaylyn/app/component/gallery/gallery-li/gallery-li.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<li class="container-fluid gallery-li">
<h2>{{galleryLiCtrl.gallery.name}}</h2>
<p>{{galleryLiCtrl.gallery.desc}}</p>
<span class="pull-right">
<span ng-click="galleryLiCtrl.showEditGallery = !galleryLiCtrl.showEditGallery" class="glyphicon glyphicon-pencil"></span>
<span ng-click="galleryLiCtrl.deleteGallery()" class="glyphicon glyphicon-trash"></span>
</span>
<edit-gallery ng-if="galleryLiCtrl.showEditGallery" gallery="galleryLiCtrl.gallery"></edit-gallery>
</li>
24 changes: 24 additions & 0 deletions lab-kaylyn/app/component/gallery/gallery-li/gallery-li.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

module.exports = {
template: require('./gallery-li.html'),
controller: ['$log', 'galleryService', GalleryLiController],
controllerAs: 'galleryLiCtrl',
bindings: {
gallery: '<', // one way data binding, passes an object
deleteDone: '&', // pass in a callback, passes a function, see home html
},
};

function GalleryLiController($log, galleryService){
$log.debug('init galleryLiCtrl');

this.showEditGallery = false;

this.deleteGallery = function(){
galleryService.deleteGallery(this.gallery._id)
.then(() => {
this.deleteDone({galleryData: this.gallery});
});
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="thumbnail-container">
<h2>{{thumbnailContainerCtrl.gallery.name}}</h2>
<upload-pic gallery="thumbnailContainerCtrl.gallery"></upload-pic>
<h2> Search Pics </h2>
<search-bar search-term="thumbnailContainerCtrl.searchTermName"></search-bar>
<search-bar search-term="thumbnailContainerCtrl.searchTermDesc"></search-bar>
<div>
<thumbnail ng-repeat="item in thumbnailContainerCtrl.gallery.pics | search:thumbnailContainerCtrl.searchTermName:thumbnailContainerCtrl.searchTermDesc"
pic="item"
gallery="thumbnailContainerCtrl.gallery"></thumbnail>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

module.exports = {
template: require('./thumbnail-container.html'),
controllerAs: 'thumbnailContainerCtrl',
bindings: {
gallery: '<',
},
};
7 changes: 7 additions & 0 deletions lab-kaylyn/app/component/gallery/thumbnail/thumbnail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="thumbnail">
<img ng-src="{{thumbnailCtrl.pic.imageURI}}" alt="{{thumbnailCtrl.pic.desc}}">
<h2>{{thumbnailCtrl.pic.name}}</h2>
<h2>{{thumbnailCtrl.pic.desc}}</h2>
<span ng-click="thumbnailCtrl.deletePic()"
class="glyphicon glyphicon-trash"></span>
</div>
26 changes: 26 additions & 0 deletions lab-kaylyn/app/component/gallery/thumbnail/thumbnail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

module.exports = {
template: require('./thumbnail.html'),
controller: ['$log', 'picService', ThumbnailController],
controllerAs: 'thumbnailCtrl',
bindings: {
pic: '<',
gallery: '<',
},
};

function ThumbnailController($log, picService){
$log.debug('init ThumbnailController');

this.deletePic = function(){
$log.debug('thumbnailCtrl.deletePic()');
picService.deleteGalleryPic(this.gallery, this.pic)
.then( () => {
$log.debug('deleteDone');
})
.catch( err => {
$log.error(err.message);
});
};
}
16 changes: 16 additions & 0 deletions lab-kaylyn/app/component/gallery/upload-pic/upload-pic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="upload-pic">
<form
ng-submit="uploadPicCtrl.uploadPic()"
novalidate>

<input class="form-control" type="text" ng-model="uploadPicCtrl.pic.name" placeholder="name">
<input class="form-control" type="text" ng-model="uploadPicCtrl.pic.desc" placeholder="desc">

<div class="btn btn-default"
ngf-select
ng-model="uploadPicCtrl.pic.file">
Select Image
</div>
<button class="btn btn-primary">Upload Image</button>
</form>
</div>
Loading