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 .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
21 changes: 21 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"rules": {
"no-console": "off",
"indent": [ "error", 2 ],
"quotes": [ "error", "single" ],
"semi": ["error", "always"],
"linebreak-style": [ "error", "unix" ]
},
"env": {
"es6": true,
"node": true,
"mocha": true,
"jasmine": true
},
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true,
"impliedStrict": true
},
"extends": "eslint:recommended"
}
123 changes: 123 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Created by https://www.gitignore.io/api/node,vim,osx,macos,linux

*node_modules

###
.env

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

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

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

# ignore angular build directory
build

# 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

# Yarn Integrity file
.yarn-integrity



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


### 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


### macOS ###
# Icon must end with two \r
# Thumbnails
# Files that might appear in the root of a volume
# Directories potentially created on remote AFP share


### 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*

# End of https://www.gitignore.io/api/node,vim,osx,macos,linux
10 changes: 10 additions & 0 deletions app/component/gallery/create-gallery/_create-gallery.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "../../../scss/lib/theme/vars";

.create-gallery {
button {
left: 250px;
padding-left: 25px;
padding-right: 25px;
border-radius: 5px;
}
}
27 changes: 27 additions & 0 deletions app/component/gallery/create-gallery/create-gallery.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<section class="create-gallery">
<h3>Create a new gallery.</h3>

<form name="createGalleryForm"
class="gallery-form"
ng-submit="createGalleryCtrl.createGallery()">

<fieldset>
<input type="text"
name="name"
class="input-std"
type="text"
ng-model="createGalleryCtrl.gallery.name"
placeholder="gallery name" required>
</fieldset>

<fieldset>
<input type="text"
name="desc"
class="input-std"
ng-model="createGalleryCtrl.gallery.desc"
placeholder="gallery description" required>
</fieldset>

<button class="btn-std" type="submit">create gallery</button>
</form>
</section>
23 changes: 23 additions & 0 deletions app/component/gallery/create-gallery/create-gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

require('./_create-gallery.scss');

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

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

this.gallery = {};

this.createGallery = function() {
galleryService.createGallery(this.gallery)
.then( () => {
this.gallery.name = null;
this.gallery.desc = null;
});
};
}
Empty file.
21 changes: 21 additions & 0 deletions app/component/gallery/edit-gallery/edit-gallery.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<section class="edit">
<form class="edit-gallery"
name="editGallery"
ng-submit="editGalleryCtrl.updateGallery()"
novalidate>

<fieldset>
<span class="item-label">name:</span>
<input name="name" class="input-std" type="text"
ng-model="editGalleryCtrl.gallery.name">
</fieldset>

<fieldset>
<span class="item-label">description:</span>
<input name="desc" class="input-std" type="text"
ng-model="editGalleryCtrl.gallery.desc">
</fieldset>

<button class="btn-std">update</button>
</form>
</section>
21 changes: 21 additions & 0 deletions app/component/gallery/edit-gallery/edit-gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

require('./_edit-gallery.scss');

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

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

this.updateGallery = function() {
$log.debug('editGalleryCtrl.updateGallery');
galleryService.updateGallery(this.gallery._id, this.gallery);
};
};
Empty file.
21 changes: 21 additions & 0 deletions app/component/gallery/gallery-item/gallery-item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<li class="gallery-item">
<div class="current-item" ng-if="!galleryItemCtrl.showEditGallery">
<div>
<span class="item-label">name:</span>
<span>{{ galleryItemCtrl.gallery.name }}</span>
</div>

<div>
<span class="item-label">description:</span>
<span>{{ galleryItemCtrl.gallery.desc }}</span>
</div>
</div>

<edit-gallery ng-if="galleryItemCtrl.showEditGallery" gallery="galleryItemCtrl.gallery"></edit-gallery>

<span
ng-click="galleryItemCtrl.showEditGallery = !galleryItemCtrl.showEditGallery">
edit
</span>
<span ng-click="galleryItemCtrl.deleteGallery()">delete</span>
</li>
22 changes: 22 additions & 0 deletions app/component/gallery/gallery-item/gallery-item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

require('./_gallery-item.scss');

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

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

this.showEditGallery = false;

this.deleteGallery = function() {
galleryService.deleteGallery(this.gallery._id);
};
};
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="thumbnail-container">
<h2>{{ thumbnailContainerCtrl.gallery.name }}</h2>
<upload-pic gallery="thumbnailContainerCtrl.gallery"></upload-pic>

<div>
<thumbnail ng-repeat="item in thumbnailContainerCtrl.gallery.pics" pic="item" gallery="thumbnailContainerCtrl.gallery"></thumbnail>
</div>
</div>
11 changes: 11 additions & 0 deletions app/component/gallery/thumbnail-container/thumbnail-container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

require('./_thumbnail-container.scss');

module.exports = {
template: require('./thumbnail-container.html'),
controllerAs: 'thumbnailContainerCtrl',
bindings: {
gallery: '<'
}
};
Empty file.
4 changes: 4 additions & 0 deletions app/component/gallery/thumbnail/thumbnail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="thumbnail">
<img ng-src="{{ thumbnailCtrl.pic.imageURI }}" alt="{{ thumbnailCtrl.pic.desc }}">
<button class="btn-std" ng-click="thumbnailCtrl.deletePic()">delete</button>
</div>
23 changes: 23 additions & 0 deletions app/component/gallery/thumbnail/thumbnail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use strict';

require('./_thumbnail.scss');

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

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

this.deletePic = function() {
$log.debug('thumbnailCtrl.deletePic');

picService.deletePic(this.gallery,this.pic._id);
};
}
Empty file.
23 changes: 23 additions & 0 deletions app/component/gallery/upload-pic/upload-pic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<section class="upload-pic">
<form
ng-submit="uploadPicCtrl.uploadPic()"
novalidate>

<h3>upload a new pic</h3>

<fieldset>
<input class="input-std" type="text" ng-model="uploadPicCtrl.pic.name" placeholder="name">
<input class="input-std" type="text" ng-model="uploadPicCtrl.pic.desc" placeholder="desc">
</fieldset>

<div>
<p class="grab-img"
ngf-select
ng-model="uploadPicCtrl.pic.file">
select a pic to upload
</p>

<button class="btn-std">upload</button>
</div>
</form>
</section>
Loading