Commits

Anonymous committed 1245622

404.html; 500.html; Some eagsite template tags tweeks; Some documentation

Comments (0)

Files changed (9)

docs/_static/default.css

 div.body h6 {
     font-family: sans-serif;
     font-weight: normal;
+    padding: 3px 0 3px 0px;
+}
+
+div.body h3,
+div.body h4,
+div.body h5,
+div.body h6 {
+    padding: 0;
+}
+
+div.body h1,
+div.body h2 {
+    margin: 50px -20px 15px -20px;
     border-bottom: 1px solid #ccc;
-    margin: 50px -20px 15px -20px;
-    padding: 3px 0 3px 10px;
 }
 
 div.body h1 { margin-top: 0; font-size: 200%; }
 }
 
 div.body p, div.body dd, div.body li {
-    text-align: justify;
+    text-align: left;
     line-height: 130%;
 }
 
     color: #333;
     line-height: 120%;
     border: 1px solid #ccc;
+    overflow: hidden; /* For google-chrome */
 }
 
 tt {

docs/eagadmin_ref.rst

 .. module:: eagadmin.forms
 .. currentmodule:: eagadmin.forms
 
+
+.. _class-picasa-widget:
+
 .. class:: PicasaWidget
 
    Lets select picasaweb galleries image.

docs/tutorial.rst

 Tutorial
 ********
 
-.. _installing:
+.. _tut-intro:
 
-Installing
-==========
+Intro
+=====
 
-Foo::
+EAG cms is as simple as possible CMS for Google App Engine (GAE) and Django
 
-    bar
+EAG cms yra sukurtas naudojantis Google App Engine (GAE) ir Django
+bibliotekomis. Taigi, aš primigtinai rekomenduočiau pirma susipažinti su
+pastarųjų dokumentacija (Žinoma, jeigu dar nesate susipažinęs):
 
-.. _fetching-the-data:
+`Google App Engine Docs <http://code.google.com/appengine/docs/python/overview.html>`_
 
-Fetching the data
------------------
+`Django Docs <http://docs.djangoproject.com/en/1.1/>`_
 
-Lorem ipsium
+.. _tut-installing:
 
+Getting started
+===============
+
+EAG cms yra visiškai priklausomas nuo GAE. Taigi, vienintelis būdas jį
+publikuoti yra publikuoti kaip GAE aplikaciją.
+
+Bet mums nereikia nieko publikuoti - dabar mes tiesiog norime pasileisti pačią
+aplikaciją ir testuoti ją namuose - localhost'e. Bent jau aš darau tokią
+prielaidą, kad jūs to norite...
+
+Prepare dev enviroment
+----------------------
+
+Visos žemiau pateiktos komandos testuotos tik linux OS. Tuo tarpu Windows
+ir/ar Mac OS savininkų teks atsiprašyti - aš neturi priėjimo prie pastarųjų
+OS. Bet jums yra pasiekiamas GAE SDK GUI. Peržvelgę linux komandas ir pridėję
+sveiką nuovoką, manau, turėtumėte išsisukti.
+
+Parsisiųskite GAE SDK. Išarchyvuokite jį į pasirinktą katalogą. Užeikite į direktoriją.::
+
+   wget http://googleappengine.googlecode.com/files/google_appengine_<last-version>.zip
+   unzip google_appengine_<last-version>.zip
+   cd google_appengine/
+
+Django siuntimą galite praleisti, jeigu jį jau esate instaliavę ir jis yra
+pasiekiamas PYTHON_PATH kintamajame. SVARBU: jums reikalinga django 1.1.*
+versija!
+
+Parsisiųskite Django 1.1. Išarchyvuokite jį į tą patį katalogą ir padarykite taip, kad anas būtų
+pasiekiamas iš GAE SDK.::
+
+   wget http://media.djangoproject.com/releases/1.1.1/Django-1.1.1.tar.gz
+   tar zxf Django-1.1.1.tar.gz
+   mv Django-1.1.1/django/ ./
+   rm -r Django-1.1.1
+
+Parsisiųskite EAG cms versiją. Išskleiskite ją į katalogą projects/eagcms.::
+
+   mkdir -p projects
+   wget TODO
+   tar zxf TODO projects/eagcms
+
+Pervadinkite main.py.sample į main.py
+Pervadinkite eagproject/settings.py.sample į eagproject/settings.py::
+
+   mv projects/eagcms/main.py.sample projects/eagcms/main.py
+   mv projects/eagcms/eagproject/settings.py.sample projects/eagcms/eagproject/settings.py.sample
+
+Paleiskite testinę aplinką::
+
+  ./dev_appserver.py projects/eagcms
+
+Pagal nutylėjimą administratoriaus pultas bus pasiekiamas adresu
+`http://localhost:8080/admin <http://localhost:8080/admin>`_, o frontend'as
+`http://localhost:8080/site <http://localhost:8080/site>`_.
+
+Rekomenduoju pasiskaityti `Čia <http://code.google.com/appengine/docs/python/gettingstarted/devenvironment.html>`_.
+
+
+.. _tut-admin-interface:
+
+Admin Interface
+===============
+
+TODO
+
+
+.. _tut-settings-vars:
+
+Django setting.py variables
+===========================
+
+EAG cms needs you to define some options in standard Django's settings module.
+
+ADMINS
+------
+
+Actually it is Django's standard settings' variable, but in EAG cms it is used
+to define additional users that are allowed to edit content.
+
+All users that are assigned as Yours app's administrators in appspots are
+allowed to edit content anyway - so You do not need to add them to `ADMINS`
+settings' var::
+
+   ADMINS = (
+       ('Default', 'test@example.com'),
+   )
+
+EAGCMS_TYPES
+------------
+modules list where EAG page types are defined.::
+
+   EAGCMS_TYPES = (
+       'eagtypes',
+   )
+
+See see :ref:`tut-eagtypes-concept` to find out more about page types.
+
+EAGCMS_PICASA_USER
+------------------
+
+Optional. `Picasa Web <http://picasaweb.google.com/>`_ user's name
+which public galleries are used to retrieve images for EAG cms wysiwyg
+and image widget (:ref:`PicasaWidget <class-picasa-widget>`)::
+
+   EAGCMS_PICASA_USER = 'some-user-name'
+
+.. _tut-eagtypes-concept:
+
+EAG Types concept
+=================
+
+TODO
+
+
+.. _tut-look-and-feel:
+
+Customizing look and feel
+=========================
+
+TODO
+
+
+.. _tut-app-integration:
+
+Fictional Django app integration (Advanced topic)
+=================================================
+
+TODO
+

eagproject/eagadmin/models/pages.py

         return get_children(self)
 
     def __eq__(self, other):
-        return self.slug == other.slug
+        return self.slug == getattr(other, 'slug', None)
 
     def __str__(self):
         return "%s %s" % ("--" * self.level, self.title)

eagproject/eagadmin/templatetags/eagsite.py

         self.depth = int(depth)
 
     def render(self, context):
-        current = template.Variable('current').resolve(context)
-        breadcrumb = template.Variable('breadcrumb').resolve(context)
+        current = None
+        breadcrumb = []
+        try:
+            current = template.Variable('current').resolve(context)
+            breadcrumb = template.Variable('breadcrumb').resolve(context)
+        except VariableDoesNotExist:
+            current = None
         items = []
         item = None
         try:
             return ''
         return self.output(items, current, breadcrumb)
 
-    def output(self, items, current, breadcrumb):
+    def output(self, items, current=None, breadcrumb=[]):
         first = items[0]
         level = first.level
         out = []
 
 class HeadNode(template.Node):
     def render(self, context):
-        current = template.Variable('current').resolve(context)
+        try:
+            current = template.Variable('current').resolve(context)
+        except VariableDoesNotExist:
+            return ''
         return '<title>%s</title>' \
             '<meta name="keywords" content="%s">' \
             '<meta name="description" content="%s" >' \

eagproject/settings.py.sample

 # Optional. picasaweb username
 # that are used in wysiwyg and
 # with PicasaWidget
-EAGCMS_PICASA_USER = 'petraszd'
+EAGCMS_PICASA_USER = 'some-user-name'
 

eagproject/templates/404.html

+{% extends "eagsite/base.html" %}
+{% block content %}
+  <h1>404 Error</h1>
+{% endblock %}

eagproject/templates/500.html

+500 Internal Server Error

eagproject/urls.py

 from django.conf.urls.defaults import *
 
 urlpatterns = patterns('',
+    (r'^admin', include('eagadmin.urls', namespace='eagadmin')),
     (r'^admin/', include('eagadmin.urls', namespace='eagadmin')),
-    (r'^site/(.*)$', 'eagadmin.views.site')
+    (r'^(.*)$', 'eagadmin.views.site')
+
+
+    # You need that duplication of 'admin' 'admin/' because
+    # last regexp matches everything and does not allow
+    # CommonMiddleware to add '/' and the end.
+    # Below code demonstrates regexps without (.*) pattern.
+
+    #(r'^admin/', include('eagadmin.urls', namespace='eagadmin')),
+    #(r'^site/(.*)$', 'eagadmin.views.site')
 )