changeset 255:4a52186008ee

Add a first version of the sidebar
author David Soria Parra <dsp@php.net>
date Sun, 04 Oct 2009 04:05:49 +0200
parents d662cba2afb1
children f6ace8678dd1
files static/javascript/download.js templates/base.html templates/frontpage.html
diffstat 3 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/static/javascript/download.js	Sun Oct 04 04:05:49 2009 +0200
@@ -0,0 +1,10 @@
+function os_detection() {
+    var OSName="Source";
+    if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
+    if (navigator.appVersion.indexOf("Mac")!=-1) OSName="Mac OS X";
+    if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
+    if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
+
+    document.write(OSName);
+}
+
--- a/templates/base.html	Thu Sep 24 18:00:24 2009 -0400
+++ b/templates/base.html	Sun Oct 04 04:05:49 2009 +0200
@@ -6,6 +6,7 @@
         <link href="/css/styles.css" type="text/css" rel="stylesheet">
         <script type="text/javascript" src="/javascript/typeface.js"></script>
         <script type="text/javascript" src="/javascript/optimer_regular.typeface.js"></script>
+        <script type="text/javascript" src="/javascript/download.js"></script>
         <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
 
         <title>Mercurial SCM</title>
@@ -44,7 +45,21 @@
                     </div>
                     <div class="col">
                         {% block sidebar %}
-                            No sidebar on this page yet.
+                        <a class="download typeface-js" href="/downloads">
+                                    <strong>Download now</strong>
+                                    Mercurial <em>1.3.1</em>
+                                    <span><script language="javascript">os_detection();</script></span>
+                        </a>
+                        <dl>
+                            <dt class="typeface-js">Requirements</dt>
+                            <dd>Python 2.4 (<a href="http://www.python.org">get python</a>)</dd>
+                            <!--2.4 is necessary for TortoiseHG, Mercurial only needs 2.3-->
+
+                            <dt>Another OS?<br><em>Get mercurial for:</em></dt>
+                            <dd><a href="/downloads">Mac OS X</a></dd>
+                            <dd><a href="/downloads">Windows</a></dd>
+                            <dd><a href="/downloads">other</a></dd>
+                        </dl>
                         {% endblock %}
                     </div>
                 </div>
--- a/templates/frontpage.html	Thu Sep 24 18:00:24 2009 -0400
+++ b/templates/frontpage.html	Sun Oct 04 04:05:49 2009 +0200
@@ -8,7 +8,9 @@
         <h2>Mercurial is a free, distributed source control management tool. It efficiently handles projects of any size and offers an easy and intuitive interface.</h2>
     </div>
     <div class="col">                   
-        {# TODO: download button #}
+        {% block sidebar %}
+         {{ super() }}
+        {% endblock %}
     </div>
 </div>