aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorSam Ockman2012-07-21 19:39:31 -0400
committerSam Ockman2012-07-21 19:39:31 -0400
commitce3364aad83938f1d84234aef6f4a19277637116 (patch)
tree3b8e735b6eeb2aae3336b737a4cdbe1d7896cd02 /wqflask
parenta72bc7c8c4a27b9e3456c5c1971034b526cdf352 (diff)
downloadgenenetwork2-ce3364aad83938f1d84234aef6f4a19277637116.tar.gz
checkpoint
Diffstat (limited to 'wqflask')
-rwxr-xr-xwqflask/wqflask/show_trait/DataEditingPage.py12
-rw-r--r--wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee20
-rw-r--r--wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js29
3 files changed, 43 insertions, 18 deletions
diff --git a/wqflask/wqflask/show_trait/DataEditingPage.py b/wqflask/wqflask/show_trait/DataEditingPage.py
index 610124ae..68de5ae4 100755
--- a/wqflask/wqflask/show_trait/DataEditingPage.py
+++ b/wqflask/wqflask/show_trait/DataEditingPage.py
@@ -227,9 +227,15 @@ class DataEditingPage(templatePage):
# """)
self.basic_table['columns'] = yaml.load("""
- - All Cases
- - BXD Only
- - Non-BXD Only
+ -
+ n: All Cases
+ t: all
+ -
+ n: BXD Only
+ t: primary
+ -
+ n: Non-BXD Only
+ t: other
""")
print(pf(self.basic_table))
diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
index 2c912f05..1f59788c 100644
--- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
+++ b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.coffee
@@ -58,8 +58,9 @@ $ ->
make_table = ->
header = "<thead><tr><th>&nbsp;</th>"
for column in basic_table['columns']
- the_id = process_id("column_" + column)
- header += """<th id="#{ the_id }">#{ column }</th>"""
+ console.log("column:", column)
+ the_id = process_id("column", column.t)
+ header += """<th id="#{ the_id }">#{ column.n }</th>"""
header += "</thead>"
rows = [
@@ -90,7 +91,7 @@ $ ->
row_line += """<td id="#{ row.vn }">#{ row.pretty }</td>"""
for column in basic_table['columns']
console.log("apple:", column)
- the_id = process_id(column + "_" + row.vn)
+ the_id = process_id(column.t, row.vn)
console.log("the_id:", the_id)
row_line += """<td id="#{ the_id }">&nbsp;</td>"""
row_line += """</tr>"""
@@ -103,11 +104,16 @@ $ ->
- process_id = (value) ->
+ process_id = (values...) ->
### Make an id or a class valid javascript by, for example, eliminating spaces ###
- console.log("value:", value)
- value = value.replace(" ", "_")
- return value
+ processed = ""
+ for value in values
+ console.log("value:", value)
+ value = value.replace(" ", "_")
+ if processed.length
+ processed += ":"
+ processed += value
+ return processed
$('#primary').change(edit_data_change)
console.log("loaded")
diff --git a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
index c288f11f..e9a141a3 100644
--- a/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
+++ b/wqflask/wqflask/static/new/javascript/trait_data_and_analysis.js
@@ -1,6 +1,7 @@
// Generated by CoffeeScript 1.3.3
(function() {
- var isNumber;
+ var isNumber,
+ __slice = [].slice;
console.log("start_b");
@@ -73,8 +74,9 @@
_ref = basic_table['columns'];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
column = _ref[_i];
- the_id = process_id("column_" + column);
- header += "<th id=\"" + the_id + "\">" + column + "</th>";
+ console.log("column:", column);
+ the_id = process_id("column", column.t);
+ header += "<th id=\"" + the_id + "\">" + column.n + "</th>";
}
header += "</thead>";
rows = [
@@ -104,7 +106,7 @@
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
column = _ref1[_k];
console.log("apple:", column);
- the_id = process_id(column + "_" + row.vn);
+ the_id = process_id(column.t, row.vn);
console.log("the_id:", the_id);
row_line += "<td id=\"" + the_id + "\">&nbsp;</td>";
}
@@ -117,12 +119,23 @@
console.log("table is:", table);
return $("#stats_table").append(table);
};
- process_id = function(value) {
+ process_id = function() {
+ var processed, value, values, _i, _len;
+ values = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
/* Make an id or a class valid javascript by, for example, eliminating spaces
*/
- console.log("value:", value);
- value = value.replace(" ", "_");
- return value;
+
+ processed = "";
+ for (_i = 0, _len = values.length; _i < _len; _i++) {
+ value = values[_i];
+ console.log("value:", value);
+ value = value.replace(" ", "_");
+ if (processed.length) {
+ processed += ":";
+ }
+ processed += value;
+ }
+ return processed;
};
$('#primary').change(edit_data_change);
console.log("loaded");