[Commits] python.it commit r261 - in code/pythonisti/trunk/pythonisti: . geo media/i media/s templates templates/geo

commit a svn.python.it commit a svn.python.it
Gio 18 Gen 2007 02:22:00 CET


Author: rhymes
Date: Thu Jan 18 02:21:53 2007
New Revision: 261

Added:
   code/pythonisti/trunk/pythonisti/media/i/
   code/pythonisti/trunk/pythonisti/media/i/ad-banner.png   (contents, props changed)
   code/pythonisti/trunk/pythonisti/media/i/bg-main-nav-a.png   (contents, props changed)
   code/pythonisti/trunk/pythonisti/media/i/external.gif   (contents, props changed)
   code/pythonisti/trunk/pythonisti/media/i/favicon.gif   (contents, props changed)
   code/pythonisti/trunk/pythonisti/media/i/logo.png   (contents, props changed)
   code/pythonisti/trunk/pythonisti/media/s/
   code/pythonisti/trunk/pythonisti/media/s/form.css
   code/pythonisti/trunk/pythonisti/media/s/home.css
   code/pythonisti/trunk/pythonisti/media/s/layout.css
   code/pythonisti/trunk/pythonisti/media/s/site.css
   code/pythonisti/trunk/pythonisti/templates/base.html
   code/pythonisti/trunk/pythonisti/templates/index.html
Removed:
   code/pythonisti/trunk/pythonisti/templates/geo/
Modified:
   code/pythonisti/trunk/pythonisti/geo/views.py
   code/pythonisti/trunk/pythonisti/urls.py
Log:
Now the app as a mockup template (thanks to deelan), so we can see how to proceed visually and progammatically.


Modified: code/pythonisti/trunk/pythonisti/geo/views.py
==============================================================================
--- code/pythonisti/trunk/pythonisti/geo/views.py	(original)
+++ code/pythonisti/trunk/pythonisti/geo/views.py	Thu Jan 18 02:21:53 2007
@@ -27,4 +27,4 @@
         'zoom': settings.MAP_ZOOM
     }
     
-    return render_to_response('geo/map.xhtml', context)
+    return render_to_response('index.html', context)

Added: code/pythonisti/trunk/pythonisti/media/i/ad-banner.png
==============================================================================
Binary file. No diff available.

Added: code/pythonisti/trunk/pythonisti/media/i/bg-main-nav-a.png
==============================================================================
Binary file. No diff available.

Added: code/pythonisti/trunk/pythonisti/media/i/external.gif
==============================================================================
Binary file. No diff available.

Added: code/pythonisti/trunk/pythonisti/media/i/favicon.gif
==============================================================================
Binary file. No diff available.

Added: code/pythonisti/trunk/pythonisti/media/i/logo.png
==============================================================================
Binary file. No diff available.

Added: code/pythonisti/trunk/pythonisti/media/s/form.css
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/media/s/form.css	Thu Jan 18 02:21:53 2007
@@ -0,0 +1,61 @@
+form {
+	
+}
+
+fieldset {
+}
+
+legend {
+	
+}
+
+label {
+    display: block; 
+}
+
+label span {
+	font-size: 90%;
+	color: #666;
+}
+
+input, select, textarea {        
+	padding: .2em;
+    margin: 0;    
+
+	font: inherit;    
+}
+
+input[type='text'], input[type='password'], select, textarea {    
+	border: 1px solid #999;
+}
+
+
+textarea {    
+    line-height: 150%;    
+    width: 90%;
+}
+
+input:focus, 
+select:focus,
+textarea:focus {    
+	border: 1px solid #000;
+}
+
+input.button {
+	
+	font-weight: bold;	
+	
+	padding: .2em;
+    margin: 0;
+    margin-right: .2em; /* space between the next button */
+	
+	color: #333;
+	
+	border: 1px solid #ccc;
+	border-bottom: 1px solid #333;
+	border-right: 1px solid #333;
+	
+	cursor: pointer;
+	
+	background: #eee;
+}

Added: code/pythonisti/trunk/pythonisti/media/s/home.css
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/media/s/home.css	Thu Jan 18 02:21:53 2007
@@ -0,0 +1,10 @@
+#map {
+	border: 1px solid;
+	margin: 2em;
+	width: 800px;
+	height: 600px;
+}
+
+#logo {
+	margin: 1em;
+}
\ No newline at end of file

