Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
tutorial added
Browse files Browse the repository at this point in the history
  • Loading branch information
zalun committed Jun 19, 2010
1 parent 8a264d9 commit bab5a2a
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 30 deletions.
5 changes: 1 addition & 4 deletions flightdeck/api/templates/api.html
Expand Up @@ -6,13 +6,10 @@
{% endblock %}

{% block app_sidebar %}
<h2 class="UI_Heading"><a title="Tutorial" href="/tutorial/">Tutorial</a></h2>
<h2 class="UI_Heading"><a title="Tutorial" href="{% url tutorial %}">Tutorial</a></h2>
<h2 class="UI_Heading"><a title="{{ package_name}}" href="{% url api_package package_name %}">
{% if package.name == 'jetpack-core' %}Core Library{% else %}{{ package.name }}{% endif %}
</a></h2>
{% include "_modules_list.html" %}
{% endblock %}


{% block app_domready %}
{% endblock %}
6 changes: 3 additions & 3 deletions flightdeck/base/templates/base.html
Expand Up @@ -34,7 +34,7 @@
jp_addon_create_url: '{% url jp_addon_create %}',
jp_library_create_url: '{% url jp_library_create %}',
create_modal_template: '{% escape_template "_create.html" %}',
user: '{{ user.username }}', // was request.user - TODO: check
user: '{{ user.username }}',
DEBUG: {{ settings.DEBUG|yesno:"true,false" }}
};
window.addEvent('domready', function() {
Expand All @@ -57,14 +57,14 @@

<header id="app-header">
{% block header %}{% include "_header.html" %}{% endblock %}
</header> <!-- /main-header -->
</header> <!-- /app-header -->

{% block app_menu %}{% comment %}
<div id="editor-menu-wrapper">
<ul class="UI_Editor_Menu minimal">
{% include "_base_app_menu_items.html" %}
</ul>
</div>
</div><!-- /editor-menu-wrapper -->
{% endcomment %}{% endblock %}

<div id="app-body">
Expand Down
13 changes: 5 additions & 8 deletions flightdeck/base/templates/homepage.html
Expand Up @@ -6,15 +6,12 @@
<link rel="stylesheet" href="/media/jetpack/css/UI.Landing_Page.css" type="text/css" media="screen" />
<script src="/media/jetpack/js/FlightDeck.Browser.js"></script>
<!-- <script src="http://github.com/oskarkrawczyk/nuTabs/raw/master/Source/nuTabs.js"></script> -->
<script type="text/javascript" charset="utf-8">
window.addEvents({
domready: function(){
// new nuTabs($$('#features-wrapper .UI_Tabs a'), $$('#features-wrapper .UI_Cont li'));
}
});
</script>
{% endblock %}

<script type="text/javascript" charset="utf-8">{% block app_domready %}
// new nuTabs($$('#features-wrapper .UI_Tabs a'), $$('#features-wrapper .UI_Cont li'));
{% endblock %}</script>

{% block app_menu %}{% endblock %}

{% block app_sidebar %}{% endblock %}
Expand All @@ -39,7 +36,7 @@ <h3>Welcome to Add-ons Builder!</h3>
inspiration. And take advantage of <a href="{% url jp_browser_libraries %}">third-party libraries</a>
with additional APIs.</p>

<p>Need more Help? <a href="">read the tutorial</a> for a
<p>Need more Help? <a href="{% url tutorial %}">read the tutorial</a> for a
step-by-step guide to building an add-on using this site.

<p>Happy hacking!</p>
Expand Down
1 change: 1 addition & 0 deletions flightdeck/settings.py
Expand Up @@ -125,6 +125,7 @@
'amo', # addons.mozilla.org integration (authentication state updates)
'jetpack', # Jetpack functionality
'api', # API browser
'tutorial', # Load tutorial templates
])

# devserver is optional
Expand Down
Empty file added flightdeck/tutorial/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions flightdeck/tutorial/models.py
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
12 changes: 12 additions & 0 deletions flightdeck/tutorial/templates/tutorial.html
@@ -0,0 +1,12 @@
{% extends "base.html" %}

{% block head %}
<link href="/media/api/css/API.Browser.css" rel="stylesheet" type="text/css" />
{% endblock %}

{% block app_content %}
<h2 class="UI_Heading">Woohoo</h3>
{% endblock %}


{% block app_sidebar %}{% endblock %}
23 changes: 23 additions & 0 deletions flightdeck/tutorial/tests.py
@@ -0,0 +1,23 @@
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""

from django.test import TestCase

class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.failUnlessEqual(1 + 1, 2)

__test__ = {"doctest": """
Another way to test that 1 + 1 is equal to 2.
>>> 1 + 1 == 2
True
"""}

