Skip to content

Zachary angular-ui-bootstrap #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1503892
signup form and auth services complete, all components, and configs s…
zcrumbo Mar 29, 2017
6abc4b5
functionality complete
zcrumbo Mar 29, 2017
f27063d
initial styling complete
zcrumbo Mar 29, 2017
f2cc234
updated styles
zcrumbo Mar 29, 2017
6da2a37
tweaked styles and changed img src to ng-src
zcrumbo Mar 29, 2017
7e6327b
added a few straggler files. karma etc.
zcrumbo Mar 29, 2017
fd5f061
setup directory and fix env issues
zcrumbo Mar 29, 2017
ae65144
base functionality completed
zcrumbo Mar 30, 2017
9b7df96
completed delete route and styled delete buttons
zcrumbo Mar 30, 2017
930c6fd
initial put route work
zcrumbo Mar 30, 2017
8b22599
added full put functionality and updated styles to scale better
zcrumbo Mar 31, 2017
2d8f77b
added cancel functionality - scoping issues still present
zcrumbo Apr 2, 2017
2e9336c
finally got cancel functioning correctl
zcrumbo Apr 3, 2017
8e993cb
added .env
zcrumbo Apr 3, 2017
8cc28d3
day 4 framework
zcrumbo Apr 3, 2017
ff7960c
added pic upload and delete functionality
zcrumbo Apr 4, 2017
98f957b
added test, worked on delete-done function
zcrumbo Apr 5, 2017
a41598d
added tests for gallery-edit and gallery-item components
zcrumbo Apr 6, 2017
0f34482
tweaked test
zcrumbo Apr 6, 2017
3003643
one commit too many
zcrumbo Apr 6, 2017
9be839b
added fuzzy search directive, title case filter and orderby toggle
zcrumbo Apr 7, 2017
4292613
started day 8
zcrumbo Apr 10, 2017
7b954e2
added dropdown and modal popup for thumbnails
zcrumbo Apr 11, 2017
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-zachary/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
1 change: 1 addition & 0 deletions lab-zachary/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_URL='http://localhost:8000'
21 changes: 21 additions & 0 deletions lab-zachary/.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"
}
130 changes: 130 additions & 0 deletions lab-zachary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/build

# Created by https://www.gitignore.io/api/node,osx,windows,linux

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

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.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

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# 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

# dotenv environment variables file
.env


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

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

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

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

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/node,osx,windows,linux
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<section class="create-gallery">
<h2>Create a new gallery.</h2>
<form name="createGalleryForm"
class="gallery-form"
ng-submit="createGalleryCtrl.createGallery()">
<fieldset>
<input type="text"
name="name"
placeholder="gallery name"
ng-model="createGalleryCtrl.gallery.name" required>
</fieldset>

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

<button class="btn-std" type="submit">create gallery</button>
<div class="clearfix"></div>

</form>
</section>
22 changes: 22 additions & 0 deletions lab-zachary/app/component/gallery/create-gallery/create-gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

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() {
$log.debug('test', this.gallery);
galleryService.createGallery(this.gallery)
.then( () => {
this.gallery.name = null;
this.gallery.desc = null;
});
};
}
15 changes: 15 additions & 0 deletions lab-zachary/app/component/gallery/gallery-edit/_gallery-edit.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@import '../../../scss/lib/base/global-vars';

form.gallery-edit{
.current-item{
input {
display:inline-block;
width: 50%;
height: unset;
margin: 0;
padding: .1vw;
background-color: $tertiaryColor*1.2;
border:none;
}
}
}
26 changes: 26 additions & 0 deletions lab-zachary/app/component/gallery/gallery-edit/gallery-edit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<form ng-submit="galleryEditCtrl.updateGallery()" class="gallery-edit">
<div class="current-item">
<div>
<span>name: </span>
<input type="text" name="name"
ng-model="galleryEditCtrl.gallery.name"
placeholder="{{ galleryEditCtrl.gallery.name }}">
</div>
<div>
<span>description: </span>
<input type="text" name="desc"
ng-model="galleryEditCtrl.gallery.desc"
placeholder="{{ galleryEditCtrl.gallery.desc}}">
</div>
</div>
<div class="edit-buttons">
<button class="btn-std"
type="submit">
update</button>
<button class="btn-std cancel"
type="button"
ng-click="galleryEditCtrl.cancelUpdate()">
cancel</button>

</form>

31 changes: 31 additions & 0 deletions lab-zachary/app/component/gallery/gallery-edit/gallery-edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use strict';

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

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

function GalleryEditController($log, galleryService) {
$log.debug('GalleryEditController');
$log.debug(this.oldData, this);

this.cancelUpdate = function() {
$log.debug(this.gallery);
this.gallery = this.oldData;
this.showEditGallery = false;
};

this.updateGallery = function() {
$log.debug('GalleryEditController.updateGallery');
galleryService.updateGallery(this.gallery._id, this.gallery);
this.showEditGallery = false;
};
}
46 changes: 46 additions & 0 deletions lab-zachary/app/component/gallery/gallery-item/_gallery-item.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@import '../../../scss/lib/base/global-vars';

.gallery-item {
.current-item{
background-color: $tertiaryColor;
color: $secondaryColor;
padding: $gutter/2 $gutter;
margin: $gutter 0 ;
@include rounded;
div {
margin-bottom: $gutter/2 ;
padding: 1.1% 0;

span:first-child {
font-weight: bold;
}
span:last-child {
}
}
div:last-child {
margin-bottom:0;
}
}
}
div.edit-buttons{
float:right;
text-align: right;
width:100%;
margin:0vw 0 2vw 0;

.btn-std{
margin: 0;
background-color:$secondaryColor;
color:$primaryColor;
float:none;

&.del{
margin-left: $gutter;
padding-left:$gutter*2;
padding-right:$gutter*2;
color: $secondaryColor;
background-color: $primaryColor/1.2;
}

}
}
24 changes: 24 additions & 0 deletions lab-zachary/app/component/gallery/gallery-item/gallery-item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<li class="gallery-item">
<div ng-if="!galleryItemCtrl.showEditGallery" class="current-item">
<div><span>name: </span>
<span>{{ galleryItemCtrl.gallery.name | titleCase }}</span>
</div>
<div><span>description: </span>
<span>{{ galleryItemCtrl.gallery.desc }}</span>
</div>
</div>
<gallery-edit gallery="galleryItemCtrl.gallery"
show-edit-gallery="galleryItemCtrl.showEditGallery"
old-data="galleryItemCtrl.oldData"
ng-if="galleryItemCtrl.showEditGallery">
</gallery-edit>
</li>
<div class="edit-buttons" ng-if="!galleryItemCtrl.showEditGallery">
<button class="btn-std"
ng-click="galleryItemCtrl.editGallery()">
edit</button>
<button class="btn-std del"
ng-click="galleryItemCtrl.deleteGallery()">delete</button>
</div>

<div class="clearfix"></div>
36 changes: 36 additions & 0 deletions lab-zachary/app/component/gallery/gallery-item/gallery-item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'use strict';

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

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

function GalleryItemController($log, galleryService) {
$log.debug('GalleryItemController');
this.showEditGallery = false;

this.editGallery = function() {
this.oldData = angular.copy(this.gallery);
this.showEditGallery = true;
};

this.deleteGallery = function() {
galleryService.deleteGallery(this.gallery._id)
.then( () => {
$log.debug('gallery deleted:', this.currentGallery );
this.deleteDone(this.gallery);
})
.catch( err => {
$log.error( err);
});
return(this.gallery);
};

}
Loading