From 290f8067571a0829a52a26eeb731590371fb65c2 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 9 Jun 2020 23:55:55 +0000 Subject: [PATCH] --- wwwroot/default.htm | 2 + wwwroot/js/app.trials.js | 86 ++++++++++++++++--------------- wwwroot/js/templates/templates.js | 2 +- 3 files changed, 47 insertions(+), 43 deletions(-) diff --git a/wwwroot/default.htm b/wwwroot/default.htm index 4f02dcc..d646e76 100644 --- a/wwwroot/default.htm +++ b/wwwroot/default.htm @@ -71,6 +71,8 @@ + + diff --git a/wwwroot/js/app.trials.js b/wwwroot/js/app.trials.js index 80f6f8b..2c59765 100644 --- a/wwwroot/js/app.trials.js +++ b/wwwroot/js/app.trials.js @@ -7,16 +7,31 @@ /*global $, app */ -app.trials = (function() { +app.trials = (function () { "use strict"; //---------------- BEGIN MODULE SCOPE VARIABLES -------------- var stateMap = {}, configModule, - initModule; + initModule, + statusText; //----------------- END MODULE SCOPE VARIABLES --------------- //------------------- BEGIN UTILITY METHODS ------------------ - + ////////////////// + //Generate a card with collapsible middle section with more details + // + statusText = function (obj) { + switch (obj.status) { + case 0: + return "NEW"; + case 1: + return "approved"; + case 2: + return "rejected"; + default: + return "BAD STATUS: " + obj.status; + } + }; //-------------------- END UTILITY METHODS ------------------- //------------------- BEGIN EVENT HANDLERS ------------------- @@ -26,7 +41,7 @@ app.trials = (function() { //------------------- BEGIN PUBLIC METHODS ------------------- //CONFIGMODULE // - configModule = function(context) { + configModule = function (context) { stateMap.context = context.context; if (stateMap.context.params.id) { stateMap.id = stateMap.context.params.id; @@ -35,62 +50,49 @@ app.trials = (function() { //INITMODULE // - initModule = function($container) { + initModule = function ($container) { if (typeof $container === "undefined") { $container = $("#app-shell-main-content"); } $container.html(Handlebars.templates["app.trials"]({})); //case 3513 - document.title = "trials"; + document.title = "Trial requests"; //=================== //Get trials - app.api.get("trial/list", function(res) { + app.api.get("trial/list", function (res) { if (res.error) { $.gevent.publish("app-show-error", res.msg); } else { var $appList = $("#rf-list"); - $appList.append('"); + } } }); //=========/trials============== diff --git a/wwwroot/js/templates/templates.js b/wwwroot/js/templates/templates.js index 0506089..937af63 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,i,l){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,i,l){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