Permalink
Browse files

can show and hide teh correct layout.

  • Loading branch information...
1 parent 12afe20 commit 81dd36fb221ee11773d1313a1acf190bf3bf2bfd @jtrain committed Mar 11, 2012
Showing with 24 additions and 2 deletions.
  1. +17 −2 views/index.tpl
  2. +7 −0 views/theme_base.tpl
View
@@ -1,11 +1,26 @@
%rebase theme_base title=title
+<script>
+function getCookie(c_name) {
+ var i,x,y,ARRcookies=document.cookie.split(";");
+ for (i=0;i<ARRcookies.length;i++) {
+
+ x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
+ y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
+ x=x.replace(/^\s+|\s+$/g,"");
+ if (x==c_name) {
+ return unescape(y).replace(/"/g, '');
+ }
+ }
+}
+</script>
<style>
+
td .btn, table {
width: 100%;
}
</style>
-<form class="pick" method="POST" action="/">
+<form class="pick hidden" method="POST" action="/">
<div class='row-fluid'>
<div class="span12">
<div class="hero-unit">
@@ -30,7 +45,7 @@ td .btn, table {
</div>
</div>
</form>
- <div class='row-fluid'>
+ <div class='row-fluid results hidden'>
<div class="span12">
<div class="hero-unit">
<h1>Game Results</h1>
View
@@ -52,5 +52,12 @@
</div>
%include js_base get_url=get_url
+ <script>
+if (getCookie('not_my_team_name') !== undefined){
+ $('.results').removeClass('hidden');
+} else {
+ $('.pick').removeClass('hidden');
+}
+ </script>
</body>
</html>

0 comments on commit 81dd36f

Please sign in to comment.