"+g.NAV_LINKS).addClass(_.ACTIVE),t(this._scrollElement).trigger(f.ACTIVATE,{relatedTarget:e})},h.prototype._clear=function(){t(this._selector).filter(g.ACTIVE).removeClass(_.ACTIVE)},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===("undefined"==typeof e?"undefined":i(e))&&e;
+if(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return u}}]),h}();return t(window).on(f.LOAD_DATA_API,function(){for(var e=t.makeArray(t(g.DATA_SPY)),n=e.length;n--;){var i=t(e[n]);m._jQueryInterface.call(i,i.data())}}),t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=c,m._jQueryInterface},m}(jQuery),function(t){var e="tab",i="4.0.0-alpha.6",s="bs.tab",a="."+s,l=".data-api",h=t.fn[e],c=150,u={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK_DATA_API:"click"+a+l},d={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},f={A:"a",LI:"li",DROPDOWN:".dropdown",LIST:"ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)",FADE_CHILD:"> .nav-item .fade, > .fade",ACTIVE:".active",ACTIVE_CHILD:"> .nav-item > .active, > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},_=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(d.ACTIVE)||t(this._element).hasClass(d.DISABLED))){var n=void 0,i=void 0,o=t(this._element).closest(f.LIST)[0],s=r.getSelectorFromElement(this._element);o&&(i=t.makeArray(t(o).find(f.ACTIVE)),i=i[i.length-1]);var a=t.Event(u.HIDE,{relatedTarget:this._element}),l=t.Event(u.SHOW,{relatedTarget:i});if(i&&t(i).trigger(a),t(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=t(s)[0]),this._activate(this._element,o);var h=function(){var n=t.Event(u.HIDDEN,{relatedTarget:e._element}),o=t.Event(u.SHOWN,{relatedTarget:i});t(i).trigger(n),t(e._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},e.prototype.dispose=function(){t.removeClass(this._element,s),this._element=null},e.prototype._activate=function(e,n,i){var o=this,s=t(n).find(f.ACTIVE_CHILD)[0],a=i&&r.supportsTransitionEnd()&&(s&&t(s).hasClass(d.FADE)||Boolean(t(n).find(f.FADE_CHILD)[0])),l=function(){return o._transitionComplete(e,s,a,i)};s&&a?t(s).one(r.TRANSITION_END,l).emulateTransitionEnd(c):l(),s&&t(s).removeClass(d.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(d.ACTIVE);var s=t(n.parentNode).find(f.DROPDOWN_ACTIVE_CHILD)[0];s&&t(s).removeClass(d.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(d.SHOW)):t(e).removeClass(d.FADE),e.parentNode&&t(e.parentNode).hasClass(d.DROPDOWN_MENU)){var a=t(e).closest(f.DROPDOWN)[0];a&&t(a).find(f.DROPDOWN_TOGGLE).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data(s);if(o||(o=new e(this),i.data(s,o)),"string"==typeof n){if(void 0===o[n])throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();return t(document).on(u.CLICK_DATA_API,f.DATA_TOGGLE,function(e){e.preventDefault(),_._jQueryInterface.call(t(this),"show")}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=h,_._jQueryInterface},_}(jQuery),function(t){if("undefined"==typeof Tether)throw new Error("Bootstrap tooltips require Tether (http://tether.io/)");var e="tooltip",s="4.0.0-alpha.6",a="bs.tooltip",l="."+a,h=t.fn[e],c=150,u="bs-tether",d={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[],container:!1},f={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array",container:"(string|element|boolean)"},_={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},g={SHOW:"show",OUT:"out"},p={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},m={FADE:"fade",SHOW:"show"},E={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},v={element:!1,enabled:!1},T={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},I=function(){function h(t,e){n(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._isTransitioning=!1,this._tether=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return h.prototype.enable=function(){this._isEnabled=!0},h.prototype.disable=function(){this._isEnabled=!1},h.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},h.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(m.SHOW))return void this._leave(null,this);this._enter(null,this)}},h.prototype.dispose=function(){clearTimeout(this._timeout),this.cleanupTether(),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null},h.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){if(this._isTransitioning)throw new Error("Tooltip is transitioning");t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(m.FADE);var a="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,l=this._getAttachment(a),c=this.config.container===!1?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({attachment:l,element:o,target:this.element,classes:v,classPrefix:u,offset:this.config.offset,constraints:this.config.constraints,addTargetClasses:!1}),r.reflow(o),this._tether.position(),t(o).addClass(m.SHOW);var d=function(){var n=e._hoverState;e._hoverState=null,e._isTransitioning=!1,t(e.element).trigger(e.constructor.Event.SHOWN),n===g.OUT&&e._leave(null,e)};if(r.supportsTransitionEnd()&&t(this.tip).hasClass(m.FADE))return this._isTransitioning=!0,void t(this.tip).one(r.TRANSITION_END,d).emulateTransitionEnd(h._TRANSITION_DURATION);d()}},h.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE);if(this._isTransitioning)throw new Error("Tooltip is transitioning");var s=function(){n._hoverState!==g.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),n._isTransitioning=!1,n.cleanupTether(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(m.SHOW),this._activeTrigger[T.CLICK]=!1,this._activeTrigger[T.FOCUS]=!1,this._activeTrigger[T.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(m.FADE)?(this._isTransitioning=!0,t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(c)):s(),this._hoverState="")},h.prototype.isWithContent=function(){return Boolean(this.getTitle())},h.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},h.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(E.TOOLTIP_INNER),this.getTitle()),e.removeClass(m.FADE+" "+m.SHOW),this.cleanupTether()},h.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===("undefined"==typeof n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},h.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},h.prototype.cleanupTether=function(){this._tether&&this._tether.destroy()},h.prototype._getAttachment=function(t){return _[t.toUpperCase()]},h.prototype._setListeners=function(){var e=this,n=this.config.trigger.split(" ");n.forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==T.MANUAL){var i=n===T.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===T.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},h.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},h.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;return n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?T.FOCUS:T.HOVER]=!0),t(n.getTipElement()).hasClass(m.SHOW)||n._hoverState===g.SHOW?void(n._hoverState=g.SHOW):(clearTimeout(n._timeout),n._hoverState=g.SHOW,n.config.delay&&n.config.delay.show?void(n._timeout=setTimeout(function(){n._hoverState===g.SHOW&&n.show()},n.config.delay.show)):void n.show())},h.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;if(n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?T.FOCUS:T.HOVER]=!1),!n._isWithActiveTrigger())return clearTimeout(n._timeout),n._hoverState=g.OUT,n.config.delay&&n.config.delay.hide?void(n._timeout=setTimeout(function(){n._hoverState===g.OUT&&n.hide()},n.config.delay.hide)):void n.hide()},h.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},h.prototype._getConfig=function(n){return n=t.extend({},this.constructor.Default,t(this.element).data(),n),n.delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},h.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===("undefined"==typeof e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e)){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return a}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return f}}]),h}();return t.fn[e]=I._jQueryInterface,t.fn[e].Constructor=I,t.fn[e].noConflict=function(){return t.fn[e]=h,I._jQueryInterface},I}(jQuery));(function(r){var a="popover",l="4.0.0-alpha.6",h="bs.popover",c="."+h,u=r.fn[a],d=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:''}),f=r.extend({},s.DefaultType,{content:"(string|element|function)"}),_={FADE:"fade",SHOW:"show"},g={TITLE:".popover-title",CONTENT:".popover-content"},p={HIDE:"hide"+c,HIDDEN:"hidden"+c,SHOW:"show"+c,SHOWN:"shown"+c,INSERTED:"inserted"+c,CLICK:"click"+c,FOCUSIN:"focusin"+c,FOCUSOUT:"focusout"+c,MOUSEENTER:"mouseenter"+c,MOUSELEAVE:"mouseleave"+c},m=function(s){function u(){return n(this,u),t(this,s.apply(this,arguments))}return e(u,s),u.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},u.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},u.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(g.TITLE),this.getTitle()),this.setElementContent(t.find(g.CONTENT),this._getContent()),t.removeClass(_.FADE+" "+_.SHOW),this.cleanupTether()},u.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},u._jQueryInterface=function(t){return this.each(function(){var e=r(this).data(h),n="object"===("undefined"==typeof t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new u(this,n),r(this).data(h,e)),"string"==typeof t)){if(void 0===e[t])throw new Error('No method named "'+t+'"');e[t]()}})},o(u,null,[{key:"VERSION",get:function(){return l}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return c}},{key:"DefaultType",get:function(){return f}}]),u}(s);return r.fn[a]=m._jQueryInterface,r.fn[a].Constructor=m,r.fn[a].noConflict=function(){return r.fn[a]=u,m._jQueryInterface},m})(jQuery)}();
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.css b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.css
new file mode 100644
index 0000000..aa309c1
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.css
@@ -0,0 +1,127 @@
+table.scroll {
+ width: 650px; /* Optional */
+ /* border-collapse: collapse; */
+ border-spacing: 0;
+ table-layout:auto;
+ border: 2px solid black;
+ word-wrap: break-word;
+}
+
+/*table.scroll tbody,
+table.scroll thead { display: block }*/
+
+table.scroll thead tr th {
+ /*width: 100px;
+ width: 90px;*/
+ height: 30px;
+ line-height: 30px;
+ border-bottom: 1px solid black;
+ /*text-align: left;*/
+}
+
+table.scroll tbody {
+ border-top: 1px solid black;
+ height: 300px;
+ overflow-y: auto;
+ overflow-x: hidden;
+}
+
+table.scroll tbody { border-top: 2px solid black; }
+
+table.scroll tbody td, thead th {
+ /*width: 20%; Optional
+ width: 100px;*/
+ border-right: 1px solid black;
+}
+
+table.scroll tbody td {
+ text-align: center;
+}
+
+table.scroll tbody td:last-child, thead th:last-child {
+ border-right: none;
+}
+
+#contentContainer{
+}
+
+#nav {
+ padding-top: 10px;
+ float: left;
+ height: 800px;
+}
+#navBar{
+ width: 200px;
+ padding: 20px;
+ float:left;
+}
+
+#content {
+ margin-left: 250px;
+ width: 700px;
+ padding: 10px;
+}
+
+#collapser{
+ float: right;
+ background: black;
+ width: 10px;
+ height: 100%;
+}
+/* Dropdown Button */
+.hoverdropbtn {
+ /*background-color: #4CAF50;
+ color: white;*/
+ padding: 14px;
+ border: none;
+ cursor: pointer;
+}
+.hoverdropdown:hover {
+ background-color: #4CAF50;
+}
+
+/* The container - needed to position the dropdown content */
+.hoverdropdown {
+ position: relative;
+ display: inline-block;
+}
+
+/* Dropdown Content (Hidden by Default) */
+.hoverdropdown-content {
+ display: none;
+ position: absolute;
+ background-color: #f9f9f9;
+ min-width: 200px;
+ z-index: 999;
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
+}
+
+/* Links inside the dropdown */
+.hoverdropdown-content a {
+ color: black;
+ padding: 12px 16px;
+ text-decoration: none;
+ display: block;
+}
+
+/* Change color of dropdown links on hover */
+.hoverdropdown-content a:hover {background-color: #f1f1f1}
+
+/* Show the dropdown menu on hover */
+.hoverdropdown:hover .hoverdropdown-content {
+ display: block;
+}
+
+/* Change the background color of the dropdown button when the dropdown content is shown */
+.hoverdropdown:hover .hoverdropbtn {
+ background-color: #4CAF50;
+}
+
+.table td.fit,
+.table th.fit {
+ white-space: nowrap;
+ width: 1%;
+}
+.table > tbody > tr > td.valign {
+ vertical-align: middle;
+}
\ No newline at end of file
diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js
new file mode 100644
index 0000000..ed4a012
--- /dev/null
+++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/www/spa.js
@@ -0,0 +1,172 @@
+(function ($) {
+ 'use strict';
+ $.fn.clickToggle = function (func1, func2) {
+ var funcs = [func1, func2];
+ this.data('toggleclicked', 0);
+ this.click(function () {
+ var data = $(this).data();
+ var tc = data.toggleclicked;
+ $.proxy(funcs[tc], this)();
+ data.toggleclicked = (tc + 1) % 2;
+ });
+ return this;
+ };
+}(jQuery));
+
+function DataVM() {
+ 'use strict';
+ var self = this;
+ self.endpointUrl = 'http://localhost:8800/api';
+ self.menuOptions = ['Users', 'Data', 'Other'];
+ self.chosenMenuItemId = ko.observable();
+ self.userList = ko.observable();
+ self.chosenUserDetails = ko.observable();
+ self.chosenMenuData = ko.observable();
+ self.userTimeLogData = ko.observable();
+ self.unassignedCardData = ko.observable();
+ self.goToMenuOption = function (menu) { location.hash = menu; console.log(menu); };
+ self.goToUserDetails = function (user) { location.hash = 'userData/' + user.Id; };
+ self.goToTimeLogs = function (user) { console.log("getTimeLogs"); location.hash = 'timeLogs/' + user.Id; };
+ //$.each(self.unassignedCardData().data, function(k,v){ if(v.IsSelected == true){console.log(v.CardUId);}})
+ //this function looks for a custom attribute called "pagedestination".
+ //if this is used as a clickhandler, the pagedestination attribute should name the page you want.
+ self.returnButtonClick = function (data, event) {
+ var target;
+ if (event.target) target = event.target;
+ else if (event.srcElement) target = event.srcElement;
+ var destination = "";
+ for (var i = 0; i < target.attributes.length; i++) {
+ if (target.attributes[i].nodeName === "pagedestination") {
+ destination = target.attributes[i].value;
+ break;
+ }
+ }
+ console.log(destination);
+ self.goToMenuOption(destination); //redirect to whereever the button is telling us to go..
+ };
+ self.addNewUserClick = function (data, event) {
+ self.goToMenuOption("newUser");
+ };
+ self.getUserData = function () {
+ console.log("beginGetUserData");
+ $.getJSON(self.endpointUrl + '/users?callback=?', function (res) {
+ console.log("getting user data");
+ console.log(res);
+ self.userList(res);
+ }).fail(function () {
+ console.log("error - getusers");
+ });
+ };
+ self.getUserDetails = function (userId) {
+ console.log("beginGetUserDetailsData");
+ var url = self.endpointUrl + '/users/' + userId;
+ console.log(url);
+ $.getJSON(url + '?callback=?', function (res) {
+ console.log("got user data");
+ //console.log(res);
+ self.chosenUserDetails(res);
+ //console.log(self.chosenUserDetails());
+ }).fail(function () {
+ console.log("error - getuserdetails");
+ });
+ };
+ self.handleEditedUser = function (user) {
+ console.log("Post Edited User: " + user.Id);
+ var url = self.endpointUrl + '/users/edit';
+ console.log("posting..");
+ $.post(url, user, function () {
+ console.log("finished posting..");
+ }, 'json')
+ .done(function () {
+ self.goToMenuOption("Users");
+ self.chosenUserDetails(null);
+ })
+ .fail(function () {
+ console.log("error - post edited user");
+ console.log(self.chosenUserDetails().Id);
+ self.goToUserData(self.chosenUserDetails().Id);
+ });
+ };
+ self.getTimeLogData = function (userId) {
+ console.log("begin get TimeLog Data");
+ var url = self.endpointUrl + '/timelogs?userId=' + userId;
+ console.log(url);
+ $.getJSON(url + '&callback=?', function (res) {
+ console.log("got user timelog data");
+ //console.log(res);
+ self.userTimeLogData(res);
+ //console.log(self.chosenUserDetails());
+ }).fail(function () {
+ console.log("error - getuserdetails");
+ });
+ };
+ self.getUnassignedCardData = function () {
+ console.log("begin get unassigned cards");
+ var url = self.endpointUrl + '/unassignedCards';
+ console.log(url);
+ $.getJSON(url + '?callback=?', function (res) {
+ console.log("got unassigned card data");
+ //console.log(res);
+ self.unassignedCardData(res);
+ //console.log(self.chosenUserDetails());
+ }).fail(function () {
+ console.log("error - getuserdetails");
+ });
+ };
+ Sammy(function () {
+ this.get('#Users', function () {
+ console.log(this.params.menuOption);
+ self.chosenMenuItemId(this.params.menuOption);
+ self.chosenUserDetails(null);
+ self.userList(null);
+ self.userTimeLogData(null);
+ self.getUserData();
+ //$.get("http://localhost:3000", { menu: this.params.menu }, self.chosenMenuData);
+ });
+ this.get('#userData/:userId', function () {
+ console.log("userData userId: " + this.params.userId);
+ console.log("getting details for user: " + this.params.userId);
+ self.chosenMenuItemId('Data');
+ self.userList(null);
+ self.getUserDetails(this.params.userId);
+ self.userTimeLogData(null);
+ //$.get("http://localhost:3000", { menu: this.params.menu }, self.chosenMenuData);
+ });
+ this.get('#timeLogs/:userId', function () {
+ console.log("get user time logs, userID: " + this.params.userId);
+ self.chosenMenuItemId('TimeLogs');
+ self.userList(null);
+ self.chosenUserDetails(null);
+ self.getTimeLogData(this.params.userId);
+ });
+ this.get('#newUser', function () {
+ console.log("creating new user");
+ self.chosenMenuItemId('newUser');
+ self.userList(null);
+ self.userTimeLogData(null);
+ self.chosenUserDetails(
+ {
+ "Id": -1,
+ "UserId": -1,
+ "FirstName": null,
+ "LastName": null,
+ "HoursPerWeek": null
+ });
+ self.getUnassignedCardData();
+ });
+ this.post('#edituser', function (context) {
+ console.log(self.chosenUserDetails());
+ self.handleEditedUser(self.chosenUserDetails());
+ return true;
+ });
+ this.get('', function () { this.app.runRoute('get', '#Users') });
+ }).run();
+}
+DataVM.prototype.dispose = function () {
+ 'use strict';
+ //window.clearInterval(self.locationTimerHandle);
+ //window.clearInterval(self.weatherTimerHandle);
+ //self.chart.destroy();
+};
+
+ko.applyBindings(new DataVM());
\ No newline at end of file