Changeset 2098
- Timestamp:
- 06/30/10 20:40:06 (20 months ago)
- Location:
- trunk/loreality
- Files:
-
- 8 added
- 8 edited
-
data/templates/base/index.html.py (modified) (10 diffs)
-
data/templates/component (added)
-
data/templates/component/navigation.html.py (added)
-
data/templates/derived/page/campaign.html.py (added)
-
development.db (modified) (previous)
-
development.ini (modified) (1 diff)
-
loreality/controllers/account.py (modified) (2 diffs)
-
loreality/controllers/campaign.py (added)
-
loreality/model/__init__.py (modified) (1 diff)
-
loreality/templates/base/index.html (modified) (3 diffs)
-
loreality/templates/component (added)
-
loreality/templates/component/navigation.html (added)
-
loreality/templates/derived/page/campaign.html (added)
-
loreality/templates/main.html (modified) (1 diff)
-
loreality/tests/functional/test_campaign.py (added)
-
loreality/websetup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/loreality/data/templates/base/index.html.py
r2097 r2098 4 4 __M_locals_builtin = locals 5 5 _magic_number = 5 6 _modified_time = 12779 08898.5217357 _template_filename='/ media/divers/personnel/dev/dartsite.org/lotatc/trunk/loreality/loreality/templates/base/index.html'6 _modified_time = 1277927792.169724 7 _template_filename='/home/dart/trunk/loreality/loreality/templates/base/index.html' 8 8 _template_uri='/base/index.html' 9 9 _template_cache=cache.Cache(__name__, _modified_time) 10 10 _source_encoding='utf-8' 11 11 from webhelpers.html import escape 12 _exports = ['head', 'title', 'tabs', 'menu', 'footer', 'header', ' breadcrumbs', 'heading']12 _exports = ['head', 'title', 'tabs', 'menu', 'footer', 'header', 'heading'] 13 13 14 15 def _mako_get_namespace(context, name): 16 try: 17 return context.namespaces[(__name__, name)] 18 except KeyError: 19 _mako_generate_namespaces(context) 20 return context.namespaces[(__name__, name)] 21 def _mako_generate_namespaces(context): 22 # SOURCE LINE 2 23 ns = runtime.Namespace('navigation', context._clean_inheritance_tokens(), templateuri='/component/navigation.html', callables=None, calling_uri=_template_uri, module=None) 24 context.namespaces[(__name__, 'navigation')] = ns 14 25 15 26 def render_body(context,**pageargs): … … 17 28 try: 18 29 __M_locals = __M_dict_builtin(pageargs=pageargs) 19 h = context.get('h', UNDEFINED) 20 self = context.get('self', UNDEFINED) 21 request = context.get('request', UNDEFINED) 22 next = context.get('next', UNDEFINED) 30 _import_ns = {} 31 _mako_get_namespace(context, 'navigation')._populate(_import_ns, ['*']) 32 h = _import_ns.get('h', context.get('h', UNDEFINED)) 33 self = _import_ns.get('self', context.get('self', UNDEFINED)) 34 request = _import_ns.get('request', context.get('request', UNDEFINED)) 35 next = _import_ns.get('next', context.get('next', UNDEFINED)) 23 36 __M_writer = context.writer() 24 # SOURCE LINE 2 37 __M_writer(u'') 38 # SOURCE LINE 3 25 39 __M_writer(u'\n<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"\n"http://www.w3.org/TR/html4/strict.dtd">\n<html>\n<head>\n <title>') 26 # SOURCE LINE 740 # SOURCE LINE 8 27 41 __M_writer(escape(self.title())) 28 42 __M_writer(u'</title>\n ') 29 # SOURCE LINE 843 # SOURCE LINE 9 30 44 __M_writer(escape(self.head())) 31 45 __M_writer(u'\n</head>\n<body>\n <div id="hd">\n <div class="yui-gc">\n <div class="yui-u first">\n ') 32 # SOURCE LINE 1 446 # SOURCE LINE 15 33 47 __M_writer(escape(self.heading())) 34 48 __M_writer(u'\n </div>\n <div class="yui-u">\n') 35 # SOURCE LINE 1 749 # SOURCE LINE 18 36 50 if h.auth.authorized(h.auth.is_valid_user) and not (request.urlvars['controller'] == 'account' and request.urlvars['action'] == 'signout'): 37 # SOURCE LINE 1 851 # SOURCE LINE 19 38 52 __M_writer(u' <p>Signed in as ') 39 53 __M_writer(escape(request.environ['REMOTE_USER'])) 40 54 __M_writer(u',\n <a href="') 41 # SOURCE LINE 1955 # SOURCE LINE 20 42 56 __M_writer(escape(h.url_for('signout'))) 43 57 __M_writer(u'">Sign out</a></p>\n') 44 # SOURCE LINE 2 058 # SOURCE LINE 21 45 59 else: 46 # SOURCE LINE 2 160 # SOURCE LINE 22 47 61 __M_writer(u' <p><a href="') 48 62 __M_writer(escape(h.url_for('signin'))) 49 63 __M_writer(u'">Sign in</a></p>\n') 50 # SOURCE LINE 2 364 # SOURCE LINE 24 51 65 __M_writer(u' </div>\n </div>\n ') 52 # SOURCE LINE 2 566 # SOURCE LINE 26 53 67 __M_writer(escape(self.header())) 54 68 __M_writer(u'\n ') 55 # SOURCE LINE 2 669 # SOURCE LINE 27 56 70 __M_writer(escape(self.tabs())) 57 71 __M_writer(u'\n </div>\n ') 58 # SOURCE LINE 2 872 # SOURCE LINE 29 59 73 __M_writer(escape(self.menu())) 60 74 __M_writer(u'\n ') 61 # SOURCE LINE 2975 # SOURCE LINE 30 62 76 __M_writer(escape(self.heading())) 63 __M_writer(u'\n ')64 # SOURCE LINE 3065 __M_writer(escape(self.breadcrumbs()))66 77 __M_writer(u'\n ') 67 78 # SOURCE LINE 31 … … 85 96 # SOURCE LINE 42 86 97 __M_writer(u'\n') 87 # SOURCE LINE 4388 __M_writer(u'\n')89 98 return '' 90 99 finally: … … 95 104 context.caller_stack._push_frame() 96 105 try: 106 _import_ns = {} 107 _mako_get_namespace(context, 'navigation')._populate(_import_ns, ['*']) 97 108 __M_writer = context.writer() 98 109 return '' … … 104 115 context.caller_stack._push_frame() 105 116 try: 117 _import_ns = {} 118 _mako_get_namespace(context, 'navigation')._populate(_import_ns, ['*']) 106 119 __M_writer = context.writer() 107 120 # SOURCE LINE 36 … … 115 128 context.caller_stack._push_frame() 116 129 try: 130 _import_ns = {} 131 _mako_get_namespace(context, 'navigation')._populate(_import_ns, ['*']) 132 navigation = _mako_get_namespace(context, 'navigation') 117 133 __M_writer = context.writer() 134 # SOURCE LINE 39 135 __M_writer(escape(navigation.tabs())) 118 136 return '' 119 137 finally: … … 124 142 context.caller_stack._push_frame() 125 143 try: 144 _import_ns = {} 145 _mako_get_namespace(context, 'navigation')._populate(_import_ns, ['*']) 146 navigation = _mako_get_namespace(context, 'navigation') 126 147 __M_writer = context.writer() 148 # SOURCE LINE 40 149 __M_writer(escape(navigation.menu())) 127 150 return '' 128 151 finally: … … 133 156 context.caller_stack._push_frame() 134 157 try: 158 _import_ns = {} 159 _mako_get_namespace(context, 'navigation')._populate(_import_ns, ['*']) 135 160 __M_writer = context.writer() 136 # SOURCE LINE 4 3161 # SOURCE LINE 42 137 162 __M_writer(u'<p><a href="#top">Top ^</a></p>') 138 163 return '' … … 144 169 context.caller_stack._push_frame() 145 170 try: 171 _import_ns = {} 172 _mako_get_namespace(context, 'navigation')._populate(_import_ns, ['*']) 146 173 __M_writer = context.writer() 147 174 # SOURCE LINE 38 … … 152 179 153 180 154 def render_breadcrumbs(context):155 context.caller_stack._push_frame()156 try:157 __M_writer = context.writer()158 return ''159 finally:160 context.caller_stack._pop_frame()161 162 163 181 def render_heading(context): 164 182 context.caller_stack._push_frame() 165 183 try: 166 c = context.get('c', UNDEFINED) 184 _import_ns = {} 185 _mako_get_namespace(context, 'navigation')._populate(_import_ns, ['*']) 186 c = _import_ns.get('c', context.get('c', UNDEFINED)) 167 187 __M_writer = context.writer() 168 188 # SOURCE LINE 41 -
trunk/loreality/development.ini
r2097 r2098 43 43 authkit.setup.enable = true 44 44 authkit.setup.method = form, cookie 45 authkit.form.authenticate.user.type = authkit.users.sqlalchemy_driver:UsersFromDatabase46 authkit.form.authenticate.user.data = loreality.model47 #authkit.form.authenticate.user.data = dart:admin45 #authkit.form.authenticate.user.type = authkit.users.sqlalchemy_driver:UsersFromDatabase 46 #authkit.form.authenticate.user.data = loreality.model 47 authkit.form.authenticate.user.data = dart:admin 48 48 authkit.cookie.secret = aoeuidts 49 49 authkit.cookie.signoutpath = /signout -
trunk/loreality/loreality/controllers/account.py
r2097 r2098 5 5 6 6 from loreality.lib.base import BaseController, render 7 import loreality.lib.helpers as h 7 8 8 9 log = logging.getLogger(__name__) … … 15 16 abort(401) 16 17 else: 17 return re nder('/derived/account/signedin.html')18 return redirect_to(h.url_for(controller='main', action='index')) 18 19 19 20 def signout(self): -
trunk/loreality/loreality/model/__init__.py
r2097 r2098 18 18 19 19 # Non-reflected tables may be defined and mapped at module level 20 #users_table = sa.Table("Users", meta.metadata, 21 # sa.Column("id", sa.types.Integer, primary_key=True), 22 # sa.Column("login", sa.types.String(255), nullable=False), 23 # ) 24 # 25 #class User(object): 26 # pass 27 # 28 #orm.mapper(User, users_table) 20 users_table = sa.Table("Pilots", meta.metadata, 21 sa.Column("id", sa.types.Integer, primary_key=True), 22 sa.Column("login", sa.types.String(255), nullable=False), 23 sa.Column("squadron", sa.types.String(255), nullable=False), 24 ) 25 mission_table = sa.Table("Missions", meta.metadata, 26 sa.Column("id", sa.types.Integer, primary_key=True), 27 sa.Column("name", sa.types.String(255), nullable=False), 28 ) 29 30 class User(object): 31 pass 32 33 class Mission(object): 34 pass 35 36 37 orm.mapper(User, users_table) 38 orm.mapper(Mission, mission_table) 29 39 30 40 -
trunk/loreality/loreality/templates/base/index.html
r2097 r2098 1 1 ## -*- coding: utf-8 -*- 2 <%namespace name="navigation" file="/component/navigation.html" import="*" />\ 2 3 3 4 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" … … 28 29 ${self.menu()} 29 30 ${self.heading()} 30 ${self.breadcrumbs()}31 31 ${next.body()} 32 32 ${self.footer()} … … 37 37 <%def name="head()"></%def> 38 38 <%def name="header()"><a name="top"></a></%def> 39 <%def name="tabs()"> </%def>40 <%def name="menu()"> </%def>39 <%def name="tabs()">${navigation.tabs()}</%def> 40 <%def name="menu()">${navigation.menu()}</%def> 41 41 <%def name="heading()"><h1>${c.heading or 'No Title'}</h1></%def> 42 <%def name="breadcrumbs()"></%def>43 42 <%def name="footer()"><p><a href="#top">Top ^</a></p></%def> -
trunk/loreality/loreality/templates/main.html
r2097 r2098 2 2 <%namespace file="/menu.html" import="get_menu" /> 3 3 4 <%def name="menu()"> 4 5 ${get_menu('Home', links=[ 5 6 ('Home', '/'), 6 7 ('Sign Out', '/admin/signout'), 7 8 ])} 9 </%def> 8 10 9 11 -
trunk/loreality/loreality/websetup.py
r2097 r2098 27 27 users.user_add_role("DArt", role="admin" ) 28 28 print users.user("dart") 29 30 log.info("Adding mission...") 31 mis = model.Mission() 32 mis.name=u'Mission 1' 33 meta.Session.add(mis) 34 meta.Session.commit() 35 log.info("Successfully set up.") 36
Note: See TracChangeset
for help on using the changeset viewer.
