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-raziyeh/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
5 changes: 5 additions & 0 deletions lab-raziyeh/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/node_modules/*
**/vendor/*
**/*.min.js
**/coverage/*
**/build/**
24 changes: 24 additions & 0 deletions lab-raziyeh/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"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": {
"__GOOGLE_CLIENT_ID__": true
},
"ecmaFeatures": {
"modules": true,
"experimentalObjectRestSpread": true,
"impliedStrict": true
},
"extends": "eslint:recommended"
}
127 changes: 127 additions & 0 deletions lab-raziyeh/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
*.env
build
coverage
html-report
build
../.DS_Store
# Created by https://www.gitignore.io/api/osx,windows,vim,node,linux

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


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


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


### 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*
4 changes: 4 additions & 0 deletions lab-raziyeh/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)

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

<form name="createGalleryForm" class="form-inline" novalidate>
<div class="form-group">
<input name="name" class="form-control" type="text" uib-tooltip="name required"
ng-model="createGalleryCtrl.gallery.name"
placeholder="name"
required>
</div>

<div class="form-group">
<input name="desc" class="form-control" type="text" uib-tooltip="description required"
ng-model="createGalleryCtrl.gallery.desc"
placeholder="description"
required>
</div>

<button class="btn btn-default" type="submit" ng-click="createGalleryCtrl.createGallery()">
<span class="glyphicon glyphicon-plus"></span> Add Gallery
</button>
</form>

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

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

function CreateGalleryController($log, galleryService){
$log.debug('init createGalleryCtrl');
this.gallery = {};

this.createGallery = function(){
galleryService.createGallery(this.gallery)
.then(() => {
this.gallery.name = null;
this.gallery.desc = null;
});
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<form name="updateForm" class="form-inline" novalidate>
<input name="name" type="text" class="form-control input-sm" ng-model="editGalleryCtrl.gallery.name" placeholder="name">
<input name="desc" type="text" class="form-control input-sm" ng-model="editGalleryCtrl.gallery.desc" placeholder="description">
<button class="btn btn-warning btn-sm" ng-click="editGalleryCtrl.updateGallery(editGalleryCtrl.gallery._id, editGalleryCtrl.gallery)"> update </button>
</form>
21 changes: 21 additions & 0 deletions lab-raziyeh/app/component/gallery/edit-gallery/edit-gallery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'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)
.catch( () => {
$log.debug('error in editGalleryCtrl');
});
};
}
14 changes: 14 additions & 0 deletions lab-raziyeh/app/component/gallery/gallery-items/gallery-items.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<a href="javascript: void(0)" class="list-group-item clearfix">
<span class="glyphicon glyphicon-file"></span>
{{ galleryItemsCtrl.gallery.name | uppercase }} - {{ galleryItemsCtrl.gallery.desc }}
<span class="pull-right">
<button class="btn btn-sm btn-info" ng-click="galleryItemsCtrl.showEdit = !galleryItemsCtrl.showEdit">
<span class="glyphicon glyphicon-pencil"></span>
</button>

<button class="btn btn-sm btn-danger" ng-click="galleryItemsCtrl.deleteGallery()">
<span class="glyphicon glyphicon-trash"></span>
</button>
</span>
<edit-gallery ng-if="galleryItemsCtrl.showEdit" gallery="galleryItemsCtrl.gallery"></edit-gallery>
</a>
27 changes: 27 additions & 0 deletions lab-raziyeh/app/component/gallery/gallery-items/gallery-items.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

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

function GalleryItemsController($log, galleryService){
$log.debug('init galleryItemsCtrl');
this.showEdit = false;

this.deleteGallery = function(){
galleryService.deleteGallery(this.gallery._id)
.then( () => {
$log.debug('delete gallery by Is, Done!');
this.deleteDone({galleryData: this.gallery});
})
.catch(err => {
$log.debug('delete gallery failed', err.message);
});
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.home .panel-heading {
background: #f5f5f5;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

<div class="panel panel-default">
<div class="panel-heading text-center">
<h6><i class="glyphicon glyphicon-cloud-upload"></i> Upload Photo</h6>
</div>
<div class="panel-body">
<h5>{{ thumbnailContainerCtrl.gallery.name }}<h5>
<upload-pic gallery="thumbnailContainerCtrl.gallery"> </upload-pic>
<thumbnail class="col-md-3" ng-repeat="item in thumbnailContainerCtrl.gallery.pics" pic="item" gallery="thumbnailContainerCtrl.gallery"></thumbnail>
</div>
</div>

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: '<',
},
};
14 changes: 14 additions & 0 deletions lab-raziyeh/app/component/gallery/thumbnail/thumbnail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

<br/>
<div class="media">
<div class="media-left">
<a ng-href="{{thumbnailCtrl.pic.imageURI}}">
<img class="media-object" ng-src="{{thumbnailCtrl.pic.imageURI}}" alt="{{thumbnailCtrl.pic.desc}}">
</a>
</div>
<div class="media-body">
<h5 class="media-heading">{{thumbnailCtrl.pic.name}}</h5>
<p class="media-heading">{{thumbnailCtrl.pic.desc}}</p>
<span ng-click="thumbnailCtrl.deletePic()" class="btn btn-xs btn-default glyphicon glyphicon-trash fa-4x"> </span>
</div>
</div>
26 changes: 26 additions & 0 deletions lab-raziyeh/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'),
controllerAs: 'thumbnailCtrl',
controller: ['$log', 'picService', ThumbnailController],
bindings: {
pic: '<',
gallery: '<',
},
};

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

this.deletePic = function(){
$log.debug('thumbnailCtrl.deletePic()');
picService.deleteGalleryPic(this.gallery, this.pic)
.then(() => {
$log.debug('delete pic, Done!');
})
.catch(() => {
$log.debug('delete pic by has error!');
});
};
}
16 changes: 16 additions & 0 deletions lab-raziyeh/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()" class="form-inline" 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="Description">

<div class="btn btn-info"
ngf-select
ng-model="uploadPicCtrl.pic.file">
Select Image
</div>

<button class="btn btn-warning"> Upload Image </button>
</form>
</div>
Loading