help text support for detail view, tenant view warnings about changing slivers
Scott Baker [Tue, 20 Jan 2015 20:24:16 +0000 (12:24 -0800)]
planetstack/core/xoslib/static/css/xosAdminSite.css
planetstack/core/xoslib/static/js/xosTenant.js
planetstack/core/xoslib/static/js/xoslib/xosHelper.js
planetstack/core/xoslib/templates/xosAdmin.html

index 91d4928..256a8a4 100644 (file)
@@ -1,3 +1,14 @@
+.xos-help-cell {
+    font-size: 11px;
+    color: #999;
+    padding-bottom: 1%;
+}
+
+.xos-detail-table td {
+    padding-left: 10px;
+    padding-right: 10px;
+}
+
 .test-table td, th {
     border: 1px solid black;
 }
index e81aacb..c0d9ab9 100644 (file)
@@ -137,6 +137,8 @@ XOSTenantApp.buildViews = function() {
                                                 app: XOSTenantApp,\r
                                                 detailFields: ["serviceClass", "default_image", "default_flavor", "network_ports", "mount_data_sets"],\r
                                                 fieldDisplayNames: {serviceClass: "Service Level", "default_flavor": "Flavor", "default_image": "Image", "mount_data_sets": "Data Sets"},\r
+                                                helpText: {"default_image": "Existing slivers will be re-instantiated if changed",\r
+                                                           "default_flavor": "Existing slivers will be re-instantiated if changed"},\r
 \r
                                                 onShow: function() {\r
                                                     // the slice selector is in a different table, so make every label cell the maximal width\r
index 6b6419c..76254f6 100644 (file)
@@ -672,6 +672,7 @@ XOSDetailView = Marionette.ItemView.extend({
                                                     model: this.model,
                                                     detailView: this,
                                                     choices: this.options.choices || this.choices || this.model.choices || {},
+                                                    helpText: this.options.helpText || this.helpText || this.model.helpText || {},
                                          }},
 });
 
index db7218d..cca9ba7 100644 (file)
 <script type="text/template" id="xos-detail-template">
   <h3 class="xos-detail-title">Edit Object: <%= modelName %></h3>
   <form>
-  <table>\r
+  <table class="xos-detail-table">\r
   <% args = arguments; %>\r
   <% _.each(detailFields, function(fieldName) { %>\r
      <tr><td class="xos-label-cell"><%= fieldName in fieldDisplayNames ? fieldDisplayNames[fieldName] : fieldNameToHumanReadable(fieldName) %>:</td>\r
         <% } else { %>\r
             <td><input type="text" name="<%= fieldName %>" value="<%= model.attributes[fieldName] %>"<%= readOnly %>></td>\r
         <% } %>\r
+        <td  class="xos-help-cell"><%= helpText[fieldName] %></td>\r
      </tr>\r
   <% }); %>\r
   <%= xosInlineDetailButtonsTemplate() %>\r
 
 <script type="text/template" id="xos-sliceselector-select">
     <% if (caption) { %>
-    <table><tr><td class="xos-label-cell"><%= caption %>: </td><td><select></select></td></tr></table>
+    <table class="xos-detail-table"><tr><td class="xos-label-cell"><%= caption %>: </td><td><select></select></td></tr></table>
     <% } else { %>
     <select></select>
     <% } %>