colored log table, save button returns to list
authorScott Baker <smbaker@gmail.com>
Sat, 15 Nov 2014 00:13:43 +0000 (16:13 -0800)
committerScott Baker <smbaker@gmail.com>
Sat, 15 Nov 2014 00:13:43 +0000 (16:13 -0800)
planetstack/core/xoslib/dashboards/xosAdminDashboard.html
planetstack/core/xoslib/dashboards/xosAdminWholePage.html
planetstack/core/xoslib/static/css/xosAdminDashboard.css
planetstack/core/xoslib/static/css/xosAdminSite.css
planetstack/core/xoslib/static/js/xosAdminSite.js
planetstack/core/xoslib/static/js/xoslib/xosHelper.js
planetstack/core/xoslib/templates/xosAdmin.html

index 78eb8e2..6d60535 100644 (file)
 <script src="{{ STATIC_URL }}/js/xoslib/xosHelper.js"></script>
 <script src="{{ STATIC_URL }}/js/xosAdminSite.js"></script>
 
+<script type="text/template" id="xos-log-template">
+  <tr id="<%= logMessageId %>" class="xos-log xos-<%= statusclass %>">
+     <td><%= what %><br>
+         <%= status %> <%= statusText %>
+     </td>
+  </tr>
+</script>
+
 <div id="contentPanel">
 <div id="contentTitle">
 </div>
 <div class="box save-box" id="xos-listview-button-box">
 <button class="btn btn-high btn-success btn-xos-contentButtonPanel" onclick="$('button.btn-xos-add').click()">Add</button>
 </div>
+<div class="box" id="logPanel">
+<table id="logTable">
+<tbody>
+</tbody>
+</table> <!-- end logTable -->
+</div> <!-- end logPanel -->
 </div> <!-- end contentButtonPanel -->
 <div id="contentInner">
 <div id="tabs">
 </div> <!-- end contentInner -->
 </div> <!-- end contentPanel -->
 
-<div id="logPanel">
-<table id="logTable">
-<thead>
-<tr><th>status</th><th>operation</th><th>code</th><th>message</th></tr>
-</thead>
-<tbody>
-</tbody>
-</table>
-
-</div>
-
 {% include 'xosAdmin.html' %}
index da9f364..0bc9924 100644 (file)
 <script src="{{ STATIC_URL }}/js/xoslib/xosHelper.js"></script>
 <script src="{{ STATIC_URL }}/js/xosAdminSite.js"></script>
 
+<script type="text/template" id="xos-log-template">
+  <tr id="<%= logMessageId %>" class="xos-log xos-<%= statusclass %>">
+     <td><%= what %></td>
+     <td><%= status %></td>
+     <td><%= statusText %></td>
+  </tr>
+</script>
+
 <div id="headerPanel">
 {% include 'xosAdminHeader.html' %}
 </div>
index ff54fee..f4e8191 100644 (file)
     display: none;
 }
 
-#logPanel {
-    display: none;
+#logTable {
+    width: 100%;
+}
+
+#logTable tr {
+  border-bottom: 1px solid;
+}
+
+#logTable tr:last-child {
+  border-bottom: none;\r
 }
 
 #contentButtonPanel {
index 5ecaa8e..d1b4275 100644 (file)
@@ -6,8 +6,17 @@
     color:blue;
     text-decoration:underline;
 }
-#logTable td, th {
-    border: 1px solid black;
+
+.xos-log.xos-success {
+    background-color: #00ff00;
+}
+
+.xos-log.xos-inprog {
+    background-color: #ffff00;
+}
+
+.xos-log.xos-failure {
+    background-color: #ff0000;
 }
 
 .btn-xosnav {
@@ -82,3 +91,4 @@
     display: none;
 }
 
+
index 212c1b4..b5d0f6c 100644 (file)
@@ -56,10 +56,12 @@ XOSAdminApp.buildViews = function() {
          collection_name = name + "s";
          region_name = name + "List";
          detailNavLink = collection_name;
+         listNavLink = collection_name;
 
          detailClass = XOSDetailView.extend({
             template: detail_template,\r
             app: XOSAdminApp,\r
+            listNavLink: listNavLink,\r
          });\r
          XOSAdminApp[collection_name + "DetailView"] = detailClass;\r
 
index b8e0347..89d0d3b 100644 (file)
@@ -37,7 +37,7 @@ XOSApplication = Marionette.Application.extend({
     },
 
     showSuccess: function(result) {
-         result["success"] = "success";
+         result["statusclass"] = "success";
          if (this.logTableId) {
              this.appendLogWindow(result);
          } else {
@@ -51,7 +51,7 @@ XOSApplication = Marionette.Application.extend({
     },
 
     showError: function(result) {
-         result["success"] = "failure";
+         result["statusclass"] = "failure";
          if (this.logTableId) {
              this.appendLogWindow(result);
          } else {
@@ -65,7 +65,7 @@ XOSApplication = Marionette.Application.extend({
     },
 
     showInformational: function(result) {
-         result["success"] = "information";
+         result["statusclass"] = "inprog";
          if (this.logTableId) {
              return this.appendLogWindow(result);
          } else {
@@ -203,6 +203,8 @@ XOSDetailView = Marionette.ItemView.extend({
                 console.log("saveLeave");
                 e.preventDefault();
                 this.save();
+                this.app.Router.navigate(this.listNavLink, {trigger: true});
+                console.log("route to " + this.listNavLink);
             },
 
             submitAddAnotherClicked: function(e) {
index ee974f6..d543502 100644 (file)
   <button class="btn btn-default btn-xosnav" onclick="<%= router %>.navigate('<%= routeUrl %>', {trigger: true})"><%= name %></button><br>
 </script>
 
-<script type="text/template" id="xos-log-template">
-  <tr id="<%= logMessageId %>">
-     <td><%= success %></td>
-     <td><%= what %></td>
-     <td><%= status %></td>
-     <td><%= statusText %></td>
-  </tr>
-</script>
-
 <script type="text/template" id="xos-status-template">
-  <%= what %>: [<%= success %>] <%= statusText %> (<%= status %>)
+  <div class="xos-status xos-<%= statusclass %>"><%= what %>: <%= statusText %> (<%= status %>)</div>
 </script>
 
 <script type="text/template" id="xos-tabs-template">