Added: code/pythonisti/trunk/pythonisti/media/s/layout.css
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/media/s/layout.css	Thu Jan 18 02:21:53 2007
@@ -0,0 +1,143 @@
+
+
+
+/* ---------------------------------------------------
+=logo
+----------------------------------------------------- */
+
+
+#logo {
+	list-style: none;
+}
+
+
+#logo a:link, #logo a:visited {
+	border: none;
+	
+	
+}
+
+#logo li {
+	float: left;
+	/*border: 1px solid red;*/
+	margin-right: 1em;
+}
+
+
+/* ---------------------------------------------------
+=main
+----------------------------------------------------- */
+
+#main {
+	width: 70em;
+}
+
+
+
+.double-col {
+	width: 34em;
+	float: left;
+	
+	margin-right: 2em;
+}
+
+
+.col {
+	width: 16em;
+	float: left;
+	
+	margin-right: 2em;
+}
+
+
+
+.last {
+	margin-right: 0;
+}
+
+
+
+/* ---------------------------------------------------
+=main-nav
+----------------------------------------------------- */
+
+#main-nav {
+	list-style: none;	
+	
+	border-bottom: 2px solid #333;
+}
+
+#main-nav li {
+	float: left;
+	/*width: 12em;*/
+	margin-left: 1em;
+	padding: .2em .5em;
+	
+
+}
+
+#main-nav .current {
+	background: #333;
+
+}
+
+#main-nav a:link, #main-nav a:visited {
+	color: #333;
+	
+	font-size: 110%;
+	font-weight: bold;
+	
+	border: none;
+	
+	/*padding-left: 12px;
+	background: transparent url(./i/bg-main-nav-a.png) center left no-repeat;
+	*/
+	
+	display: block;
+}
+
+#main-nav a:hover {
+	color: #fff;
+	background: #333;
+}
+
+#main-nav .current a:link, #main-nav .current a:visited {
+	color: #fff;
+	/*border: none;*/
+}
+
+#main-nav li.current a:hover {
+	color: #BF1D1D;
+}
+
+
+/*
+
+#li-xxx  a:hover {
+	background: #BF1D1D;
+}
+
+*/
+
+
+
+
+/* ---------------------------------------------------
+=footer
+----------------------------------------------------- */
+
+#disclamer {
+	
+	margin: 1em 0;
+	
+	font-size: 90%;
+	color: #666;
+}
+
+#footer {
+	border-top: 1px dotted #999;
+	
+	padding: 1em 0;
+	margin: 2em 0;
+	
+}

Added: code/pythonisti/trunk/pythonisti/media/s/site.css
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/media/s/site.css	Thu Jan 18 02:21:53 2007
@@ -0,0 +1,111 @@
+ a import url("./form.css");
+
+/*
+base stylesheet.
+*/
+
+/* ---------------------------------------------------
+=page
+------------------------------------------------------ */
+
+
+html, body {
+	margin: 0;
+	padding: 0;
+	
+	direction: ltr;
+}
+
+body { 	
+	margin: 1em 0;
+	margin-left: 2em;
+	
+	padding: 0;
+	
+	color: #333;		
+	background: #fff;
+
+	font: normal small/1.3 Arial, Helvetica, sans-serif;	
+	
+}
+
+* {
+	margin: 0;
+	padding: 0;
+}
+
+
+
+
+h1, h2, h3 {	
+	font: bold small/1.3 Arial, Helvetica, sans-serif;	
+	font: bold small/1.3 Georgia, serif;	
+}
+
+
+/* ---------------------------------------------------
+=hyperlinks
+----------------------------------------------------- */
+
+a:link, a:visited {
+
+	text-decoration: none;
+
+	color: #333;	
+	/*font-weight: bold;*/
+	
+	border-bottom: 1px solid #ccc;
+
+}
+
+a:visited {		
+
+}
+
+a:hover {	
+	color: #BF1D1D;
+	border-bottom: none;
+}
+
+
+a.external:link, a.external:visited  {
+	background: transparent url(./i/external.gif) center right no-repeat;
+	padding-right: 12px;
+
+}
+
+
+/* ---------------------------------------------------
+=misc
+----------------------------------------------------- */
+
+a img {
+	border: none;
+}
+
+_ {
+	
+}
+
+.hidden { display: none; }
+.inline {display: inline; }
+
+.clear-float {	
+	/* auto-clear floated children */
+	overflow: hidden;
+	/* IE fix see:
+	http://www.positioniseverything.net/easyclearing.html		
+	*/
+	height: 1%;	
+}
+
+
+hr {
+	visibility: hidden;
+	
+	margin: 0;
+	margin-top: 1.5em;
+	padding: 0;
+	
+	border: none;
+}

