├── README.md ├── app ├── public │ ├── favicon.ico │ ├── fonts │ │ ├── fontello.eot │ │ ├── fontello.ttf │ │ ├── fontello.woff │ │ └── fontello.woff2 │ ├── img │ │ ├── glyphicons-halflings.png │ │ └── glyphicons-halflings-white.png │ ├── lib │ │ ├── smoothness │ │ │ └── images │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ └── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ ├── bootstrap │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ └── npm.js │ │ ├── bootstrap-3.1.1-dist │ │ │ └── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── bootstrap-table │ │ │ ├── extensions │ │ │ │ ├── group-by-v2 │ │ │ │ │ └── bootstrap-table-group-by.css │ │ │ │ ├── sticky-header │ │ │ │ │ ├── bootstrap-table-sticky-header.css │ │ │ │ │ └── bootstrap-table-sticky-header.min.js │ │ │ │ ├── i18n-enhance │ │ │ │ │ ├── bootstrap-table-i18n-enhance.min.js │ │ │ │ │ └── bootstrap-table-i18n-enhance.js │ │ │ │ ├── natural-sorting │ │ │ │ │ ├── bootstrap-table-natural-sorting.min.js │ │ │ │ │ └── bootstrap-table-natural-sorting.js │ │ │ │ ├── flat-json │ │ │ │ │ ├── bootstrap-table-flat-json.min.js │ │ │ │ │ └── bootstrap-table-flat-json.js │ │ │ │ ├── reorder-rows │ │ │ │ │ ├── bootstrap-table-reorder-rows.css │ │ │ │ │ └── bootstrap-table-reorder-rows.min.js │ │ │ │ ├── key-events │ │ │ │ │ ├── bootstrap-table-key-events.min.js │ │ │ │ │ └── bootstrap-table-key-events.js │ │ │ │ ├── resizable │ │ │ │ │ ├── bootstrap-table-resizable.min.js │ │ │ │ │ └── bootstrap-table-resizable.js │ │ │ │ ├── filter │ │ │ │ │ ├── bootstrap-table-filter.min.js │ │ │ │ │ └── bootstrap-table-filter.js │ │ │ │ ├── multiple-search │ │ │ │ │ ├── bootstrap-table-multiple-search.min.js │ │ │ │ │ └── bootstrap-table-multiple-search.js │ │ │ │ ├── mobile │ │ │ │ │ └── bootstrap-table-mobile.min.js │ │ │ │ ├── multi-column-toggle │ │ │ │ │ └── bootstrap-table-multi-toggle.min.js │ │ │ │ ├── copy-rows │ │ │ │ │ └── bootstrap-table-copy-rows.min.js │ │ │ │ ├── angular │ │ │ │ │ └── bootstrap-table-angular.min.js │ │ │ │ ├── export │ │ │ │ │ └── bootstrap-table-export.min.js │ │ │ │ ├── reorder-columns │ │ │ │ │ └── bootstrap-table-reorder-columns.min.js │ │ │ │ ├── editable │ │ │ │ │ └── bootstrap-table-editable.min.js │ │ │ │ └── group-by │ │ │ │ │ └── bootstrap-table-group-by.min.js │ │ │ └── locale │ │ │ │ ├── bootstrap-table-vi-VN.min.js │ │ │ │ ├── bootstrap-table-fr-BE.min.js │ │ │ │ ├── bootstrap-table-el-GR.min.js │ │ │ │ ├── bootstrap-table-es-AR.min.js │ │ │ │ ├── bootstrap-table-es-MX.min.js │ │ │ │ ├── bootstrap-table-ko-KR.min.js │ │ │ │ ├── bootstrap-table-da-DK.min.js │ │ │ │ ├── bootstrap-table-nb-NO.min.js │ │ │ │ ├── bootstrap-table-ur-PK.min.js │ │ │ │ ├── bootstrap-table-sv-SE.min.js │ │ │ │ ├── bootstrap-table-zh-TW.min.js │ │ │ │ ├── bootstrap-table-pl-PL.min.js │ │ │ │ ├── bootstrap-table-th-TH.min.js │ │ │ │ ├── bootstrap-table-uk-UA.min.js │ │ │ │ ├── bootstrap-table-sk-SK.min.js │ │ │ │ ├── bootstrap-table-de-DE.min.js │ │ │ │ ├── bootstrap-table-it-IT.min.js │ │ │ │ ├── bootstrap-table-ja-JP.min.js │ │ │ │ ├── bootstrap-table-ar-SA.min.js │ │ │ │ ├── bootstrap-table-es-SP.min.js │ │ │ │ ├── bootstrap-table-ru-RU.min.js │ │ │ │ ├── bootstrap-table-tr-TR.min.js │ │ │ │ ├── bootstrap-table-af-ZA.min.js │ │ │ │ ├── bootstrap-table-es-CR.min.js │ │ │ │ ├── bootstrap-table-es-NI.min.js │ │ │ │ ├── bootstrap-table-he-IL.min.js │ │ │ │ ├── bootstrap-table-pt-BR.min.js │ │ │ │ ├── bootstrap-table-zh-CN.min.js │ │ │ │ ├── bootstrap-table-fr-FR.min.js │ │ │ │ ├── bootstrap-table-fa-IR.min.js │ │ │ │ ├── bootstrap-table-ka-GE.min.js │ │ │ │ ├── bootstrap-table-hu-HU.min.js │ │ │ │ ├── bootstrap-table-ca-ES.min.js │ │ │ │ ├── bootstrap-table-cs-CZ.min.js │ │ │ │ ├── bootstrap-table-hr-HR.min.js │ │ │ │ ├── bootstrap-table-ro-RO.min.js │ │ │ │ ├── bootstrap-table-es-ES.min.js │ │ │ │ ├── bootstrap-table-et-EE.min.js │ │ │ │ ├── bootstrap-table-pt-PT.min.js │ │ │ │ ├── bootstrap-table-ms-MY.min.js │ │ │ │ ├── bootstrap-table-en-US.min.js │ │ │ │ ├── bootstrap-table-vi-VN.js │ │ │ │ ├── bootstrap-table-fr-BE.js │ │ │ │ ├── bootstrap-table-el-GR.js │ │ │ │ ├── bootstrap-table-nl-NL.min.js │ │ │ │ ├── bootstrap-table-es-AR.js │ │ │ │ ├── bootstrap-table-de-DE.js │ │ │ │ ├── bootstrap-table-es-MX.js │ │ │ │ ├── bootstrap-table-ko-KR.js │ │ │ │ ├── bootstrap-table-nb-NO.js │ │ │ │ ├── bootstrap-table-ur-PK.js │ │ │ │ ├── bootstrap-table-da-DK.js │ │ │ │ ├── bootstrap-table-sv-SE.js │ │ │ │ ├── bootstrap-table-pl-PL.js │ │ │ │ ├── bootstrap-table-th-TH.js │ │ │ │ ├── bootstrap-table-sk-SK.js │ │ │ │ ├── bootstrap-table-uk-UA.js │ │ │ │ ├── bootstrap-table-zh-TW.js │ │ │ │ ├── bootstrap-table-ru-RU.js │ │ │ │ ├── bootstrap-table-ar-SA.js │ │ │ │ ├── bootstrap-table-es-SP.js │ │ │ │ ├── bootstrap-table-tr-TR.js │ │ │ │ ├── bootstrap-table-af-ZA.js │ │ │ │ ├── bootstrap-table-ja-JP.js │ │ │ │ ├── bootstrap-table-es-CR.js │ │ │ │ ├── bootstrap-table-es-NI.js │ │ │ │ ├── bootstrap-table-he-IL.js │ │ │ │ ├── bootstrap-table-ka-GE.js │ │ │ │ ├── bootstrap-table-fa-IR.js │ │ │ │ ├── bootstrap-table-pt-BR.js │ │ │ │ ├── bootstrap-table-it-IT.js │ │ │ │ ├── bootstrap-table-fr-FR.js │ │ │ │ ├── bootstrap-table-hu-HU.js │ │ │ │ ├── bootstrap-table-et-EE.js │ │ │ │ ├── bootstrap-table-ro-RO.js │ │ │ │ ├── bootstrap-table-zh-CN.js │ │ │ │ ├── bootstrap-table-es-ES.js │ │ │ │ ├── bootstrap-table-pt-PT.js │ │ │ │ ├── bootstrap-table-cs-CZ.js │ │ │ │ ├── bootstrap-table-ms-MY.js │ │ │ │ ├── bootstrap-table-ca-ES.js │ │ │ │ ├── bootstrap-table-hr-HR.js │ │ │ │ ├── bootstrap-table-en-US.js │ │ │ │ └── bootstrap-table-nl-NL.js │ │ └── jquerymx-3.2.custom.min.js │ ├── js │ │ ├── sendemail.js │ │ └── login.js │ └── css │ │ └── fontello-animation.css ├── server │ ├── views │ │ ├── layout_pdf.pug │ │ ├── 404.pug │ │ ├── modals │ │ │ ├── errors_client.pug │ │ │ ├── reset-password.pug │ │ │ ├── confirm.pug │ │ │ ├── alert.pug │ │ │ ├── lost-password.pug │ │ │ └── errors.pug │ │ ├── reset.pug │ │ ├── partners_dett.pug │ │ ├── actions_tw.pug │ │ ├── sidebar_settings.pug │ │ ├── actions_fb.pug │ │ ├── home.pug │ │ ├── login.pug │ │ ├── sidebar_accounting.pug │ │ ├── accounts.pug │ │ ├── layout_nologged.pug │ │ ├── sidebar_partners.pug │ │ └── customers.pug │ ├── routes │ │ ├── logout.js │ │ ├── home.js │ │ ├── errors.js │ │ ├── changedb.js │ │ ├── ajax.js │ │ ├── reset-password.js │ │ ├── lost-password.js │ │ ├── users.js │ │ ├── send-email.js │ │ ├── api.js │ │ ├── offers.js │ │ ├── invoices.js │ │ ├── settings.js │ │ └── startup.js │ ├── helpers │ │ ├── i18n-admin.js │ │ └── email-dispatcher.js │ ├── setup.js │ └── config.js └── common │ └── accounting.js ├── .gitignore ├── package.json └── app-example.js /README.md: -------------------------------------------------------------------------------- 1 | # AVnode-Members-Tools 2 | Tools for the AVnode Network Members 3 | -------------------------------------------------------------------------------- /app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/favicon.ico -------------------------------------------------------------------------------- /app/public/fonts/fontello.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/fonts/fontello.eot -------------------------------------------------------------------------------- /app/public/fonts/fontello.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/fonts/fontello.ttf -------------------------------------------------------------------------------- /app/public/fonts/fontello.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/fonts/fontello.woff -------------------------------------------------------------------------------- /app/public/fonts/fontello.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/fonts/fontello.woff2 -------------------------------------------------------------------------------- /app/public/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /app/public/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /app/server/views/layout_pdf.pug: -------------------------------------------------------------------------------- 1 | html 2 | head 3 | title= title 4 | include print_style 5 | !=style 6 | body 7 | .print_container 8 | block content -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /app/public/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /app/public/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /app/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /app/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | err.log 4 | forever.log 5 | node_modules 6 | out.log 7 | app.js 8 | app/public/css/style.css 9 | warehouse/accounts/* 10 | package-lock.json 11 | dumps/* 12 | -------------------------------------------------------------------------------- /app/public/lib/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /app/public/lib/bootstrap-3.1.1-dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/bootstrap-3.1.1-dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /app/public/lib/bootstrap-3.1.1-dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/bootstrap-3.1.1-dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /app/public/lib/bootstrap-3.1.1-dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gianlucadelgobbo/mongo-invoices/HEAD/app/public/lib/bootstrap-3.1.1-dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.css: -------------------------------------------------------------------------------- 1 | .bootstrap-table .table > tbody > tr.groupBy { 2 | cursor: pointer; 3 | } 4 | 5 | .bootstrap-table .table > tbody > tr.groupBy.expanded { 6 | 7 | } -------------------------------------------------------------------------------- /app/server/routes/logout.js: -------------------------------------------------------------------------------- 1 | exports.get = function get(req, res) { 2 | res.clearCookie('user'); 3 | res.clearCookie('pass'); 4 | res.clearCookie('role'); 5 | req.session.destroy(function(e){ 6 | res.redirect('/'); 7 | }); 8 | }; 9 | -------------------------------------------------------------------------------- /app/server/views/404.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | block content 3 | .cnt 4 | .col-sm-4.col-sm-offset-4.cnt#login-container 5 | form(method="post")#login-form.well 6 | h1.page-title="404 Content not found" 7 | p.subheading=__("I'm sorry, the page or resource you are searching for is currently unavailable.") 8 | -------------------------------------------------------------------------------- /app/server/routes/home.js: -------------------------------------------------------------------------------- 1 | var CT = require('../helpers/country-list'); 2 | var helpers = require('../helpers/helpers.js'); 3 | 4 | exports.get = function get(req, res) { 5 | helpers.canIseeThis(req, function (auth) { 6 | if (auth) { 7 | res.render('home', { title: __("Home"), countries : CT, udata : req.session.user }); 8 | } else { 9 | res.redirect('/?from='+req.url); 10 | } 11 | }); 12 | }; 13 | -------------------------------------------------------------------------------- /app/server/routes/errors.js: -------------------------------------------------------------------------------- 1 | var helpers = require('./../helpers/helpers'); 2 | 3 | exports.get404 = function get(req, res) { 4 | helpers.canIseeThis(req, function (auth) { 5 | if (auth) { 6 | res.render('404', { title: "Page Not Found", udata : req.session.user}); 7 | } else { 8 | res.redirect('/?from='+req.url); 9 | } 10 | }); 11 | }; 12 | exports.get = function get(req, res) { 13 | helpers.canIseeThis(req, function (auth) { 14 | res.redirect('/'); 15 | }); 16 | }; -------------------------------------------------------------------------------- /app/server/views/modals/errors_client.pug: -------------------------------------------------------------------------------- 1 | 2 | .modal-error.modal.fade 3 | .modal-dialog 4 | .modal-content 5 | div.modal-header 6 | button.close(data-dismiss='modal') x 7 | h4.modal-title=__("Error") 8 | div.modal-body 9 | p.subheading=__("It looks like there was a problem") 10 | ul 11 | div.modal-footer 12 | button(data-dismiss="modal").cancel.btn=__("Cancel") 13 | button(data-dismiss="modal")#ok.btn.btn-danger=__("OK") 14 | button(data-dismiss="modal")#force.btn.btn-confirm=__("SAVE IT ANYWAY") -------------------------------------------------------------------------------- /app/server/views/modals/reset-password.pug: -------------------------------------------------------------------------------- 1 | 2 | #set-password.modal-single-input.modal.fade 3 | .modal-dialog 4 | .modal-content 5 | div.modal-header 6 | h3 Reset Password 7 | div.modal-body 8 | form( method="post")#set-password-form.wellspan= 9 | p Please enter your new password 10 | input(type="password", name="pass", id='pass-tf')span=.required 11 | button(type="submit")#submit.btn.btn-primary Submit 12 | div.alert.alert-error.hide 13 | button(data-dismiss="alert").close 14 | div.modal-footer -------------------------------------------------------------------------------- /app/public/lib/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /app/server/routes/changedb.js: -------------------------------------------------------------------------------- 1 | var helpers = require('./../helpers/helpers'); 2 | 3 | exports.get = function get(req, res) { 4 | helpers.canIseeThis(req, function (auth) { 5 | if (auth) { 6 | var redirect = req.query.from ? req.query.from : "/"+global.settings.dbName+"/home/"; 7 | res.redirect(redirect); 8 | } else { 9 | res.clearCookie('user'); 10 | res.clearCookie('pass'); 11 | res.clearCookie('role'); 12 | req.session.destroy(function(e){ 13 | res.redirect('/'); 14 | }); 15 | } 16 | }); 17 | }; 18 | -------------------------------------------------------------------------------- /app/server/helpers/i18n-admin.js: -------------------------------------------------------------------------------- 1 | var i18nAdmin = require('i18n'); 2 | 3 | i18nAdmin.init = function(callback) { 4 | i18nAdmin.configure({ 5 | // setup some locales - other locales default to en silently 6 | locales: global.settings.defaultLocales, 7 | directory: global.settings.root_path + '/locales', 8 | defaultLocale: global.settings.defaultLocale, 9 | // where to register __() and __n() to, might be "global" if you know what you are doing 10 | register: global 11 | }); 12 | callback(); 13 | }; 14 | 15 | module.exports = i18nAdmin; 16 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.css: -------------------------------------------------------------------------------- 1 | /** 2 | * @author vincent loh 3 | * @version: v1.0.0 4 | * https://github.com/vinzloh/bootstrap-table/ 5 | * Sticky header for bootstrap-table 6 | */ 7 | 8 | .fix-sticky { 9 | position: fixed; 10 | z-index: 100; 11 | } 12 | .fix-sticky thead { 13 | background: #fff; 14 | } 15 | 16 | .fix-sticky thead th, 17 | .fix-sticky thead th:first-child { 18 | border-left: 0; 19 | border-right: 0; 20 | border-bottom: 1px solid #eee; 21 | border-radius: 0; 22 | } 23 | -------------------------------------------------------------------------------- /app/server/routes/ajax.js: -------------------------------------------------------------------------------- 1 | var CT = require('../helpers/country-list'); 2 | var helpers = require('../helpers/helpers.js'); 3 | 4 | exports.drawFBPostActivities = function drawFBPostActivities(req, res) { 5 | console.log("drawFBPostActivities"); 6 | //delete req.body.partners_channels; 7 | console.log(req.body); 8 | res.render('actions_fb', { results:req.body }); 9 | }; 10 | exports.drawTWPostActivities = function drawTWPostActivities(req, res) { 11 | console.log("drawTWPostActivities"); 12 | delete req.body.partners_channels; 13 | //console.log(req.body); 14 | res.render('actions_tw', { results:req.body }); 15 | }; 16 | -------------------------------------------------------------------------------- /app/server/views/modals/confirm.pug: -------------------------------------------------------------------------------- 1 | 2 | .modal-confirm.modal.fade 3 | .modal-dialog 4 | .modal-content 5 | div.modal-header 6 | button.close(data-dismiss='modal') x 7 | - if(typeof __ === 'function') 8 | h3=__("Success") 9 | - else 10 | h3="Success" 11 | div.modal-body 12 | p 13 | div.modal-footer 14 | - if(typeof __ === 'function') 15 | button(data-dismiss="modal").cancel.btn=__("Cancel") 16 | button(data-dismiss="modal")#ok.btn.btn-warning=__("OK") 17 | - else 18 | button(data-dismiss="modal").cancel.btn="Cancel" 19 | button(data-dismiss="modal")#ok.btn.btn-warning="OK" -------------------------------------------------------------------------------- /app/server/views/modals/alert.pug: -------------------------------------------------------------------------------- 1 | 2 | .modal-alert.modal.fade 3 | .modal-dialog 4 | .modal-content 5 | .modal-header 6 | button.close(data-dismiss='modal') x 7 | - if(typeof __ === 'function') 8 | h4.modal-title=__("Warning") 9 | - else 10 | h4.modal-title="Warning" 11 | .modal-body 12 | p 13 | .modal-footer 14 | - if(typeof __ === 'function') 15 | button(data-dismiss="modal").cancel.btn=__("Cancel") 16 | button(data-dismiss="modal")#ok.btn.btn-warning=__("OK") 17 | - else 18 | button(data-dismiss="modal").cancel.btn="Cancel" 19 | button(data-dismiss="modal")#ok.btn.btn-warning="OK" 20 | -------------------------------------------------------------------------------- /app/server/views/reset.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | block content 3 | div.col-sm-4.col-sm-offset-4#login-container 4 | form(method="post")#set-password-form.well 5 | h1.page-title="Reset Password" 6 | p.subheading=__("Please enter your new password") 7 | - if (typeof result!='undefined') 8 | .alert.alert-success 9 | h4=__("Password updated") 10 | p!=__("Please log in")+" "+__("log in")+"" 11 | - else 12 | .form-group 13 | label Password 14 | input(type="password", name="pass").form-control.required 15 | input(type="hidden", name="email", value=email) 16 | button(type="submit").btn.btn-primary=__("Reset") 17 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-vi-VN.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["vi-VN"]={formatLoadingMessage:function(){return"Đang tải..."},formatRecordsPerPage:function(a){return a+" bản ghi mỗi trang"},formatShowingRows:function(a,b,c){return"Hiển thị từ trang "+a+" đến "+b+" của "+c+" bảng ghi"},formatSearch:function(){return"Tìm kiếm"},formatNoMatches:function(){return"Không có dữ liệu"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["vi-VN"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-fr-BE.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["fr-BE"]={formatLoadingMessage:function(){return"Chargement en cours..."},formatRecordsPerPage:function(a){return a+" entrées par page"},formatShowingRows:function(a,b,c){return"Affiche de"+a+" à "+b+" sur "+c+" lignes"},formatSearch:function(){return"Recherche"},formatNoMatches:function(){return"Pas de fichiers trouvés"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["fr-BE"])}(jQuery); -------------------------------------------------------------------------------- /app/server/views/modals/lost-password.pug: -------------------------------------------------------------------------------- 1 | 2 | #get-credentials.modal-single-input.modal.fade 3 | .modal-dialog 4 | .modal-content 5 | div.modal-header 6 | button.close(data-dismiss='modal') x 7 | h3="Retrieve Password" 8 | div.modal-body 9 | form( method="post")#get-credentials-form.form-inline 10 | p="Please enter the email address associated with your account" 11 | input(type="text", name="email", id='email-tf').form-control 12 | button(type="submit")#submit.btn.btn-primary="Submit" 13 | button(data-dismiss="modal")#cancel.btn="Cancel" 14 | div.alert.alert-error.hide 15 | button(data-dismiss="alert").close 16 | div.modal-footer -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=a.fn.bootstrapTable.Constructor;b.prototype.changeTitle=function(b){a.each(this.options.columns,function(c,d){a.each(d,function(a,c){c.field&&(c.title=b[c.field])})}),this.initHeader(),this.initBody(),this.initToolbar()},b.prototype.changeLocale=function(a){this.options.locale=a,this.initLocale(),this.initPagination()},a.fn.bootstrapTable.methods.push("changeTitle"),a.fn.bootstrapTable.methods.push("changeLocale")}(jQuery); -------------------------------------------------------------------------------- /app/server/views/partners_dett.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | block content 3 | .row-offcanvas.row-offcanvas-left.cnt 4 | include sidebar_partners 5 | #main 6 | .col-md-12 7 | .row 8 | .col-sm-6 9 | h1.page-title=__("Partner") + ": " + result.brand 10 | .col-sm-6 11 | .pull-right 12 | a.btn.btn-success(href="/" + global.settings.dbName + "/partners/partner/" + result._id + "/edit/")=__("Edit") 13 | !=" " 14 | a.btn.btn-danger(href="/" + global.settings.dbName + "/partners/partner/" + result._id + "/?del=1")=__("Delete") 15 | hr 16 | pre=JSON.stringify(result, null, '\t') 17 | 18 | -------------------------------------------------------------------------------- /app/server/routes/reset-password.js: -------------------------------------------------------------------------------- 1 | var DB = require('./../helpers/db-manager'); 2 | 3 | exports.get = function get(req, res) { 4 | res.render('reset', { title: __("Reset Password"), email:req.query.e }); 5 | }; 6 | 7 | exports.post = function post(req, res) { 8 | var nPass = req.body.pass; 9 | // retrieve the user's email from the session to lookup their account and reset password // 10 | var email = new Buffer(req.body.email, 'base64').toString('ascii'); 11 | // destory the session immediately after retrieving the stored email // 12 | req.session.destroy(); 13 | DB.setPassword(email, nPass, function(o){ 14 | res.render('reset', { title: __("Reset Password"), result:o }); 15 | }); 16 | }; 17 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-el-GR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["el-GR"]={formatLoadingMessage:function(){return"Φορτώνει, παρακαλώ περιμένετε..."},formatRecordsPerPage:function(a){return a+" αποτελέσματα ανά σελίδα"},formatShowingRows:function(a,b,c){return"Εμφανίζονται από την "+a+" ως την "+b+" από σύνολο "+c+" σειρών"},formatSearch:function(){return"Αναζητήστε"},formatNoMatches:function(){return"Δεν βρέθηκαν αποτελέσματα"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["el-GR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-AR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["es-AR"]={formatLoadingMessage:function(){return"Cargando, espere por favor..."},formatRecordsPerPage:function(a){return a+" registros por página"},formatShowingRows:function(a,b,c){return"Mostrando "+a+" a "+b+" de "+c+" filas"},formatSearch:function(){return"Buscar"},formatNoMatches:function(){return"No se encontraron registros"},formatAllRows:function(){return"Todo"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["es-AR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-MX.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["es-MX"]={formatLoadingMessage:function(){return"Cargando, espere por favor..."},formatRecordsPerPage:function(a){return a+" registros por página"},formatShowingRows:function(a,b,c){return"Mostrando "+a+" a "+b+" de "+c+" filas"},formatSearch:function(){return"Buscar"},formatNoMatches:function(){return"No se encontraron registros"},formatAllRows:function(){return"Todo"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["es-MX"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/natural-sorting/bootstrap-table-natural-sorting.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | function alphanum(a,b){function c(a){for(var b,c,d=[],e=0,f=-1,g=0;b=(c=a.charAt(e++)).charCodeAt(0);){var h=46===b||b>=48&&57>=b;h!==g&&(d[++f]="",g=h),d[f]+=c}return d}function d(a){return"number"==typeof a&&(a=""+a),a||(a=""),a}var e=c(d(a)),f=c(d(b));for(x=0;e[x]&&f[x];x++)if(e[x]!==f[x]){var g=Number(e[x]),h=Number(f[x]);return g==e[x]&&h==f[x]?g-h:e[x]>f[x]?1:-1}return e.length-f.length}function numericOnly(a,b){function c(a){return a=a.replace(new RegExp(/[^0-9]/g),""),parseInt(a,10)}return c(a)-c(b)} -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ko-KR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ko-KR"]={formatLoadingMessage:function(){return"데이터를 불러오는 중입니다..."},formatRecordsPerPage:function(a){return"페이지 당 "+a+"개 데이터 출력"},formatShowingRows:function(a,b,c){return"전체 "+c+"개 중 "+a+"~"+b+"번째 데이터 출력,"},formatSearch:function(){return"검색"},formatNoMatches:function(){return"조회된 데이터가 없습니다."},formatRefresh:function(){return"새로 고침"},formatToggle:function(){return"전환"},formatColumns:function(){return"컬럼 필터링"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ko-KR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-da-DK.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["da-DK"]={formatLoadingMessage:function(){return"Indlæser, vent venligst..."},formatRecordsPerPage:function(a){return a+" poster pr side"},formatShowingRows:function(a,b,c){return"Viser "+a+" til "+b+" af "+c+" rækker"},formatSearch:function(){return"Søg"},formatNoMatches:function(){return"Ingen poster fundet"},formatRefresh:function(){return"Opdater"},formatToggle:function(){return"Skift"},formatColumns:function(){return"Kolonner"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["da-DK"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-nb-NO.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["nb-NO"]={formatLoadingMessage:function(){return"Oppdaterer, vennligst vent..."},formatRecordsPerPage:function(a){return a+" poster pr side"},formatShowingRows:function(a,b,c){return"Viser "+a+" til "+b+" av "+c+" rekker"},formatSearch:function(){return"Søk"},formatNoMatches:function(){return"Ingen poster funnet"},formatRefresh:function(){return"Oppdater"},formatToggle:function(){return"Endre"},formatColumns:function(){return"Kolonner"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["nb-NO"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ur-PK.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ur-PK"]={formatLoadingMessage:function(){return"براۓ مہربانی انتظار کیجئے"},formatRecordsPerPage:function(a){return a+" ریکارڈز فی صفہ "},formatShowingRows:function(a,b,c){return"دیکھیں "+a+" سے "+b+" کے "+c+"ریکارڈز"},formatSearch:function(){return"تلاش"},formatNoMatches:function(){return"کوئی ریکارڈ نہیں ملا"},formatRefresh:function(){return"تازہ کریں"},formatToggle:function(){return"تبدیل کریں"},formatColumns:function(){return"کالم"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ur-PK"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-sv-SE.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["sv-SE"]={formatLoadingMessage:function(){return"Laddar, vänligen vänta..."},formatRecordsPerPage:function(a){return a+" rader per sida"},formatShowingRows:function(a,b,c){return"Visa "+a+" till "+b+" av "+c+" rader"},formatSearch:function(){return"Sök"},formatNoMatches:function(){return"Inga matchande resultat funna."},formatRefresh:function(){return"Uppdatera"},formatToggle:function(){return"Skifta"},formatColumns:function(){return"kolumn"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["sv-SE"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-zh-TW.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["zh-TW"]={formatLoadingMessage:function(){return"正在努力地載入資料,請稍候……"},formatRecordsPerPage:function(a){return"每頁顯示 "+a+" 項記錄"},formatShowingRows:function(a,b,c){return"顯示第 "+a+" 到第 "+b+" 項記錄,總共 "+c+" 項記錄"},formatSearch:function(){return"搜尋"},formatNoMatches:function(){return"沒有找到符合的結果"},formatPaginationSwitch:function(){return"隱藏/顯示分頁"},formatRefresh:function(){return"重新整理"},formatToggle:function(){return"切換"},formatColumns:function(){return"列"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["zh-TW"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-pl-PL.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["pl-PL"]={formatLoadingMessage:function(){return"Ładowanie, proszę czekać..."},formatRecordsPerPage:function(a){return a+" rekordów na stronę"},formatShowingRows:function(a,b,c){return"Wyświetlanie rekordów od "+a+" do "+b+" z "+c},formatSearch:function(){return"Szukaj"},formatNoMatches:function(){return"Niestety, nic nie znaleziono"},formatRefresh:function(){return"Odśwież"},formatToggle:function(){return"Przełącz"},formatColumns:function(){return"Kolumny"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["pl-PL"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-th-TH.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["th-TH"]={formatLoadingMessage:function(){return"กำลังโหลดข้อมูล, กรุณารอสักครู่..."},formatRecordsPerPage:function(a){return a+" รายการต่อหน้า"},formatShowingRows:function(a,b,c){return"รายการที่ "+a+" ถึง "+b+" จากทั้งหมด "+c+" รายการ"},formatSearch:function(){return"ค้นหา"},formatNoMatches:function(){return"ไม่พบรายการที่ค้นหา !"},formatRefresh:function(){return"รีเฟรส"},formatToggle:function(){return"สลับมุมมอง"},formatColumns:function(){return"คอลัมน์"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["th-TH"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-uk-UA.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["uk-UA"]={formatLoadingMessage:function(){return"Завантаження, будь ласка, зачекайте..."},formatRecordsPerPage:function(a){return a+" записів на сторінку"},formatShowingRows:function(a,b,c){return"Показано з "+a+" по "+b+". Всього: "+c},formatSearch:function(){return"Пошук"},formatNoMatches:function(){return"Не знайдено жодного запису"},formatRefresh:function(){return"Оновити"},formatToggle:function(){return"Змінити"},formatColumns:function(){return"Стовпці"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["uk-UA"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-sk-SK.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["sk-SK"]={formatLoadingMessage:function(){return"Prosím čakajte ..."},formatRecordsPerPage:function(a){return a+" záznamov na stranu"},formatShowingRows:function(a,b,c){return"Zobrazená "+a+". - "+b+". položka z celkových "+c},formatSearch:function(){return"Vyhľadávanie"},formatNoMatches:function(){return"Nenájdená žiadna vyhovujúca položka"},formatRefresh:function(){return"Obnoviť"},formatToggle:function(){return"Prepni"},formatColumns:function(){return"Stĺpce"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["sk-SK"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-de-DE.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["de-DE"]={formatLoadingMessage:function(){return"Lade, bitte warten..."},formatRecordsPerPage:function(a){return a+" Einträge pro Seite"},formatShowingRows:function(a,b,c){return"Zeige "+a+" bis "+b+" von "+c+" Zeile"+(c>1?"n":"")},formatSearch:function(){return"Suchen"},formatNoMatches:function(){return"Keine passenden Ergebnisse gefunden"},formatRefresh:function(){return"Neu laden"},formatToggle:function(){return"Umschalten"},formatColumns:function(){return"Spalten"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["de-DE"])}(jQuery); -------------------------------------------------------------------------------- /app/server/views/modals/errors.pug: -------------------------------------------------------------------------------- 1 | 2 | .modal-error.modal.fade 3 | .modal-dialog 4 | .modal-content 5 | div.modal-header 6 | button.close(data-dismiss='modal') x 7 | - if(typeof __ === 'function') 8 | h4.modal-title=__("Error") 9 | - else 10 | h4.modal-title="Error" 11 | div.modal-body 12 | - if(typeof __ === 'function') 13 | p.subheading=__("It looks like there was a problem") 14 | - else 15 | p.subheading="It looks like there was a problem" 16 | ul 17 | div.modal-footer 18 | - if(typeof __ === 'function') 19 | button(data-dismiss="modal").cancel.btn=__("Cancel") 20 | button(data-dismiss="modal")#ok.btn.btn-warning=__("OK") 21 | - else 22 | button(data-dismiss="modal").cancel.btn="Cancel" 23 | button(data-dismiss="modal")#ok.btn.btn-warning="OK" 24 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-it-IT.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["it-IT"]={formatLoadingMessage:function(){return"Caricamento in corso..."},formatRecordsPerPage:function(a){return a+" elementi per pagina"},formatShowingRows:function(a,b,c){return"Pagina "+a+" di "+b+" ("+c+" elementi)"},formatSearch:function(){return"Cerca"},formatNoMatches:function(){return"Nessun elemento trovato"},formatRefresh:function(){return"Aggiorna"},formatToggle:function(){return"Alterna"},formatColumns:function(){return"Colonne"},formatAllRows:function(){return"Tutto"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["it-IT"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ja-JP.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ja-JP"]={formatLoadingMessage:function(){return"読み込み中です。少々お待ちください。"},formatRecordsPerPage:function(a){return"ページ当たり最大"+a+"件"},formatShowingRows:function(a,b,c){return"全"+c+"件から、"+a+"から"+b+"件目まで表示しています"},formatSearch:function(){return"検索"},formatNoMatches:function(){return"該当するレコードが見つかりません"},formatPaginationSwitch:function(){return"ページ数を表示・非表示"},formatRefresh:function(){return"更新"},formatToggle:function(){return"トグル"},formatColumns:function(){return"列"},formatAllRows:function(){return"すべて"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ja-JP"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ar-SA.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ar-SA"]={formatLoadingMessage:function(){return"جاري التحميل, يرجى الإنتظار..."},formatRecordsPerPage:function(a){return a+" سجل لكل صفحة"},formatShowingRows:function(a,b,c){return"الظاهر "+a+" إلى "+b+" من "+c+" سجل"},formatSearch:function(){return"بحث"},formatNoMatches:function(){return"لا توجد نتائج مطابقة للبحث"},formatPaginationSwitch:function(){return"إخفاءإظهار ترقيم الصفحات"},formatRefresh:function(){return"تحديث"},formatToggle:function(){return"تغيير"},formatColumns:function(){return"أعمدة"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ar-SA"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-SP.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["es-SP"]={formatLoadingMessage:function(){return"Cargando, por favor espera..."},formatRecordsPerPage:function(a){return a+" registros por página."},formatShowingRows:function(a,b,c){return a+" - "+b+" de "+c+" registros."},formatSearch:function(){return"Buscar"},formatNoMatches:function(){return"No se han encontrado registros."},formatRefresh:function(){return"Actualizar"},formatToggle:function(){return"Alternar"},formatColumns:function(){return"Columnas"},formatAllRows:function(){return"Todo"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["es-SP"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ru-RU.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ru-RU"]={formatLoadingMessage:function(){return"Пожалуйста, подождите, идёт загрузка..."},formatRecordsPerPage:function(a){return a+" записей на страницу"},formatShowingRows:function(a,b,c){return"Записи с "+a+" по "+b+" из "+c},formatSearch:function(){return"Поиск"},formatNoMatches:function(){return"Ничего не найдено"},formatRefresh:function(){return"Обновить"},formatToggle:function(){return"Переключить"},formatColumns:function(){return"Колонки"},formatClearFilters:function(){return"Очистить фильтры"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ru-RU"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-tr-TR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["tr-TR"]={formatLoadingMessage:function(){return"Yükleniyor, lütfen bekleyin..."},formatRecordsPerPage:function(a){return"Sayfa başına "+a+" kayıt."},formatShowingRows:function(a,b,c){return c+" kayıttan "+a+"-"+b+" arası gösteriliyor."},formatSearch:function(){return"Ara"},formatNoMatches:function(){return"Eşleşen kayıt bulunamadı."},formatRefresh:function(){return"Yenile"},formatToggle:function(){return"Değiştir"},formatColumns:function(){return"Sütunlar"},formatAllRows:function(){return"Tüm Satırlar"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["tr-TR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/flat-json/bootstrap-table-flat-json.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=function(b,c){function d(b,f){if(Object(b)!==b)e[f]=b;else if(a.isArray(b))for(var g=0,h=b.length;h>g;g++)d(b[g],f?f+c.options.flatSeparator+g:""+g),0==h&&(e[f]=[]);else{var i=!0;for(var j in b)i=!1,d(b[j],f?f+c.options.flatSeparator+j:j);i&&(e[f]={})}}var e={};return d(b,""),e},c=function(c,d){var e=[];return a.each(a.isArray(c)?c:[c],function(a,c){e.push(b(c,d))}),e};a.extend(a.fn.bootstrapTable.defaults,{flat:!1,flatSeparator:"."});var d=a.fn.bootstrapTable.Constructor,e=d.prototype.initData;d.prototype.initData=function(a,b){this.options.flat&&(a=c(a?a:this.options.data,this)),e.apply(this,[a,b])}}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-af-ZA.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["af-ZA"]={formatLoadingMessage:function(){return"Besig om te laai, wag asseblief ..."},formatRecordsPerPage:function(a){return a+" rekords per bladsy"},formatShowingRows:function(a,b,c){return"Resultate "+a+" tot "+b+" van "+c+" rye"},formatSearch:function(){return"Soek"},formatNoMatches:function(){return"Geen rekords gevind nie"},formatPaginationSwitch:function(){return"Wys/verberg bladsy nummering"},formatRefresh:function(){return"Herlaai"},formatToggle:function(){return"Wissel"},formatColumns:function(){return"Kolomme"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["af-ZA"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-CR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["es-CR"]={formatLoadingMessage:function(){return"Cargando, por favor espere..."},formatRecordsPerPage:function(a){return a+" registros por página"},formatShowingRows:function(a,b,c){return"Mostrando de "+a+" a "+b+" registros de "+c+" registros en total"},formatSearch:function(){return"Buscar"},formatNoMatches:function(){return"No se encontraron registros"},formatRefresh:function(){return"Refrescar"},formatToggle:function(){return"Alternar"},formatColumns:function(){return"Columnas"},formatAllRows:function(){return"Todo"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["es-CR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-NI.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["es-NI"]={formatLoadingMessage:function(){return"Cargando, por favor espere..."},formatRecordsPerPage:function(a){return a+" registros por página"},formatShowingRows:function(a,b,c){return"Mostrando de "+a+" a "+b+" registros de "+c+" registros en total"},formatSearch:function(){return"Buscar"},formatNoMatches:function(){return"No se encontraron registros"},formatRefresh:function(){return"Refrescar"},formatToggle:function(){return"Alternar"},formatColumns:function(){return"Columnas"},formatAllRows:function(){return"Todo"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["es-NI"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-he-IL.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["he-IL"]={formatLoadingMessage:function(){return"טוען, נא להמתין..."},formatRecordsPerPage:function(a){return a+" שורות בעמוד"},formatShowingRows:function(a,b,c){return"מציג "+a+" עד "+b+" מ-"+c+" שורות"},formatSearch:function(){return"חיפוש"},formatNoMatches:function(){return"לא נמצאו רשומות תואמות"},formatPaginationSwitch:function(){return"הסתר/הצג מספור דפים"},formatRefresh:function(){return"רענן"},formatToggle:function(){return"החלף תצוגה"},formatColumns:function(){return"עמודות"},formatAllRows:function(){return"הכל"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["he-IL"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-pt-BR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["pt-BR"]={formatLoadingMessage:function(){return"Carregando, aguarde..."},formatRecordsPerPage:function(a){return a+" registros por página"},formatShowingRows:function(a,b,c){return"Exibindo "+a+" até "+b+" de "+c+" linhas"},formatSearch:function(){return"Pesquisar"},formatRefresh:function(){return"Recarregar"},formatToggle:function(){return"Alternar"},formatColumns:function(){return"Colunas"},formatPaginationSwitch:function(){return"Ocultar/Exibir paginação"},formatNoMatches:function(){return"Nenhum registro encontrado"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["pt-BR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-zh-CN.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(a){return"每页显示 "+a+" 条记录"},formatShowingRows:function(a,b,c){return"显示第 "+a+" 到第 "+b+" 条记录,总共 "+c+" 条记录"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"},formatExport:function(){return"导出数据"},formatClearFilters:function(){return"清空过滤"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["zh-CN"])}(jQuery); -------------------------------------------------------------------------------- /app/server/views/actions_tw.pug: -------------------------------------------------------------------------------- 1 | #res_FB 2 | table.table 3 | tr 4 | td ID 5 | td=results.post.id 6 | tr 7 | td=__("From") 8 | td=results.post.user.name 9 | tr 10 | td=__("Post date") 11 | td=results.post.created_at 12 | table.table 13 | tr 14 | td(colspan=2)=results.checkdate 15 | tr 16 | td=__("Likes") 17 | td=results.likes.length 18 | tr 19 | td=__("Retweets") 20 | td 21 | p=__("Total") + ": " + results.retweets.length 22 | //- var retweets = 0 23 | - var likes = 0 24 | each item in results.retweets 25 | - retweets+=item.retweet_count ? parseInt(item.retweet_count) : 0 26 | - likes+=item.favorite_count ? parseInt(item.favorite_count) : 0 27 | p=__("Retweets") + ": " + retweets 28 | p=__("Likes") + ": " + likes 29 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-fr-FR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["fr-FR"]={formatLoadingMessage:function(){return"Chargement en cours, patientez, s´il vous plaît ..."},formatRecordsPerPage:function(a){return a+" lignes par page"},formatShowingRows:function(a,b,c){return"Affichage des lignes "+a+" à "+b+" sur "+c+" lignes au total"},formatSearch:function(){return"Rechercher"},formatNoMatches:function(){return"Aucun résultat trouvé"},formatRefresh:function(){return"Rafraîchir"},formatToggle:function(){return"Alterner"},formatColumns:function(){return"Colonnes"},formatAllRows:function(){return"Tous"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["fr-FR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-fa-IR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["fa-IR"]={formatLoadingMessage:function(){return"در حال بارگذاری, لطفا صبر کنید..."},formatRecordsPerPage:function(a){return a+" رکورد در صفحه"},formatShowingRows:function(a,b,c){return"نمایش "+a+" تا "+b+" از "+c+" ردیف"},formatSearch:function(){return"جستجو"},formatNoMatches:function(){return"رکوردی یافت نشد."},formatPaginationSwitch:function(){return"نمایش/مخفی صفحه بندی"},formatRefresh:function(){return"به روز رسانی"},formatToggle:function(){return"تغییر نمایش"},formatColumns:function(){return"سطر ها"},formatAllRows:function(){return"همه"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["fa-IR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ka-GE.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ka-GE"]={formatLoadingMessage:function(){return"იტვირთება, გთხოვთ მოიცადოთ..."},formatRecordsPerPage:function(a){return a+" ჩანაწერი თითო გვერდზე"},formatShowingRows:function(a,b,c){return"ნაჩვენებია "+a+"-დან "+b+"-მდე ჩანაწერი ჯამური "+c+"-დან"},formatSearch:function(){return"ძებნა"},formatNoMatches:function(){return"მონაცემები არ არის"},formatPaginationSwitch:function(){return"გვერდების გადამრთველის დამალვა/გამოჩენა"},formatRefresh:function(){return"განახლება"},formatToggle:function(){return"ჩართვა/გამორთვა"},formatColumns:function(){return"სვეტები"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ka-GE"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-hu-HU.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["hu-HU"]={formatLoadingMessage:function(){return"Betöltés, kérem várjon..."},formatRecordsPerPage:function(a){return a+" rekord per oldal"},formatShowingRows:function(a,b,c){return"Megjelenítve "+a+" - "+b+" / "+c+" összesen"},formatSearch:function(){return"Keresés"},formatNoMatches:function(){return"Nincs találat"},formatPaginationSwitch:function(){return"Lapozó elrejtése/megjelenítése"},formatRefresh:function(){return"Frissítés"},formatToggle:function(){return"Összecsuk/Kinyit"},formatColumns:function(){return"Oszlopok"},formatAllRows:function(){return"Összes"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["hu-HU"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ca-ES.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ca-ES"]={formatLoadingMessage:function(){return"Espereu, si us plau..."},formatRecordsPerPage:function(a){return a+" resultats per pàgina"},formatShowingRows:function(a,b,c){return"Mostrant de "+a+" fins "+b+" - total "+c+" resultats"},formatSearch:function(){return"Cerca"},formatNoMatches:function(){return"No s'han trobat resultats"},formatPaginationSwitch:function(){return"Amaga/Mostra paginació"},formatRefresh:function(){return"Refresca"},formatToggle:function(){return"Alterna formatació"},formatColumns:function(){return"Columnes"},formatAllRows:function(){return"Tots"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ca-ES"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-cs-CZ.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["cs-CZ"]={formatLoadingMessage:function(){return"Čekejte, prosím..."},formatRecordsPerPage:function(a){return a+" položek na stránku"},formatShowingRows:function(a,b,c){return"Zobrazena "+a+". - "+b+". položka z celkových "+c},formatSearch:function(){return"Vyhledávání"},formatNoMatches:function(){return"Nenalezena žádná vyhovující položka"},formatPaginationSwitch:function(){return"Skrýt/Zobrazit stránkování"},formatRefresh:function(){return"Aktualizovat"},formatToggle:function(){return"Přepni"},formatColumns:function(){return"Sloupce"},formatAllRows:function(){return"Vše"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["cs-CZ"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-hr-HR.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["hr-HR"]={formatLoadingMessage:function(){return"Molimo pričekajte ..."},formatRecordsPerPage:function(a){return a+" broj zapisa po stranici"},formatShowingRows:function(a,b,c){return"Prikazujem "+a+". - "+b+". od ukupnog broja zapisa "+c},formatSearch:function(){return"Pretraži"},formatNoMatches:function(){return"Nije pronađen niti jedan zapis"},formatPaginationSwitch:function(){return"Prikaži/sakrij stranice"},formatRefresh:function(){return"Osvježi"},formatToggle:function(){return"Promijeni prikaz"},formatColumns:function(){return"Kolone"},formatAllRows:function(){return"Sve"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["hr-HR"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ro-RO.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ro-RO"]={formatLoadingMessage:function(){return"Se incarca, va rugam asteptati..."},formatRecordsPerPage:function(a){return a+" inregistrari pe pagina"},formatShowingRows:function(a,b,c){return"Arata de la "+a+" pana la "+b+" din "+c+" randuri"},formatSearch:function(){return"Cauta"},formatNoMatches:function(){return"Nu au fost gasite inregistrari"},formatPaginationSwitch:function(){return"Ascunde/Arata paginatia"},formatRefresh:function(){return"Reincarca"},formatToggle:function(){return"Comuta"},formatColumns:function(){return"Coloane"},formatAllRows:function(){return"Toate"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ro-RO"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.css: -------------------------------------------------------------------------------- 1 | .reorder_rows_onDragClass td { 2 | background-color: #eee; 3 | -webkit-box-shadow: 11px 5px 12px 2px #333, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset; 4 | -webkit-box-shadow: 6px 3px 5px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset; 5 | -moz-box-shadow: 6px 4px 5px 1px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset; 6 | -box-shadow: 6px 4px 5px 1px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset; 7 | } 8 | 9 | .reorder_rows_onDragClass td:last-child { 10 | -webkit-box-shadow: 8px 7px 12px 0 #333, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset; 11 | -webkit-box-shadow: 1px 8px 6px -4px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset; 12 | -moz-box-shadow: 0 9px 4px -4px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset, -1px 0 0 #ccc inset; 13 | -box-shadow: 0 9px 4px -4px #555, 0 1px 0 #ccc inset, 0 -1px 0 #ccc inset, -1px 0 0 #ccc inset; 14 | } -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-ES.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["es-ES"]={formatLoadingMessage:function(){return"Por favor espere..."},formatRecordsPerPage:function(a){return a+" resultados por página"},formatShowingRows:function(a,b,c){return"Mostrando desde "+a+" hasta "+b+" - En total "+c+" resultados"},formatSearch:function(){return"Buscar"},formatNoMatches:function(){return"No se encontraron resultados"},formatPaginationSwitch:function(){return"Ocultar/Mostrar paginación"},formatRefresh:function(){return"Refrescar"},formatToggle:function(){return"Ocultar/Mostrar"},formatColumns:function(){return"Columnas"},formatAllRows:function(){return"Todos"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["es-ES"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-et-EE.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["et-EE"]={formatLoadingMessage:function(){return"Päring käib, palun oota..."},formatRecordsPerPage:function(a){return a+" rida lehe kohta"},formatShowingRows:function(a,b,c){return"Näitan tulemusi "+a+" kuni "+b+" - kokku "+c+" tulemust"},formatSearch:function(){return"Otsi"},formatNoMatches:function(){return"Päringu tingimustele ei vastanud ühtegi tulemust"},formatPaginationSwitch:function(){return"Näita/Peida lehtedeks jagamine"},formatRefresh:function(){return"Värskenda"},formatToggle:function(){return"Lülita"},formatColumns:function(){return"Veerud"},formatAllRows:function(){return"Kõik"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["et-EE"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-pt-PT.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["pt-PT"]={formatLoadingMessage:function(){return"A carregar, por favor aguarde..."},formatRecordsPerPage:function(a){return a+" registos por página"},formatShowingRows:function(a,b,c){return"A mostrar "+a+" até "+b+" de "+c+" linhas"},formatSearch:function(){return"Pesquisa"},formatNoMatches:function(){return"Nenhum registo encontrado"},formatPaginationSwitch:function(){return"Esconder/Mostrar paginação"},formatRefresh:function(){return"Atualizar"},formatToggle:function(){return"Alternar"},formatColumns:function(){return"Colunas"},formatAllRows:function(){return"Tudo"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["pt-PT"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/i18n-enhance/bootstrap-table-i18n-enhance.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author: Jewway 3 | * @version: v1.0.0 4 | */ 5 | 6 | !function ($) { 7 | 'use strict'; 8 | 9 | var BootstrapTable = $.fn.bootstrapTable.Constructor; 10 | 11 | BootstrapTable.prototype.changeTitle = function (locale) { 12 | $.each(this.options.columns, function (idx, columnList) { 13 | $.each(columnList, function (idx, column) { 14 | if (column.field) { 15 | column.title = locale[column.field]; 16 | } 17 | }); 18 | }); 19 | 20 | this.initHeader(); 21 | this.initBody(); 22 | this.initToolbar(); 23 | }; 24 | 25 | BootstrapTable.prototype.changeLocale = function (localeId) { 26 | this.options.locale = localeId; 27 | this.initLocale(); 28 | this.initPagination(); 29 | }; 30 | 31 | $.fn.bootstrapTable.methods.push('changeTitle'); 32 | $.fn.bootstrapTable.methods.push('changeLocale'); 33 | 34 | }(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ms-MY.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ms-MY"]={formatLoadingMessage:function(){return"Permintaan sedang dimuatkan. Sila tunggu sebentar..."},formatRecordsPerPage:function(a){return a+" rekod setiap muka surat"},formatShowingRows:function(a,b,c){return"Sedang memaparkan rekod "+a+" hingga "+b+" daripada jumlah "+c+" rekod"},formatSearch:function(){return"Cari"},formatNoMatches:function(){return"Tiada rekod yang menyamai permintaan"},formatPaginationSwitch:function(){return"Tunjuk/sembunyi muka surat"},formatRefresh:function(){return"Muatsemula"},formatToggle:function(){return"Tukar"},formatColumns:function(){return"Lajur"},formatAllRows:function(){return"Semua"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ms-MY"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-en-US.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["en-US"]={formatLoadingMessage:function(){return"Loading, please wait..."},formatRecordsPerPage:function(a){return a+" rows per page"},formatShowingRows:function(a,b,c){return"Showing "+a+" to "+b+" of "+c+" rows"},formatSearch:function(){return"Search"},formatNoMatches:function(){return"No matching records found"},formatPaginationSwitch:function(){return"Hide/Show pagination"},formatRefresh:function(){return"Refresh"},formatToggle:function(){return"Toggle"},formatColumns:function(){return"Columns"},formatAllRows:function(){return"All"},formatExport:function(){return"Export data"},formatClearFilters:function(){return"Clear filters"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["en-US"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-vi-VN.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Vietnamese translation 3 | * Author: Duc N. PHAM 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['vi-VN'] = { 9 | formatLoadingMessage: function () { 10 | return 'Đang tải...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' bản ghi mỗi trang'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Hiển thị từ trang ' + pageFrom + ' đến ' + pageTo + ' của ' + totalRows + ' bảng ghi'; 17 | }, 18 | formatSearch: function () { 19 | return 'Tìm kiếm'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Không có dữ liệu'; 23 | } 24 | }; 25 | 26 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['vi-VN']); 27 | 28 | })(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-fr-BE.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table French (Belgium) translation 3 | * Author: Julien Bisconti (julien.bisconti@gmail.com) 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['fr-BE'] = { 9 | formatLoadingMessage: function () { 10 | return 'Chargement en cours...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' entrées par page'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Affiche de' + pageFrom + ' à ' + pageTo + ' sur ' + totalRows + ' lignes'; 17 | }, 18 | formatSearch: function () { 19 | return 'Recherche'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Pas de fichiers trouvés'; 23 | } 24 | }; 25 | 26 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['fr-BE']); 27 | 28 | })(jQuery); 29 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-el-GR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Greek translation 3 | * Author: giannisdallas 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['el-GR'] = { 9 | formatLoadingMessage: function () { 10 | return 'Φορτώνει, παρακαλώ περιμένετε...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' αποτελέσματα ανά σελίδα'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Εμφανίζονται από την ' + pageFrom + ' ως την ' + pageTo + ' από σύνολο ' + totalRows + ' σειρών'; 17 | }, 18 | formatSearch: function () { 19 | return 'Αναζητήστε'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Δεν βρέθηκαν αποτελέσματα'; 23 | } 24 | }; 25 | 26 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['el-GR']); 27 | 28 | })(jQuery); 29 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-nl-NL.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["nl-NL"]={formatLoadingMessage:function(){return"Laden, even geduld..."},formatRecordsPerPage:function(a){return a+" records per pagina"},formatShowingRows:function(a,b,c){return"Toon "+a+" tot "+b+" van "+c+" record"+(c>1?"s":"")},formatDetailPagination:function(a){return"Toon "+a+" record"+(a>1?"s":"")},formatSearch:function(){return"Zoeken"},formatNoMatches:function(){return"Geen resultaten gevonden"},formatRefresh:function(){return"Vernieuwen"},formatToggle:function(){return"Omschakelen"},formatColumns:function(){return"Kolommen"},formatAllRows:function(){return"Alle"},formatPaginationSwitch:function(){return"Verberg/Toon paginatie"},formatExport:function(){return"Exporteer data"},formatClearFilters:function(){return"Verwijder filters"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["nl-NL"])}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-AR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Spanish (Argentina) translation 3 | * Author: Felix Vera (felix.vera@gmail.com) 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['es-AR'] = { 9 | formatLoadingMessage: function () { 10 | return 'Cargando, espere por favor...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' registros por página'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Mostrando ' + pageFrom + ' a ' + pageTo + ' de ' + totalRows + ' filas'; 17 | }, 18 | formatSearch: function () { 19 | return 'Buscar'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'No se encontraron registros'; 23 | }, 24 | formatAllRows: function () { 25 | return 'Todo'; 26 | } 27 | }; 28 | 29 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['es-AR']); 30 | 31 | })(jQuery); -------------------------------------------------------------------------------- /app/server/routes/lost-password.js: -------------------------------------------------------------------------------- 1 | exports.post = function post(req, res) { 2 | var DB = require('./../helpers/db-manager'); 3 | var EM = require('./email-dispatcher'); 4 | // look up the user's account via their email // 5 | if (global._config.emailDispatcher && global._config.emailDispatcher.host && global._config.emailDispatcher.password) { 6 | DB.accounts.findOne({email: req.param('email')}, function (e, o) { 7 | if (o) { 8 | res.status(200).send('ok'); 9 | EM.dispatchResetPasswordLink(o, req.headers.host, function (e, m) { 10 | console.log(req); 11 | console.log(req.headers.host); 12 | // this callback takes a moment to return // 13 | // should add an ajax loader to give user feedback // 14 | if (!e) { 15 | // res.status(200).send('ok'); 16 | } else { 17 | res.status(400).send('email-server-error'); 18 | for (var k in e) console.log('error : ', k, e[k]); 19 | } 20 | }); 21 | } else { 22 | res.status(400).send('email-not-found'); 23 | } 24 | }); 25 | } else { 26 | res.status(400).send('email-settings-not-found'); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mongo-invoices", 3 | "version": "2.0.0", 4 | "description": "open-source invoice system build on node.js and mongodb", 5 | "main": "app.js", 6 | "dependencies": { 7 | "accounting": "~0.4.1", 8 | "bcrypt-nodejs": "0.0.3", 9 | "body-parser": "^1.15.2", 10 | "cookie-parser": "^1.4.3", 11 | "emailjs": "~1.0.8", 12 | "express": "~4.14.0", 13 | "express-session": "^1.14.1", 14 | "html-pdf": "^2.1.0", 15 | "i18n": "^0.8.3", 16 | "method-override": "^2.3.6", 17 | "moment": "~2.15.1", 18 | "mongodb": "~2.2.10", 19 | "pug": "^2.0.0-beta6", 20 | "request": "^2.79.0", 21 | "stylus": "~0.54.5" 22 | }, 23 | "scripts": { 24 | "test": "echo \"Error: no test specified\" && exit 1" 25 | }, 26 | "repository": { 27 | "type": "git", 28 | "url": "git://github.com/gianlucadelgobbo/mongo-invoices.git" 29 | }, 30 | "keywords": [ 31 | "invoices", 32 | "mongodb", 33 | "node.js" 34 | ], 35 | "author": "Gianluca Del Gobbo ", 36 | "license": "BSD", 37 | "readmeFilename": "README.md", 38 | "private": true 39 | } 40 | -------------------------------------------------------------------------------- /app/server/views/sidebar_settings.pug: -------------------------------------------------------------------------------- 1 | #sidebar.sidebar-offcanvas 2 | .col-md-12 3 | h3=__("Settings") 4 | ul.nav.nav-pills.nav-stacked 5 | li(class=global.settings.currenturl == "/" + global.settings.dbName + "/account/?id=" + udata._id ? "active" : undefined) 6 | a(href="/" + global.settings.dbName + "/account/?id=" + udata._id)=__("My account") 7 | li(class=global.settings.currenturl == "/" + global.settings.dbName + "/accounts/" ? "active" : undefined) 8 | a(href="/" + global.settings.dbName + "/accounts/")=__("Accounts") 9 | li(class=global.settings.currenturl == "/" + global.settings.dbName + "/account/" ? "active" : undefined) 10 | a(href="/" + global.settings.dbName + "/account/")=__("New account") 11 | 12 | - if (global.settings.roles[udata.role].admin) 13 | li(class=global.settings.currenturl == "/" + global.settings.dbName + "/settings/" ? "active" : undefined) 14 | a(href="/" + global.settings.dbName + "/settings/")=__("Settings") 15 | li 16 | a(href="/logout") 17 | i.glyphicon.glyphicon-lock.icon-white 18 | !=" " + __("Log Out") 19 | -------------------------------------------------------------------------------- /app/server/routes/users.js: -------------------------------------------------------------------------------- 1 | var DBUsers = require('../helpers/db-users-manager'); 2 | var helpers = require('./../helpers/helpers'); 3 | 4 | exports.get = function get(req, res) { 5 | helpers.canIseeThis(req, function (auth) { 6 | if (auth) { 7 | var msg = {}; 8 | if (req.query.id && req.query.del) { 9 | DBUsers.delete_account(req.query.id, function(err, obj){ 10 | if (obj){ 11 | msg.c = []; 12 | msg.c.push({name:"",m:__("Account deleted successfully")}); 13 | } else { 14 | msg.e = []; 15 | msg.e.push({name:"",m:__("Account not found")}); 16 | } 17 | }); 18 | } 19 | var q = []; 20 | for(var a=0;a 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['de-DE'] = { 9 | formatLoadingMessage: function () { 10 | return 'Lade, bitte warten...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' Einträge pro Seite'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Zeige ' + pageFrom + ' bis ' + pageTo + ' von ' + totalRows + ' Zeile' + ((totalRows > 1) ? "n" : ""); 17 | }, 18 | formatSearch: function () { 19 | return 'Suchen'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Keine passenden Ergebnisse gefunden'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Neu laden'; 26 | }, 27 | formatToggle: function () { 28 | return 'Umschalten'; 29 | }, 30 | formatColumns: function () { 31 | return 'Spalten'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['de-DE']); 36 | 37 | })(jQuery); 38 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-MX.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Spanish (México) translation (Obtenido de traducción de Argentina) 3 | * Author: Felix Vera (felix.vera@gmail.com) 4 | * Copiado: Mauricio Vera (mauricioa.vera@gmail.com) 5 | */ 6 | (function ($) { 7 | 'use strict'; 8 | 9 | $.fn.bootstrapTable.locales['es-MX'] = { 10 | formatLoadingMessage: function () { 11 | return 'Cargando, espere por favor...'; 12 | }, 13 | formatRecordsPerPage: function (pageNumber) { 14 | return pageNumber + ' registros por página'; 15 | }, 16 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 17 | return 'Mostrando ' + pageFrom + ' a ' + pageTo + ' de ' + totalRows + ' filas'; 18 | }, 19 | formatSearch: function () { 20 | return 'Buscar'; 21 | }, 22 | formatNoMatches: function () { 23 | return 'No se encontraron registros'; 24 | }, 25 | formatAllRows: function () { 26 | return 'Todo'; 27 | } 28 | }; 29 | 30 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['es-MX']); 31 | 32 | })(jQuery); 33 | -------------------------------------------------------------------------------- /app/public/js/sendemail.js: -------------------------------------------------------------------------------- 1 | function sendByEmail() { 2 | $('.modal-sendbyemail .alert.alert-success').hide(); 3 | $('.modal-sendbyemail .alert.alert-danger' ).hide(); 4 | $('.modal-sendbyemail .alert.alert-info' ).show("fast", function() { 5 | var data = $('#sendbyemail').serializeArray().reduce(function(obj, item) { 6 | obj[item.name] = item.value; 7 | return obj; 8 | }, {}); 9 | $.ajax({ 10 | 'async': false, 11 | url: "/sendemail", 12 | dataType: "json", 13 | method: "POST", 14 | data: data 15 | }).done(function( err ) { 16 | $('.modal-sendbyemail .alert.alert-info' ).hide("fast"); 17 | if (err) { 18 | $('.modal-sendbyemail .alert.alert-danger' ).show("fast"); 19 | $('.modal-sendbyemail .alert-danger .alert-body').html(err); 20 | 21 | } else { 22 | $('.modal-sendbyemail .alert.alert-success').show("fast"); 23 | $('.modal-sendbyemail .alert-success .alert-body').html("Messagge sent"); 24 | } 25 | }).fail(function(msg ) { 26 | $('.modal-sendbyemail .alert.alert-info' ).hide("fast"); 27 | $('.modal-sendbyemail .alert.alert-danger').show("fast"); 28 | $('.modal-sendbyemail .alert-danger .alert-body').html(msg.responseText); 29 | }); 30 | }); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/server/views/actions_fb.pug: -------------------------------------------------------------------------------- 1 | #res_FB 2 | table.table 3 | tr 4 | td ID 5 | td=results.id 6 | tr 7 | td=__("From") 8 | td=results.from.name 9 | tr 10 | td=__("Post date") 11 | td=results.created_time 12 | table.table 13 | tr 14 | td(colspan=2)=results.checkdate 15 | tr 16 | td=__("Likes") 17 | td=results.likes.data.length 18 | tr 19 | td=__("Comments") 20 | td=results.comments && results.comments.data && results.comments.data.length ? results.comments.data.length : 0 21 | tr 22 | td=__("Shares") 23 | td 24 | p=__("Total") + ": " + results.shares.count 25 | - var shares = 0 26 | - var comments = 0 27 | - var likes = 0 28 | each item in results.sharedposts.data 29 | -console.log(item) 30 | - shares+=item.shares && item.shares.count ? parseInt(item.shares.count) : 0 31 | - comments+=item.comments && item.comments.data ? item.comments.data.length : 0 32 | - likes+=item.likes && item.likes.data ? item.likes.data.length : 0 33 | p=__("Shares") + ": " + shares 34 | p=__("Comments") + ": " + comments 35 | p=__("Likes") + ": " + likes 36 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ko-KR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Korean translation 3 | * Author: Yi Tae-Hyeong (jsonobject@gmail.com) 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['ko-KR'] = { 9 | formatLoadingMessage: function () { 10 | return '데이터를 불러오는 중입니다...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return '페이지 당 ' + pageNumber + '개 데이터 출력'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return '전체 ' + totalRows + '개 중 ' + pageFrom + '~' + pageTo + '번째 데이터 출력,'; 17 | }, 18 | formatSearch: function () { 19 | return '검색'; 20 | }, 21 | formatNoMatches: function () { 22 | return '조회된 데이터가 없습니다.'; 23 | }, 24 | formatRefresh: function () { 25 | return '새로 고침'; 26 | }, 27 | formatToggle: function () { 28 | return '전환'; 29 | }, 30 | formatColumns: function () { 31 | return '컬럼 필터링'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ko-KR']); 36 | 37 | })(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-nb-NO.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table norwegian translation 3 | * Author: Jim Nordbø, jim@nordb.no 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['nb-NO'] = { 9 | formatLoadingMessage: function () { 10 | return 'Oppdaterer, vennligst vent...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' poster pr side'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Viser ' + pageFrom + ' til ' + pageTo + ' av ' + totalRows + ' rekker'; 17 | }, 18 | formatSearch: function () { 19 | return 'Søk'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Ingen poster funnet'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Oppdater'; 26 | }, 27 | formatToggle: function () { 28 | return 'Endre'; 29 | }, 30 | formatColumns: function () { 31 | return 'Kolonner'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['nb-NO']); 36 | 37 | })(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ur-PK.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Urdu translation 3 | * Author: Malik 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['ur-PK'] = { 9 | formatLoadingMessage: function () { 10 | return 'براۓ مہربانی انتظار کیجئے'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' ریکارڈز فی صفہ '; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'دیکھیں ' + pageFrom + ' سے ' + pageTo + ' کے ' + totalRows + 'ریکارڈز'; 17 | }, 18 | formatSearch: function () { 19 | return 'تلاش'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'کوئی ریکارڈ نہیں ملا'; 23 | }, 24 | formatRefresh: function () { 25 | return 'تازہ کریں'; 26 | }, 27 | formatToggle: function () { 28 | return 'تبدیل کریں'; 29 | }, 30 | formatColumns: function () { 31 | return 'کالم'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ur-PK']); 36 | 37 | })(jQuery); 38 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/key-events/bootstrap-table-key-events.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.extend(a.fn.bootstrapTable.defaults,{keyEvents:!1});var b=a.fn.bootstrapTable.Constructor,c=b.prototype.init;b.prototype.init=function(){c.apply(this,Array.prototype.slice.apply(arguments)),this.initKeyEvents()},b.prototype.initKeyEvents=function(){if(this.options.keyEvents){var b=this;a(document).off("keydown").on("keydown",function(c){var d=b.$toolbar.find(".search input"),e=b.$toolbar.find('button[name="refresh"]'),f=b.$toolbar.find('button[name="toggle"]'),g=b.$toolbar.find('button[name="paginationSwitch"]');if(document.activeElement===d.get(0)||!a.contains(document.activeElement,b.$toolbar.get(0)))return!0;switch(c.keyCode){case 83:if(!b.options.search)return;return d.focus(),!1;case 82:if(!b.options.showRefresh)return;return e.click(),!1;case 84:if(!b.options.showToggle)return;return f.click(),!1;case 80:if(!b.options.showPaginationSwitch)return;return g.click(),!1;case 37:if(!b.options.pagination)return;return b.prevPage(),!1;case 39:if(!b.options.pagination)return;return void b.nextPage()}})}}}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-da-DK.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table danish translation 3 | * Author: Your Name Jan Borup Coyle, github@coyle.dk 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['da-DK'] = { 9 | formatLoadingMessage: function () { 10 | return 'Indlæser, vent venligst...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' poster pr side'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Viser ' + pageFrom + ' til ' + pageTo + ' af ' + totalRows + ' rækker'; 17 | }, 18 | formatSearch: function () { 19 | return 'Søg'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Ingen poster fundet'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Opdater'; 26 | }, 27 | formatToggle: function () { 28 | return 'Skift'; 29 | }, 30 | formatColumns: function () { 31 | return 'Kolonner'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['da-DK']); 36 | 37 | })(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-sv-SE.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Swedish translation 3 | * Author: C Bratt 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['sv-SE'] = { 9 | formatLoadingMessage: function () { 10 | return 'Laddar, vänligen vänta...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' rader per sida'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Visa ' + pageFrom + ' till ' + pageTo + ' av ' + totalRows + ' rader'; 17 | }, 18 | formatSearch: function () { 19 | return 'Sök'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Inga matchande resultat funna.'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Uppdatera'; 26 | }, 27 | formatToggle: function () { 28 | return 'Skifta'; 29 | }, 30 | formatColumns: function () { 31 | return 'kolumn'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['sv-SE']); 36 | 37 | })(jQuery); 38 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-pl-PL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Polish translation 3 | * Author: zergu 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['pl-PL'] = { 9 | formatLoadingMessage: function () { 10 | return 'Ładowanie, proszę czekać...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' rekordów na stronę'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Wyświetlanie rekordów od ' + pageFrom + ' do ' + pageTo + ' z ' + totalRows; 17 | }, 18 | formatSearch: function () { 19 | return 'Szukaj'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Niestety, nic nie znaleziono'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Odśwież'; 26 | }, 27 | formatToggle: function () { 28 | return 'Przełącz'; 29 | }, 30 | formatColumns: function () { 31 | return 'Kolumny'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['pl-PL']); 36 | 37 | })(jQuery); 38 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-th-TH.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Thai translation 3 | * Author: Monchai S. 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['th-TH'] = { 9 | formatLoadingMessage: function () { 10 | return 'กำลังโหลดข้อมูล, กรุณารอสักครู่...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' รายการต่อหน้า'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'รายการที่ ' + pageFrom + ' ถึง ' + pageTo + ' จากทั้งหมด ' + totalRows + ' รายการ'; 17 | }, 18 | formatSearch: function () { 19 | return 'ค้นหา'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'ไม่พบรายการที่ค้นหา !'; 23 | }, 24 | formatRefresh: function () { 25 | return 'รีเฟรส'; 26 | }, 27 | formatToggle: function () { 28 | return 'สลับมุมมอง'; 29 | }, 30 | formatColumns: function () { 31 | return 'คอลัมน์'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['th-TH']); 36 | 37 | })(jQuery); 38 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-sk-SK.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Slovak translation 3 | * Author: Jozef Dúc 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['sk-SK'] = { 9 | formatLoadingMessage: function () { 10 | return 'Prosím čakajte ...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' záznamov na stranu'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Zobrazená ' + pageFrom + '. - ' + pageTo + '. položka z celkových ' + totalRows; 17 | }, 18 | formatSearch: function () { 19 | return 'Vyhľadávanie'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Nenájdená žiadna vyhovujúca položka'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Obnoviť'; 26 | }, 27 | formatToggle: function () { 28 | return 'Prepni'; 29 | }, 30 | formatColumns: function () { 31 | return 'Stĺpce'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['sk-SK']); 36 | 37 | })(jQuery); 38 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-uk-UA.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Ukrainian translation 3 | * Author: Vitaliy Timchenko 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['uk-UA'] = { 9 | formatLoadingMessage: function () { 10 | return 'Завантаження, будь ласка, зачекайте...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' записів на сторінку'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Показано з ' + pageFrom + ' по ' + pageTo + '. Всього: ' + totalRows; 17 | }, 18 | formatSearch: function () { 19 | return 'Пошук'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Не знайдено жодного запису'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Оновити'; 26 | }, 27 | formatToggle: function () { 28 | return 'Змінити'; 29 | }, 30 | formatColumns: function () { 31 | return 'Стовпці'; 32 | } 33 | }; 34 | 35 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['uk-UA']); 36 | 37 | })(jQuery); 38 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-zh-TW.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Chinese translation 3 | * Author: Zhixin Wen 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['zh-TW'] = { 9 | formatLoadingMessage: function () { 10 | return '正在努力地載入資料,請稍候……'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return '每頁顯示 ' + pageNumber + ' 項記錄'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return '顯示第 ' + pageFrom + ' 到第 ' + pageTo + ' 項記錄,總共 ' + totalRows + ' 項記錄'; 17 | }, 18 | formatSearch: function () { 19 | return '搜尋'; 20 | }, 21 | formatNoMatches: function () { 22 | return '沒有找到符合的結果'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return '隱藏/顯示分頁'; 26 | }, 27 | formatRefresh: function () { 28 | return '重新整理'; 29 | }, 30 | formatToggle: function () { 31 | return '切換'; 32 | }, 33 | formatColumns: function () { 34 | return '列'; 35 | } 36 | }; 37 | 38 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-TW']); 39 | 40 | })(jQuery); 41 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/resizable/bootstrap-table-resizable.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=function(a){a.$el.colResizable({disable:!0}),a.$el.colResizable({liveDrag:a.options.liveDrag,fixed:a.options.fixed,headerOnly:a.options.headerOnly,minWidth:a.options.minWidth,hoverCursor:a.options.hoverCursor,dragCursor:a.options.dragCursor,onResize:a.onResize,onDrag:a.options.onResizableDrag})};a.extend(a.fn.bootstrapTable.defaults,{resizable:!1,liveDrag:!1,fixed:!0,headerOnly:!1,minWidth:15,hoverCursor:"e-resize",dragCursor:"e-resize",onResizableResize:function(){return!1},onResizableDrag:function(){return!1}});var c=a.fn.bootstrapTable.Constructor,d=c.prototype.toggleView,e=c.prototype.resetView;c.prototype.toggleView=function(){d.apply(this,Array.prototype.slice.apply(arguments)),this.options.resizable&&this.options.cardView&&a(this.$el).colResizable({disable:!0})},c.prototype.resetView=function(){var a=this;e.apply(this,Array.prototype.slice.apply(arguments)),this.options.resizable&&setTimeout(function(){b(a)},100)},c.prototype.onResize=function(b){var c=a(b.currentTarget);c.bootstrapTable("resetView"),c.data("bootstrap.table").options.onResizableResize.apply(b)}}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/filter/bootstrap-table-filter.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.extend(a.fn.bootstrapTable.defaults,{showFilter:!1});var b=a.fn.bootstrapTable.Constructor,c=b.prototype.init,d=b.prototype.initSearch;b.prototype.init=function(){c.apply(this,Array.prototype.slice.apply(arguments));var b=this;this.$el.on("load-success.bs.table",function(){b.options.showFilter&&a(b.options.toolbar).bootstrapTableFilter({connectTo:b.$el})})},b.prototype.initSearch=function(){d.apply(this,Array.prototype.slice.apply(arguments)),"server"!==this.options.sidePagination&&"function"==typeof this.searchCallback&&(this.data=a.grep(this.options.data,this.searchCallback))},b.prototype.getData=function(){return this.searchText||this.searchCallback?this.data:this.options.data},b.prototype.getColumns=function(){return this.columns},b.prototype.registerSearchCallback=function(a){this.searchCallback=a},b.prototype.updateSearch=function(){this.options.pageNumber=1,this.initSearch(),this.updatePagination()},b.prototype.getServerUrl=function(){return"server"===this.options.sidePagination?this.options.url:!1},a.fn.bootstrapTable.methods.push("getColumns","registerSearchCallback","updateSearch","getServerUrl")}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/jquerymx-3.2.custom.min.js: -------------------------------------------------------------------------------- 1 | 2 | (function(g){var i=/radio|checkbox/i,j=/[^\[\]]+/g,k=/^[\-+]?[0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)?$/,l=function(b){if(typeof b=="number")return true;if(typeof b!="string")return false;return b.match(k)};g.fn.extend({formParams:function(b,d){if(!!b===b){d=b;b=null}if(b)return this.setParams(b);else if(this[0].nodeName.toLowerCase()=="form"&&this[0].elements)return jQuery(jQuery.makeArray(this[0].elements)).getParams(d);return jQuery("input[name], textarea[name], select[name]",this[0]).getParams(d)},setParams:function(b){this.find("[name]").each(function(){var d= 3 | b[g(this).attr("name")],a;if(d!==undefined){a=g(this);if(a.is(":radio"))a.val()==d&&a.attr("checked",true);else if(a.is(":checkbox")){d=g.isArray(d)?d:[d];g.inArray(a.val(),d)>-1&&a.attr("checked",true)}else a.val(d)}})},getParams:function(b){var d={},a;b=b===undefined?false:b;this.each(function(){var e=this;if(!((e.type&&e.type.toLowerCase())=="submit"||!e.name)){var c=e.name,f=g.data(e,"value")||g.fn.val.call([e]),h=i.test(e.type);c=c.match(j);e=!h||!!e.checked;if(b){if(l(f))f=parseFloat(f);else if(f=== 4 | "true")f=true;else if(f==="false")f=false;if(f==="")f=undefined}a=d;for(h=0;h 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | $.fn.bootstrapTable.locales['ru-RU'] = { 8 | formatLoadingMessage: function () { 9 | return 'Пожалуйста, подождите, идёт загрузка...'; 10 | }, 11 | formatRecordsPerPage: function (pageNumber) { 12 | return pageNumber + ' записей на страницу'; 13 | }, 14 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 15 | return 'Записи с ' + pageFrom + ' по ' + pageTo + ' из ' + totalRows; 16 | }, 17 | formatSearch: function () { 18 | return 'Поиск'; 19 | }, 20 | formatNoMatches: function () { 21 | return 'Ничего не найдено'; 22 | }, 23 | formatRefresh: function () { 24 | return 'Обновить'; 25 | }, 26 | formatToggle: function () { 27 | return 'Переключить'; 28 | }, 29 | formatColumns: function () { 30 | return 'Колонки'; 31 | }, 32 | formatClearFilters: function () { 33 | return 'Очистить фильтры'; 34 | } 35 | }; 36 | 37 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ru-RU']); 38 | 39 | })(jQuery); 40 | -------------------------------------------------------------------------------- /app/server/views/home.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | block content 3 | .row-offcanvas.row-offcanvas-left.cnt 4 | include sidebar_accounting 5 | #main 6 | .col-md-12 7 | .row 8 | .col-sm-4 9 | div.well 10 | h1=__('Customers') 11 | ul 12 | li 13 | a(href="/"+global.settings.dbName+"/customers") 14 | span=__("Customers") 15 | li 16 | a(href="/"+global.settings.dbName+"/customer") 17 | span=__("New customer") 18 | hr 19 | 20 | .col-sm-4 21 | div.well 22 | h1=__('Offers') 23 | ul 24 | li 25 | a(href="/"+global.settings.dbName+"/invoices") 26 | span=__("Invoices") 27 | li 28 | a(href="/"+global.settings.dbName+"/invoice") 29 | span=__("New invoice") 30 | hr 31 | 32 | .col-sm-4 33 | div.well 34 | h1=__('Invoices') 35 | ul 36 | li 37 | a(href="/"+global.settings.dbName+"/offers") 38 | span=__("Offers") 39 | li 40 | a(href="/"+global.settings.dbName+"/offer") 41 | span=__("New offer") 42 | hr 43 | -------------------------------------------------------------------------------- /app/server/views/login.pug: -------------------------------------------------------------------------------- 1 | extends layout_nologged 2 | block content 3 | div.col-sm-4.col-sm-offset-4#login-container 4 | form(method="post")#login-form.well 5 | input(type="hidden", name="from", value=from ? from : "undefined") 6 | h1.page-title="AVnode Members Tools" 7 | p.subheading="Please Login To Your Account" 8 | - if (typeof errors !== "undefined" && errors.length) 9 | .alert.alert-danger 10 | h4="There are some errors" 11 | ul 12 | - for(var a=0;a 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['ar-SA'] = { 9 | formatLoadingMessage: function () { 10 | return 'جاري التحميل, يرجى الإنتظار...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' سجل لكل صفحة'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'الظاهر ' + pageFrom + ' إلى ' + pageTo + ' من ' + totalRows + ' سجل'; 17 | }, 18 | formatSearch: function () { 19 | return 'بحث'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'لا توجد نتائج مطابقة للبحث'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'إخفاء\إظهار ترقيم الصفحات'; 26 | }, 27 | formatRefresh: function () { 28 | return 'تحديث'; 29 | }, 30 | formatToggle: function () { 31 | return 'تغيير'; 32 | }, 33 | formatColumns: function () { 34 | return 'أعمدة'; 35 | } 36 | }; 37 | 38 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ar-SA']); 39 | 40 | })(jQuery); 41 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-SP.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Spanish (España) translation 3 | * Author: Antonio Pérez 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['es-SP'] = { 9 | formatLoadingMessage: function () { 10 | return 'Cargando, por favor espera...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' registros por página.'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return pageFrom + ' - ' + pageTo + ' de ' + totalRows + ' registros.'; 17 | }, 18 | formatSearch: function () { 19 | return 'Buscar'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'No se han encontrado registros.'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Actualizar'; 26 | }, 27 | formatToggle: function () { 28 | return 'Alternar'; 29 | }, 30 | formatColumns: function () { 31 | return 'Columnas'; 32 | }, 33 | formatAllRows: function () { 34 | return 'Todo'; 35 | } 36 | }; 37 | 38 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['es-SP']); 39 | 40 | })(jQuery); -------------------------------------------------------------------------------- /app/server/routes/send-email.js: -------------------------------------------------------------------------------- 1 | var helpers = require('./../helpers/helpers'); 2 | 3 | exports.get = function get(req, res) { 4 | res.status(200).send('stocazzoooooooooooo'); 5 | }; 6 | exports.post = function post(req, res) { 7 | if(req.session.user) { 8 | //if (auth) { 9 | var email = require('emailjs'); 10 | 11 | var server = email.server.connect({ 12 | host : global._config.emailDispatcher.host, 13 | user : global._config.emailDispatcher.user, 14 | password : global._config.emailDispatcher.password, 15 | ssl: true 16 | }); 17 | server.send({ 18 | text: req.body.text, 19 | from: global._config.emailDispatcher.sendername+' <'+ global._config.emailDispatcher.senderemail + ">", 20 | to: req.body.to_name+'<'+req.body.to_email+'>', 21 | cc: '', 22 | subject: req.body.subject, 23 | attachment: [ 24 | {data:req.body.text.replace(/(?:\r\n|\r|\n)/g, '
'), alternative:true}, 25 | {path:req.body.folderfile, type:"application/pdf", name:req.body.file} 26 | ] 27 | }, function (err, message) { 28 | if (err) { 29 | res.status(200).send(err.smtp); 30 | } else { 31 | res.status(200).send(false); 32 | } 33 | 34 | }); 35 | //} else { 36 | //res.redirect('/?from='+req.url); 37 | //} 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-tr-TR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Turkish translation 3 | * Author: Emin Şen 4 | * Author: Sercan Cakir 5 | */ 6 | (function ($) { 7 | 'use strict'; 8 | 9 | $.fn.bootstrapTable.locales['tr-TR'] = { 10 | formatLoadingMessage: function () { 11 | return 'Yükleniyor, lütfen bekleyin...'; 12 | }, 13 | formatRecordsPerPage: function (pageNumber) { 14 | return 'Sayfa başına ' + pageNumber + ' kayıt.'; 15 | }, 16 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 17 | return totalRows + ' kayıttan ' + pageFrom + '-' + pageTo + ' arası gösteriliyor.'; 18 | }, 19 | formatSearch: function () { 20 | return 'Ara'; 21 | }, 22 | formatNoMatches: function () { 23 | return 'Eşleşen kayıt bulunamadı.'; 24 | }, 25 | formatRefresh: function () { 26 | return 'Yenile'; 27 | }, 28 | formatToggle: function () { 29 | return 'Değiştir'; 30 | }, 31 | formatColumns: function () { 32 | return 'Sütunlar'; 33 | }, 34 | formatAllRows: function () { 35 | return 'Tüm Satırlar'; 36 | } 37 | }; 38 | 39 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['tr-TR']); 40 | 41 | })(jQuery); 42 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-af-ZA.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Afrikaans translation 3 | * Author: Phillip Kruger 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['af-ZA'] = { 9 | formatLoadingMessage: function () { 10 | return 'Besig om te laai, wag asseblief ...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' rekords per bladsy'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Resultate ' + pageFrom + ' tot ' + pageTo + ' van ' + totalRows + ' rye'; 17 | }, 18 | formatSearch: function () { 19 | return 'Soek'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Geen rekords gevind nie'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'Wys/verberg bladsy nummering'; 26 | }, 27 | formatRefresh: function () { 28 | return 'Herlaai'; 29 | }, 30 | formatToggle: function () { 31 | return 'Wissel'; 32 | }, 33 | formatColumns: function () { 34 | return 'Kolomme'; 35 | } 36 | }; 37 | 38 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['af-ZA']); 39 | 40 | })(jQuery); 41 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ja-JP.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Japanese translation 3 | * Author: Azamshul Azizy 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['ja-JP'] = { 9 | formatLoadingMessage: function () { 10 | return '読み込み中です。少々お待ちください。'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return 'ページ当たり最大' + pageNumber + '件'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return '全' + totalRows + '件から、'+ pageFrom + 'から' + pageTo + '件目まで表示しています'; 17 | }, 18 | formatSearch: function () { 19 | return '検索'; 20 | }, 21 | formatNoMatches: function () { 22 | return '該当するレコードが見つかりません'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'ページ数を表示・非表示'; 26 | }, 27 | formatRefresh: function () { 28 | return '更新'; 29 | }, 30 | formatToggle: function () { 31 | return 'トグル'; 32 | }, 33 | formatColumns: function () { 34 | return '列'; 35 | }, 36 | formatAllRows: function () { 37 | return 'すべて'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ja-JP']); 42 | 43 | })(jQuery); -------------------------------------------------------------------------------- /app/server/views/sidebar_accounting.pug: -------------------------------------------------------------------------------- 1 | #sidebar.sidebar-offcanvas 2 | .col-md-12 3 | h3=__("Accounting") 4 | ul.nav.nav-pills.nav-stacked 5 | - console.log(global.settings.currenturl) 6 | li(class=global.settings.currenturl.indexOf('/accounting/customers/')>0 && global.settings.currenturl.indexOf('/accounting/customers/new/')==-1 ? "active" : undefined) 7 | a(href="/" + global.settings.dbName + "/accounting/customers/")=__("Customers") 8 | li(class=global.settings.currenturl.indexOf('/accounting/customers/new/')>0 ? "active" : undefined) 9 | a(href="/" + global.settings.dbName + "/accounting/customers/new/")=__("New customer") 10 | li(class=global.settings.currenturl.indexOf('/accounting/offers/')>0 ? "active" : undefined) 11 | a(href="/" + global.settings.dbName + "/accounting/offers/")=__("Offers") 12 | li(class=global.settings.currenturl.indexOf('/accounting/offer/')>0 ? "active" : undefined) 13 | a(href="/" + global.settings.dbName + "/accounting/offer/")=__("New offer") 14 | li(class=global.settings.currenturl.indexOf('/accounting/invoices/')>0 ? "active" : undefined) 15 | a(href="/" + global.settings.dbName + "/accounting/invoices/")=__("Invoices") 16 | li(class=global.settings.currenturl.indexOf('/accounting/invoice/')>0 ? "active" : undefined) 17 | a(href="/" + global.settings.dbName + "/accounting/invoice/")=__("New invoice") 18 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-CR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Spanish (Costa Rica) translation 3 | * Author: Dennis Hernández (http://djhvscf.github.io/Blog/) 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['es-CR'] = { 9 | formatLoadingMessage: function () { 10 | return 'Cargando, por favor espere...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' registros por página'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Mostrando de ' + pageFrom + ' a ' + pageTo + ' registros de ' + totalRows + ' registros en total'; 17 | }, 18 | formatSearch: function () { 19 | return 'Buscar'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'No se encontraron registros'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Refrescar'; 26 | }, 27 | formatToggle: function () { 28 | return 'Alternar'; 29 | }, 30 | formatColumns: function () { 31 | return 'Columnas'; 32 | }, 33 | formatAllRows: function () { 34 | return 'Todo'; 35 | } 36 | }; 37 | 38 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['es-CR']); 39 | 40 | })(jQuery); 41 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-NI.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Spanish (Nicaragua) translation 3 | * Author: Dennis Hernández (http://djhvscf.github.io/Blog/) 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['es-NI'] = { 9 | formatLoadingMessage: function () { 10 | return 'Cargando, por favor espere...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' registros por página'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Mostrando de ' + pageFrom + ' a ' + pageTo + ' registros de ' + totalRows + ' registros en total'; 17 | }, 18 | formatSearch: function () { 19 | return 'Buscar'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'No se encontraron registros'; 23 | }, 24 | formatRefresh: function () { 25 | return 'Refrescar'; 26 | }, 27 | formatToggle: function () { 28 | return 'Alternar'; 29 | }, 30 | formatColumns: function () { 31 | return 'Columnas'; 32 | }, 33 | formatAllRows: function () { 34 | return 'Todo'; 35 | } 36 | }; 37 | 38 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['es-NI']); 39 | 40 | })(jQuery); 41 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-he-IL.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Hebrew translation 3 | * Author: legshooter 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['he-IL'] = { 9 | formatLoadingMessage: function () { 10 | return 'טוען, נא להמתין...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' שורות בעמוד'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'מציג ' + pageFrom + ' עד ' + pageTo + ' מ-' + totalRows + ' שורות'; 17 | }, 18 | formatSearch: function () { 19 | return 'חיפוש'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'לא נמצאו רשומות תואמות'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'הסתר/הצג מספור דפים'; 26 | }, 27 | formatRefresh: function () { 28 | return 'רענן'; 29 | }, 30 | formatToggle: function () { 31 | return 'החלף תצוגה'; 32 | }, 33 | formatColumns: function () { 34 | return 'עמודות'; 35 | }, 36 | formatAllRows: function () { 37 | return 'הכל'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['he-IL']); 42 | 43 | })(jQuery); 44 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ka-GE.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Georgian translation 3 | * Author: Levan Lotuashvili 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['ka-GE'] = { 9 | formatLoadingMessage: function() { 10 | return 'იტვირთება, გთხოვთ მოიცადოთ...'; 11 | }, 12 | formatRecordsPerPage: function(pageNumber) { 13 | return pageNumber + ' ჩანაწერი თითო გვერდზე'; 14 | }, 15 | formatShowingRows: function(pageFrom, pageTo, totalRows) { 16 | return 'ნაჩვენებია ' + pageFrom + '-დან ' + pageTo + '-მდე ჩანაწერი ჯამური ' + totalRows + '-დან'; 17 | }, 18 | formatSearch: function() { 19 | return 'ძებნა'; 20 | }, 21 | formatNoMatches: function() { 22 | return 'მონაცემები არ არის'; 23 | }, 24 | formatPaginationSwitch: function() { 25 | return 'გვერდების გადამრთველის დამალვა/გამოჩენა'; 26 | }, 27 | formatRefresh: function() { 28 | return 'განახლება'; 29 | }, 30 | formatToggle: function() { 31 | return 'ჩართვა/გამორთვა'; 32 | }, 33 | formatColumns: function() { 34 | return 'სვეტები'; 35 | } 36 | }; 37 | 38 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ka-GE']); 39 | 40 | })(jQuery); 41 | -------------------------------------------------------------------------------- /app/server/setup.js: -------------------------------------------------------------------------------- 1 | //var DB = require('./server/modules/db-manager'); 2 | var bodyParser = require('body-parser'); 3 | var cookieParser = require('cookie-parser'); 4 | var session = require('express-session'); 5 | var methodOverride = require('method-override'); 6 | 7 | module.exports = function(app, exp) { 8 | //var env = process.env.NODE_ENV || 'development'; 9 | //if ('development' == env) { 10 | app.set('views', [global.settings.root_path + '/app/server/views', global.settings.root_path + '/warehouse']); 11 | app.set('view engine', 'pug'); 12 | //app.set('view options', { doctype : 'html', pretty : true }); 13 | app.use(bodyParser.raw({ limit: '50mb'})); 14 | app.use(bodyParser.json({ limit: '50mb'})); 15 | app.use(bodyParser.text({ limit: '50mb'})); 16 | app.use(bodyParser.urlencoded({ extended: true,limit: '50mb',parameterLimit: 1000000 })); 17 | //app.use(bodyParser()); 18 | app.use(cookieParser()); 19 | app.use(session({ secret: 'mongo-invoices', resave: false, saveUninitialized: true, cookie: { maxAge: 3600000 } })); 20 | app.use(methodOverride()); 21 | app.use(require('stylus').middleware({ src: global.settings.root_path + '/app/public' })); 22 | app.use(exp.static(global.settings.root_path + '/app/common')); 23 | app.use(exp.static(global.settings.root_path + '/app/public')); 24 | app.use(exp.static(global.settings.root_path + '/warehouse')); 25 | //app.use(DB.i18n.init); 26 | //} 27 | }; -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-fa-IR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Persian translation 3 | * Author: MJ Vakili 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['fa-IR'] = { 9 | formatLoadingMessage: function () { 10 | return 'در حال بارگذاری, لطفا صبر کنید...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' رکورد در صفحه'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'نمایش ' + pageFrom + ' تا ' + pageTo + ' از ' + totalRows + ' ردیف'; 17 | }, 18 | formatSearch: function () { 19 | return 'جستجو'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'رکوردی یافت نشد.'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'نمایش/مخفی صفحه بندی'; 26 | }, 27 | formatRefresh: function () { 28 | return 'به روز رسانی'; 29 | }, 30 | formatToggle: function () { 31 | return 'تغییر نمایش'; 32 | }, 33 | formatColumns: function () { 34 | return 'سطر ها'; 35 | }, 36 | formatAllRows: function () { 37 | return 'همه'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['fa-IR']); 42 | 43 | })(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-pt-BR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Brazilian Portuguese Translation 3 | * Author: Eduardo Cerqueira 4 | * Update: João Mello 5 | */ 6 | (function ($) { 7 | 'use strict'; 8 | 9 | $.fn.bootstrapTable.locales['pt-BR'] = { 10 | formatLoadingMessage: function () { 11 | return 'Carregando, aguarde...'; 12 | }, 13 | formatRecordsPerPage: function (pageNumber) { 14 | return pageNumber + ' registros por página'; 15 | }, 16 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 17 | return 'Exibindo ' + pageFrom + ' até ' + pageTo + ' de ' + totalRows + ' linhas'; 18 | }, 19 | formatSearch: function () { 20 | return 'Pesquisar'; 21 | }, 22 | formatRefresh: function () { 23 | return 'Recarregar'; 24 | }, 25 | formatToggle: function () { 26 | return 'Alternar'; 27 | }, 28 | formatColumns: function () { 29 | return 'Colunas'; 30 | }, 31 | formatPaginationSwitch: function () { 32 | return 'Ocultar/Exibir paginação'; 33 | }, 34 | formatNoMatches: function () { 35 | return 'Nenhum registro encontrado'; 36 | } 37 | }; 38 | 39 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['pt-BR']); 40 | 41 | })(jQuery); 42 | -------------------------------------------------------------------------------- /app/server/helpers/email-dispatcher.js: -------------------------------------------------------------------------------- 1 | 2 | var EM = {}; 3 | module.exports = EM; 4 | if (global._config.emailDispatcher && global._config.emailDispatcher.host && global._config.emailDispatcher.password){ 5 | EM.server = require("emailjs/email").server.connect({ 6 | host : global._config.emailDispatcher.host, 7 | user : global._config.emailDispatcher.user, 8 | password : global._config.emailDispatcher.password, 9 | ssl : true 10 | }); 11 | 12 | EM.dispatchResetPasswordLink = function(account, host, callback) { 13 | EM.server.send({ 14 | from : global._config.emailDispatcher.sendername+" <"+global._config.emailDispatcher.senderemail+">", 15 | to : account.email, 16 | subject : 'Password Reset', 17 | text : 'something went wrong... :(', 18 | attachment : EM.composeEmail(account, host) 19 | }, callback ); 20 | }; 21 | 22 | EM.composeEmail = function(o,host) { 23 | var emailencoded = new Buffer(o.email).toString('base64'); 24 | var link = 'http://'+host+'/reset-password?e='+emailencoded; 25 | var html = ""; 26 | html += "Hi "+o.name+",

"; 27 | html += "Your username is: "+o.user+"

"; 28 | html += ""+__("Please click here to reset your password")+"

"; 29 | html += "Cheers,
"; 30 | html += ""+host+"

"; 31 | html += ""; 32 | return [{data:html, alternative:true}]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-it-IT.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Italian translation 3 | * Author: Davide Renzi 4 | * Author: Davide Borsatto 5 | * Author: Alessio Felicioni 6 | */ 7 | (function ($) { 8 | 'use strict'; 9 | 10 | $.fn.bootstrapTable.locales['it-IT'] = { 11 | formatLoadingMessage: function () { 12 | return 'Caricamento in corso...'; 13 | }, 14 | formatRecordsPerPage: function (pageNumber) { 15 | return pageNumber + ' elementi per pagina'; 16 | }, 17 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 18 | return 'Pagina ' + pageFrom + ' di ' + pageTo + ' (' + totalRows + ' elementi)'; 19 | }, 20 | formatSearch: function () { 21 | return 'Cerca'; 22 | }, 23 | formatNoMatches: function () { 24 | return 'Nessun elemento trovato'; 25 | }, 26 | formatRefresh: function () { 27 | return 'Aggiorna'; 28 | }, 29 | formatToggle: function () { 30 | return 'Alterna'; 31 | }, 32 | formatColumns: function () { 33 | return 'Colonne'; 34 | }, 35 | formatAllRows: function () { 36 | return 'Tutto'; 37 | } 38 | }; 39 | 40 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['it-IT']); 41 | 42 | })(jQuery); 43 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-fr-FR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table French (France) translation 3 | * Author: Dennis Hernández (http://djhvscf.github.io/Blog/) 4 | * Modification: Tidalf (https://github.com/TidalfFR) 5 | */ 6 | (function ($) { 7 | 'use strict'; 8 | 9 | $.fn.bootstrapTable.locales['fr-FR'] = { 10 | formatLoadingMessage: function () { 11 | return 'Chargement en cours, patientez, s´il vous plaît ...'; 12 | }, 13 | formatRecordsPerPage: function (pageNumber) { 14 | return pageNumber + ' lignes par page'; 15 | }, 16 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 17 | return 'Affichage des lignes ' + pageFrom + ' à ' + pageTo + ' sur ' + totalRows + ' lignes au total'; 18 | }, 19 | formatSearch: function () { 20 | return 'Rechercher'; 21 | }, 22 | formatNoMatches: function () { 23 | return 'Aucun résultat trouvé'; 24 | }, 25 | formatRefresh: function () { 26 | return 'Rafraîchir'; 27 | }, 28 | formatToggle: function () { 29 | return 'Alterner'; 30 | }, 31 | formatColumns: function () { 32 | return 'Colonnes'; 33 | }, 34 | formatAllRows: function () { 35 | return 'Tous'; 36 | } 37 | }; 38 | 39 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['fr-FR']); 40 | 41 | })(jQuery); 42 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-hu-HU.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Hungarian translation 3 | * Author: Nagy Gergely 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['hu-HU'] = { 9 | formatLoadingMessage: function () { 10 | return 'Betöltés, kérem várjon...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' rekord per oldal'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Megjelenítve ' + pageFrom + ' - ' + pageTo + ' / ' + totalRows + ' összesen'; 17 | }, 18 | formatSearch: function () { 19 | return 'Keresés'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Nincs találat'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'Lapozó elrejtése/megjelenítése'; 26 | }, 27 | formatRefresh: function () { 28 | return 'Frissítés'; 29 | }, 30 | formatToggle: function () { 31 | return 'Összecsuk/Kinyit'; 32 | }, 33 | formatColumns: function () { 34 | return 'Oszlopok'; 35 | }, 36 | formatAllRows: function () { 37 | return 'Összes'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['hu-HU']); 42 | 43 | })(jQuery); 44 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-et-EE.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Estonian translation 3 | * Author: kristjan@logist.it> 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['et-EE'] = { 9 | formatLoadingMessage: function () { 10 | return 'Päring käib, palun oota...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' rida lehe kohta'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Näitan tulemusi ' + pageFrom + ' kuni ' + pageTo + ' - kokku ' + totalRows + ' tulemust'; 17 | }, 18 | formatSearch: function () { 19 | return 'Otsi'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Päringu tingimustele ei vastanud ühtegi tulemust'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'Näita/Peida lehtedeks jagamine'; 26 | }, 27 | formatRefresh: function () { 28 | return 'Värskenda'; 29 | }, 30 | formatToggle: function () { 31 | return 'Lülita'; 32 | }, 33 | formatColumns: function () { 34 | return 'Veerud'; 35 | }, 36 | formatAllRows: function () { 37 | return 'Kõik'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['et-EE']); 42 | 43 | })(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ro-RO.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Romanian translation 3 | * Author: cristake 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['ro-RO'] = { 9 | formatLoadingMessage: function () { 10 | return 'Se incarca, va rugam asteptati...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' inregistrari pe pagina'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Arata de la ' + pageFrom + ' pana la ' + pageTo + ' din ' + totalRows + ' randuri'; 17 | }, 18 | formatSearch: function () { 19 | return 'Cauta'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Nu au fost gasite inregistrari'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'Ascunde/Arata paginatia'; 26 | }, 27 | formatRefresh: function () { 28 | return 'Reincarca'; 29 | }, 30 | formatToggle: function () { 31 | return 'Comuta'; 32 | }, 33 | formatColumns: function () { 34 | return 'Coloane'; 35 | }, 36 | formatAllRows: function () { 37 | return 'Toate'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ro-RO']); 42 | 43 | })(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-zh-CN.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Chinese translation 3 | * Author: Zhixin Wen 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['zh-CN'] = { 9 | formatLoadingMessage: function () { 10 | return '正在努力地加载数据中,请稍候……'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return '每页显示 ' + pageNumber + ' 条记录'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录'; 17 | }, 18 | formatSearch: function () { 19 | return '搜索'; 20 | }, 21 | formatNoMatches: function () { 22 | return '没有找到匹配的记录'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return '隐藏/显示分页'; 26 | }, 27 | formatRefresh: function () { 28 | return '刷新'; 29 | }, 30 | formatToggle: function () { 31 | return '切换'; 32 | }, 33 | formatColumns: function () { 34 | return '列'; 35 | }, 36 | formatExport: function () { 37 | return '导出数据'; 38 | }, 39 | formatClearFilters: function () { 40 | return '清空过滤'; 41 | } 42 | }; 43 | 44 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']); 45 | 46 | })(jQuery); 47 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-es-ES.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Spanish Spain translation 3 | * Author: Marc Pina 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['es-ES'] = { 9 | formatLoadingMessage: function () { 10 | return 'Por favor espere...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' resultados por página'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Mostrando desde ' + pageFrom + ' hasta ' + pageTo + ' - En total ' + totalRows + ' resultados'; 17 | }, 18 | formatSearch: function () { 19 | return 'Buscar'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'No se encontraron resultados'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'Ocultar/Mostrar paginación'; 26 | }, 27 | formatRefresh: function () { 28 | return 'Refrescar'; 29 | }, 30 | formatToggle: function () { 31 | return 'Ocultar/Mostrar'; 32 | }, 33 | formatColumns: function () { 34 | return 'Columnas'; 35 | }, 36 | formatAllRows: function () { 37 | return 'Todos'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['es-ES']); 42 | 43 | })(jQuery); 44 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-pt-PT.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Portuguese Portugal Translation 3 | * Author: Burnspirit 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['pt-PT'] = { 9 | formatLoadingMessage: function () { 10 | return 'A carregar, por favor aguarde...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' registos por página'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'A mostrar ' + pageFrom + ' até ' + pageTo + ' de ' + totalRows + ' linhas'; 17 | }, 18 | formatSearch: function () { 19 | return 'Pesquisa'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Nenhum registo encontrado'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'Esconder/Mostrar paginação'; 26 | }, 27 | formatRefresh: function () { 28 | return 'Atualizar'; 29 | }, 30 | formatToggle: function () { 31 | return 'Alternar'; 32 | }, 33 | formatColumns: function () { 34 | return 'Colunas'; 35 | }, 36 | formatAllRows: function () { 37 | return 'Tudo'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['pt-PT']); 42 | 43 | })(jQuery); 44 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-cs-CZ.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Czech translation 3 | * Author: Lukas Kral (monarcha@seznam.cz) 4 | * Author: Jakub Svestka 5 | */ 6 | (function ($) { 7 | 'use strict'; 8 | 9 | $.fn.bootstrapTable.locales['cs-CZ'] = { 10 | formatLoadingMessage: function () { 11 | return 'Čekejte, prosím...'; 12 | }, 13 | formatRecordsPerPage: function (pageNumber) { 14 | return pageNumber + ' položek na stránku'; 15 | }, 16 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 17 | return 'Zobrazena ' + pageFrom + '. - ' + pageTo + '. položka z celkových ' + totalRows; 18 | }, 19 | formatSearch: function () { 20 | return 'Vyhledávání'; 21 | }, 22 | formatNoMatches: function () { 23 | return 'Nenalezena žádná vyhovující položka'; 24 | }, 25 | formatPaginationSwitch: function () { 26 | return 'Skrýt/Zobrazit stránkování'; 27 | }, 28 | formatRefresh: function () { 29 | return 'Aktualizovat'; 30 | }, 31 | formatToggle: function () { 32 | return 'Přepni'; 33 | }, 34 | formatColumns: function () { 35 | return 'Sloupce'; 36 | }, 37 | formatAllRows: function () { 38 | return 'Vše'; 39 | } 40 | }; 41 | 42 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['cs-CZ']); 43 | 44 | })(jQuery); 45 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ms-MY.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Malay translation 3 | * Author: Azamshul Azizy 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['ms-MY'] = { 9 | formatLoadingMessage: function () { 10 | return 'Permintaan sedang dimuatkan. Sila tunggu sebentar...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' rekod setiap muka surat'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Sedang memaparkan rekod ' + pageFrom + ' hingga ' + pageTo + ' daripada jumlah ' + totalRows + ' rekod'; 17 | }, 18 | formatSearch: function () { 19 | return 'Cari'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'Tiada rekod yang menyamai permintaan'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'Tunjuk/sembunyi muka surat'; 26 | }, 27 | formatRefresh: function () { 28 | return 'Muatsemula'; 29 | }, 30 | formatToggle: function () { 31 | return 'Tukar'; 32 | }, 33 | formatColumns: function () { 34 | return 'Lajur'; 35 | }, 36 | formatAllRows: function () { 37 | return 'Semua'; 38 | } 39 | }; 40 | 41 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ms-MY']); 42 | 43 | })(jQuery); 44 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-ca-ES.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Catalan translation 3 | * Authors: Marc Pina 4 | * Claudi Martinez 5 | */ 6 | (function ($) { 7 | 'use strict'; 8 | 9 | $.fn.bootstrapTable.locales['ca-ES'] = { 10 | formatLoadingMessage: function () { 11 | return 'Espereu, si us plau...'; 12 | }, 13 | formatRecordsPerPage: function (pageNumber) { 14 | return pageNumber + ' resultats per pàgina'; 15 | }, 16 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 17 | return 'Mostrant de ' + pageFrom + ' fins ' + pageTo + ' - total ' + totalRows + ' resultats'; 18 | }, 19 | formatSearch: function () { 20 | return 'Cerca'; 21 | }, 22 | formatNoMatches: function () { 23 | return 'No s\'han trobat resultats'; 24 | }, 25 | formatPaginationSwitch: function () { 26 | return 'Amaga/Mostra paginació'; 27 | }, 28 | formatRefresh: function () { 29 | return 'Refresca'; 30 | }, 31 | formatToggle: function () { 32 | return 'Alterna formatació'; 33 | }, 34 | formatColumns: function () { 35 | return 'Columnes'; 36 | }, 37 | formatAllRows: function () { 38 | return 'Tots'; 39 | } 40 | }; 41 | 42 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ca-ES']); 43 | 44 | })(jQuery); 45 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-hr-HR.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table Croatian translation 3 | * Author: Petra Štrbenac (petra.strbenac@gmail.com) 4 | * Author: Petra Štrbenac (petra.strbenac@gmail.com) 5 | */ 6 | (function ($) { 7 | 'use strict'; 8 | 9 | $.fn.bootstrapTable.locales['hr-HR'] = { 10 | formatLoadingMessage: function () { 11 | return 'Molimo pričekajte ...'; 12 | }, 13 | formatRecordsPerPage: function (pageNumber) { 14 | return pageNumber + ' broj zapisa po stranici'; 15 | }, 16 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 17 | return 'Prikazujem ' + pageFrom + '. - ' + pageTo + '. od ukupnog broja zapisa ' + totalRows; 18 | }, 19 | formatSearch: function () { 20 | return 'Pretraži'; 21 | }, 22 | formatNoMatches: function () { 23 | return 'Nije pronađen niti jedan zapis'; 24 | }, 25 | formatPaginationSwitch: function () { 26 | return 'Prikaži/sakrij stranice'; 27 | }, 28 | formatRefresh: function () { 29 | return 'Osvježi'; 30 | }, 31 | formatToggle: function () { 32 | return 'Promijeni prikaz'; 33 | }, 34 | formatColumns: function () { 35 | return 'Kolone'; 36 | }, 37 | formatAllRows: function () { 38 | return 'Sve'; 39 | } 40 | }; 41 | 42 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['hr-HR']); 43 | 44 | })(jQuery); 45 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/locale/bootstrap-table-en-US.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap Table English translation 3 | * Author: Zhixin Wen 4 | */ 5 | (function ($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['en-US'] = { 9 | formatLoadingMessage: function () { 10 | return 'Loading, please wait...'; 11 | }, 12 | formatRecordsPerPage: function (pageNumber) { 13 | return pageNumber + ' rows per page'; 14 | }, 15 | formatShowingRows: function (pageFrom, pageTo, totalRows) { 16 | return 'Showing ' + pageFrom + ' to ' + pageTo + ' of ' + totalRows + ' rows'; 17 | }, 18 | formatSearch: function () { 19 | return 'Search'; 20 | }, 21 | formatNoMatches: function () { 22 | return 'No matching records found'; 23 | }, 24 | formatPaginationSwitch: function () { 25 | return 'Hide/Show pagination'; 26 | }, 27 | formatRefresh: function () { 28 | return 'Refresh'; 29 | }, 30 | formatToggle: function () { 31 | return 'Toggle'; 32 | }, 33 | formatColumns: function () { 34 | return 'Columns'; 35 | }, 36 | formatAllRows: function () { 37 | return 'All'; 38 | }, 39 | formatExport: function () { 40 | return 'Export data'; 41 | }, 42 | formatClearFilters: function () { 43 | return 'Clear filters'; 44 | } 45 | }; 46 | 47 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['en-US']); 48 | 49 | })(jQuery); 50 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/natural-sorting/bootstrap-table-natural-sorting.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author: Brian Huisman 3 | * @webSite: http://www.greywyvern.com 4 | * @version: v1.0.0 5 | * JS functions to allow natural sorting on bootstrap-table columns 6 | * add data-sorter="alphanum" or data-sorter="numericOnly" to any th 7 | * 8 | * @update Dennis Hernández 9 | * @update Duane May 10 | */ 11 | 12 | function alphanum(a, b) { 13 | function chunkify(t) { 14 | var tz = [], 15 | x = 0, 16 | y = -1, 17 | n = 0, 18 | i, 19 | j; 20 | 21 | while (i = (j = t.charAt(x++)).charCodeAt(0)) { 22 | var m = (i === 46 || (i >= 48 && i <= 57)); 23 | if (m !== n) { 24 | tz[++y] = ""; 25 | n = m; 26 | } 27 | tz[y] += j; 28 | } 29 | return tz; 30 | } 31 | 32 | function stringfy(v) { 33 | if (typeof(v) === "number") { 34 | v = "" + v; 35 | } 36 | if (!v) { 37 | v = ""; 38 | } 39 | return v; 40 | } 41 | 42 | var aa = chunkify(stringfy(a)); 43 | var bb = chunkify(stringfy(b)); 44 | 45 | for (x = 0; aa[x] && bb[x]; x++) { 46 | if (aa[x] !== bb[x]) { 47 | var c = Number(aa[x]), 48 | d = Number(bb[x]); 49 | 50 | if (c == aa[x] && d == bb[x]) { 51 | return c - d; 52 | } else { 53 | return (aa[x] > bb[x]) ? 1 : -1; 54 | } 55 | } 56 | } 57 | return aa.length - bb.length; 58 | } 59 | 60 | function numericOnly(a, b) { 61 | function stripNonNumber(s) { 62 | s = s.replace(new RegExp(/[^0-9]/g), ""); 63 | return parseInt(s, 10); 64 | } 65 | 66 | return stripNonNumber(a) - stripNonNumber(b); 67 | } -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/reorder-rows/bootstrap-table-reorder-rows.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=function(a,b){return{id:"customId_"+b}};a.extend(a.fn.bootstrapTable.defaults,{reorderableRows:!1,onDragStyle:null,onDropStyle:null,onDragClass:"reorder_rows_onDragClass",dragHandle:null,useRowAttrFunc:!1,onReorderRowsDrag:function(){return!1},onReorderRowsDrop:function(){return!1},onReorderRow:function(){return!1}}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"reorder-row.bs.table":"onReorderRow"});var c=a.fn.bootstrapTable.Constructor,d=c.prototype.init,e=c.prototype.initSearch;c.prototype.init=function(){if(!this.options.reorderableRows)return void d.apply(this,Array.prototype.slice.apply(arguments));var a=this;this.options.useRowAttrFunc&&(this.options.rowAttributes=b);var c=this.options.onPostBody;this.options.onPostBody=function(){setTimeout(function(){a.makeRowsReorderable(),c.apply()},1)},d.apply(this,Array.prototype.slice.apply(arguments))},c.prototype.initSearch=function(){e.apply(this,Array.prototype.slice.apply(arguments)),!this.options.reorderableRows},c.prototype.makeRowsReorderable=function(){if(!this.options.cardView){var a=this;this.$el.tableDnD({onDragStyle:a.options.onDragStyle,onDropStyle:a.options.onDropStyle,onDragClass:a.options.onDragClass,onDrop:a.onDrop,onDragStart:a.options.onReorderRowsDrag,dragHandle:a.options.dragHandle})}},c.prototype.onDrop=function(b,c){for(var d=a(b),e=d.data("bootstrap.table"),f=d.data("bootstrap.table").options,g=null,h=[],i=0;i 4 | */ 5 | (function($) { 6 | 'use strict'; 7 | 8 | $.fn.bootstrapTable.locales['nl-NL'] = { 9 | formatLoadingMessage: function() { 10 | return 'Laden, even geduld...'; 11 | }, 12 | formatRecordsPerPage: function(pageNumber) { 13 | return pageNumber + ' records per pagina'; 14 | }, 15 | formatShowingRows: function(pageFrom, pageTo, totalRows) { 16 | return 'Toon ' + pageFrom + ' tot ' + pageTo + ' van ' + totalRows + ' record' + ((totalRows > 1) ? 's' : ''); 17 | }, 18 | formatDetailPagination: function(totalRows) { 19 | return 'Toon ' + totalRows + ' record' + ((totalRows > 1) ? 's' : ''); 20 | }, 21 | formatSearch: function() { 22 | return 'Zoeken'; 23 | }, 24 | formatNoMatches: function() { 25 | return 'Geen resultaten gevonden'; 26 | }, 27 | formatRefresh: function() { 28 | return 'Vernieuwen'; 29 | }, 30 | formatToggle: function() { 31 | return 'Omschakelen'; 32 | }, 33 | formatColumns: function() { 34 | return 'Kolommen'; 35 | }, 36 | formatAllRows: function() { 37 | return 'Alle'; 38 | }, 39 | formatPaginationSwitch: function() { 40 | return 'Verberg/Toon paginatie'; 41 | }, 42 | formatExport: function() { 43 | return 'Exporteer data'; 44 | }, 45 | formatClearFilters: function() { 46 | return 'Verwijder filters'; 47 | } 48 | }; 49 | 50 | $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['nl-NL']); 51 | 52 | })(jQuery); 53 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=function(b,c){b.options.columnsHidden.length>0&&a.each(b.columns,function(d,e){-1!==b.options.columnsHidden.indexOf(e.field)&&e.visible!==c&&b.toggleColumn(a.fn.bootstrapTable.utils.getFieldIndex(b.columns,e.field),c,!0)})},c=function(a){(a.options.height||a.options.showFooter)&&setTimeout(function(){a.resetView.call(a)},1)},d=function(a,b,d){a.options.minHeight?b<=a.options.minWidth&&d<=a.options.minHeight?e(a):b>a.options.minWidth&&d>a.options.minHeight&&f(a):b<=a.options.minWidth?e(a):b>a.options.minWidth&&f(a),c(a)},e=function(a){g(a,!1),b(a,!1)},f=function(a){g(a,!0),b(a,!0)},g=function(a,b){a.options.cardView=b,a.toggleView()},h=function(a,b){var c;return function(){var d=this,e=arguments,f=function(){c=null,a.apply(d,e)};clearTimeout(c),c=setTimeout(f,b)}};a.extend(a.fn.bootstrapTable.defaults,{mobileResponsive:!1,minWidth:562,minHeight:void 0,heightThreshold:100,checkOnInit:!0,columnsHidden:[]});var i=a.fn.bootstrapTable.Constructor,j=i.prototype.init;i.prototype.init=function(){if(j.apply(this,Array.prototype.slice.apply(arguments)),this.options.mobileResponsive&&this.options.minWidth){this.options.minWidth<100&&this.options.resizable&&(console.log("The minWidth when the resizable extension is active should be greater or equal than 100"),this.options.minWidth=100);var b=this,c={width:a(window).width(),height:a(window).height()};if(a(window).on("resize orientationchange",h(function(){var e=a(this).height(),f=a(this).width();(Math.abs(c.height-e)>b.options.heightThreshold||c.width!=f)&&(d(b,f,e),c={width:f,height:e})},200)),this.options.checkOnInit){var e=a(window).height(),f=a(window).width();d(this,f,e),c={width:f,height:e}}}}}(jQuery); -------------------------------------------------------------------------------- /app/server/views/accounts.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | block content 3 | .row-offcanvas.row-offcanvas-left.cnt 4 | include sidebar_settings 5 | #main 6 | .col-md-12 7 | h1.page-title=__("Accounts") 8 | div 9 | - if (typeof msg !== "undefined" && typeof msg.e !== "undefined" && msg.e.length) { 10 | .alert.alert-danger 11 | h4=__("There are some errors") 12 | ul 13 | - for(var a=0;a.btn-group");if("string"==typeof this.options.multiToggleDefaults&&(this.options.multiToggleDefaults=JSON.parse(this.options.multiToggleDefaults)),this.options.showToggleBtn&&this.options.showColumns){var c="",d="";b.append(c+d),b.find("#showAllBtn").click(function(){a.showAllColumns(),b.find("#hideAllBtn").toggleClass("hidden"),b.find("#showAllBtn").toggleClass("hidden")}),b.find("#hideAllBtn").click(function(){a.hideAllColumns(),b.find("#hideAllBtn").toggleClass("hidden"),b.find("#showAllBtn").toggleClass("hidden")})}},d.prototype.hideAllColumns=function(){var d=this,e=d.options.multiToggleDefaults;a.each(this.columns,function(a,c){if(-1==e.indexOf(c.field)&&c.switchable){c.visible=!1;var f=d.$toolbar.find(".keep-open input").prop("disabled",!1);f.filter(b('[value="%s"]',a)).prop("checked",!1)}}),c(d)},d.prototype.showAllColumns=function(){var d=this;a.each(this.columns,function(a,c){c.switchable&&(c.visible=!0);var e=d.$toolbar.find(".keep-open input").prop("disabled",!1);e.filter(b('[value="%s"]',a)).prop("checked",!0)}),c(d),d.toggleColumn(0,d.columns[0].visible,!1)}}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/flat-json/bootstrap-table-flat-json.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author: Dennis Hernández 3 | * @webSite: http://djhvscf.github.io/Blog 4 | * @version: v1.3.0 5 | */ 6 | 7 | (function ($) { 8 | 'use strict'; 9 | 10 | var flat = function (element, that) { 11 | var result = {}; 12 | 13 | function recurse(cur, prop) { 14 | if (Object(cur) !== cur) { 15 | result[prop] = cur; 16 | } else if ($.isArray(cur)) { 17 | for (var i = 0, l = cur.length; i < l; i++) { 18 | recurse(cur[i], prop ? prop + that.options.flatSeparator + i : "" + i); 19 | if (l == 0) { 20 | result[prop] = []; 21 | } 22 | } 23 | } else { 24 | var isEmpty = true; 25 | for (var p in cur) { 26 | isEmpty = false; 27 | recurse(cur[p], prop ? prop + that.options.flatSeparator + p : p); 28 | } 29 | if (isEmpty) { 30 | result[prop] = {}; 31 | } 32 | } 33 | } 34 | 35 | recurse(element, ""); 36 | return result; 37 | }; 38 | 39 | var flatHelper = function (data, that) { 40 | var flatArray = []; 41 | 42 | $.each(!$.isArray(data) ? [data] : data, function (i, element) { 43 | flatArray.push(flat(element, that)); 44 | }); 45 | return flatArray; 46 | }; 47 | 48 | $.extend($.fn.bootstrapTable.defaults, { 49 | flat: false, 50 | flatSeparator: '.' 51 | }); 52 | 53 | var BootstrapTable = $.fn.bootstrapTable.Constructor, 54 | _initData = BootstrapTable.prototype.initData; 55 | 56 | BootstrapTable.prototype.initData = function (data, type) { 57 | if (this.options.flat) { 58 | data = flatHelper(data ? data : this.options.data, this); 59 | } 60 | _initData.apply(this, [data, type]); 61 | }; 62 | })(jQuery); 63 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/copy-rows/bootstrap-table-copy-rows.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=a.fn.bootstrapTable.utils.calculateObjectValue,c=(a.fn.bootstrapTable.utils.sprintf,function(b){var c=document.createElement("textarea");a(c).html(b),document.body.appendChild(c),c.select();try{document.execCommand("copy")}catch(d){console.log("Oops, unable to copy")}a(c).remove()});a.extend(a.fn.bootstrapTable.defaults,{copyBtn:!1,copyWHiddenBtn:!1,copyDelemeter:", "}),a.fn.bootstrapTable.methods.push("copyColumnsToClipboard","copyColumnsToClipboardWithHidden");var d=a.fn.bootstrapTable.Constructor,e=d.prototype.initToolbar;d.prototype.initToolbar=function(){e.apply(this,Array.prototype.slice.apply(arguments));var a=this,b=this.$toolbar.find(">.btn-group");if(this.options.clickToSelect||this.options.singleSelect){if(this.options.copyBtn){var c="";b.append(c),b.find("#copyBtn").click(function(){a.copyColumnsToClipboard()})}if(this.options.copyWHiddenBtn){var d="";b.append(d),b.find("#copyWHiddenBtn").click(function(){a.copyColumnsToClipboardWithHidden()})}}},d.prototype.copyColumnsToClipboard=function(){var d=this,e="",f=this.options.copyDelemeter;a.each(d.getSelections(),function(c,g){a.each(d.options.columns[0],function(a,h){"state"!==h.field&&"RowNumber"!==h.field&&h.visible&&(null!==g[h.field]&&(e+=b(h,d.header.formatters[a],[g[h.field],g,c],g[h.field])),e+=f)}),e+="\r\n"}),c(e)},d.prototype.copyColumnsToClipboardWithHidden=function(){var d=this,e="",f=this.options.copyDelemeter;a.each(d.getSelections(),function(c,g){a.each(d.options.columns[0],function(a,h){"state"!=h.field&&"RowNumber"!==h.field&&(null!==g[h.field]&&(e+=b(h,d.header.formatters[a],[g[h.field],g,c],g[h.field])),e+=f)}),e+="\r\n"}),c(e)}}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/angular/bootstrap-table-angular.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(){"undefined"!=typeof angular&&angular.module("bsTable",[]).constant("uiBsTables",{bsTables:{}}).directive("bsTableControl",["uiBsTables",function(a){function b(a){var b;return $.each(g,function(c,e){return e.$el.closest(d).has(a).length?(b=e,!0):void 0}),b}function c(){var a=this,b=a.$s.bsTableControl.state;a.$s.$applyAsync(function(){b.scroll=a.$el.bootstrapTable("getScrollPosition")})}var d=".bootstrap-table",e=".fixed-table-body",f=".search input",g=a.bsTables;return $(window).resize(function(){$.each(g,function(a,b){b.$el.bootstrapTable("resetView")})}),$(document).on("post-header.bs.table",d+" table",function(a){var f=b(a.target);f&&f.$el.closest(d).find(e).on("scroll",c.bind(f))}).on("sort.bs.table",d+" table",function(a,c,d){var e=b(a.target);if(e){var f=e.$s.bsTableControl.state;e.$s.$applyAsync(function(){f.sortName=c,f.sortOrder=d})}}).on("page-change.bs.table",d+" table",function(a,c,d){var e=b(a.target);if(e){var f=e.$s.bsTableControl.state;e.$s.$applyAsync(function(){f.pageNumber=c,f.pageSize=d})}}).on("search.bs.table",d+" table",function(a,c){var d=b(a.target);if(d){var e=d.$s.bsTableControl.state;d.$s.$applyAsync(function(){e.searchText=c})}}).on("focus blur",d+" "+f,function(a){var c=b(a.target);if(c){var d=c.$s.bsTableControl.state;c.$s.$applyAsync(function(){d.searchHasFocus=$(a.target).is(":focus")})}}),{restrict:"EA",scope:{bsTableControl:"="},link:function(a,b){g[a.$id]={$s:a,$el:b};a.instantiated=!1,a.$watch("bsTableControl.options",function(c){c||(c=a.bsTableControl.options={});var e=a.bsTableControl.state||{};a.instantiated&&b.bootstrapTable("destroy"),b.bootstrapTable(angular.extend(angular.copy(c),e)),a.instantiated=!0,"scroll"in e&&b.bootstrapTable("scrollTo",e.scroll),"searchHasFocus"in e&&b.closest(d).find(f).focus()},!0),a.$watch("bsTableControl.state",function(c){c||(c=a.bsTableControl.state={}),b.trigger("directive-updated.bs.table",[c])},!0),a.$on("$destroy",function(){delete g[a.$id]})}}}])}(); -------------------------------------------------------------------------------- /app/server/routes/api.js: -------------------------------------------------------------------------------- 1 | var DB = require('../helpers/db-manager'); 2 | var helpers = require('../helpers/helpers'); 3 | 4 | exports.getCustomers = function getCustomers(req, res) { 5 | console.log(req.session.user); 6 | if (req.session.user == null) { 7 | res.redirect('/?from='+req.url); 8 | } else { 9 | var query = {name:{$regex: req.query.term, $options: 'i' }}; 10 | console.dir(query); 11 | DB.customers.find(query).toArray(function(e, result) { 12 | console.dir(result); 13 | res.status(200).send(result); 14 | }); 15 | } 16 | 17 | }; 18 | 19 | exports.getPayments = function getPayments(req, res) { 20 | if (req.session.user == null) { 21 | res.redirect('/?from='+req.url); 22 | } else { 23 | var query = {payment:{$regex: req.query.term, $options: 'i' }}; 24 | console.dir(query); 25 | DB.invoices.distinct("payment", query, function(e, result) { 26 | console.dir(result); 27 | res.status(200).send(result); 28 | }); 29 | } 30 | }; 31 | 32 | exports.getInvoices = function getInvoices(req, res) { 33 | var d = req.query.invoice_date.split("/"); 34 | var q = {invoice_date:{$gt: new Date(parseInt(d[2], 10),parseInt(d[1], 10)-1,parseInt(d[0], 10))},invoice_number:(req.query.invoice_number-1).toString() }; 35 | console.dir(q); 36 | DB.invoices.find(q).toArray(function(e, result) { 37 | console.dir(result); 38 | res.status(200).send({result:result}); 39 | }); 40 | }; 41 | 42 | exports.getOffers = function getInvoices(req, res) { 43 | DB.offers.find({},{offer_number:1,offer_date:1,to_client:1,description:1}).sort({offer_number:-1}).toArray(function(e, result) { 44 | console.dir(result); 45 | res.status(200).send({result:result}); 46 | }); 47 | }; 48 | 49 | exports.getProducts = function getProducts(req, res) { 50 | if (req.session.user == null) { 51 | res.redirect('/?from='+req.url); 52 | } else { 53 | var query = {'items.description':{$regex: req.query.term, $options: 'i' }}; 54 | console.dir(query); 55 | DB.invoices.distinct('items.description', query, function(e, result) { 56 | console.dir(result); 57 | res.status(200).send(result); 58 | }); 59 | } 60 | }; 61 | -------------------------------------------------------------------------------- /app/server/routes/offers.js: -------------------------------------------------------------------------------- 1 | var ObjectID = require('mongodb').ObjectID; 2 | var DB = require('./../helpers/db-manager'); 3 | var helpers = require('./../helpers/helpers'); 4 | 5 | exports.get = function get(req, res) { 6 | helpers.canIseeThis(req, function (auth) { 7 | if (auth) { 8 | var msg = {}; 9 | if (req.query.id && req.query.del) { 10 | DB.delete_offer(req.query.id, function(err, obj){ 11 | if (obj){ 12 | msg.c = []; 13 | msg.c.push({name:"",m:__("Offer deleted successfully")}); 14 | } else { 15 | msg.e = []; 16 | msg.e.push({name:"",m:__("Offer not found")}); 17 | } 18 | }); 19 | } 20 | var query = req.query.customer ? {"to_client._id":req.query.customer} : {}; 21 | if (!req.query.year) req.query.year = new Date().getFullYear(); 22 | if (req.query.year && req.query.year!="ALL Years") { 23 | year = parseInt(req.query.year); 24 | var start = new Date(year-1, 11, 31); 25 | var end = new Date(year+1, 0, 1); 26 | query.offer_date = {$gte: start, $lt: end} 27 | } else { 28 | year = req.query.year; 29 | } 30 | 31 | DB.offers.find().toArray(function(e, result) { 32 | var years = [new Date().getFullYear()]; 33 | for (var a=0;a"; 17 | } 18 | str+= ""; 19 | if (response.msg && response.msg.e && response.msg.e.length) { 20 | showModal('error', str); 21 | } else { 22 | location.href=response.msg.redirect 23 | } 24 | }, 25 | error : function(e){ 26 | showModal('error', 'Please check your username and/or password'); 27 | } 28 | }); 29 | //$('#user-tf').focus(); 30 | 31 | // login retrieval form via email // 32 | $('#get-credentials-form').ajaxForm({ 33 | url: '/lost-password', 34 | beforeSubmit : function(formData, jqForm, options){ 35 | if (Validators.validateEmail($('#email-tf').val())){ 36 | hideEmailAlert(); 37 | return true; 38 | } else{ 39 | showEmailAlert(" Error! Please enter a valid email address"); 40 | return false; 41 | } 42 | }, 43 | success : function(responseText, status, xhr, $form){ 44 | showEmailSuccess("Check your email on how to reset your password."); 45 | }, 46 | error : function(){ 47 | showEmailAlert("Sorry. There was a problem, please try again later."); 48 | } 49 | }); 50 | 51 | }); 52 | var get_credentials_alert = $('#get-credentials .alert'); 53 | function showEmailAlert(m) { 54 | get_credentials_alert.attr('class', 'alert alert-error').html(m).show(); 55 | } 56 | 57 | function hideEmailAlert() { 58 | get_credentials_alert.hide(); 59 | } 60 | 61 | function showEmailSuccess(m) { 62 | get_credentials_alert.attr('class', 'alert alert-success').html(m).fadeIn(500); 63 | } 64 | 65 | -------------------------------------------------------------------------------- /app/public/css/fontello-animation.css: -------------------------------------------------------------------------------- 1 | /* 2 | Animation example, for spinners 3 | */ 4 | .animate-spin { 5 | -moz-animation: spin 2s infinite linear; 6 | -o-animation: spin 2s infinite linear; 7 | -webkit-animation: spin 2s infinite linear; 8 | animation: spin 2s infinite linear; 9 | display: inline-block; 10 | } 11 | @-moz-keyframes spin { 12 | 0% { 13 | -moz-transform: rotate(0deg); 14 | -o-transform: rotate(0deg); 15 | -webkit-transform: rotate(0deg); 16 | transform: rotate(0deg); 17 | } 18 | 19 | 100% { 20 | -moz-transform: rotate(359deg); 21 | -o-transform: rotate(359deg); 22 | -webkit-transform: rotate(359deg); 23 | transform: rotate(359deg); 24 | } 25 | } 26 | @-webkit-keyframes spin { 27 | 0% { 28 | -moz-transform: rotate(0deg); 29 | -o-transform: rotate(0deg); 30 | -webkit-transform: rotate(0deg); 31 | transform: rotate(0deg); 32 | } 33 | 34 | 100% { 35 | -moz-transform: rotate(359deg); 36 | -o-transform: rotate(359deg); 37 | -webkit-transform: rotate(359deg); 38 | transform: rotate(359deg); 39 | } 40 | } 41 | @-o-keyframes spin { 42 | 0% { 43 | -moz-transform: rotate(0deg); 44 | -o-transform: rotate(0deg); 45 | -webkit-transform: rotate(0deg); 46 | transform: rotate(0deg); 47 | } 48 | 49 | 100% { 50 | -moz-transform: rotate(359deg); 51 | -o-transform: rotate(359deg); 52 | -webkit-transform: rotate(359deg); 53 | transform: rotate(359deg); 54 | } 55 | } 56 | @-ms-keyframes spin { 57 | 0% { 58 | -moz-transform: rotate(0deg); 59 | -o-transform: rotate(0deg); 60 | -webkit-transform: rotate(0deg); 61 | transform: rotate(0deg); 62 | } 63 | 64 | 100% { 65 | -moz-transform: rotate(359deg); 66 | -o-transform: rotate(359deg); 67 | -webkit-transform: rotate(359deg); 68 | transform: rotate(359deg); 69 | } 70 | } 71 | @keyframes spin { 72 | 0% { 73 | -moz-transform: rotate(0deg); 74 | -o-transform: rotate(0deg); 75 | -webkit-transform: rotate(0deg); 76 | transform: rotate(0deg); 77 | } 78 | 79 | 100% { 80 | -moz-transform: rotate(359deg); 81 | -o-transform: rotate(359deg); 82 | -webkit-transform: rotate(359deg); 83 | transform: rotate(359deg); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/sticky-header/bootstrap-table-sticky-header.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=a.fn.bootstrapTable.utils.sprintf;a.extend(a.fn.bootstrapTable.defaults,{stickyHeader:!1});var c=a.fn.bootstrapTable.Constructor,d=c.prototype.initHeader;c.prototype.initHeader=function(){function c(b){var c=b.data,d=c.find("thead").attr("id");if(c.length<1||a("#"+h).length<1)return a(window).off("resize."+h),a(window).off("scroll."+h),void c.closest(".fixed-table-container").find(".fixed-table-body").off("scroll."+h);var g="0";f.options.stickyHeaderOffsetY&&(g=f.options.stickyHeaderOffsetY.replace("px",""));var i=a(window).scrollTop(),m=a("#"+k).offset().top-g,n=a("#"+l).offset().top-g-a("#"+d).css("height").replace("px","");if(i>m&&n>=i){a.each(f.$stickyHeader.find("tr").eq(0).find("th"),function(b,c){a(c).css("min-width",a("#"+d+" tr").eq(0).find("th").eq(b).css("width"))}),a("#"+j).removeClass("hidden").addClass("fix-sticky fixed-table-container"),a("#"+j).css("top",g+"px");var o=a('
');a("#"+j).html(o.append(f.$stickyHeader)),e(b)}else a("#"+j).removeClass("fix-sticky").addClass("hidden")}function e(b){var c=b.data,d=c.find("thead").attr("id");a("#"+j).css("width",+c.closest(".fixed-table-body").css("width").replace("px","")+1),a("#"+j+" thead").parent().scrollLeft(Math.abs(a("#"+d).position().left))}var f=this;if(d.apply(this,Array.prototype.slice.apply(arguments)),this.options.stickyHeader){var g=this.$tableBody.find("table"),h=g.attr("id"),i=g.attr("id")+"-sticky-header",j=i+"-sticky-header-container",k=i+"_sticky_anchor_begin",l=i+"_sticky_anchor_end";g.before(b('',j)),g.before(b('
',k)),g.after(b('
',l)),g.find("thead").attr("id",i),this.$stickyHeader=a(a("#"+i).clone(!0,!0)),this.$stickyHeader.removeAttr("id"),a(window).on("resize."+h,g,c),a(window).on("scroll."+h,g,c),g.closest(".fixed-table-container").find(".fixed-table-body").on("scroll."+h,g,e),this.$el.on("all.bs.table",function(){f.$stickyHeader=a(a("#"+i).clone(!0,!0)),f.$stickyHeader.removeAttr("id")})}}}(jQuery); -------------------------------------------------------------------------------- /app/server/routes/invoices.js: -------------------------------------------------------------------------------- 1 | var ObjectID = require('mongodb').ObjectID; 2 | var DB = require('./../helpers/db-manager'); 3 | var helpers = require('./../helpers/helpers'); 4 | 5 | exports.get = function get(req, res) { 6 | helpers.canIseeThis(req, function (auth) { 7 | if (auth) { 8 | var msg = {}; 9 | var year; 10 | if (req.query.id && req.query.del) { 11 | DB.delete_invoice(req.query.id, function(err, obj){ 12 | if (obj){ 13 | msg.c = []; 14 | msg.c.push({name:"",m:__("Invoice deleted successfully")}); 15 | } else { 16 | msg.e = []; 17 | msg.e.push({name:"",m:__("Invoice not found")}); 18 | } 19 | }); 20 | } 21 | var query = req.query.customer ? {"to_client._id":req.query.customer} : {}; 22 | if (!req.query.year) req.query.year = new Date().getFullYear(); 23 | if (req.query.year && req.query.year!="ALL Years") { 24 | year = parseInt(req.query.year); 25 | var start = new Date(year-1, 11, 31); 26 | var end = new Date(year+1, 0, 1); 27 | query.invoice_date = {$gte: start, $lt: end} 28 | } else { 29 | year = req.query.year; 30 | } 31 | 32 | DB.invoices.find().toArray(function(e, result) { 33 | var years = [new Date().getFullYear()]; 34 | for (var a=0;a 11 | | 15 | body 16 | .container-fluid.cnt 17 | block content 18 | a(href="https://github.com/gianlucadelgobbo/mongo-invoices") 19 | img#github-banner(style="position:absolute;top:0px;right:0;border:0;", src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67", alt="Fork me on GitHub") 20 | 21 | // display form errors in a custom modal window // 22 | 23 | include modals/alert 24 | include modals/confirm 25 | include modals/errors 26 | script 27 | script(src="/lib/jquery.min.js") 28 | script(src="/lib/jquery.form.js") 29 | script(src="/lib/bootstrap-3.1.1-dist/js/bootstrap.min.js") 30 | script(src="/lib/jquery-ui-1.9.0.custom.min.js") 31 | script(src="/lib/jquerymx-3.2.custom.min.js") 32 | 33 | script(src="/js/scripts.js") 34 | - if (typeof js != 'undefined') 35 | script(src=js) 36 | - if (global.settings.googleAnalytics!="") 37 | script(type="text/javascript"). 38 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject'] = r;i[r]=i[r]||function(){ 39 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 40 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 41 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); 42 | ga('create', '#{global.settings.googleAnalytics}', 'auto'); 43 | ga('send', 'pageview'); 44 | 45 | -------------------------------------------------------------------------------- /app/server/config.js: -------------------------------------------------------------------------------- 1 | var _config = { 2 | "locales": ["it","en"], 3 | 4 | "defaultLocale": "it", 5 | "company": { 6 | "logo": "/logo.png", 7 | "name": "Associazione Culturale Linux Club Italia", 8 | "row1": "Associazione Culturale Linux Club Italia
Via del Verano 39, 00185 Roma, Italia - t +39.06.78147301 - f +39.06.78390805", 9 | "row2": "CF 97318630585 P.IVA 08459281005 - linux-club.org - info@linux-club.org" 10 | }, 11 | "banks":[ 12 | ["POSTE ITALIANE SPA - Ufficio radicamento: 55937 CC intestato a: Associazione Culturale Linux Club Italia - IBAN: IT-37-M-07601-03200-000063473623"] 13 | ], 14 | "currency": ["€"], 15 | "vat_perc": 22, 16 | "accountingSettings":{ 17 | "currency": { 18 | "symbol" : "", // default currency symbol is "$" 19 | "format": "%v", // controls output: %s = symbol, %v = value/number (can be object: see below) 20 | "decimal" : ",", // decimal point separator 21 | "thousand": ".", // thousands separator 22 | "precision" : 2 // decimal places 23 | }, 24 | "number": { 25 | "precision" : 2, // default precision on numbers is 0 26 | "thousand": ".", 27 | "decimal" : "," 28 | } 29 | }, 30 | "googleAnalytics": "", 31 | "emailDispatcher": { 32 | "host" : 'smtp.gmail.com', 33 | "user" : '', 34 | "password" : '', 35 | "sendername" : '', 36 | "senderemail" : '', 37 | "signature" : '' 38 | } 39 | }; 40 | var _roles = { 41 | "roles":{ 42 | "superadmin": { 43 | "display_name" : "Super Administrator", 44 | "superadmin" : true, 45 | "admin" : true, 46 | "write": true, 47 | "read" : true 48 | }, 49 | "admin": { 50 | "display_name" : "Administrator", 51 | "superadmin" : false, 52 | "admin" : true, 53 | "write": true, 54 | "read" : true 55 | }, 56 | "editor": { 57 | "display_name" : "Editor", 58 | "superadmin" : false, 59 | "admin" : false, 60 | "write": true, 61 | "read" : true 62 | }, 63 | "viewer": { 64 | "display_name" : "Viewer", 65 | "superadmin" : false, 66 | "admin" : false, 67 | "write": false, 68 | "read" : true 69 | } 70 | } 71 | }; 72 | if (typeof exports !== "undefined") exports._config = _config; 73 | if (typeof exports !== "undefined") exports._roles = _roles; 74 | //if (GLOBAL) GLOBAL._config = _config; 75 | //console.log(GLOBAL._config); 76 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/filter/bootstrap-table-filter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author zhixin wen 3 | * extensions: https://github.com/lukaskral/bootstrap-table-filter 4 | */ 5 | 6 | !function($) { 7 | 8 | 'use strict'; 9 | 10 | $.extend($.fn.bootstrapTable.defaults, { 11 | showFilter: false 12 | }); 13 | 14 | var BootstrapTable = $.fn.bootstrapTable.Constructor, 15 | _init = BootstrapTable.prototype.init, 16 | _initSearch = BootstrapTable.prototype.initSearch; 17 | 18 | BootstrapTable.prototype.init = function () { 19 | _init.apply(this, Array.prototype.slice.apply(arguments)); 20 | 21 | var that = this; 22 | this.$el.on('load-success.bs.table', function () { 23 | if (that.options.showFilter) { 24 | $(that.options.toolbar).bootstrapTableFilter({ 25 | connectTo: that.$el 26 | }); 27 | } 28 | }); 29 | }; 30 | 31 | BootstrapTable.prototype.initSearch = function () { 32 | _initSearch.apply(this, Array.prototype.slice.apply(arguments)); 33 | 34 | if (this.options.sidePagination !== 'server') { 35 | if (typeof this.searchCallback === 'function') { 36 | this.data = $.grep(this.options.data, this.searchCallback); 37 | } 38 | } 39 | }; 40 | 41 | BootstrapTable.prototype.getData = function () { 42 | return (this.searchText || this.searchCallback) ? this.data : this.options.data; 43 | }; 44 | 45 | BootstrapTable.prototype.getColumns = function () { 46 | return this.columns; 47 | }; 48 | 49 | BootstrapTable.prototype.registerSearchCallback = function (callback) { 50 | this.searchCallback = callback; 51 | }; 52 | 53 | BootstrapTable.prototype.updateSearch = function () { 54 | this.options.pageNumber = 1; 55 | this.initSearch(); 56 | this.updatePagination(); 57 | }; 58 | 59 | BootstrapTable.prototype.getServerUrl = function () { 60 | return (this.options.sidePagination === 'server') ? this.options.url : false; 61 | }; 62 | 63 | $.fn.bootstrapTable.methods.push('getColumns', 64 | 'registerSearchCallback', 'updateSearch', 65 | 'getServerUrl'); 66 | 67 | }(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/export/bootstrap-table-export.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=a.fn.bootstrapTable.utils.sprintf,c={json:"JSON",xml:"XML",png:"PNG",csv:"CSV",txt:"TXT",sql:"SQL",doc:"MS-Word",excel:"MS-Excel",powerpoint:"MS-Powerpoint",pdf:"PDF"};a.extend(a.fn.bootstrapTable.defaults,{showExport:!1,exportDataType:"basic",exportTypes:["json","xml","csv","txt","sql","excel"],exportOptions:{}}),a.extend(a.fn.bootstrapTable.defaults.icons,{"export":"glyphicon-export icon-share"}),a.extend(a.fn.bootstrapTable.locales,{formatExport:function(){return"Export data"}}),a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales);var d=a.fn.bootstrapTable.Constructor,e=d.prototype.initToolbar;d.prototype.initToolbar=function(){if(this.showToolbar=this.options.showExport,e.apply(this,Array.prototype.slice.apply(arguments)),this.options.showExport){var d=this,f=this.$toolbar.find(">.btn-group"),g=f.find("div.export");if(!g.length){g=a(['
','",'","
"].join("")).appendTo(f);var h=g.find(".dropdown-menu"),i=this.options.exportTypes;if("string"==typeof this.options.exportTypes){var j=this.options.exportTypes.slice(1,-1).replace(/ /g,"").split(",");i=[],a.each(j,function(a,b){i.push(b.slice(1,-1))})}a.each(i,function(a,b){c.hasOwnProperty(b)&&h.append(['
  • ','',c[b],"","
  • "].join(""))}),h.find("li").click(function(){var b=a(this).data("type"),c=function(){d.$el.tableExport(a.extend({},d.options.exportOptions,{type:b,escape:!1}))};if("all"===d.options.exportDataType&&d.options.pagination)d.$el.one("server"===d.options.sidePagination?"post-body.bs.table":"page-change.bs.table",function(){c(),d.togglePagination()}),d.togglePagination();else if("selected"===d.options.exportDataType){var e=d.getData(),f=d.getAllSelections();d.load(f),c(),d.load(e)}else c()})}}}}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/reorder-columns/bootstrap-table-reorder-columns.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b=function(){Array.prototype.filter||(Array.prototype.filter=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d})};a.extend(a.fn.bootstrapTable.defaults,{reorderableColumns:!1,maxMovingRows:10,onReorderColumn:function(){return!1},dragaccept:null}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"reorder-column.bs.table":"onReorderColumn"});var c=a.fn.bootstrapTable.Constructor,d=c.prototype.initHeader,e=c.prototype.toggleColumn,f=c.prototype.toggleView,g=c.prototype.resetView;c.prototype.initHeader=function(){d.apply(this,Array.prototype.slice.apply(arguments)),this.options.reorderableColumns&&this.makeRowsReorderable()},c.prototype.toggleColumn=function(){e.apply(this,Array.prototype.slice.apply(arguments)),this.options.reorderableColumns&&this.makeRowsReorderable()},c.prototype.toggleView=function(){f.apply(this,Array.prototype.slice.apply(arguments)),this.options.reorderableColumns&&(this.options.cardView||this.makeRowsReorderable())},c.prototype.resetView=function(){g.apply(this,Array.prototype.slice.apply(arguments)),this.options.reorderableColumns&&this.makeRowsReorderable()},c.prototype.makeRowsReorderable=function(){var c=this;try{a(this.$el).dragtable("destroy")}catch(d){}a(this.$el).dragtable({maxMovingRows:c.options.maxMovingRows,dragaccept:c.options.dragaccept,clickDelay:200,beforeStop:function(){var d=[],e=[],f=[],g=[],h=-1,i=[];if(c.$header.find("th").each(function(){d.push(a(this).data("field")),e.push(a(this).data("formatter"))}),d.length"].join(""):k}}})},b.prototype.initBody=function(){var b=this;d.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&(a.each(this.columns,function(c,d){d.editable&&(b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("save").on("save",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g],i=h[d.field];a(this).data("value",e.submitValue),h[d.field]=e.submitValue,b.trigger("editable-save",d.field,h,i,a(this)),b.resetFooter()}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("shown").on("shown",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-shown",d.field,h,a(this),e)}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("hidden").on("hidden",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-hidden",d.field,h,a(this),e)}))}),this.trigger("editable-init"))}}(jQuery); -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/resizable/bootstrap-table-resizable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author: Dennis Hernández 3 | * @webSite: http://djhvscf.github.io/Blog 4 | * @version: v1.0.0 5 | */ 6 | 7 | (function ($) { 8 | 'use strict'; 9 | 10 | var initResizable = function (that) { 11 | //Deletes the plugin to re-create it 12 | that.$el.colResizable({disable: true}); 13 | 14 | //Creates the plugin 15 | that.$el.colResizable({ 16 | liveDrag: that.options.liveDrag, 17 | fixed: that.options.fixed, 18 | headerOnly: that.options.headerOnly, 19 | minWidth: that.options.minWidth, 20 | hoverCursor: that.options.hoverCursor, 21 | dragCursor: that.options.dragCursor, 22 | onResize: that.onResize, 23 | onDrag: that.options.onResizableDrag 24 | }); 25 | }; 26 | 27 | $.extend($.fn.bootstrapTable.defaults, { 28 | resizable: false, 29 | liveDrag: false, 30 | fixed: true, 31 | headerOnly: false, 32 | minWidth: 15, 33 | hoverCursor: 'e-resize', 34 | dragCursor: 'e-resize', 35 | onResizableResize: function (e) { 36 | return false; 37 | }, 38 | onResizableDrag: function (e) { 39 | return false; 40 | } 41 | }); 42 | 43 | var BootstrapTable = $.fn.bootstrapTable.Constructor, 44 | _toggleView = BootstrapTable.prototype.toggleView, 45 | _resetView = BootstrapTable.prototype.resetView; 46 | 47 | BootstrapTable.prototype.toggleView = function () { 48 | _toggleView.apply(this, Array.prototype.slice.apply(arguments)); 49 | 50 | if (this.options.resizable && this.options.cardView) { 51 | //Deletes the plugin 52 | $(this.$el).colResizable({disable: true}); 53 | } 54 | }; 55 | 56 | BootstrapTable.prototype.resetView = function () { 57 | var that = this; 58 | 59 | _resetView.apply(this, Array.prototype.slice.apply(arguments)); 60 | 61 | if (this.options.resizable) { 62 | // because in fitHeader function, we use setTimeout(func, 100); 63 | setTimeout(function () { 64 | initResizable(that); 65 | }, 100); 66 | } 67 | }; 68 | 69 | BootstrapTable.prototype.onResize = function (e) { 70 | var that = $(e.currentTarget); 71 | that.bootstrapTable('resetView'); 72 | that.data('bootstrap.table').options.onResizableResize.apply(e); 73 | } 74 | })(jQuery); 75 | -------------------------------------------------------------------------------- /app/server/routes/startup.js: -------------------------------------------------------------------------------- 1 | var DBUsers = require('../helpers/db-users-manager'); 2 | var DB = require('../helpers/db-manager'); 3 | var CT = require('../helpers/country-list'); 4 | var helpers = require('./../helpers/helpers'); 5 | 6 | exports.get = function get(req, res) { 7 | DBUsers.users.findOne({}, function (e, result) { 8 | if (result) { 9 | var redirect = req.query.from ? req.query.from : "/" + global.settings.dbName + "/"; 10 | res.redirect(redirect); 11 | } else { 12 | res.render('account_admin_new', {title: __('Signup'), countries : CT, result: {}}); 13 | } 14 | }); 15 | }; 16 | 17 | 18 | exports.post = function post(req, res) { 19 | DBUsers.users.findOne({},function(e, result){ 20 | if(result){ 21 | res.redirect("/"); 22 | } else { 23 | helpers.validateFormAccount(req.body, function(e, o) { 24 | if (e.length) { 25 | if (req.body.ajax) { 26 | res.status(200).send({msg:{e:e}}); 27 | } else { 28 | res.render('account_admin_new', { title: __("Account"), countries : CT, result : o, msg:{e:e}}); 29 | } 30 | } else { 31 | DBUsers.insert_user(req.body, function(e, o){ 32 | e = []; 33 | if (!o){ 34 | e.push({name:"",m:__("Error creating account")}); 35 | } 36 | if (e.length) { 37 | if (req.body.ajax) { 38 | res.status(200).send({msg:{e:e}}); 39 | } else { 40 | res.render('account_admin_new', { title: __("Account"), countries : CT, result : o, msg:{e:e}}); 41 | } 42 | //res.render('account_admin_new', { title: __("Customer"), countries : CT, result : o[0], msg:{e:e}, udata : req.session.user }); 43 | } else { 44 | DBUsers.users.findOne({}, function(err, result) { 45 | result.dbs = helpers.generateDBs(result); 46 | req.session.user = result; 47 | global.settings.dbName = result.companies[0].dbname; 48 | global.settings.companyName = result.companies[0].companyname; 49 | DB.init(function(){ 50 | if (req.body.ajax) { 51 | res.status(200).send({msg:{c:[{m:__("Start Up success!!! Redirecting...")}],redirect:"/"+global.settings.dbName+"/home/"}}); 52 | } else { 53 | res.redirect("/"+global.settings.dbName+"/home/"); 54 | } 55 | 56 | }); 57 | }); 58 | } 59 | }); 60 | } 61 | }); 62 | } 63 | }); 64 | }; 65 | -------------------------------------------------------------------------------- /app/server/views/customers.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | block content 3 | .row-offcanvas.row-offcanvas-left.cnt 4 | include sidebar_accounting 5 | #main 6 | .col-md-12 7 | h1.page-title=__("Customers") 8 | div 9 | - if (typeof msg !== "undefined" && typeof msg.e !== "undefined" && msg.e.length) { 10 | .alert.alert-danger 11 | h4=__("There are some errors") 12 | ul 13 | - for(var a=0;aa?"-":"",g=parseInt(y(Math.abs(a||0),h),10)+"",l=3a?g.neg:g.zero).replace("%s",f.symbol).replace("%v",t(Math.abs(a),n(f.precision),f.thousand,f.decimal))};c.formatColumn=function(a,b,d,i,e,h){if(!a)return[];var f=s(r(b)?b:{symbol:b,precision:d,thousand:i,decimal:e,format:h},c.settings.currency),g=x(f.format),l=g.pos.indexOf("%s")a?g.neg:g.zero).replace("%s",f.symbol).replace("%v",t(Math.abs(a),n(f.precision),f.thousand,f.decimal));if(a.length>k)k=a.length;return a});return j(a,function(a){return q(a)&&a.length 7 | */ 8 | 9 | !function ($) { 10 | 11 | 'use strict'; 12 | 13 | $.extend($.fn.bootstrapTable.defaults, { 14 | keyEvents: false 15 | }); 16 | 17 | var BootstrapTable = $.fn.bootstrapTable.Constructor, 18 | _init = BootstrapTable.prototype.init; 19 | 20 | BootstrapTable.prototype.init = function () { 21 | _init.apply(this, Array.prototype.slice.apply(arguments)); 22 | this.initKeyEvents(); 23 | }; 24 | 25 | BootstrapTable.prototype.initKeyEvents = function () { 26 | if (this.options.keyEvents) { 27 | var that = this; 28 | 29 | $(document).off('keydown').on('keydown', function (e) { 30 | var $search = that.$toolbar.find('.search input'), 31 | $refresh = that.$toolbar.find('button[name="refresh"]'), 32 | $toggle = that.$toolbar.find('button[name="toggle"]'), 33 | $paginationSwitch = that.$toolbar.find('button[name="paginationSwitch"]'); 34 | 35 | if (document.activeElement === $search.get(0) || !$.contains(document.activeElement ,that.$toolbar.get(0))) { 36 | return true; 37 | } 38 | 39 | switch (e.keyCode) { 40 | case 83: //s 41 | if (!that.options.search) { 42 | return; 43 | } 44 | $search.focus(); 45 | return false; 46 | case 82: //r 47 | if (!that.options.showRefresh) { 48 | return; 49 | } 50 | $refresh.click(); 51 | return false; 52 | case 84: //t 53 | if (!that.options.showToggle) { 54 | return; 55 | } 56 | $toggle.click(); 57 | return false; 58 | case 80: //p 59 | if (!that.options.showPaginationSwitch) { 60 | return; 61 | } 62 | $paginationSwitch.click(); 63 | return false; 64 | case 37: // left 65 | if (!that.options.pagination) { 66 | return; 67 | } 68 | that.prevPage(); 69 | return false; 70 | case 39: // right 71 | if (!that.options.pagination) { 72 | return; 73 | } 74 | that.nextPage(); 75 | return; 76 | } 77 | }); 78 | } 79 | }; 80 | }(jQuery); 81 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/multiple-search/bootstrap-table-multiple-search.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author: Dennis Hernández 3 | * @webSite: http://djhvscf.github.io/Blog 4 | * @version: v1.0.0 5 | */ 6 | 7 | !function ($) { 8 | 9 | 'use strict'; 10 | 11 | $.extend($.fn.bootstrapTable.defaults, { 12 | multipleSearch: false, 13 | delimeter: " " 14 | }); 15 | 16 | var BootstrapTable = $.fn.bootstrapTable.Constructor, 17 | _initSearch = BootstrapTable.prototype.initSearch; 18 | 19 | BootstrapTable.prototype.initSearch = function () { 20 | if (this.options.multipleSearch) { 21 | if (this.searchText === undefined) { 22 | return; 23 | } 24 | var strArray = this.searchText.split(this.options.delimeter), 25 | that = this, 26 | f = $.isEmptyObject(this.filterColumns) ? null : this.filterColumns, 27 | dataFiltered = []; 28 | 29 | if (strArray.length === 1) { 30 | _initSearch.apply(this, Array.prototype.slice.apply(arguments)); 31 | } else { 32 | for (var i = 0; i < strArray.length; i++) { 33 | var str = strArray[i].trim(); 34 | dataFiltered = str ? $.grep(dataFiltered.length === 0 ? this.options.data : dataFiltered, function (item, i) { 35 | for (var key in item) { 36 | key = $.isNumeric(key) ? parseInt(key, 10) : key; 37 | var value = item[key], 38 | column = that.columns[$.fn.bootstrapTable.utils.getFieldIndex(that.columns, key)], 39 | j = $.inArray(key, that.header.fields); 40 | 41 | // Fix #142: search use formated data 42 | if (column && column.searchFormatter) { 43 | value = $.fn.bootstrapTable.utils.calculateObjectValue(column, 44 | that.header.formatters[j], [value, item, i], value); 45 | } 46 | 47 | var index = $.inArray(key, that.header.fields); 48 | if (index !== -1 && that.header.searchables[index] && (typeof value === 'string' || typeof value === 'number')) { 49 | if (that.options.strictSearch) { 50 | if ((value + '').toLowerCase() === str) { 51 | return true; 52 | } 53 | } else { 54 | if ((value + '').toLowerCase().indexOf(str) !== -1) { 55 | return true; 56 | } 57 | } 58 | } 59 | } 60 | return false; 61 | }) : this.data; 62 | } 63 | 64 | this.data = dataFiltered; 65 | } 66 | } else { 67 | _initSearch.apply(this, Array.prototype.slice.apply(arguments)); 68 | } 69 | }; 70 | 71 | }(jQuery); 72 | -------------------------------------------------------------------------------- /app/public/lib/bootstrap-table/extensions/group-by/bootstrap-table-group-by.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.11.0 - 2016-07-02 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2016 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";var b,c="data-tt-id",d="data-tt-parent-id",e={},f=void 0,g=function(b,c){for(var d=b.$body.find("tr").not("[data-tt-parent-id]"),e=0;e0&&(b.options.loaded=!0,b.options.originalData=b.options.data,b.options.data=d),d};a.extend(a.fn.bootstrapTable.defaults,{groupBy:!1,groupByField:[],groupBySumGroup:!1,groupByInitExpanded:void 0,loaded:!1,originalData:void 0}),a.fn.bootstrapTable.methods.push("collapseAll","expandAll","refreshGroupByField"),a.extend(a.fn.bootstrapTable.COLUMN_DEFAULTS,{groupBySumGroup:!1});var n=a.fn.bootstrapTable.Constructor,o=n.prototype.init,p=n.prototype.initData;n.prototype.init=function(){if(!this.options.sortName&&this.options.groupBy&&this.options.groupByField.length>0){var c=this;Object.keys||a.fn.bootstrapTable.utils.objectKeys(),this.options.loaded=!1,this.options.originalData=void 0,b=this.options.rowAttributes,this.options.rowAttributes=i,this.$el.on("post-body.bs.table",function(){c.$el.treetable({expandable:!0,onNodeExpand:function(){c.options.height&&c.resetHeader()},onNodeCollapse:function(){c.options.height&&c.resetHeader()}},!0),void 0!==c.options.groupByInitExpanded&&("number"==typeof c.options.groupByInitExpanded?c.expandNode(c.options.groupByInitExpanded):"all"===c.options.groupByInitExpanded.toLowerCase()&&c.expandAll())})}o.apply(this,Array.prototype.slice.apply(arguments))},n.prototype.initData=function(a,b){this.options.sortName||this.options.groupBy&&this.options.groupByField.length>0&&(this.options.groupByField="string"==typeof this.options.groupByField?this.options.groupByField.replace("[","").replace("]","").replace(/ /g,"").toLowerCase().split(","):this.options.groupByField,a=m(this,a?a:this.options.data)),p.apply(this,[a,b])},n.prototype.expandAll=function(){this.$el.treetable("expandAll")},n.prototype.collapseAll=function(){this.$el.treetable("collapseAll")},n.prototype.expandNode=function(a){a=g(this,a),void 0!==a&&this.$el.treetable("expandNode",a)},n.prototype.refreshGroupByField=function(b){a.fn.bootstrapTable.utils.compareObjects(this.options.groupByField,b)||(this.options.groupByField=b,this.load(this.options.originalData))}}(jQuery); --------------------------------------------------------------------------------