Anonymous avatar Anonymous committed b3c3321

Docs; GAE config and index files

Comments (0)

Files changed (6)

+application: changethisname
+version: 1
+runtime: python
+api_version: 1
+
+handlers:
+- url: /eag-static
+  static_dir: eagproject/eag-static
+
+- url: /static
+  static_dir: eagproject/static
+
+- url: .*
+  script: main.py
+
    tutorial
    eagadmin_ref
    eagsite_templatetags_ref
+   settings_ref
 
 Indices and tables
 ==================

docs/settings_ref.rst

+.. _settings:
+
+********
+Settings
+********
+
+
+.. _settings-django:
+
+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-page>`). If no name is defined
+than current logged in user's name is used instead::
+
+   EAGCMS_PICASA_USER = 'some-user-name'
+
+

docs/tutorial.rst

 .. _tutorial:
 
-
 ********
 Tutorial
 ********
 
   ./dev_appserver.py projects/eagcms
 
-Default url of backend is `http://localhost:8080/admin <http://localhost:8080/admin>`_.
+Default url of backend is `http://localhost:8080/admin/ <http://localhost:8080/admin/>`_.
 
-Frontend: `http://localhost:8080/site <http://localhost:8080/site>`_.
+Frontend: `http://localhost:8080/ <http://localhost:8080/>`_.
 
 `More about dev environment <http://code.google.com/appengine/docs/python/gettingstarted/devenvironment.html>`_.
 
 5. Page's controls
 
 
-.. _tut-settings-vars:
+.. _tut-simple-web-site:
 
-Django setting.py variables
-===========================
+Simple web site
+===============
 
-EAG cms needs you to define some options in standard Django's settings module.
+Creating
+--------
 
-ADMINS
-------
+Go to `http://localhost:8080/ <http://localhost:8080/>`_.
 
-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.
+TODO: pic
 
-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::
+Your site is empty. Go to `http://localhost:8080/admin/ <http://localhost:8080/admin/>`_.
+and add three pages:
 
-   ADMINS = (
-       ('Default', 'test@example.com'),
-   )
+* 'Main Menu' with
+  top = 'Home Page', title = 'Main Menu', slug = 'main-menu', type = 'Menu'
+* 'Foo' with
+  top = 'Main Menu', title = 'Foo', slug = 'foo', type = 'Text'
+* 'Bar' with
+  top = 'Main Menu', title = 'Bar', slug = 'bar', type = 'Text'
 
-EAGCMS_TYPES
-------------
-modules list where EAG page types are defined.::
+TODO: pic
 
-   EAGCMS_TYPES = (
-       'eagtypes',
-   )
+Now Your site has a menu
 
-See see :ref:`tut-eagtypes-concept` to find out more about page types.
+TODO: pics
 
-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-page>`)::
+Edit
+----
 
-   EAGCMS_PICASA_USER = 'some-user-name'
+In admin, edit page 'Foo'. When editing You can see more fields than You were
+able when You were creating that page. It is because now page has type (Text)
+and nows that text can have 'content'.
+
+Enter some stupid (Example: 'foo foo foo') text to Foo's content.
+
+TODO: pics
+
+
+Types' templates
+----------------
+
+Each page' type may have it's own template, which is rendered when you enter
+that page in frontend.
+
+Just take a look at 'templates/eagsite/'::
+
+   tree templates/eagsite/
+
+   # templates/eagsite/
+   # |-- base.html
+   # |-- page.html
+   # `-- types
+   #     `-- text.html
+
+This is templates where You can customize Your site's look and feel. 'types'
+are folder where You can put custom types' templates. Take a look at
+text.html::
+
+   {% extends "eagsite/page.html" %}
+   {% block custom %}
+   <div class="text">{{ current.content|safe }}</div>
+   {% endblock %}
+
+It simple extends page.html template and outputs page's content var.
+Each type may have template. If now template is pressed than system falls back
+to page.html template. So, that one must be presented.
+
+'Home' type
+-----------
+
+Now You are going to create Your own page type - 'Home' type.
+
+Take a look at 'base.html'::
+
+   {% eagsite_get_page "" as root %}
+   <div id="Wrapper">
+       {# ... #}
+       <h1 id="SiteName">&lt;Site Name&gt;</h1>
+   </div>
+   <div id="Footer">
+     Copyright (c) &lt;Year&gt; &lt;Name Surname|Company's Name&gt;
+   </div>
+
+You probrabably can replace 'Site Name' and copyright by hand in template
+because there is almost zero change they are going to change. But now We are
+learning stuff and You are going to learn how to make these fields changanble
+via root page ('Home Page').
+
+Go into 'eagproject/eagtypes.py', add and register 'Home' class::
+
+   class Home(Page):
+       footer = db.StringProperty(required=False)
+
+   register.add(Home)
+
+Now go to admin and change 'Home Page' type to 'Home'. Edit 'Home Page' and
+change title to 'My Site' and footer to 'Copyright by Me'.
+
+We are going to use it's title as site's name and footer as footer.
+
+Go to 'base.html' and change::
+
+   <h1 id="SiteName">&lt;Site Name&gt;</h1> --> <h1 id="SiteName">{{ root.title }}</h1>
+
+And::
+
+   Copyright (c) &lt;Year&gt; &lt;Name Surname|Company's Name&gt; --> {{ root.footer }}
+
+Result:
+
+TODO: pic
+
+Ok, that double mention of 'My site' is a little bit annoying. So, let's
+change it.
+
+Create 'templates/eagsite/types/home.html'::
+
+   {% extends "eagsite/base.html" %}
+   {% block content %}
+   <h1 style="text-align: center;">Welcome!!!</h1>
+   {% endblock %}
+
+TODO: pic
+
+That's better.
+
 
 .. _tut-eagtypes-concept:
 

eagproject/templates/eagsite/base.html

   <div id="Wrapper">
     <div id="Content">
       <ul id="Menu">
-        <li class="home {% ifequal current root %}current{% endifequal %}"><a href="{{ root.get_absolute_url }}">Home</a>
+        <li class="home {% ifequal current root %}current{% endifequal %}"><a href="{{ root.get_absolute_url }}">{{ root.menu_title}} </a>
         {% eagsite_list_menu "main-menu" %}
       </ul>
       <h1 id="SiteName">&lt;Site Name&gt;</h1>
+indexes:
+
+# AUTOGENERATED
+
+# This index.yaml is automatically updated whenever the dev_appserver
+# detects that a new type of query is run.  If you want to manage the
+# index.yaml file manually, remove the above marker line (the line
+# saying "# AUTOGENERATED").  If you want to manage some indexes
+# manually, move them above the marker line.  The index.yaml file is
+# automatically uploaded to the admin console when you next deploy
+# your application using appcfg.py.
+
+- kind: Page
+  properties:
+  - name: draft
+  - name: top
+  - name: order
+
+- kind: Page
+  properties:
+  - name: top
+  - name: order
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.