Changeset 2113
- Timestamp:
- 07/15/10 19:22:52 (19 months ago)
- Location:
- trunk/loreality
- Files:
-
- 4 edited
-
development.db (modified) (previous)
-
loreality/controllers/messager.py (modified) (1 diff)
-
loreality/templates/base/index.html (modified) (2 diffs)
-
loreality/templates/derived/page/messager.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/loreality/loreality/controllers/messager.py
r2112 r2113 72 72 73 73 messages = pilot.messages 74 buf = "" 74 res = { 'messages':[] } 75 75 76 76 77 for m in messages: 77 buf += "%(date)s#%(from_)s#%(subject)s|"%m.__dict__ 78 if buf: 79 buf = buf[:-1] 80 return buf 78 p = pilot_q.filter_by(id=m.from_).first() 79 res['messages'].append({ 'date': m.date.strftime("%c"), 'from':p.name, 'subject':m.subject }) 80 return res 81 81 #-------------------------------------------------------------- 82 82 def getmsg(self, id): -
trunk/loreality/loreality/templates/base/index.html
r2112 r2113 11 11 <head> 12 12 ${ h.stylesheet_link( '/style.css') } 13 ${ h.javascript_link( '/dojo/dojo/dojo.js', djConfig="parseOnLoad: true") } 14 <script type="text/javascript"> 13 <style type="text/css"> 14 @import "dojoroot/dijit/themes/tundra/tundra.css"; 15 @import "dojoroot/dojo/resources/dojo.css"; 16 </style> 17 18 ${ h.javascript_link( '/dojo/dojo/dojo.js', djConfig="parseOnLoad: true") } 19 <script type="text/javascript"> 15 20 // Load Dojo's code relating to the Button widget 16 21 dojo.require("dijit.form.Button"); 22 dojo.require("dijit.Editor"); 17 23 dojo.require("dojo.fx"); 18 24 dojo.require("dojo.html"); 25 dojo.require("dojox.json.ref"); 19 26 </script> 20 27 … … 22 29 ${self.head()} 23 30 </head> 24 <body> 25 31 <body class="tundra"> 26 32 <div id="hd"> 27 33 <div class="yui-gc"> -
trunk/loreality/loreality/templates/derived/page/messager.html
r2112 r2113 37 37 alert("Error"); 38 38 }else{ 39 objects = dojox.json.ref.fromJson(data); 40 messages = objects['messages']; 41 39 42 var buffer = ""; 40 messages = data.split("|");41 43 for (i = 0; i < messages.length; i += 1) { 42 buffer += "<tr>"; 43 elements = messages[i].split("#"); 44 for (n = 0; n < elements.length; n += 1 ){ 45 buffer += "<td>" + elements[n] + "</td>" 46 } 47 buffer += "</tr>"; 44 msg = messages[i]; 45 buffer += "<tr><td>" + msg['date'] + '</td><td>' + msg['from'] + '</td><td>' + msg['subject'] +"</td></tr>" 48 46 } 49 47 dojo.html.set("message_table", buffer);
Note: See TracChangeset
for help on using the changeset viewer.
