This commit is contained in:
2020-06-17 21:16:31 +00:00
parent ce035b1072
commit cb159ebb51
6 changed files with 123 additions and 1 deletions

View File

@@ -73,6 +73,7 @@
<script src="js/app.ops.js?rfv=6.9"></script>
<script src="js/app.trials.js?rfv=6.9"></script>
<script src="js/app.trialEdit.js?rfv=6.9"></script>
<script src="js/app.ravLicenses.js?rfv=6.9"></script>
<script src="js/app.ravLicense.js?rfv=6.9"></script>
<!-- handlebars templates -->

View File

@@ -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
}
};

View File

@@ -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('<ul class="list-group">');
$.each(res, function(i, obj) {
if (obj.fetched) {
$appList.append(
"<li class='rfc-list-item-inactive list-group-item'><a href=\"#!/ravLicense/" +
obj.id +
'">' +
"<span class='text-muted'>" +
(obj.trial
? "Trial "
: "") +
app.utilB.genListColumn(obj.regto) +
"&nbsp;&nbsp;" +
app.utilB.genListColumn(
app.utilB.epochToShortDate(obj.created)
) +
"</span>" +
"</a></li>"
);
} else {
$appList.append(
"<li class='list-group-item'><a href=\"#!/licenseView/" +
obj.id +
'">' +
(obj.trial
? "Trial "
: "") +
app.utilB.genListColumn(obj.regto) +
"&nbsp;&nbsp;" +
app.utilB.genListColumn(
app.utilB.epochToShortDate(obj.created)
) +
"</a></li>"
);
}
});
$appList.append("</ul>");
}
});
//=========/licenses==============
app.nav.contextClear();
};
//PUBLIC METHODS
//
return {
configModule: configModule,
initModule: initModule
};
//------------------- END PUBLIC METHODS ---------------------
})();

View File

@@ -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({

View File

@@ -0,0 +1,3 @@
<div>
<div id="rf-list" class="rf-list"/>
</div>

File diff suppressed because one or more lines are too long