Commit be3fa4bbea37450a0b3cf230218cb5f6c9e2734d
1 parent
2e6c8806
Exists in
master
and in
1 other branch
Fix bug validateForm JS. Thanks path: Caio S. de B. Almeida <caiosba@gmail.com>
Showing
2 changed files
with
19 additions
and
17 deletions
Show diff stats
src/web/templates/layout.html
| @@ -27,22 +27,22 @@ $ url_base = "http://localhost:8080" | @@ -27,22 +27,22 @@ $ url_base = "http://localhost:8080" | ||
| 27 | <script type="text/javascript"> | 27 | <script type="text/javascript"> |
| 28 | window.onload = function() { | 28 | window.onload = function() { |
| 29 | setupDependencies('weboptions'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' ) | 29 | setupDependencies('weboptions'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' ) |
| 30 | - }; | 30 | +}; |
| 31 | 31 | ||
| 32 | function validateForm() | 32 | function validateForm() |
| 33 | -{ | ||
| 34 | -var u=document.forms["weboptions"]["pkgs_file"].value | ||
| 35 | -var x=document.forms["weboptions"]["pkgs_list"].value | ||
| 36 | -if ((u==null) && (x==null) || (x=="Write your list App here or send a file list this icon:") && (u=="") ) | ||
| 37 | - { | ||
| 38 | - alert("Choice your list App or create a list!"); | ||
| 39 | - return false; | ||
| 40 | - } | ||
| 41 | -else { | ||
| 42 | - if (x=='Write your list App here or send a file list this icon:') {x=''} | ||
| 43 | - } | ||
| 44 | -}; | ||
| 45 | -</script> | 33 | + { |
| 34 | + var t = $$("#pkgs_list"); | ||
| 35 | + var i = $$("input[name=pkgs_file]"); | ||
| 36 | + if (!i.val() && ( !t.val() || t.val() == "Write your list App here or send a file list this icon:")) { | ||
| 37 | + alert("Choose your list app or create a list!"); | ||
| 38 | + return false; | ||
| 39 | + } else { | ||
| 40 | + if (i.val()) t.val(""); | ||
| 41 | + return true; | ||
| 42 | + } | ||
| 43 | +} | ||
| 44 | + </script> | ||
| 45 | + | ||
| 46 | 46 | ||
| 47 | <script type="text/javascript"> | 47 | <script type="text/javascript"> |
| 48 | $$(document).ready(function() { | 48 | $$(document).ready(function() { |
| @@ -158,7 +158,6 @@ else { | @@ -158,7 +158,6 @@ else { | ||
| 158 | </div> | 158 | </div> |
| 159 | </noscript> | 159 | </noscript> |
| 160 | 160 | ||
| 161 | - | ||
| 162 | $:content | 161 | $:content |
| 163 | 162 | ||
| 164 | <div id="footer"> | 163 | <div id="footer"> |
src/web/templates/survey.html
| @@ -7,6 +7,9 @@ $var jsfiles: static/coda-slider-2.0/javascripts/jquery-1.3.2.min.js static/coda | @@ -7,6 +7,9 @@ $var jsfiles: static/coda-slider-2.0/javascripts/jquery-1.3.2.min.js static/coda | ||
| 7 | 7 | ||
| 8 | <script type="text/javascript"> | 8 | <script type="text/javascript"> |
| 9 | $$(document).ready(function() { | 9 | $$(document).ready(function() { |
| 10 | + $$("#bar-header").click(function () { | ||
| 11 | + $$("#header").slideToggle("slow"); | ||
| 12 | + }); | ||
| 10 | $$('a[rel*=facebox]').facebox({ | 13 | $$('a[rel*=facebox]').facebox({ |
| 11 | loadingImage : '/static/images/loading.gif', | 14 | loadingImage : '/static/images/loading.gif', |
| 12 | closeImage : '/static/images/closelabel.png' | 15 | closeImage : '/static/images/closelabel.png' |
| @@ -18,7 +21,7 @@ $var jsfiles: static/coda-slider-2.0/javascripts/jquery-1.3.2.min.js static/coda | @@ -18,7 +21,7 @@ $var jsfiles: static/coda-slider-2.0/javascripts/jquery-1.3.2.min.js static/coda | ||
| 18 | <div id="sidebar"> | 21 | <div id="sidebar"> |
| 19 | <div class="innertube"> | 22 | <div class="innertube"> |
| 20 | 23 | ||
| 21 | -<div id="details_box" class="graybox align-left glass_blue"> | 24 | +<div id="details_box" class="graybox align-left"> |
| 22 | <h2>Recommendation strategy details</h2> | 25 | <h2>Recommendation strategy details</h2> |
| 23 | <ul class="toc"> | 26 | <ul class="toc"> |
| 24 | $for key, value in request.get_details().items(): | 27 | $for key, value in request.get_details().items(): |
| @@ -80,7 +83,7 @@ $for pkg in pkg_details: | @@ -80,7 +83,7 @@ $for pkg in pkg_details: | ||
| 80 | <a href="#finish" id="finish-button" class="glass">Finish | 83 | <a href="#finish" id="finish-button" class="glass">Finish |
| 81 | <div class="tip important" id="tip-finish"><p>Tem certeza que não gostaria de avaliar uma nova estratégia? </p></div> | 84 | <div class="tip important" id="tip-finish"><p>Tem certeza que não gostaria de avaliar uma nova estratégia? </p></div> |
| 82 | </a> | 85 | </a> |
| 83 | -<label for="strategy_button" id="tip-strategy"><div class="tip note"><p> Gerar um novo resultado com uma estratégia diferente para mesma lista de pacotes. </p></div><input id="strategy-button" name="strategy_button" type="submit" value="New Strategy" class="glass" /></label> | 86 | +<label for="strategy_button" id="tip-strategy"><div class="tip note"><p> Gerar um novo resultado com uma estratégia diferente para mesma lista de pacotes ou <a id="bar-header">envie uma nova lista de pacotes</a>. </p></div><input id="strategy-button" name="strategy_button" type="submit" value="New Strategy" class="glass" /></label> |
| 84 | </div> | 87 | </div> |
| 85 | 88 | ||
| 86 | </form> | 89 | </form> |