5 changes: 5 additions & 0 deletions flightdeck/tutorial/urls.py
@@ -0,0 +1,5 @@
from django.conf.urls.defaults import *

urlpatterns = patterns('tutorial.views',
url(r'^$', 'tutorial', name='tutorial'),
)
5 changes: 5 additions & 0 deletions flightdeck/tutorial/views.py
@@ -0,0 +1,5 @@
# Create your views here.
from django.shortcuts import render_to_response, get_object_or_404

def tutorial(r):
return render_to_response('tutorial.html')
3 changes: 3 additions & 0 deletions flightdeck/urls.py
Expand Up @@ -30,6 +30,9 @@
# API Browser
(r'^api/', include('api.urls')),

# Tutorial
(r'^tutorial/', include('tutorial.urls')),

# Jetpack
(r'^user/', include('person.urls')),
(r'', include('jetpack.urls'))
Expand Down
7 changes: 7 additions & 0 deletions scripts/admin.sh
@@ -0,0 +1,7 @@
#!/bin/bash

source scripts/environment.sh

# run server
cd $PROJECT_DIR/$PROJECT_NAME/
django-admin.py $@
36 changes: 21 additions & 15 deletions tools/jetpack.vim
Expand Up @@ -8,12 +8,12 @@ if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
endif
set shortmess=aoO
badd +1 /private/tmp/------------Jetpack
badd +275 ~/Projects/FlightDeck/flightdeck/jetpack/views.py
badd +8 ~/Projects/FlightDeck/flightdeck/jetpack/views.py
badd +800 ~/Projects/FlightDeck/flightdeck/jetpack/models.py
badd +1 ~/Projects/FlightDeck/flightdeck/jetpack/tests/module_tests.py
badd +7 ~/Projects/FlightDeck/flightdeck/jetpack/managers.py
badd +1 ~/Projects/FlightDeck/flightdeck/jetpack/admin.py
badd +96 ~/Projects/FlightDeck/flightdeck/jetpack/urls.py
badd +128 ~/Projects/FlightDeck/flightdeck/jetpack/urls.py
badd +16 ~/Projects/FlightDeck/flightdeck/jetpack/errors.py
badd +21 ~/Projects/FlightDeck/flightdeck/jetpack/default_settings.py
badd +11 ~/Projects/FlightDeck/flightdeck/jetpack/package_helpers.py
Expand Down Expand Up @@ -67,7 +67,7 @@ badd +3 ~/Projects/FlightDeck/flightdeck/jetpack/templates/json/library_autocomp
badd +5 ~/Projects/FlightDeck/flightdeck/jetpack/templates/json/library_assigned.json
badd +6 ~/Projects/FlightDeck/flightdeck/jetpack/templates/json/_edit_urls.json
badd +7 ~/Projects/FlightDeck/flightdeck/jetpack/templates/json/attachment_added.json
badd +0 ~/Projects/FlightDeck/flightdeck/jetpack/templates/json/module_removed.json
badd +1 ~/Projects/FlightDeck/flightdeck/jetpack/templates/json/module_removed.json
badd +5 ~/Projects/FlightDeck/flightdeck/jetpack/templates/json/attachment_removed.json
badd +1 /private/tmp/----------JJS
badd +26 ~/Projects/FlightDeck/flightdeck/jetpack/templates/js/_view_package_initiate.js
Expand Down Expand Up @@ -100,25 +100,29 @@ badd +1 ~/Projects/FlightDeck/flightdeck/jetpack/media/css/edit.css
badd +1 /private/tmp/-----------Base
badd +3 ~/Projects/FlightDeck/flightdeck/base/views.py
badd +11 ~/Projects/FlightDeck/flightdeck/base/templatetags/base_helpers.py
badd +42 ~/Projects/FlightDeck/flightdeck/base/templates/base.html
badd +88 ~/Projects/FlightDeck/flightdeck/base/templates/base.html
badd +16 ~/Projects/FlightDeck/flightdeck/base/templates/_header.html
badd +105 ~/Projects/FlightDeck/flightdeck/media/js/FlightDeck.js
badd +1 ~/Projects/FlightDeck/flightdeck/media/js/FlightDeck.js
badd +27 ~/Projects/FlightDeck/flightdeck/media/js/Clientcide.ModalWindow.js
badd +71 ~/Projects/FlightDeck/flightdeck/media/js/FlightDeck.Roar.js
badd +34 ~/Projects/FlightDeck/flightdeck/media/js/FlightDeck.Modal.js
badd +1 ~/Projects/FlightDeck/flightdeck/media/js/FlightDeck.Utils.js
badd +15 ~/Projects/FlightDeck/flightdeck/media/js/FlightDeck.Autocomplete.js
badd +55 ~/Projects/FlightDeck/flightdeck/media/js/lib/sendFile.js
badd +75 ~/Projects/FlightDeck/flightdeck/settings.py
badd +35 ~/Projects/FlightDeck/flightdeck/urls.py
badd +128 ~/Projects/FlightDeck/flightdeck/settings.py
badd +34 ~/Projects/FlightDeck/flightdeck/urls.py
badd +27 ~/Projects/FlightDeck/flightdeck/settings_local-default.py
badd +29 ~/Projects/FlightDeck/flightdeck/settings_local.py
badd +1 ~/Projects/FlightDeck/flightdeck/utils/os_utils.py
badd +2 ~/Projects/FlightDeck/flightdeck/base/shortcuts.py
badd +91 ~/Projects/FlightDeck/flightdeck/base/templates/homepage.html
badd +39 ~/Projects/FlightDeck/flightdeck/base/templates/homepage.html
badd +2 ~/Projects/FlightDeck/flightdeck/base/templates/_base_app_menu_items.html
badd +10 ~/Projects/FlightDeck/flightdeck/base/templates/404.html
badd +8 ~/Projects/FlightDeck/flightdeck/media/css/UI.HttpError.css
badd +1 /tmp/-----------Tutorial
badd +5 ~/Projects/FlightDeck/flightdeck/tutorial/views.py
badd +4 ~/Projects/FlightDeck/flightdeck/tutorial/templates/tutorial.html
badd +5 ~/Projects/FlightDeck/flightdeck/tutorial/urls.py
badd +1 /private/tmp/------------Person
badd +30 ~/Projects/FlightDeck/flightdeck/person/views.py
badd +38 ~/Projects/FlightDeck/flightdeck/person/templates/dashboard.html
Expand All @@ -132,8 +136,8 @@ badd +1 ~/Projects/FlightDeck/flightdeck/api/models.py
badd +7 ~/Projects/FlightDeck/flightdeck/api/default_settings.py
badd +15 ~/Projects/FlightDeck/flightdeck/api/tests.py
badd +1 ~/Projects/FlightDeck/flightdeck/api/urls.py
badd +7 ~/Projects/FlightDeck/flightdeck/api/templates/api.html
badd +4 ~/Projects/FlightDeck/flightdeck/api/templates/api_homepage.html
badd +9 ~/Projects/FlightDeck/flightdeck/api/templates/api.html
badd +38 ~/Projects/FlightDeck/flightdeck/api/templates/api_homepage.html
badd +4 ~/Projects/FlightDeck/flightdeck/api/templates/module_doc.html
badd +4 ~/Projects/FlightDeck/flightdeck/api/templates/package_doc.html
badd +5 ~/Projects/FlightDeck/flightdeck/api/templates/_modules_list.html
Expand All @@ -157,19 +161,21 @@ badd +12 ~/Projects/FlightDeck/scripts/initiate.sh
badd +1 ~/Projects/FlightDeck/scripts/runserver.sh
badd +1 ~/Projects/FlightDeck/scripts/syncdb.sh
badd +1 ~/Projects/FlightDeck/scripts/test.sh
badd +7 ~/Projects/FlightDeck/scripts/admin.sh
badd +7 ~/Projects/FlightDeck/scripts/manage.sh
badd +7 ~/Projects/FlightDeck/tools/pip-requirements.txt
badd +1 ~/Projects/FlightDeck/scripts/cfx.sh
badd +29 ~/Projects/FlightDeck/tools/git-exclude
badd +30 ~/Projects/FlightDeck/apache/config_local-default.wsgi
badd +1 /private/tmp/------------AMO
badd +4 ~/Projects/FlightDeck/flightdeck/amo/default_settings.py
badd +57 ~/Projects/FlightDeck/flightdeck/amo/authentication.py
badd +1 tmp/-----------DOCS
badd +1 /tmp/-----------DOCS
badd +15 ~/Projects/FlightDeck/Docs/mozillaaddonbuilderstyle.sty
badd +28 ~/Projects/FlightDeck/README
badd +72 ~/Projects/FlightDeck/INSTALL
silent! argdel *
edit ~/Projects/FlightDeck/flightdeck/media/js/FlightDeck.js
edit ~/Projects/FlightDeck/flightdeck/base/templates/base.html
set splitbelow splitright
set nosplitbelow
set nosplitright
Expand All @@ -185,12 +191,12 @@ setlocal fml=1
setlocal fdn=20
setlocal fen
silent! normal! zE
let s:l = 61 - ((60 * winheight(0) + 43) / 87)
let s:l = 52 - ((51 * winheight(0) + 29) / 59)
if s:l < 1 | let s:l = 1 | endif
exe s:l
normal! zt
61
normal! 02l
52
normal! 03l
if exists('s:wipebuf')
silent exe 'bwipe ' . s:wipebuf
endif
Expand Down

0 comments on commit bab5a2a

Please sign in to comment.