diff --git a/oilarchive/controllers.py b/oilarchive/controllers.py index 52eb4c2..c3eebbb 100644 --- a/oilarchive/controllers.py +++ b/oilarchive/controllers.py @@ -25,7 +25,7 @@ class View: @expose() def default(self, id, *args, **kw): try: - item = ArchiveItem.byHash(id) + item = ArchiveItem.byHashId(id) if not args: return self.view(item) elif args[0] == 'icon.png': @@ -38,6 +38,8 @@ class View: class Root(controllers.RootController): + view = View() + @expose(template=".templates.welcome") # @identity.require(identity.in_group("admin")) def index(self): diff --git a/oilarchive/model.py b/oilarchive/model.py index edac434..9c31804 100644 --- a/oilarchive/model.py +++ b/oilarchive/model.py @@ -13,7 +13,7 @@ __connection__ = hub class ArchiveItem(SQLObject): - hash = UnicodeCol(alternateId = True) + hashId = UnicodeCol(alternateID = True, length=128) title = UnicodeCol() description = UnicodeCol() author = UnicodeCol() diff --git a/oilarchive/oilcache.py b/oilarchive/oilcache.py index 4b0f60e..46b0f28 100644 --- a/oilarchive/oilcache.py +++ b/oilarchive/oilcache.py @@ -25,7 +25,7 @@ def icon(item): icon_root = join(cache_root, 'icon') if not exists(icon_root): os.makedirs(icon_root) - icon = join(icon_root, "%s.png" % item.hash) + icon = join(icon_root, "%s.png" % item.hashId) if exists(icon): data = laod_file(icon) else: diff --git a/oilarchive/static/css/style.css b/oilarchive/static/css/style.css index 1bc7d64..e69de29 100644 --- a/oilarchive/static/css/style.css +++ b/oilarchive/static/css/style.css @@ -1,124 +0,0 @@ -/* - * Quick mash-up of CSS for the TG quick start page. - */ - -html, body, th, td { - color: black; - background-color: #ddd; - font: x-small "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif; - margin: 0; - padding: 0; -} - -#header { - height: 80px; - width: 777px; - background: blue URL('../images/header_inner.png') no-repeat; - border-left: 1px solid #aaa; - border-right: 1px solid #aaa; - margin: 0 auto 0 auto; -} - -a.link, a, a.active { - color: #369; -} - - -#main_content { - color: black; - font-size: 127%; - background-color: white; - width: 757px; - margin: 0 auto 0 auto; - border-left: 1px solid #aaa; - border-right: 1px solid #aaa; - padding: 10px; -} - -#sidebar { - border: 1px solid #aaa; - background-color: #eee; - margin: 0.5em; - padding: 1em; - float: right; - width: 200px; - font-size: 88%; -} - -#sidebar h2 { - margin-top: 0; -} - -#sidebar ul { - margin-left: 1.5em; - padding-left: 0; -} - -h1,h2,h3,h4,h5,h6,#getting_started_steps { - font-family: "Century Schoolbook L", Georgia, serif; - font-weight: bold; -} - -h2 { - font-size: 150%; -} - -#getting_started_steps a { - text-decoration: none; -} - -#getting_started_steps a:hover { - text-decoration: underline; -} - -#getting_started_steps li { - font-size: 80%; - margin-bottom: 0.5em; -} - -#getting_started_steps h2 { - font-size: 120%; -} - -#getting_started_steps p { - font: 100% "Lucida Grande", "Lucida Sans Unicode", geneva, verdana, sans-serif; -} - -#footer { - border: 1px solid #aaa; - border-top: 0px none; - color: #999; - background-color: white; - padding: 10px; - font-size: 80%; - text-align: center; - width: 757px; - margin: 0 auto 1em auto; -} - -.code { - font-family: monospace; -} - -span.code { - font-weight: bold; - background: #eee; -} - -#status_block { - margin: 0 auto 0.5em auto; - padding: 15px 10px 15px 55px; - background: #cec URL('../images/ok.png') left center no-repeat; - border: 1px solid #9c9; - width: 450px; - font-size: 120%; - font-weight: bolder; -} - -.notice { - margin: 0.5em auto 0.5em auto; - padding: 15px 10px 15px 55px; - width: 450px; - background: #eef URL('../images/info.png') left center no-repeat; - border: 1px solid #cce; -} diff --git a/oilarchive/templates/master.kid b/oilarchive/templates/master.kid index f13dad6..cd0cf41 100644 --- a/oilarchive/templates/master.kid +++ b/oilarchive/templates/master.kid @@ -20,29 +20,22 @@ -
- - Login - - - Welcome ${tg.identity.user.display_name}. - Logout - -
- -
-
+
+ + Login + + + Welcome ${tg.identity.user.display_name}. + Logout + +
+ +
+
-
- - -
- +
+
diff --git a/oilarchive/templates/view.kid b/oilarchive/templates/view.kid index ecca92f..dabd80f 100644 --- a/oilarchive/templates/view.kid +++ b/oilarchive/templates/view.kid @@ -8,7 +8,7 @@
- +
${item.author}
${item.title}
${item.description}
diff --git a/oilarchive/templates/welcome.kid b/oilarchive/templates/welcome.kid index 3de8a12..38c50b4 100644 --- a/oilarchive/templates/welcome.kid +++ b/oilarchive/templates/welcome.kid @@ -6,43 +6,6 @@ Oil Archive - -
Your application is now running
- -
-
    -
  1. -

    Model

    -

    Design models in the model.py.
    - Edit dev.cfg to use a different backend, or start with a pre-configured SQLite database.
    - Use script tg-admin sql create to create the database tables.

    -
  2. -
  3. -

    View

    -

    Edit html-like templates in the /templates folder;
    - Put all static contents in the /static folder.

    -
  4. -
  5. -

    Controller

    -

    Edit controllers.py and build your - website structure with the simplicity of Python objects.
    - TurboGears will automatically reload itself when you modify your project.

    -
  6. -
-
If you create something cool, please let people know, and consider contributing something back to the community.
-
- + Fill me