Added: code/pythonisti/trunk/pythonisti/templates/base.html
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/templates/base.html	Thu Jan 18 02:21:53 2007
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>{% block title %}Working With Python{% endblock %}</title>
+    <!-- <link rel="icon" href="./i/favicon.gif" type="image/gif" /> -->
+    <link rel="stylesheet" href="/media/s/site.css" type="text/css" media="screen" />
+    <link rel="stylesheet" href="/media/s/layout.css" type="text/css" media="screen" />
+    <link rel="stylesheet" href="/media/s/home.css" type="text/css" media="screen" />
+    {% block js_head %}<!-- js links go here -->{% endblock %}
+</head>
+
+<body onload="load()" onunload="GUnload()">
+    <a class="hidden" href="#content">Skip to page contents</a>
+    <div id="main">
+        <div id="header">
+           <ul id="logo" class="clear-float">
+                <!-- <li id="li-home"><a title="Pythonistas home" href="#"><img src="./i/logo.png" alt="Pythonistas" /></a></li> -->
+                <li id="li-search">
+                    <form action="#" method="get"><label class="inline">Search&nbsp;<input type="text" name="q" value="" size="15" /></label>
+                    <input type="submit" class="button" name="" value="Go" /></form>
+                </li>
+                                
+            </ul>
+            <ul id="main-nav" class="clear-float">
+                <li class="current"><a href="#">Home</a>
+                </li>        
+
+                <li id="li-xxx"><a href="#">Menu 2</a>
+                </li>        
+                <li id=""><a href="#">Menu 3</a>
+                </li>
+                <li id=""><a href="#">Menu 4</a>
+                </li>
+                
+                <li><a href="#">About Pythonistas</a>
+                </li>
+            </ul>
+
+<!--
+            <div class="ad">
+                <a href="#"><img src="./i/ad-banner.png" alt="Ad text here" /></a>
+            </div>        
+-->
+        </div>
+        
+        <div id="content">
+
+            <div class="clear-float">                
+                                
+                <div id="map" class="double-col">        
+                    {% block map %}
+                    <p>Map goes here.</p>
+                    {% endblock %}
+                </div>
+
+                <div class="double-col last">
+                    <div id="splash" class="clear-float">
+                        <!--
+                            TAGS GOES HERE
+                        -->  
+                        <p>Tags goes here.</p>                                                                        
+                    </div>
+
+                <!-- /double-col -->
+                </div>
+                
+            <!-- /clear-float -->
+            </div>
+    
+            <!--
+                Other stuff
+            -->
+
+        <!-- /content -->
+        </div>
+
+
+        <div id="footer">
+            <div>
+                <a href="#">Home</a>
+                &bull; <a href="#">Menu 2</a>
+                &bull; <a href="#">Menu 3</a>            
+                &bull; <a href="#">Cos&#8217; Pythonistas</a>
+                &bull; <a href="#">Privacy</a>
+            </div>
+
+<!--
+            <div class="ad">
+                <a href="#"><img src="./i/ad-banner.png" alt="Ad text here" /></a>
+            </div>
+-->            
+            <p id="disclamer">
+                Disclamer: Nunc nulla lacus, iaculis quis, posuere eget, convallis sed, lacus. Integer sit amet justo ac metus laoreet ultricies
+            </p>
+
+        </div>
+
+    <!-- /main -->
+    </div>
+
+
+</body>
+</html>
\ No newline at end of file

Added: code/pythonisti/trunk/pythonisti/templates/index.html
==============================================================================
--- (empty file)
+++ code/pythonisti/trunk/pythonisti/templates/index.html	Thu Jan 18 02:21:53 2007
@@ -0,0 +1,45 @@
+{% extends "base.html" %}
+
+{% block js_head %}
+    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={{key}}"
+            type="text/javascript"></script> 
+    <script src="/media/j/jquery.js" type="text/javascript"></script>
+    <script type="text/javascript">
+      //<![CDATA[
+    var center = {{ center }};
+    var zoom = {{ zoom }};
+    
+    function load() {
+      $.getJSON("/geo/json", fillMap);
+    }
+
+    function fillMap(locations) {  
+      if (GBrowserIsCompatible()) {
+
+        var map = new GMap2(document.getElementById("map"));
+        map.addControl(new GSmallMapControl());
+        map.addControl(new GMapTypeControl());
+        map.setCenter(new GLatLng(center[1], center[0]), zoom);
+
+        /* Define a custom marker function, that adds an info window
+           about the pythonista */
+        function createMarker(point, i) {
+          var marker = new GMarker(point);
+          GEvent.addListener(marker, "click", function() {
+            info = locations[i]["info"]
+            marker.openInfoWindowHtml("<strong>" + info + "</strong>");
+          });
+          return marker;
+        }
+        
+        // Add the pythonisti markers
+        for (var i = 0, n = locations.length; i < n; i++) {
+          var location = locations[i]["location"];
+          var point = new GLatLng(location[1], location[0]);
+          map.addOverlay(createMarker(point, i));
+        }
+      }
+    }
+      //]]>
+    </script>
+{% endblock %}

Modified: code/pythonisti/trunk/pythonisti/urls.py
==============================================================================
--- code/pythonisti/trunk/pythonisti/urls.py	(original)
+++ code/pythonisti/trunk/pythonisti/urls.py	Thu Jan 18 02:21:53 2007
@@ -2,11 +2,8 @@
 from django.conf import settings
 
 urlpatterns = patterns('',
-    # Example:
-    # (r'^pythonisti/', include('pythonisti.apps.foo.urls.foo')),
+    (r'^$', 'pythonisti.geo.views.gmap'),
     (r'^geo/', include('pythonisti.geo.urls')),
-                       
-    # Uncomment this for admin:
     (r'^admin/', include('django.contrib.admin.urls')),
 )
 


Maggiori informazioni sulla lista Commits