diff --git a/ui/public/assets/scripts/home.js b/ui/public/assets/scripts/home.js index 8cbe3d2..382b948 100644 --- a/ui/public/assets/scripts/home.js +++ b/ui/public/assets/scripts/home.js @@ -210,29 +210,38 @@ class TipoCategoria { } } const cuentas = { - id: 'cuentas', + id: '#cuentas', balance: 0, tipos: [], tipos_categorias: [], + build: function() { + return { + parent: (segment) => { + const tr = $('').append( + $('').attr('colspan', 3).html('Cuenta') + ) + $.each(this.tipos, (i, el) => { + tr.append( + $('').attr('class', 'right aligned').css('color', '#' + el.color).html(el.descripcion) + ) + }) + const table = $('
').attr('class', 'ui striped table').append( + $('').append(tr) + ) + const parent = $('') + table.append(parent) + segment.append(table) + return parent + } + } + }, get: function() { return { parent: () => { - let parent = $('#' + this.id) + const segment = $(this.id) + let parent = segment.find('tbody') if (parent.length === 0) { - const tr = $('').append( - $('').attr('colspan', 3).html('Cuenta') - ) - $.each(this.tipos, (i, el) => { - tr.append( - $('').attr('class', 'right aligned').css('color', '#' + el.color).html(el.descripcion) - ) - }) - const table = $('
').attr('class', 'ui striped table').append( - $('').append(tr) - ) - parent = $('').attr('id', this.id) - table.append(parent) - $('h1.header').after(table) + parent = this.build().parent(segment) } return parent }, diff --git a/ui/public/assets/scripts/tipos_categorias.list.js b/ui/public/assets/scripts/tipos_categorias.list.js index 51c72fd..815a194 100644 --- a/ui/public/assets/scripts/tipos_categorias.list.js +++ b/ui/public/assets/scripts/tipos_categorias.list.js @@ -90,32 +90,37 @@ const tipos_categorias = { this.draw() }) }, - getParent: function() { - let parent = $(this.id).find('tbody') - if (parent.length === 0) { - const table = $('
').attr('class', 'ui table').append( - $('').append( - $('').append( - $('').attr('class', 'twelve wide').html('Tipo Categoría') - ).append( - $('').attr('class', 'two wide').html('Activo') - ).append( - $('').attr('class', 'two wide right aligned').append( - $('').attr('class', 'ui tiny green circular icon button').append( - $('').attr('class', 'plus icon') - ) + buildParent: function(segment) { + const table = $('
').attr('class', 'ui table').append( + $('').append( + $('').append( + $('').attr('class', 'twelve wide').html('Tipo Categoría') + ).append( + $('').attr('class', 'two wide').html('Activo') + ).append( + $('').attr('class', 'two wide right aligned').append( + $('').attr('class', 'ui tiny green circular icon button').append( + $('').attr('class', 'plus icon') ) ) ) ) - table.find('.ui.button').click((e) => { - e.preventDefault() - this.add() - return false - }) - parent = $('') - table.append(parent) - $(this.id).append(table) + ) + table.find('.ui.button').click((e) => { + e.preventDefault() + this.add() + return false + }) + parent = $('') + table.append(parent) + segment.append(table) + return parent + }, + getParent: function() { + const segment = $(this.id) + let parent = segment.find('tbody') + if (parent.length === 0) { + parent = this.buildParent(segment) } return parent }, diff --git a/ui/public/assets/scripts/tipos_cuentas.list.js b/ui/public/assets/scripts/tipos_cuentas.list.js index ea739e9..40d33cd 100644 --- a/ui/public/assets/scripts/tipos_cuentas.list.js +++ b/ui/public/assets/scripts/tipos_cuentas.list.js @@ -55,6 +55,7 @@ class TipoCuenta { const tipos_cuentas = { id: '#tipos_cuentas', tipos: [], + modal: null, getTipos: function() { this.tipos = [] return sendGet(_urls.api + '/tipos/cuentas').then((data) => { diff --git a/ui/public/assets/scripts/uploads.list.js b/ui/public/assets/scripts/uploads.list.js index 012618d..5251968 100644 --- a/ui/public/assets/scripts/uploads.list.js +++ b/ui/public/assets/scripts/uploads.list.js @@ -57,31 +57,40 @@ const archivos = { add: null, edit: null }, - get: function() { + build: function() { return { - parent: () => { - let parent = $(this.id).find('tbody') - if (parent.length === 0) { - const table = $('
').attr('class', 'ui striped table').append( - $('').append( - $('').append( - $('').html('Archivo') - ).append( - $('').attr('class', 'right aligned').append( - $('').attr('class', 'ui tiny green circular icon button').append( - $('').attr('class', 'plus icon') - ).click((e) => { - e.preventDefault() - this.add() - return false - }) - ) + parent: (segment) => { + const table = $('
').attr('class', 'ui striped table').append( + $('').append( + $('').append( + $('').html('Archivo') + ).append( + $('').attr('class', 'right aligned').append( + $('').attr('class', 'ui tiny green circular icon button').append( + $('').attr('class', 'plus icon') + ).click((e) => { + e.preventDefault() + this.add() + return false + }) ) ) ) - parent = $('') - table.append(parent) - $(this.id).append(table) + ) + const parent = $('') + table.append(parent) + segment.append(table) + return parent + } + } + }, + get: function() { + return { + parent: () => { + const segment = $(this.id) + let parent = segment.find('tbody') + if (parent.length === 0) { + parent = this.build().parent(segment) } return parent }, diff --git a/ui/resources/views/categorias/base.blade.php b/ui/resources/views/categorias/base.blade.php index 4b14c94..2146949 100644 --- a/ui/resources/views/categorias/base.blade.php +++ b/ui/resources/views/categorias/base.blade.php @@ -8,7 +8,7 @@ Categorías @endif -
+
@yield('categorias_content')
@endsection diff --git a/ui/resources/views/categorias/tipos/base.blade.php b/ui/resources/views/categorias/tipos/base.blade.php index a1a0944..49d6c00 100644 --- a/ui/resources/views/categorias/tipos/base.blade.php +++ b/ui/resources/views/categorias/tipos/base.blade.php @@ -8,7 +8,7 @@ Tipos Categoría @endif -
+
@yield('tipos_categorias_content')
@endsection diff --git a/ui/resources/views/config/list.blade.php b/ui/resources/views/config/list.blade.php index 4499e0f..408f8df 100644 --- a/ui/resources/views/config/list.blade.php +++ b/ui/resources/views/config/list.blade.php @@ -1 +1,8 @@ @extends('config.base') + +@section('config_content') +

Configuraciones Generales

+
+ +
+@endsection diff --git a/ui/resources/views/cuentas/base.blade.php b/ui/resources/views/cuentas/base.blade.php index c8d6d8d..6d20fd5 100644 --- a/ui/resources/views/cuentas/base.blade.php +++ b/ui/resources/views/cuentas/base.blade.php @@ -8,7 +8,7 @@ Cuentas @endif -
+
@yield('cuentas_content')
@endsection diff --git a/ui/resources/views/home.blade.php b/ui/resources/views/home.blade.php index a96590e..9690e6a 100644 --- a/ui/resources/views/home.blade.php +++ b/ui/resources/views/home.blade.php @@ -4,6 +4,7 @@

Contabilidad

+
@endsection @push('scripts') diff --git a/ui/resources/views/uploads/base.blade.php b/ui/resources/views/uploads/base.blade.php index 731187e..9c0a995 100644 --- a/ui/resources/views/uploads/base.blade.php +++ b/ui/resources/views/uploads/base.blade.php @@ -8,7 +8,7 @@ Archivos @endif -
+
@yield('uploads_content')
@endsection diff --git a/ui/resources/views/uploads/list.blade.php b/ui/resources/views/uploads/list.blade.php index 6addb02..675f3f7 100644 --- a/ui/resources/views/uploads/list.blade.php +++ b/ui/resources/views/uploads/list.blade.php @@ -1,6 +1,7 @@ @extends('uploads.base') @section('uploads_content') +