From cb159ebb511c9d5f771e07721dcfa8708e387557 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 17 Jun 2020 21:16:31 +0000 Subject: [PATCH] --- wwwroot/default.htm | 1 + wwwroot/js/app.customerSiteEdit.js | 1 + wwwroot/js/app.ravLicenses.js | 108 ++++++++++++++++++ wwwroot/js/app.shell.js | 9 ++ .../js/templates/app.ravLicenses.handlebars | 3 + wwwroot/js/templates/templates.js | 2 +- 6 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 wwwroot/js/app.ravLicenses.js create mode 100644 wwwroot/js/templates/app.ravLicenses.handlebars diff --git a/wwwroot/default.htm b/wwwroot/default.htm index 2324d74..037b398 100644 --- a/wwwroot/default.htm +++ b/wwwroot/default.htm @@ -73,6 +73,7 @@ + diff --git a/wwwroot/js/app.customerSiteEdit.js b/wwwroot/js/app.customerSiteEdit.js index 19c1599..cc27dd5 100644 --- a/wwwroot/js/app.customerSiteEdit.js +++ b/wwwroot/js/app.customerSiteEdit.js @@ -164,6 +164,7 @@ app.customerSiteEdit = (function () { if (stateMap.id != "new") { app.nav.contextAddLink("purchases/" + stateMap.id, "Purchases", "basket"); + app.nav.contextAddLink("ravLicenses/" + stateMap.id, "Licenses", "ticket");//from here to new license } }; diff --git a/wwwroot/js/app.ravLicenses.js b/wwwroot/js/app.ravLicenses.js new file mode 100644 index 0000000..b4f5d2f --- /dev/null +++ b/wwwroot/js/app.ravLicenses.js @@ -0,0 +1,108 @@ +/*jslint browser : true, continue : true, + devel : true, indent : 2, maxerr : 50, + newcap : true, nomen : true, plusplus : true, + regexp : true, sloppy : true, vars : false, + white : true +*/ + +/*global $, app */ + +app.ravLicenses = (function() { + "use strict"; + //---------------- BEGIN MODULE SCOPE VARIABLES -------------- + var stateMap = {}, + configModule, + initModule; + //----------------- END MODULE SCOPE VARIABLES --------------- + + //------------------- BEGIN UTILITY METHODS ------------------ + + //-------------------- END UTILITY METHODS ------------------- + + //------------------- BEGIN EVENT HANDLERS ------------------- + + //-------------------- END EVENT HANDLERS -------------------- + + //------------------- BEGIN PUBLIC METHODS ------------------- + //CONFIGMODULE + // + configModule = function(context) { + stateMap.context = context.context; + if (stateMap.context.params.id) { + stateMap.id = stateMap.context.params.id;//siteid + } + }; + + //INITMODULE + // + initModule = function($container) { + if (typeof $container === "undefined") { + $container = $("#app-shell-main-content"); + } + $container.html(Handlebars.templates["app.ravLicenses"]({})); + + //case 3513 + document.title = "Licenses"; + + //=================== + //Get licenses + app.api.get("rvl/list/"+ stateMap.id, function(res) { + if (res.error) { + $.gevent.publish("app-show-error", res.msg); + } else { + var $appList = $("#rf-list"); + + $appList.append('"); + } + }); + //=========/licenses============== + + app.nav.contextClear(); + }; + + //PUBLIC METHODS + // + return { + configModule: configModule, + initModule: initModule + }; + //------------------- END PUBLIC METHODS --------------------- +})(); diff --git a/wwwroot/js/app.shell.js b/wwwroot/js/app.shell.js index 6aaa128..a4684dc 100644 --- a/wwwroot/js/app.shell.js +++ b/wwwroot/js/app.shell.js @@ -240,6 +240,7 @@ app.shell = (function () { page('/ops', ops); page('/trials', trials); page('/trialEdit/:id', trialEdit); + page('/ravLicenses/:id/', ravLicenses); page('/ravLicense/:id/:site_id', ravLicense); page('*', notFound); page({ @@ -586,6 +587,14 @@ app.shell = (function () { app.ravLicense.initModule(); } + var ravLicenses = function (ctx) { + app.nav.setSelectedMenuItem('customers'); + app.ravLicenses.configModule({ + context: ctx + }); + app.ravLicenses.initModule(); + } + var notFound = function (ctx) { app.fourohfour.configModule({ diff --git a/wwwroot/js/templates/app.ravLicenses.handlebars b/wwwroot/js/templates/app.ravLicenses.handlebars new file mode 100644 index 0000000..28be4e5 --- /dev/null +++ b/wwwroot/js/templates/app.ravLicenses.handlebars @@ -0,0 +1,3 @@ +
+
+
\ No newline at end of file diff --git a/wwwroot/js/templates/templates.js b/wwwroot/js/templates/templates.js index 8e7d5ac..1a6fefb 100644 --- a/wwwroot/js/templates/templates.js +++ b/wwwroot/js/templates/templates.js @@ -1 +1 @@ -!function(){var n=Handlebars.template,e=Handlebars.templates=Handlebars.templates||{};e["app.authenticate"]=n({compiler:[8,">= 4.3.0"],main:function(n,e,a,l,i){return'
\n Rockfish logo\n

Login

\n
\n

\n

\n

\n
\n
'},useData:!0}),e["app.customerEdit"]=n({compiler:[8,">= 4.3.0"],main:function(n,e,a,l,i){return'
\n
\n\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n
\n\n\n
\n \n
\n\n\n\n
\n \n