Skip to content

Instantly share code, notes, and snippets.

@2947721120
Created July 6, 2016 09:34
Show Gist options
  • Save 2947721120/dddef85f2915abf2f9e57a0510c60ad7 to your computer and use it in GitHub Desktop.
Save 2947721120/dddef85f2915abf2f9e57a0510c60ad7 to your computer and use it in GitHub Desktop.
CRUD
<html ng-app="app" ng-controller="Controll">
<head>
<link rel="stylesheet" type="text/css" href="//staging.seucondominio.com.br/assets/sistema_responsivo-529025b48cd859fc621449055981e08c.css" />
</head>
<body class="sc-system">
<section id="top-menu" class="sc-p-v-sm sc-p-h-xl header-bar">
<img src="https://www.seucondominio.com.br/assets/institucional/logo-mobile-c07a4de0cd57b02cf5eaffefcda8d48e.png" style="width:125px" />
</section>
<section id="top-bar" class="sc-bg-gray-lighter">
<div id="top-bar-content" class="sc-bg-gray-lighter">
<div class="clear"></div>
<section id="main-page" class="sc-scrollbar">
<section id="main-content">
<section id="top-bar" class="sc-bg-gray-lighter">
<section id="top-bar-content">
<div style="justify-content: space-between;" class="flex flex-center">
<div class="flex flex-center">
<div class="sc-p-l-lg sc-p-l-none">
<button ng-class="novaEntrega._new ? 'sc-btn-gray':'sc-btn-blue'" ng-click="formulario.open()" class="sc-btn sc-btn-blue sc-btn-awesomeness">
<div class="sc-btn-icon"><i class="sc-icon sc-icon-mais-1"></i></div>
<div class="sc-btn-text">Adicionar</div>
</button>
</div>
<div class="sc-p-l-lg">
<div class="sc-input-group">
<input type="search" ng-model="f" class="sc-input-default" />
<i class="sc-icon sc-icon-lupa-1 sc-btn sc-btn-blue"></i>
<i ng-class="{'sc-btn-gray':filtro.open}" ng-click="filtro.open = !filtro.open" class="sc-icon sc-icon-filtro-2 sc-btn"></i>
</div>
</div>
</div>
</div>
<div id="top-bar-filter">
<form ng-show="filtro.open" class="ng-animation-slider sc-p-lg">
<div class="sc-p-l-md sc-p-b-md sc-align-bottom">
<label>
<div class="sc-label">Objeto:</div>
<div class="sc-input-group">
<input ng-model="o" type="search" class="sc-input-default sc-input-block"typeahead-loading="loading" />
<i class="sc-icon sc-icon-lupa-2 sc-btn sc-btn-blue"></i>
</div>
</label>
</div>
<div class="sc-p-l-md sc-p-b-md sc-align-bottom">
<span sc-dropdown-menu class="sc-dropdown">
<div class="sc-label">Morador:</div>
<div class="sc-input-group">
<input ng-model="mora" ng-click="menu.open()" class="sc-input-default"/>
<button ng-click="menu.toggle()" class="sc-btn sc-btn-blue">
<i class="sc-icon sc-icon-seta-5-baixo sc-transition" ng-class="{'sc-rotate-180':menu.isOn}"></i>
</button>
</div>
<ul class="sc-dropdown-menu ng-animation-slider" ng-show="menu.isOn">
<li ng-hide="moradorFilter.length">clique para cadastrar</li>
<li ng-show="moradorFilter.length" ng-repeat="i in moradorFilter = (morador | scFilter:mora)">
<a href="#" ng-click="choice1(i); menu.close()" value="{{i.name}}">{{i.name}}</a>
</li>
</ul>
</span>
</div>
<div class="sc-p-l-md sc-p-b-md sc-align-bottom">
<span sc-dropdown-menu class="sc-dropdown">
<div class="sc-label">Visitante:</div>
<div class="sc-input-group">
<input ng-model="visit" ng-click="menu.open()" class="sc-input-default"/>
<button ng-click="menu.toggle()" class="sc-btn sc-btn-blue">
<i class="sc-icon sc-icon-seta-5-baixo sc-transition" ng-class="{'sc-rotate-180':menu.isOn}"></i>
</button>
</div>
<ul class="sc-dropdown-menu ng-animation-slider" ng-show="menu.isOn">
<li ng-repeat="i in visitante | scFilter:visit">
<a href="#" ng-click="choice2(i)" value="{{i.name}}; menu.close()">{{i.name}}</a>
</li>
</ul>
</span>
</div>
<div class="sc-p-l-md sc-p-b-md sc-align-bottom">
<label>
<div class="sc-label">Data inicial:</div>
<input ng-model="di" type="date" class="sc-input-default"/>
</label>
</div>
<div class="sc-p-l-md sc-p-b-md sc-align-bottom">
<label>
<div class="sc-label">Data final:</div>
<input ng-model="df" type="date" class="sc-input-default"/>
</label>
</div>
<div class="sc-p-l-md sc-p-b-md sc-align-bottom">
<label>
<div class="sc-label">Situação:</div>
<div class="sc-btn-group">
<button ng-model="b1" ng-click="b1 = true; b2 = false" class="sc-btn sc-btn-md" ng-class="{'sc-btn-red':b1}">Pendente</button>
<button ng-model="b2" ng-click="b1 = false; b2 = true" class="sc-btn sc-btn-md" ng-class="{'sc-btn-green':b2}">Entregue</button>
</div>
</label>
</div>
<hr/>
<div class="clear"></div>
<div class="sc-p-h-md sc-p-b-md sc-align-bottom">
<button ng-click="searching(o); statusLoc()" class="sc-btn sc-btn-blue sc-btn-awesomeness">
<div class="sc-btn-icon"><i class="sc-icon sc-icon-lupa-2"></i></div>
<div class="sc-btn-text hidden-xs hidden-sm">Pesquisar</div>
</button>
</div>
<div class="sc-p-h-md sc-p-b-md sc-align-bottom">
<button ng-click="clear()" class="sc-btn sc-btn-red sc-btn-awesomeness">
<div class="sc-btn-icon"><i class="sc-icon sc-icon-fechar-1"></i></div>
<div class="sc-btn-text hidden-xs hidden-sm">Limpar Busca</div>
</button>
</div>
</form>
</div>
</section>
</section>
<section id="breadcrumb" class="sc-p-b-none"><a>Início </a><span> / Tarefas</span></section>
</section>
</section>
</div>
</section>
<section id="corpo" ng-controller="Guarda-Volumes" style="margin-top: 61px;">
<section id="novo-funcionario" ng-show="novaEntrega._new">
<ul class="sc-accordion">
<li ng-controller="Volume" ng-init="initForm(novaEntrega.dados)" ng-include="'form.html'" class="sc-acc"></li>
</ul>
</section>
<section id="funcionarios">
<ul class="sc-accordion">
<li ng-class="{ 'sc-acc-blue':form.opened }" ng-controller="Volume" ng-repeat="func in funcionarios | orderBy: 'id' | filter:f as results" ng-init="initForm(func)" ng-include="'form.html'" class="sc-text-blue">
</li>
</ul>
</section>
</section>
<script id="form.html" type="text/ng-template">
<div ng-click="toggleAcc(form)" class="sc-accordion-head" ng-class="(entregue == true && !form.opened) ? 'sc-p-b-none':'' ">
<div class="sc-accordion-elastic-col title">
<span>Tarefa:</span> <span class="sc-text-gray" ng-class="form.opened ? 'sc-text-white':''"> {{form.infoPess.tarefas}}</span>
</div>
<div class="sc-accordion-col-3">
<div sc-stop-click="sc-stop-click" class="pull-right">
<div sc-dropdown-menu="sc-dropdown-menu" class="menu">
<div ng-click="menu.toggle()">
<i ng-class="{'sc-badge-active':menu.isOn, 'sc-badge-hover-gray': !form.opened,'sc-badge-hover-white': form.opened }" class="sc-icon sc-icon-reticiencias-v"></i>
</div>
<ul style="width: 9.2em" ng-show="menu.isOn">
<li ng-click="actionMenu(form, item)" ng-repeat="item in dadosGerais.menu">
<i class="pull-left sc-p-h-md {{item.icon}} {{item.iconColor}}"></i>
<span>{{item.name}}</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div ng-show="form.opened" class="sc-accordion-body ng-animation-slider">
<div class="sc-p-md">
<div class="sc-fieldset flex flex-wrap">
<div class="col-md-12 sc-p-b-md">
<div class="sc-label">Nome</div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.nome}} {{form.infoPess.nome? '':'-'}}</div>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Categoria</div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.categoria}}</div>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Relevância</div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.relevancia}} {{form.infoPess.relevancia? '':'-'}}</div>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Link Mockup</div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.linkMockup}} {{form.infoPess.linkMockup? '':'-'}}</div>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Link Protótipo</div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.linkPrototipo}} {{form.infoPess.linkPrototipo? '':'-'}}</div>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label"> Status</div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.status}} {{form.infoPess.status? '':'-'}}</div>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label"> Sub-Status</div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.subStatus}} {{form.infoPess.subStatus? '':'-'}}</div>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Analista </div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.analista}} {{form.infoPess.analista? '':'-'}}</div>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Desenvolvedor</div>
<div class="sc-label sc-text-gray sc-p-l-md">{{form.infoPess.desenvolvedor}} {{form.infoPess.desenvolvedor? '':'-'}}</div>
</div>
<div class="col-md-12 sc-p-b-md">
<span class="sc-label">Comentário:</span>
<div class="sc-p-t-md">
<textarea ng-model="mensagem" class="sc-input-default" rows="4" style="width:100%" ng-class="{'error':msgError}"></textarea>
<p class="pull-left sc-text-red" ng-show="msgError">
<span class="sc-p-r-md"><i class="sc-icon sc-icon-exclamacao-3"></i></span>Campo "Comentário" não pode ser vazio!</p>
<button class="sc-btn sc-btn-blue sc-btn-awesomeness pull-right sc-m-t-md" ng-click="enviarComentario(mensagem)">
<div class="sc-btn-icon"><i class="sc-icon sc-icon-comentarios"></i></div>
<div class="sc-btn-text">Enviar Comentário</div>
</button>
</div>
</div>
<div class="col-md-12 sc-p-b-md">
<span class="sc-p-r-sm sc-p-t-sm"><i class=" sc-text-xxl sc-icon sc-icon-comentarios"></i></span>
<span class="sc-label">Comentários</span>
<div class="sc-fieldset" ng-repeat="i in form.infoPess.comentario">
<div class="pull-right" ng-click="deletarComentario(i, $index)"><i class="sc-badge-hover-red sc-icon sc-icon-lixeira-1"></i></div>
<div style="display:flex" class="sc-p-b-md">
<div class="sc-border-gray-dark-solid-md sc-border-radius" style="width:28px">
<i class="sc-text-xxl sc-text-black sc-icon-homem-1 sc-icon"></i>
</div>
<div class="sc-p-l-md">
<span class="sc-text-gray"> {{i.nomeComentario}}</span>
</div>
</div>
<div class="sc-text-gray"> {{i.msg}}</div>
</div>
</div>
</div>
</div>
<div class="clear"></div>
</div>
</script>
<script id="formModal.html" type="text/ng-template">
<div class="sc-p-md">
<div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Nome</div>
<input ng-model="form.infoPess.nome" type="text" class="sc-input-default" style="width:100%"></input>
</div>
<div class="col-md-3 sc-p-b-md">
<div class="sc-label">Categoria</div>
<select ng-model="form.infoPess.categoria" type="number" class="sc-input-default" style="width:100%">
<option style="display:none"></option>
<option value="Financeiro">Financeiro</option>
<option value="-- Cobrança">-- Cobrança</option>
<option value="-- Conciliação">-- Conciliação</option>
<option value="Suprimentos">Suprimentos</option>
<option value="-- Compras">-- Compras</option>
<option value="-- Produtos">-- Produtos</option>
</select>
</div>
<div class="col-md-3 sc-p-b-md">
<div class="sc-label">Relevância</div>
<select ng-model="form.infoPess.relevancia" type="number" class="sc-input-default" style="width:100%">
<option style="display:none"></option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Link Mockup</div>
<input ng-model="form.infoPess.linkMockup" type="text" class="sc-input-default" style="width:100%"></input>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label"> Link Protótipo</div>
<input ng-model="form.infoPess.linkPrototipo" type="text" class="sc-input-default" style="width:100%"></input>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Status </div>
<select ng-model="form.infoPess.status" class="sc-input-default" style="width:100%">
<option style="display:none"></option>
<option value="Concluído">Pesquisa</option>
<option value="Pendente">Mockup</option>
<option value="Em andamento">Prototipação Front</option>
</select>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Sub-Status</div>
<select ng-model="form.infoPess.subStatus" class="sc-input-default" style="width:100%">
<option style="display:none"></option>
<option value="Aguardando">Aguardando</option>
<option value="Em Execução">Em Execução</option>
<option value="Concluído">Concluído</option>
</select>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Analista </div>
<select ng-model="form.infoPess.analista" class="sc-input-default" style="width:100%">
<option style="display:none"></option>
<option value="David">David</option>
<option value="Diego">Diego</option>
<option value="Renato">Renato</option>
</select>
</div>
<div class="col-md-6 sc-p-b-md">
<div class="sc-label">Deselvolvedor</div>
<select ng-model="form.infoPess.desenvolvedor" class="sc-input-default" style="width:100%">
<option style="display:none"></option>
<option value="David">David</option>
<option value="Diego">Diego</option>
<option value="Renato">Renato</option>
</select>
</div>
<div class="clear"></div>
<div class="col-md-6 sc-p-b-md">
<div style="width: 100%" class="sc-m-h-md sc-m-b-md">
<div>
<div class="sc-label">Tarefas <button ng-click="addTarefa()" class="sc-btn sc-btn-sm sc-btn-blue">Adicionar</button></div>
<div class="flex" style="flex-wrap: wrap">
<div ng-repeat="i in teste" >
<div class="sc-m-b-md">
<input type="text" ng-model="i.campo" class="sc-input-default" />
<i ng-click="eliminarTarefa()" class="sc-modal-close sc-icon sc-icon-lixeira-1 sc-cursor-pointer sc-text-red sc-badge-hover-red"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 sc-p-b-md">
<span class="sc-label">Comentário:</span>
<div class="sc-p-t-md">
<textarea ng-model="mensagem" class="sc-input-default" rows="4" style="width:100%" ng-class="{'error':msgError}"></textarea>
</div>
</div>
</div>
</div>
</script>
<!-- Loagding Page-->
<div id="box-body-loading" ng-class="{'active':carregando}">
<div id="body-loading" ng-class="{'active':carregando}" class="sc-loading ng-animation-slider"><i class="sc-icon sc-icon-carregando-1 sc-icon-spin"></i>Carregando</div>
</div>
<!-- scModal -->
<div sc-modal="formulario" class="sc-modal-xxl">
<div class="sc-modal-header">
<i ng-click="formulario.close()" class="sc-modal-close sc-icon sc-icon-fechar-2 sc-cursor-pointer sc-text-gray sc-text-hover-red"></i>
<div class="align-center sc-label" ng-hide="editar">Formulário</div>
</div>
<div class="sc-modal-body">
<div ng-include="'formModal.html'" class="flex flex-wrap"></div>
</div>
<div class="sc-modal-footer">
<div>
<button ng-click="formulario.close()" class="sc-btn sc-m-h-md sc-btn-red"> Cancelar</button>
<button ng-click="salvar(obj)" class="sc-btn sc-m-h-md sc-btn-green"> Salvar</button>
</div>
</div>
</div>
<!-- scTopMessages-->
<div ng-click="scTopMessages.close()" ng-cloak="" ng-show="scTopMessages.toggler.opened" class="sc-cursor-pointer sc-top-messages ng-cloak ng-animation-slider">
<div class="sc-text-white align-center sc-text-shadow-dark flex align-items-center {{scTopMessages.theme}}">
<div class="sc-top-messages-msgs">
<p ng-repeat="msg in scTopMessages.messages track by $index">{{msg}}</p>
</div>
<div class="sc-top-messages-close-button"><i class="sc-icon sc-icon-fechar-1 sc-cursor-pointer"></i></div>
</div>
</div>
<!-- scAlert-->
<div ng-cloak="" ng-show="scAlert.toggler.opened" ng-class="{'active': scAlert.toggler.opened}" class="sc-alert ng-cloak">
<div class="sc-alert-box">
<h2 class="sc-alert-title">{{scAlert.title}}</h2>
<div ng-show="scAlert.messages.length" class="sc-alert-messages">
<p ng-repeat="msg in scAlert.messages track by $index">{{msg}}</p>
</div>
<div class="sc-alert-buttons">
<button ng-repeat="btn in scAlert.buttons" ng-click="scAlert.btnAction(btn)" type="button" class="sc-btn sc-btn-block-only-xs sc-btn-{{btn.color}}">{{btn.label}}</button>
</div>
</div>
</div>
<script type="text/javascript" src="http://staging.seucondominio.com.br/assets/prototype-f52befec1edfca0a31237ad13a4132fc.js">
<script type="text/javascript" src="https://dl.dropboxusercontent.com/u/2946154/assets/js/ng-sortable.js">
</script>
<script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/angularfire/1.1.3/angularfire.min.js"></script>
</script>
</body>
</html>
angular.module 'app', [
'sc.app.helpers', 'firebase'
]
.run [
'$rootScope', 'scAlert', 'scTopMessages'
($rootScope, scAlert, scTopMessages)->
$rootScope.scAlert = scAlert
$rootScope.scTopMessages = scTopMessages
]
.controller 'Controll', [
'$scope', '$scModal', 'DadosFuncionarios', 'EntregaResource', 'scAlert', '$timeout'
(sc, $scModal, DadosFuncionarios, EntregaResource, scAlert, $timeout)->
sc.formulario = new $scModal()
sc.cont = 0
cont = sc.cont
sc.addTarefa = ()->
sc.teste.push
id: sc.teste.id+1
conta: sc.teste.campo
sc.eliminarTarefa = ()->
sc.teste.splice
conta: sc.teste.campo
sc.teste =[
id: 0
conta: 300
]
sc.filtro = false
sc.carregando = true
sc.searching = (o)->
sc.f = o
sc.filtro = false
sc.statusLoc = ()->
if sc.b1 == true
sc.f = 'Pendente'
sc.filtro = false
if sc.b2 == true
sc.f = 'Entregue'
sc.filtro = false
sc.clear = ()->
sc.f = ''
sc.o = ''
sc.mora = ''
sc.visit = ''
sc.di = false
sc.df = false
sc.b1 = false
sc.b2 = false
sc.choice1 = (i)->
sc.mora = i.name
sc.choice2 = (i)->
sc.visit = i.name
$timeout ->
sc.carregando = false
, 900
sc.dadosGerais =
menu: [
{
name: 'Editar'
icon: 'sc-icon sc-icon-lapis'
iconColor: 'sc-text-yellow'
}
{
name: 'Excluir'
icon: 'sc-icon sc-icon-lixeira-1'
iconColor: 'sc-text-red'
}
]
sc.filtro =
_open: false
dados: {}
sc.objTemp = {}
sc.novaEntrega =
_new: false
dados:
infoPess: {}
sc.t1 = true
sc.t2 = false
sc.t3 = false
sc.trocar1 = ()->
sc.t1 = true
sc.t2 = false
sc.t3 = false
sc.trocar2 = ()->
sc.t1 = false
sc.t2 = true
sc.t3 = false
sc.trocar3 = ()->
sc.t1 = false
sc.t2 = false
sc.t3 = true
sc.funcionarios = DadosFuncionarios.funcionarios
sc.newFunc = ()->
if sc.novaEntrega._new
sc.novaEntrega.dados = {}
sc.novaEntrega._new = !sc.novaEntrega._new
sc.morador = [
{
name: 'Renato Souza - Bloco A / Apt 123'
}
{
name: 'Nelson Plínio - Bloco B / Apt 456'
}
{
name: 'Júlio Luiz - Bloco C / Apt 789'
}
{
name: 'Márcio Inumaru - Bloco D / Apt 111'
}
{
name: 'Lúcio Torres - Bloco E / Apt 222'
}
]
sc.visitante = [
{
name: 'Gabriel Morais'
}
{
name: 'Thiago Hermano'
}
{
name: 'Diego Felipe'
}
{
name: 'Guilherme Nascimento'
}
{
name: 'Rodrigo Mendonça'
}
]
]
.controller 'Guarda-Volumes', [
'$scope', 'EntregaResource'
(sc, EntregaResource)->
sc.toggleAcc = (obj)->
f.opened = false for f in sc.funcionarios unless obj.opened
obj.opened = !obj.opened
]
.controller 'Volume', [
'$scope', '$filter', '$timeout', 'EntregaService', 'scAlert', 'scTopMessages'
(sc, $filter, $timeout, EntregaService, scAlert, scTopMessages)->
sc.deletarComentario = (i, index)->
sc.form.infoPess.comentario.splice index, 1
sc.deletarAlert = (id)->
scAlert.open
title: 'Excluir registro?'
messages: 'Você não será capaz de recuperar esse registro!'
buttons: [
{
label: 'Cancelar'
color: 'red'
}
{
label: 'Confirmar'
color: 'green'
action: ()->
deletar = (id)->
count = 0
for i in sc.funcionarios
if parseInt(i.id) == id
sc.funcionarios.splice count, 1
scTopMessages.openSuccess "Registro excluído com sucesso!", {timeOut: 3000}
return
count++
}
]
sc.limpar = (op)->
if op == 1
sc.form.infoPess.remet = ''
if op == 2
sc.form.infoPess.dest = ''
sc.initForm = (obj)->
sc.form = obj
sc.form.opened = false
sc.actionMenu = (obj, item)->
switch item.name
when 'Editar'
sc.formulario.open()
when 'Excluir'
sc.deletarAlert(obj.id)
sc.enviarComentario = (mensagem)->
if mensagem != undefined && mensagem != ''
sc.msgError = false
sc.error = false
sc.form.infoPess.comentario.push
nomeComentario: 'José'
msg: mensagem
else
sc.msgError = true
sc.error = true
sc.cancelar = (obj)->
if sc.novaEntrega._new
sc.novaEntrega._new = false
else
sc.funcionarios[obj.id] = angular.copy sc.objTemp
sc.objTemp = {}
obj._edit = false
sc.salvar = (obj)->
console.log "eijwqeiwqj"
sc.funcionarios.push
id: sc.funcionarios.length
infoPess:
nome: obj.infoPess.nome
categoria: obj.infoPess.categoria
relevancia: obj.infoPess.relevancia
linkMockup: obj.infoPess.linkMockup
linkPrototipo: obj.infoPess.linkPrototipo
status: obj.infoPess.status
subStatus: obj.infoPess.subStatus
analista: obj.infoPess.analista
desenvolvedor: obj.infoPess.desenvolvedor
comentario: []
]
.factory "EntregaService", [
'EntregaResource', '$filter'
(EntregaResource, $filter)->
entreg =
aplicarEntrega: (obj, index, getStatus)->
setAplicada = !obj.aplicada
dataAplicada = $filter("date")(new Date, "yyyy-MM-dd")
newObj = { aplicada: setAplicada.toString(), dataAplicada: dataAplicada }
EntregaResource.update index, newObj, getStatus
]
.factory "EntregaResource", [
'$firebaseObject', 'scTopMessages', '$filter'
($firebaseObject, scTopMessages, $filter)->
entreg =
query: ()->
new Firebase "//infracoes.firebaseIO.com"
update: (index, obj, getStatus)->
new Firebase "//infracoes.firebaseio.com/#{index}"
.update obj, getStatus
entreg
]
# Dados
.factory 'DadosFuncionarios', [
()->
func =
funcionarios: [
{
id: 0
infoPess:
nome: 'Playstation 2'
categoria: 'Cobrança'
relevancia: 3
linkMockup: 'hwekqwjhejkwhekwhe'
linkPrototipo: 'ekwqleqjwelkjqwewqk'
status: 'Pesquisa'
subStatus: 'Aguardando'
analista: 'Diego'
desenvolvedor: 'Diego'
tarefas: 'Concluiir'
nomeComentario: 'Diego'
comentario: [
{
id: 0
msg: 'O CREF não nos representa!'
nomeComentario: 'CREF'
}
{
id: 1
msg: 'ooioioioiasoaisoaisoas'
nomeComentario: 'Tulio'
}
{
id: 2
msg: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
nomeComentario: 'Renato'
}
]
}
{
id: 1
infoPess:
nome: 'Óculos espelhado'
categoria: 'Produto'
relevancia: 2
linkMockup: 'ekewlqeçqelqwew'
linkPrototipo: 'qwkemqlwewjmqe'
status: 'Mockup'
subStatus: "Em Andamento"
analista: 'David'
desenvolvedor: 'David'
tarefas: 'Procurando...'
nomeComentario: 'José'
comentario: [
{
id: 0
msg: '!!!!representa!'
nomeComentario: 'CREF'
}
]
}
{
id: 2
infoPess:
nome: 'Celular'
categoria: 'Produto'
relevancia: 1
linkMockup: 'dsadlkasdksajdasld'
linkPrototipo: 'xsdwqdeqwdsacxdb'
status: 'Presquisa'
subStatus: 'Concluído'
analista: 'Renato'
desenvolvedor: 'Renato'
tarefas: 'dasdlkçjas'
nomeComentario: 'David'
comentario: [
{
id: 0
msg: 'O dasdsa representa!'
nomeComentario: 'CREF'
}
]
}
{
id: 3
infoPess:
nome: 'Carteira'
categoria: 'Compras'
relevancia: 1
linkMockup: 'lçejççjjçljjjk'
linkPrototipo: 'xxxxxxxxxxç'
status: 'Mockup'
subStatus: 'Concluído'
analista: 'David'
desenvolvedor: 'David'
tarefas: 'lkçklkçlk'
nomeComentario: 'David'
comentario: [
{
id: 0
msg: 'O CREF não !'
nomeComentario: 'Renato'
}
]
}
]
func
]
.filter "scFilter", () ->
(collection, search) ->
if search
regexp = createAccentRegexp(search)
doesMatch = (txt) ->
(''+txt).match(regexp)
collection.filter (el) ->
if typeof el == 'object'
return true for att, value of el when (typeof value == 'string') && doesMatch(value)
doesMatch(el)
false
else
collection
menu =
w: $(window)
topBar: $('#top-bar')
topBarContent: $('#top-bar-content')
init: ->
@setTopBarHeight()
setTopBarHeight: ->
@topBar.css 'height', @topBarContent[0].offsetHeight
menu.init()
menu.w.resize -> menu.setTopBarHeight()
<script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
html {width: 100%}
body {width: 100%}
body ul.sc-accordion>li>.sc-accordion-head>*.title .description {
font-size: .8em;
font-weight: normal;
display: block;
cursor: pointer;
}
.accmod {
padding: 0.2em !important;
}
.header-bar {
background: #244560;
}
<link href="http://staging.seucondominio.com.br/assets/prototype-18ad8b3faa305cd2008247a0a466490d.css" rel="stylesheet" />
<link href="http://codepen.io/dev6-seucondominio/pen/avpxNZ.css" rel="stylesheet" />
<link href="http://codepen.io/dev6-seucondominio/pen/gaXWjX.css" rel="stylesheet" />
@2947721120
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment