Commits

Miran Levar  committed 187cb00

Added requred appengine routes.

  • Participants
  • Parent commits 465f55d

Comments (0)

Files changed (6)

File P4/graph_viewer/Templates/frame.html

 </div>
 
 <div class="footer navbar-fixed-bottom" >
-    <a  id="info" class="btn btn-info btn-small pull-left" style="margin:4px;" rel="popover" data-placement="top"
-     data-content="<p>Graphs can be viewed in the home screen and managed in the graphs tab.You can add your own graphs and select them for viewing.</p> <p> 
-    You can also add graphs by sending them via email to graph@graph-viewer.appspotmail.com
-                (subject is the graph name and the body should contain the graph json.</p>" 
-    title="Graph viewer basic information">Info</a>
-
-    <img class="pull-right" src="https://developers.google.com/appengine/images/appengine-noborder-120x30.gif" 
+    <a  id="info" class="btn btn-info btn-small pull-left" style="margin:4px;" href="/info/">Info</a>
+    <img class="pull-right" src="/img/appengine-noborder-120x30.gif" 
     alt="Powered by Google App Engine" />
     <p id="foot">
     <span class="brand">Miran Levar, P2, FRI 2012/2013 </span>
     </p>
-    <script>
-    $('#info').popover()
-    </script>
 </div>
 </body>
 </html>

File P4/static/js/graph.js

-
 var nodes;
 var links;
 var foce;
         else
             return linkDst;
     })
+
     force.start();
 });
 $("#selfDst").blur(function () {
     var path = svg.append("svg:g").selectAll("path")
         .data(force.links())
       .enter().append("svg:path")
-        .attr("class",  function (n) {
+        .attr("class", function (n) {
             if (n.visible)
                 return "link";
             else
             return -9;
     })
     .attr("y", 4)
-    .attr("class","text")
+    .attr("class", "text")
     .text(function (d) { if (d.visible) return d.name; else return ""; });
 
     function tick() {
 application: graph-viewer
-version: 2
+version: 3
 runtime: python27
 api_version: 1
 threadsafe: true #false
 
 
+
+handlers:
+- url: /favicon.ico
+  static_files: img/favicon.ico
+  upload: img/favicon.ico
+- url: /img/
+  static_dir: img
+- url: /info/
+  script: main.app
+
 libraries:
+- name: jinja2
+  version: latest
 - name: django
   version: "1.4"
 

File img/appengine-noborder-120x30.gif

Added
New image

File jinja/info.html

+<?xml version="1.0" encoding="utf-8"?>
+<!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">
+<head>
+    <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/>
+    <link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css "/>
+    
+    <style>
+        html, body {
+	        margin:0;
+	        height:100%;
+        }
+
+        /* Custom container */
+        .container-narrow {
+	        min-height: 100%;
+	        height: auto !important;
+	        height: 100%;
+            margin: 0 auto;
+            margin-bottom:-38px;
+            max-width: 1200px;
+      
+        }
+
+        .footer{
+            height:32px;
+            width:1200px;
+            margin-left:auto;
+            margin-right:auto;
+
+            background-color: #fafafa;
+            background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2);
+            background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2));
+            background-image: -webkit-linear-gradient(top, #ffffff, #f2f2f2);
+            background-image: -o-linear-gradient(top, #ffffff, #f2f2f2);
+            background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
+            background-repeat: repeat-x;
+            border: 1px solid #d4d4d4;
+            -webkit-border-radius: 4px;
+            -moz-border-radius: 4px;
+            border-radius: 4px;
+            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);
+            *zoom: 1;
+            -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
+            -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
+            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
+	
+        }
+
+        .footer #foot{
+	        padding-top:6px;
+	        margin-left:auto;
+	        margin-right:auto;
+	        width:260px;
+            font-size: 15px;
+            font-weight:bolder;
+	        color: #777777;
+	        text-shadow: 0 1px 0 #ffffff;
+        }
+
+    </style>	
+
+    <title>graph viewer</title>
+
+    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"> </script>
+    <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap.js "></script>
+</head>
+<body>
+
+<div class="container-narrow">
+    <div class="masthead">
+		<div class="navbar navbar-static-top">
+		<div class="navbar-inner">
+			<span class="brand">graph viewer</span>
+			<ul class="nav">
+                <li id="home"><a href="/">Home</a></li>				
+                <li id="graphs"><a href="/graphs/">Graphs</a></li>        	
+            </ul>
+            <ul class="nav pull-right">
+                <li><a href="/logout/">{{ username}}, sign out here</a></li>
+		    </ul>
+	    </div>
+	    </div>
+	</div>
+
+    <div class="content">
+<h1> Graph viewer basic information</h1>
+        <p>Graphs can be viewed in the home screen and managed in the graphs tab.You can add your own graphs and select them for viewing.</p> <p> 
+    You can also add graphs by sending them via email to graph@graph-viewer.appspotmail.com
+                (subject is the graph name and the body should contain the graph json.</p>
+	</div>
+</div>
+
+<div class="footer navbar-fixed-bottom" >
+    <a  id="info" class="btn btn-info btn-small pull-left" style="margin:4px;" href="/info/">Info</a>
+    <img class="pull-right" src="/img/appengine-noborder-120x30.gif" 
+    alt="Powered by Google App Engine" />
+    <p id="foot">
+    <span class="brand">Miran Levar, P2, FRI 2012/2013 </span>
+    </p>
+</div>
+</body>
+</html>
+#!/usr/bin/env python
+#coding: UTF-8
+
+import jinja2
+import webapp2
+import datetime
+import os
+
+from google.appengine.api import users
+from google.appengine.api import memcache
+
+jinja_environment = jinja2.Environment(
+    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)+'/jinja/'))
+
+class MainHandler(webapp2.RequestHandler):
+    def get(self):
+        user = users.get_current_user()
+
+        template = jinja_environment.get_template('info.html')
+        self.response.out.write(template.render({"username": user.nickname()}))
+
+app = webapp2.WSGIApplication([('/info/', MainHandler)], debug=True)