Commits

Ralph Bean committed 3fbe688

My stab at a new frontpage.

Comments (0)

Files changed (8)

htdocs/css/panes.css

+
+#pane_container {
+        width:950px;
+        margin:0 auto;
+}
+
+.pane {
+        width: 425px;
+
+        -webkit-border-radius: 15px;
+        -moz-border-radius: 15px;
+        border-radius: 15px;
+}
+
+#left {
+        float:left;
+}
+
+#right {
+        float:right;
+}

htdocs/css/pygments-native.css

+.syntax {
+        padding: 10px;
+        -webkit-border-radius: 15px;
+        -moz-border-radius: 15px;
+        border-radius: 15px;
+}
+.syntax .hll { background-color: #404040 }
+.syntax  { background: #202020; color: #d0d0d0 }
+.syntax .c { color: #999999; font-style: italic } /* Comment */
+.syntax .err { color: #a61717; background-color: #e3d2d2 } /* Error */
+.syntax .g { color: #d0d0d0 } /* Generic */
+.syntax .k { color: #6ab825; font-weight: bold } /* Keyword */
+.syntax .l { color: #d0d0d0 } /* Literal */
+.syntax .n { color: #d0d0d0 } /* Name */
+.syntax .o { color: #d0d0d0 } /* Operator */
+.syntax .x { color: #d0d0d0 } /* Other */
+.syntax .p { color: #d0d0d0 } /* Punctuation */
+.syntax .cm { color: #999999; font-style: italic } /* Comment.Multiline */
+.syntax .cp { color: #cd2828; font-weight: bold } /* Comment.Preproc */
+.syntax .c1 { color: #999999; font-style: italic } /* Comment.Single */
+.syntax .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */
+.syntax .gd { color: #d22323 } /* Generic.Deleted */
+.syntax .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */
+.syntax .gr { color: #d22323 } /* Generic.Error */
+.syntax .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */
+.syntax .gi { color: #589819 } /* Generic.Inserted */
+.syntax .go { color: #cccccc } /* Generic.Output */
+.syntax .gp { color: #aaaaaa } /* Generic.Prompt */
+.syntax .gs { color: #d0d0d0; font-weight: bold } /* Generic.Strong */
+.syntax .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */
+.syntax .gt { color: #d22323 } /* Generic.Traceback */
+.syntax .kc { color: #6ab825; font-weight: bold } /* Keyword.Constant */
+.syntax .kd { color: #6ab825; font-weight: bold } /* Keyword.Declaration */
+.syntax .kn { color: #6ab825; font-weight: bold } /* Keyword.Namespace */
+.syntax .kp { color: #6ab825 } /* Keyword.Pseudo */
+.syntax .kr { color: #6ab825; font-weight: bold } /* Keyword.Reserved */
+.syntax .kt { color: #6ab825; font-weight: bold } /* Keyword.Type */
+.syntax .ld { color: #d0d0d0 } /* Literal.Date */
+.syntax .m { color: #3677a9 } /* Literal.Number */
+.syntax .s { color: #ed9d13 } /* Literal.String */
+.syntax .na { color: #bbbbbb } /* Name.Attribute */
+.syntax .nb { color: #24909d } /* Name.Builtin */
+.syntax .nc { color: #447fcf; text-decoration: underline } /* Name.Class */
+.syntax .no { color: #40ffff } /* Name.Constant */
+.syntax .nd { color: #ffa500 } /* Name.Decorator */
+.syntax .ni { color: #d0d0d0 } /* Name.Entity */
+.syntax .ne { color: #bbbbbb } /* Name.Exception */
+.syntax .nf { color: #447fcf } /* Name.Function */
+.syntax .nl { color: #d0d0d0 } /* Name.Label */
+.syntax .nn { color: #447fcf; text-decoration: underline } /* Name.Namespace */
+.syntax .nx { color: #d0d0d0 } /* Name.Other */
+.syntax .py { color: #d0d0d0 } /* Name.Property */
+.syntax .nt { color: #6ab825; font-weight: bold } /* Name.Tag */
+.syntax .nv { color: #40ffff } /* Name.Variable */
+.syntax .ow { color: #6ab825; font-weight: bold } /* Operator.Word */
+.syntax .w { color: #666666 } /* Text.Whitespace */
+.syntax .mf { color: #3677a9 } /* Literal.Number.Float */
+.syntax .mh { color: #3677a9 } /* Literal.Number.Hex */
+.syntax .mi { color: #3677a9 } /* Literal.Number.Integer */
+.syntax .mo { color: #3677a9 } /* Literal.Number.Oct */
+.syntax .sb { color: #ed9d13 } /* Literal.String.Backtick */
+.syntax .sc { color: #ed9d13 } /* Literal.String.Char */
+.syntax .sd { color: #ed9d13 } /* Literal.String.Doc */
+.syntax .s2 { color: #ed9d13 } /* Literal.String.Double */
+.syntax .se { color: #ed9d13 } /* Literal.String.Escape */
+.syntax .sh { color: #ed9d13 } /* Literal.String.Heredoc */
+.syntax .si { color: #ed9d13 } /* Literal.String.Interpol */
+.syntax .sx { color: #ffa500 } /* Literal.String.Other */
+.syntax .sr { color: #ed9d13 } /* Literal.String.Regex */
+.syntax .s1 { color: #ed9d13 } /* Literal.String.Single */
+.syntax .ss { color: #ed9d13 } /* Literal.String.Symbol */
+.syntax .bp { color: #24909d } /* Name.Builtin.Pseudo */
+.syntax .vc { color: #40ffff } /* Name.Variable.Class */
+.syntax .vg { color: #40ffff } /* Name.Variable.Global */
+.syntax .vi { color: #40ffff } /* Name.Variable.Instance */
+.syntax .il { color: #3677a9 } /* Literal.Number.Integer.Long */

htdocs/css/tosca.css

     display: none;
 }
 
+.clear {
+    clear: both;
+}
 #footer {
+    clear: both;
     margin: 2em 0.5em;
     padding: 0.5em;
     border-top: 1px solid #597984;

htdocs/index.html

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
-    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><link rel="stylesheet" type="text/css" href="index_files/calendar-system.css" media="all">
-    <script type="text/javascript" src="index_files/calendar.js"></script>
-    <script type="text/javascript" src="index_files/calendar-setup.js"></script>
-    <script type="text/javascript" src="index_files/calendar-en.js"></script>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
     <link href="css/tosca.css" rel="stylesheet">
-    <link href="css/forms.css" rel="stylesheet">
+    <link href="css/panes.css" rel="stylesheet">
+    <link href="css/pygments-native.css" rel="stylesheet">
     <link rel="shortcut icon" href="images/favicon.ico" type="image/vnd.microsoft.icon">
     <title>ToscaWidgets</title>
   </head>
     <div id="header">
       <h1>ToscaWidgets</h1>
       <a href="/">
-        <img src="images/toscawidgets-logo.jpg" alt="Toscawidgets Logo" id="logo" height="74" width="343"></a>
+        <img src="images/toscawidgets-logo.jpg" alt="Toscawidgets Logo" id="logo" height="74" width="343">
+      </a>
       <ul id="main-menu">
-        <li>
-        <a href="download.html" title="Go to Download">Download</a>
-        </li><li>
-        <a href="documentation/" title="Go to Documentation">Documentation</a>
-        </li><li>
-        <a href="trac.html" title="Go to Trac">Trac</a>
-        </li><li>
-        <a href="repos.html" title="Go to Repositories">Repositories</a>
-        </li>
+        <li><a href="download.html" title="Go to Download">Download</a></li>
+        <li><a href="documentation/" title="Go to Documentation">Documentation</a></li>
+        <li><a href="trac.html" title="Go to Trac">Trac</a></li>
+        <li><a href="repos.html" title="Go to Repositories">Repositories</a></li>
       </ul>
     </div>
     <div id="page">
-      <div id="sidebar-right" class="sidebar">
-        <h3>News</h3>
-        <p>12/8/2010 - New documentation - <a href="documentation/tw2.core/history.html">What's New in ToscaWidgets 2</a></p>
-        <p>2/8/2010 - Alpha releases to PyPI of <a href="documentation/tw2.core/">ToscaWidget 2</a>.</p>
-        <p>26/7/2010 - New tutorial - <a href="documentation/tw2.core/tutorial.html">Using ToscaWidgets 2 Standalone</a></p>
-        <h3>Community</h3>
-        <p><a href="http://groups.google.com/group/toscawidgets-discuss" title="ToscaWidgets-discuss | Google Groups">
-          ToscaWidgets' Google Group</a>
-        </p>
-      </div>
       <div class="content">
         <h1>ToscaWidgets</h1>
-        <p>ToscaWidgets is a framework for building reusable web 
-        components. The system allows a web developer to use a complex widget in
-        their application with ease - the internal complexity of the widget is 
-        hidden. This helps rapidly develop compelling web applications. There is
-        an extensive library of existing widgets, for example:</p>
-        <form id="demo1" action="" method="post" class="tableform">
-          <table border="0" cellpadding="2" cellspacing="0">
-            <tbody><tr id="demo1_date.container" class="even">
-                <td class="labelcol">
-                  <label id="demo1_date.label" for="demo1_date" class="fieldlabel required">Pick a date</label>
-                </td>
-                <td class="fieldcol">
-                  <div>
-                    <input id="demo1_date" class="calendardatepicker required" name="date" value="02/04/2012" type="text">
-                    <input id="demo1_date_trigger" class="date_field_button" value="Choose" type="button">
-                  </div>
-                </td>
-              </tr>
-          </tbody></table>
-        </form>
-        <br><p>The main benefit of ToscaWidgets is that this example took very little Python code to implement.</p>
-        <h1>tw.forms</h1>
-        <p>tw.forms is a library of widgets for building HTML forms. It 
-        enables the rapid creation of forms, with server-side validation that 
-        returns clear error messages to users.</p>
-        <p>As tw.forms is built on ToscaWidgets, the developer can 
-        easily use more complex widgets in the forms. The end result is a 
-        powerful framework that is useful to web developers in the real world.</p>
-        <h2>Getting Started</h2>
-        <p>ToscaWidgets works with many <a href="http://www.python.org/">Python</a> web frameworks, including <a href="http://www.pylonshq.com/">Pylons</a>, <a href="http://www.turbogears.org/">TurboGears</a>, and raw <a href="http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface">WSGI</a>. To start using ToscaWidgets:</p>
-        <p></p><ol>
-          <li>1) Enable ToscaWidgets in your web framework. <a href="/documentation/ToscaWidgets/install/index.html">More...</a></li>
-          <li>2) Learn the basics of creating forms. <a href="/documentation/tw.forms/tutorials/index.html">More...</a></li>
-          <li>3) Discover the exciting widgets available. <a href="http://turbogears.org/2.0/docs/main/ToscaWidgets/Cookbook.html">More...</a></li>
-        </ol><p></p><br>
-        <p>After this, move on to the <a href="documentation/">reference documentation</a>.</p>
+        <p>ToscaWidgets is WSGI framework for building reusable web UI
+        components in python. The system allows a web developer to use a
+        complex widget in their application with ease - the internal complexity
+        of the widget is  hidden. This helps rapidly develop compelling web
+        applications.  It is in theory compatible with any other WSGI-based web
+        framework (such as <a href="http://pyramid.rtfd.org">Pyramid</a> or
+        <a href="http://turbogears.org">TurboGears</a>).  There is an extensive
+        library of existing widgets.</p>
+
+        <p>ToscaWidgets is split into two major versions...</p>
+
+        <div id="pane_container">
+          <div id="left" class="pane">
+            <p><a href="http://toscawidgets.org/documentation/ToscaWidgets/">
+              ToscaWidgets 1</a> is battle-hardened.  It has been used for years
+            in the TurboGears community.  You can depend on it.</p>
+            <div class="syntax">
+              <div class="highlight"><pre><span class="sd">&quot;&quot;&quot; The most basic form with ToscaWidgets 1 &quot;&quot;&quot;</span>
+
+<span class="kn">import</span> <span class="nn">tw.forms</span> <span class="kn">as</span> <span class="nn">twf</span>
+
+<span class="n">movie_form</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TableForm</span><span class="p">(</span>
+    <span class="s">&#39;movie_form&#39;</span><span class="p">,</span>
+    <span class="n">action</span><span class="o">=</span><span class="s">&#39;save_movie&#39;</span><span class="p">,</span>
+    <span class="n">children</span><span class="o">=</span><span class="p">[</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">HiddenField</span><span class="p">(</span><span class="s">&#39;id&#39;</span><span class="p">),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">(</span><span class="s">&#39;title&#39;</span><span class="p">),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">(</span><span class="s">&#39;year&#39;</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">4</span><span class="p">),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">CalendarDatePicker</span><span class="p">(</span><span class="s">&#39;release_date&#39;</span><span class="p">),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">SingleSelectField</span><span class="p">(</span><span class="s">&#39;genera&#39;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="p">[</span>
+            <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="s">&#39;Action&#39;</span><span class="p">,</span> <span class="s">&#39;Comedy&#39;</span><span class="p">,</span> <span class="s">&#39;Other&#39;</span>
+        <span class="p">]),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">TextArea</span><span class="p">(</span><span class="s">&#39;description&#39;</span><span class="p">),</span>
+    <span class="p">]</span>
+<span class="p">)</span>
+</pre></div>
+            </div>
+
+          </div>
+          <div id="right" class="pane">
+            <p><a href="http://tw2core.rtfd.org">ToscaWidgets 2</a> is where
+            all the new development is happening.</p>
+            <div class="syntax">
+              <div class="highlight"><pre><span class="sd">&quot;&quot;&quot; The most basic form with ToscaWidgets 2 &quot;&quot;&quot;</span>
+
+<span class="kn">import</span> <span class="nn">tw2.core</span> <span class="kn">as</span> <span class="nn">twc</span>
+<span class="kn">import</span> <span class="nn">tw2.forms</span> <span class="kn">as</span> <span class="nn">twf</span>
+
+<span class="k">class</span> <span class="nc">MovieForm</span><span class="p">(</span><span class="n">twf</span><span class="o">.</span><span class="n">FormPage</span><span class="p">):</span>
+    <span class="n">title</span> <span class="o">=</span> <span class="s">&#39;Movie&#39;</span>
+    <span class="k">class</span> <span class="nc">child</span><span class="p">(</span><span class="n">twf</span><span class="o">.</span><span class="n">TableForm</span><span class="p">):</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">HiddenField</span><span class="p">()</span>
+        <span class="n">title</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">(</span><span class="n">validator</span><span class="o">=</span><span class="n">twc</span><span class="o">.</span><span class="n">Required</span><span class="p">)</span>
+        <span class="n">director</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">()</span>
+        <span class="n">genres</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">CheckBoxList</span><span class="p">(</span><span class="n">options</span><span class="o">=</span><span class="p">[</span>
+            <span class="s">&#39;Action&#39;</span><span class="p">,</span> <span class="s">&#39;Comedy&#39;</span><span class="p">,</span> <span class="s">&#39;Romance&#39;</span><span class="p">,</span> <span class="s">&#39;Sci-fi&#39;</span>
+        <span class="p">])</span>
+        <span class="k">class</span> <span class="nc">cast</span><span class="p">(</span><span class="n">twf</span><span class="o">.</span><span class="n">GridLayout</span><span class="p">):</span>
+            <span class="n">extra_reps</span> <span class="o">=</span> <span class="mi">5</span>
+            <span class="n">character</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">()</span>
+            <span class="n">actor</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">()</span>
+</pre></div>
+
+
+            </div>
+          </div>
+        </div>
       </div>
     </div>
+    <div class="clear"></div>
     <div id="footer">
       © 2008-2012 Alberto Valverde Gonzalez and contributors,
       Webdesign Theme by Daniel Haus,

htdocs/syntax-resources/snippet-tw1.html

+<div class="highlight"><pre><span class="sd">&quot;&quot;&quot; The most basic form with ToscaWidgets 1 &quot;&quot;&quot;</span>
+
+<span class="kn">import</span> <span class="nn">tw.forms</span> <span class="kn">as</span> <span class="nn">twf</span>
+
+<span class="n">movie_form</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TableForm</span><span class="p">(</span>
+    <span class="s">&#39;movie_form&#39;</span><span class="p">,</span>
+    <span class="n">action</span><span class="o">=</span><span class="s">&#39;save_movie&#39;</span><span class="p">,</span>
+    <span class="n">children</span><span class="o">=</span><span class="p">[</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">HiddenField</span><span class="p">(</span><span class="s">&#39;id&#39;</span><span class="p">),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">(</span><span class="s">&#39;title&#39;</span><span class="p">),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">(</span><span class="s">&#39;year&#39;</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">4</span><span class="p">),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">CalendarDatePicker</span><span class="p">(</span><span class="s">&#39;release_date&#39;</span><span class="p">),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">SingleSelectField</span><span class="p">(</span><span class="s">&#39;genera&#39;</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="p">[</span>
+            <span class="s">&#39;&#39;</span><span class="p">,</span> <span class="s">&#39;Action&#39;</span><span class="p">,</span> <span class="s">&#39;Comedy&#39;</span><span class="p">,</span> <span class="s">&#39;Other&#39;</span>
+        <span class="p">]),</span>
+        <span class="n">twf</span><span class="o">.</span><span class="n">TextArea</span><span class="p">(</span><span class="s">&#39;description&#39;</span><span class="p">),</span>
+    <span class="p">]</span>
+<span class="p">)</span>
+</pre></div>

htdocs/syntax-resources/snippet-tw1.py

+""" The most basic form with ToscaWidgets 1
+
+Stable, but no new development. """
+
+import tw.forms as twf
+
+movie_form = twf.TableForm(
+    'movie_form',
+    action='save_movie',
+    children=[
+        twf.HiddenField('id'),
+        twf.TextField('title'),
+        twf.TextField('year', size=4),
+        twf.CalendarDatePicker('release_date'),
+        twf.SingleSelectField('genera', options=[
+            '', 'Action', 'Comedy', 'Other'
+        ]),
+        twf.TextArea('description'),
+    ]
+)

htdocs/syntax-resources/snippet-tw2.html

+<div class="highlight"><pre><span class="sd">&quot;&quot;&quot; The most basic form with ToscaWidgets 2 &quot;&quot;&quot;</span>
+
+<span class="kn">import</span> <span class="nn">tw2.core</span> <span class="kn">as</span> <span class="nn">twc</span>
+<span class="kn">import</span> <span class="nn">tw2.forms</span> <span class="kn">as</span> <span class="nn">twf</span>
+
+<span class="k">class</span> <span class="nc">MovieForm</span><span class="p">(</span><span class="n">twf</span><span class="o">.</span><span class="n">FormPage</span><span class="p">):</span>
+    <span class="n">title</span> <span class="o">=</span> <span class="s">&#39;Movie&#39;</span>
+    <span class="k">class</span> <span class="nc">child</span><span class="p">(</span><span class="n">twf</span><span class="o">.</span><span class="n">TableForm</span><span class="p">):</span>
+        <span class="nb">id</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">HiddenField</span><span class="p">()</span>
+        <span class="n">title</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">(</span><span class="n">validator</span><span class="o">=</span><span class="n">twc</span><span class="o">.</span><span class="n">Required</span><span class="p">)</span>
+        <span class="n">director</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">()</span>
+        <span class="n">genres</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">CheckBoxList</span><span class="p">(</span><span class="n">options</span><span class="o">=</span><span class="p">[</span>
+            <span class="s">&#39;Action&#39;</span><span class="p">,</span> <span class="s">&#39;Comedy&#39;</span><span class="p">,</span> <span class="s">&#39;Romance&#39;</span><span class="p">,</span> <span class="s">&#39;Sci-fi&#39;</span>
+        <span class="p">])</span>
+        <span class="k">class</span> <span class="nc">cast</span><span class="p">(</span><span class="n">twf</span><span class="o">.</span><span class="n">GridLayout</span><span class="p">):</span>
+            <span class="n">extra_reps</span> <span class="o">=</span> <span class="mi">5</span>
+            <span class="n">character</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">()</span>
+            <span class="n">actor</span> <span class="o">=</span> <span class="n">twf</span><span class="o">.</span><span class="n">TextField</span><span class="p">()</span>
+</pre></div>

htdocs/syntax-resources/snippet-tw2.py

+""" The most basic form with ToscaWidgets 2 """
+
+import tw2.core as twc
+import tw2.forms as twf
+
+class MovieForm(twf.FormPage):
+    title = 'Movie'
+    class child(twf.TableForm):
+        id = twf.HiddenField()
+        title = twf.TextField(validator=twc.Required)
+        director = twf.TextField()
+        genres = twf.CheckBoxList(options=[
+            'Action', 'Comedy', 'Romance', 'Sci-fi'
+        ])
+        class cast(twf.GridLayout):
+            extra_reps = 5
+            character = twf.TextField()
+            actor = twf.TextField()