Skip to content

Commit

Permalink
yehh
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Philip de Rogatis authored and Jean Philip de Rogatis committed Nov 22, 2016
1 parent 5ab34f0 commit 16532d0
Show file tree
Hide file tree
Showing 25 changed files with 6,092 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"typescript.check.workspaceVersion": false,
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.wrappingColumn": 0
"editor.wrappingColumn": 300
}
Binary file modified client/app/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions client/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ md-content{
// Component styles are injected through gulp
/* inject:scss */
@import 'admin/admin';
@import 'cad-ong/cad-ong';
@import 'cadastro-ong/cad-ong';
@import 'list-ongs/list-ongs';
@import 'main/main';
@import 'sobre/sobre';
Expand Down
5 changes: 2 additions & 3 deletions client/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import contactForm from '../components/contact-form/contact-form.component';
import main from './main/main.component';
import listOngs from './list-ongs/list-ongs.component';
import sobre from './sobre/sobre.component';
import cadOng from './cad-ong/cad-ong.component';
import constants from './app.constants';
import util from '../components/util/util.module';
import socket from '../components/socket/socket.service';
Expand All @@ -34,12 +35,9 @@ angular.module('doebemOrgApp', [
ngCookies,
ngResource,
ngSanitize,

'btford.socket-io',

ngRoute,
uiBootstrap,

_Auth,
account,
admin,
Expand All @@ -49,6 +47,7 @@ angular.module('doebemOrgApp', [
listOngs,
contactForm,
sobre,
cadOng,
constants,
socket,
util
Expand Down
47 changes: 47 additions & 0 deletions client/app/cad-ong/cad-ong.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const angular = require('angular');
const ngRoute = require('angular-route');
import routing from './cad-ong.routes';

export class CadOngController {
$http;
$scope;
$routeParams;
listOng = [];
listAreas = [];
listAreasDeAtuacao =[];
ong = {}
/*@ngInject*/
constructor($http, $scope, socket, $routeParams) {
this.$http = $http;
this.$scope = $scope;
this.$routeParams = $routeParams;
this.listAreasDeAtuacao = [
{ abbrev: 'educacao', desc: 'Educação' },
{ abbrev: 'saude', desc: 'Saúde' },
{ abbrev: 'combateAProbreza', desc: 'Combate A Probreza' }
]

}


carregaLista() {
this.$http.get('api/ong')
.then(res => {
this.listOng = res.data;
})
}


$onInit() {
this.carregaLista()
}

addOng(ongForm) {
this.$http.post('api/ong', ongForm);
}
}

export default angular.module('doebemOrgApp.cadOng', [ ngRoute]) .config(routing) .component('cadOng', {
template: require('./cad-ong.pug'), controller: CadOngController
})
.name;
67 changes: 67 additions & 0 deletions client/app/cad-ong/cad-ong.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
div#cadOng(layout="column" layout-align="center center")
h1 Cadastre aqui sua ONG
.container(layout = "row" )
div#list(flex="25")
md-list
md-list-item(ng-repeat="ong in $ctrl.listOng")
h3 {{ong.nome}}
div#form(flex="75")
h2.sectionHeading Cadastro
div(layout="column" flex="100")
form(name="ongForm" layout="column" ng-submit="$ctrl.addOng($ctrl.ongForm)")
div(layout="column" layout-gt-sm="row" flex="100" )
div#info(layout="column" flex="100")
md-input-container.md-block(flex-gt-sm)
label Nome Fantasia
input(ng-model="$ctrl.ongForm.nomeFantasia" required)
md-input-container.md-block(flex-gt-sm)
label Razão Social
input(ng-model="$ctrl.ongForm.razaoSocial" required)
md-input-container.md-block(flex-gt-sm)
label CNPJ
input(ng-model="$ctrl.ongForm.cnpj" required)
md-input-container.md-block(flex-gt-sm)
label End
input(ng-model="$ctrl.ongForm.end" required)
md-input-container.md-block(flex-gt-sm)
label Cidade
input(ng-model="$ctrl.ongForm.cidade" required)
md-input-container.md-block(flex-gt-sm)
label Estado
md-select(ng-model="$ctrl.ongForm.uf" )
md-option(ng-repeat="state in $ctrl.states" value="{{state.Sigla}}")
span {{state.Nome}}
md-input-container.md-block(flex-gt-sm)
label Cep
input(ng-model="$ctrl.ongForm.cep" required)
md-input-container.md-block
label Area de Atuação
md-select(ng-model="$ctrl.ongForm.areaDeAtuacao" )
md-option(ng-repeat="area in $ctrl.listAreasDeAtuacao" value="{{area.abbrev}}")
span {{area.desc}}
md-input-container.md-block
label Logo
input(ng-model="$ctrl.ongForm.logo" required)
div#desc(layout="$ctrl.column" flex="100")
md-input-container.md-block(flex-gt-sm)
label Desc
textarea(ng-model="$ctrl.ongForm.desc" columns="1")
div(flex="10")
md-button.md-raized.md-primary(type="submit") Cadastrar

script(type="text/ng-template" id="dialogEmailSend.tmpl.pug")
md-dialog(aria-label="emailSend")
form(ng-cloak)
md-toolbar
div.md-toolbar-tools
h2 Email Enviado!
span(flex)
md-button.md-icon-button(aria-label="md-button ok", ng-click="cancel()")
md-icon
ng-md-icon.name(icon="close" style="fill: white")
md-dialog-content
div.md-dialog-content
h2 Obrigado pela sua mensagem! {{$ctrl.user.fistName}}
md-dialog-actions(layout="row")
span(flex)
md-button(ng-click="cancel()") Ok
11 changes: 11 additions & 0 deletions client/app/cad-ong/cad-ong.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

export default function routes($routeProvider) {
'ngInject';
$routeProvider
.when('/cadOng', {
template: '<cad-ong></cad-ong>'
})

};

Empty file added client/app/cad-ong/cad-ong.scss
Empty file.
45 changes: 45 additions & 0 deletions client/app/cadastro-ong/cad-ong.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const angular = require('angular');
const ngRoute = require('angular-route');
import routing from './cad-ong.routes';

export class CadOngController {
$http;
$scope;
$routeParams;
listOng = [];
listAreas = [];
listAreasDeAtuacao =[];
ong = {}
/*@ngInject*/
constructor($http, $scope, socket, $routeParams) {
this.$http = $http;
this.$scope = $scope;
this.$routeParams = $routeParams;
this.listAreasDeAtuacao =[
{abbrev: 'educacao', desc: 'Educação'},
{abbrev: 'saude', desc: 'Saúde'},
{abbrev: 'combateAProbreza', desc: 'Combate A Probreza'}
]

}

carregaLista() {
this.$http.get('api/ong')
.then(res => {
this.listOng = res.data;
})
}

$onInit() {
this.carregaLista()
}

addOng(ongForm) {
this.$http.post('api/ong', ongForm);
}
}

export default angular.module('doebemOrgApp.cadOng', [ ngRoute]) .config(routing) .component('cadOng', {
template: require('./cad-ong.pug'), controller: CadOngController
})
.name;
62 changes: 62 additions & 0 deletions client/app/cadastro-ong/cad-ong.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
div#cadOng(layout="column" layout-align="center center")
h1 Cadastre aqui sua ONG
.container(layout = "row" )
div#list(flex="25")
md-list
md-list-item(ng-repeat="ong in $ctrl.listOng")
h3 {{ong.nome}}
div#form(flex="75")
h2.sectionHeading Cadastro
div(layout="column" flex="100")
form(name="ongForm" layout="column" ng-submit="$ctrl.addOng($ctrl.ongForm)")
div(layout="column" layout-gt-sm="row" flex="100" )
div#info(layout="column" flex="100")
md-input-container.md-block(flex-gt-sm)
label Nome Fantasia
input(ng-model="$ctrl.ongForm.nomeFantasia" required)
md-input-container.md-block(flex-gt-sm)
label Razão Social
input(ng-model="$ctrl.ongForm.razaoSocial" required)
md-input-container.md-block(flex-gt-sm)
label End
input(ng-model="$ctrl.ongForm.end" required)
md-input-container.md-block(flex-gt-sm)
label Cidade
input(ng-model="$ctrl.ongForm.cidade" required)
md-input-container.md-block(flex-gt-sm)
label Estado
input(ng-model="$ctrl.ongForm.estado" required)
md-input-container.md-block(flex-gt-sm)
label Cep
input(ng-model="$ctrl.ongForm.cep" required)
md-input-container.md-block
label Area de Atuação
md-select(ng-model="$ctrl.ongForm.areaDeAtuacao" )
md-option(ng-repeat="area in $ctrl.listAreasDeAtuacao" value="{{area.abbrev}}")
span {{area.desc}}
md-input-container.md-block
label Logo
input(ng-model="$ctrl.ongForm.logo" required)
div#desc(layout="$ctrl.column" flex="100")
md-input-container.md-block(flex-gt-sm)
label Desc
textarea(ng-model="$ctrl.ongForm.desc" columns="1")
div(flex="10")
md-button.md-raized.md-primary(type="submit") Cadastrar

script(type="text/ng-template" id="dialogEmailSend.tmpl.pug")
md-dialog(aria-label="emailSend")
form(ng-cloak)
md-toolbar
div.md-toolbar-tools
h2 Email Enviado!
span(flex)
md-button.md-icon-button(aria-label="md-button ok", ng-click="cancel()")
md-icon
ng-md-icon.name(icon="close" style="fill: white")
md-dialog-content
div.md-dialog-content
h2 Obrigado pela sua mensagem! {{$ctrl.user.fistName}}
md-dialog-actions(layout="row")
span(flex)
md-button(ng-click="cancel()") Ok
11 changes: 11 additions & 0 deletions client/app/cadastro-ong/cad-ong.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

export default function routes($routeProvider) {
'ngInject';
$routeProvider
.when('/cadOng', {
template: '<cad-ong></cad-ong>'
})

};

3 changes: 3 additions & 0 deletions client/app/cadastro-ong/cad-ong.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
div#cadOng{
padding-top: 70px;
}
3 changes: 1 addition & 2 deletions client/components/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export class NavbarComponent {

scrollToSection(eID) {
var section = angular.element(document.getElementById(eID));
console.log(section);
this.$document.scrollToElementAnimated(section, 70, this.duration)
this.$document.scrollToElementAnimated(section, 70, this.duration)
}
}

Expand Down
Loading

0 comments on commit 16532d0

Please sign in to comment.