Commits

Alex Rattray committed 7f59b93

better about page, cleared index, topbar back to fixed

Comments (0)

Files changed (14)

mysite/__init__.pyc

Binary file modified.

mysite/app/__init__.pyc

Binary file modified.

mysite/app/forms.pyc

Binary file modified.

mysite/app/models.pyc

Binary file modified.

mysite/app/views.py

 # from bootstrap.forms import BootstrapModelForm, Fieldset
 
 #HP:
-def hackpackify(request, page_context):
+def hackpackify(request, context):
   '''
     Updates a view's context to include variables expected in base.html
     Intended to make boilerplate info conveyance and menu bars quick and easy.
       {'name':'Home', 'url':'/'},
       {'name':'About', 'url':'/about/'},
     ]
-  project_name = "A Django HackPack Project"
+  #HP project_name is used in navbar, copyright (footer), about page, and <title>
+  project_name = "A Django HackPack Project" 
+  #HP project_description is used in <meta name="description"> and the about page.
   project_description = "A super cool app."
+  #HP Founder information is in popups linked from the footers, the about page, and <meta name="author">
   founders = [
     {'name':'Alex Rattray',
        'email':'rattray@wharton.upenn.edu',
        'blurb':'I\'m Greg. I like webdev and most things Boston. And Dogs.',
        'picture':'http://chucknorri.com/wp-content/uploads/2011/03/Chuck-Norris-14.jpg'},
     ]
-  global_context = {
+  hackpack_context = {
       'pages': pages,
       'project_name': project_name,
       'founders': founders,
       'project_description': project_description,
       }
-  context = dict(page_context, **global_context)
-  return RequestContext(request, context) #HP
+  if not context.__contains__('hackpack'):
+    #HP add the hackpack dict to the page's context
+    context['hackpack'] = hackpack_context
+
+  return RequestContext(request, context) #HP RequestContext is good practice. (I think).
 
 def index(request):
   message = 'hello world!' #HP just used for example. Don't do this.

mysite/app/views.pyc

Binary file modified.

mysite/media/css/bootstrap.css

   *z-index: 2;
 }
 .navbar-inner {
-  min-height: 60px;
+  min-height: 40px;
   padding-left: 20px;
   padding-right: 20px;
   background-color: #fafafa;
 .navbar .brand {
   float: left;
   display: block;
-  padding: 20px 20px 20px;
+  padding: 10px 20px 10px;
   margin-left: -20px;
   font-size: 20px;
   font-weight: 200;
 }
 .navbar-text {
   margin-bottom: 0;
-  line-height: 60px;
+  line-height: 40px;
 }
 .navbar-link {
   color: #777777;
   color: #333333;
 }
 .navbar .divider-vertical {
-  height: 60px;
+  height: 40px;
   margin: 0 9px;
   border-left: 1px solid #f2f2f2;
   border-right: 1px solid #ffffff;
 }
 .navbar .btn,
 .navbar .btn-group {
-  margin-top: 15px;
+  margin-top: 5px;
 }
 .navbar .btn-group .btn,
 .navbar .input-prepend .btn,
 .navbar-form select,
 .navbar-form .radio,
 .navbar-form .checkbox {
-  margin-top: 15px;
+  margin-top: 5px;
 }
 .navbar-form input,
 .navbar-form select,
 .navbar-search {
   position: relative;
   float: left;
-  margin-top: 15px;
+  margin-top: 5px;
   margin-bottom: 0;
 }
 .navbar-search .search-query {
 }
 .navbar .nav > li > a {
   float: none;
-  padding: 20px 15px 20px;
+  padding: 10px 15px 10px;
   color: #777777;
   text-decoration: none;
   text-shadow: 0 1px 0 #ffffff;

mysite/media/css/bootstrap.min.css

 .nav>.disabled>a{color:#999999;}
 .nav>.disabled>a:hover{text-decoration:none;background-color:transparent;cursor:default;}
 .navbar{overflow:visible;margin-bottom:20px;color:#777777;*position:relative;*z-index:2;}
-.navbar-inner{min-height:60px;padding-left:20px;padding-right:20px;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;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-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);*zoom:1;}.navbar-inner:before,.navbar-inner:after{display:table;content:"";line-height:0;}
+.navbar-inner{min-height:40px;padding-left:20px;padding-right:20px;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;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-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);*zoom:1;}.navbar-inner:before,.navbar-inner:after{display:table;content:"";line-height:0;}
 .navbar-inner:after{clear:both;}
 .navbar .container{width:auto;}
 .nav-collapse.collapse{height:auto;}
-.navbar .brand{float:left;display:block;padding:20px 20px 20px;margin-left:-20px;font-size:20px;font-weight:200;color:#777777;text-shadow:0 1px 0 #ffffff;}.navbar .brand:hover{text-decoration:none;}
-.navbar-text{margin-bottom:0;line-height:60px;}
+.navbar .brand{float:left;display:block;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777777;text-shadow:0 1px 0 #ffffff;}.navbar .brand:hover{text-decoration:none;}
+.navbar-text{margin-bottom:0;line-height:40px;}
 .navbar-link{color:#777777;}.navbar-link:hover{color:#333333;}
-.navbar .divider-vertical{height:60px;margin:0 9px;border-left:1px solid #f2f2f2;border-right:1px solid #ffffff;}
-.navbar .btn,.navbar .btn-group{margin-top:15px;}
+.navbar .divider-vertical{height:40px;margin:0 9px;border-left:1px solid #f2f2f2;border-right:1px solid #ffffff;}
+.navbar .btn,.navbar .btn-group{margin-top:5px;}
 .navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0;}
 .navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";line-height:0;}
 .navbar-form:after{clear:both;}
-.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:15px;}
+.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;}
 .navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0;}
 .navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;}
 .navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0;}
-.navbar-search{position:relative;float:left;margin-top:15px;margin-bottom:0;}.navbar-search .search-query{margin-bottom:0;padding:4px 14px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}
+.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0;}.navbar-search .search-query{margin-bottom:0;padding:4px 14px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}
 .navbar-static-top{position:static;width:100%;margin-bottom:0;}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
 .navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0;}
 .navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px;}
 .navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;}
 .navbar .nav.pull-right{float:right;margin-right:0;}
 .navbar .nav>li{float:left;}
-.navbar .nav>li>a{float:none;padding:20px 15px 20px;color:#777777;text-decoration:none;text-shadow:0 1px 0 #ffffff;}
+.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777777;text-decoration:none;text-shadow:0 1px 0 #ffffff;}
 .navbar .nav .dropdown-toggle .caret{margin-top:8px;}
 .navbar .nav>li>a:focus,.navbar .nav>li>a:hover{background-color:transparent;color:#333333;text-decoration:none;}
 .navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);-moz-box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);}

mysite/media/css/style.css

-.navbar {
-  margin-bottom: 20px;
-}
+body {
+	padding-top:60px; /* this is for the navbar */
+}

mysite/settings.pyc

Binary file modified.

mysite/templates/about.html

 
   <!-- Main hero unit for a primary marketing message or call to action -->
   <div class="hero-unit">
-    <h1>Hello, world!</h1>
-    <p>Welcome to my super groovy about page. </p>
-    <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
+    <h1>About {{hackpack.project_name}}</h1>
+    <hr>
+    <p>{{hackpack.project_description}}</p>
   </div>
 
   <!-- Example row of columns -->
   <div class="row">
-    <div class="span4">
-      <h2>Heading</h2>
-      <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
-      <p><a class="btn" href="#">View details &raquo;</a></p>
-    </div>
-    <div class="span4">
-      <h2>Heading</h2>
-      <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
-      <p><a class="btn" href="#">View details &raquo;</a></p>
-   </div>
-    <div class="span4">
-      <h2>Heading</h2>
-      <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
-      <p><a class="btn" href="#">View details &raquo;</a></p>
-    </div>
+    {% for founder in hackpack.founders %}
+      <div class="span3">
+        <div class="well">
+          <h2><a href="{{founder.url}}">{{founder.name}}</a></h2>
+          <p>{{founder.blurb}}</p>
+          <hr>
+          <img class="thumbnail" src="{{founder.picture}}" style="max-width:90%; margin:auto;"/>
+        </div>
+      </div>
+    {% endfor %}
   </div>
 
 {% endblock content %}

mysite/templates/base.html

 <html lang="en">
   <head>
     <meta charset="utf-8">
-    <title>{% block title %}{{project_name}} | {{thispage}}{% endblock %}</title>
+    <title>{% block title %}{{hackpack.project_name}} | {{hackpack.thispage}}{% endblock %}</title>
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta name="description" content="{{project_description}}">
     <meta name="author" content="{% for author in founders %}{{ author.name }},{% endfor %}">
   </head>
 
   <body>
-    <!-- HP: By executive fiat, I hereby declare it prohibited to use the navbar-inverse or navbar-fixed-top classes! -->
-    <div class="navbar navbar-static-top"> 
+    <!-- HP: By executive fiat, I hereby declare it prohibited to use the navbar-inverse class! -->
+    <div class="navbar navbar-fixed-top"> 
       <div class="navbar-inner">
         <div class="container">
           <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
             <span class="icon-bar"></span>
             <span class="icon-bar"></span>
           </a>
-          <a class="brand" href="/">{{project_name}}</a>
+          <a class="brand" href="/">{{hackpack.project_name}}</a>
           <div class="nav-collapse collapse">
             <ul class="nav">
               {% block nav %}
-                {% for page in pages %}
+                {% for page in hackpack.pages %}
                   {% if page.name == thispage %}
                     <li class="active"><a href="{{page.url}}">{{page.name}}</a></li>
                   {% else %}
       {% block content %}
       {% endblock content %}
 
-      
-
       <footer>
         <hr>
         {% block footer %}
           <center>
-            <p>&copy; {{project_name}} 2012</p>
+            <p>&copy; {{hackpack.project_name}} 2012</p>
             <p>
               A project by 
-              {% for author in founders %}
+              {% for author in hackpack.founders %}
                 <a 
                   href="{% if author.url %}{{ author.url }}{% else %}mailto:{{ author.email }}{% endif %}" 
                   rel="popover" 

mysite/templates/index.html

   <!-- Main hero unit for a primary marketing message or call to action -->
   <div class="hero-unit">
     <h1>Hello, world!</h1>
-    <p>This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
-    <p><a class="btn btn-primary btn-large">Learn more &raquo;</a></p>
-  </div>
-
-  <!-- Example row of columns -->
-  <div class="row">
-    <div class="span4">
-      <h2>Heading</h2>
-      <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
-      <p><a class="btn" href="#">View details &raquo;</a></p>
-    </div>
-    <div class="span4">
-      <h2>Heading</h2>
-      <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
-      <p><a class="btn" href="#">View details &raquo;</a></p>
-   </div>
-    <div class="span4">
-      <h2>Heading</h2>
-      <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
-      <p><a class="btn" href="#">View details &raquo;</a></p>
-    </div>
+    <p>Your Stuff Here. </p>
+    <p></p>
   </div>
 
 {% endblock content %}

mysite/urls.pyc

Binary file modified.