1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-12-25 00:48:51 -05:00

Change /info to /chat

This commit is contained in:
Lance Stout 2013-08-23 16:07:37 -07:00
parent d56afc0611
commit dd630a281e
5 changed files with 11 additions and 11 deletions

View File

@ -7,7 +7,7 @@ var Message = require('views/message');
module.exports = BasePage.extend({
template: templates.pages.info,
template: templates.pages.chat,
initialize: function (spec) {
this.render();
},

View File

@ -14,7 +14,7 @@ var Backbone = require('backbone'),
module.exports = Backbone.Router.extend({
routes: {
'': 'main',
'info/:jid': 'info'
'chat/:jid': 'chat'
},
// ------- ROUTE HANDLERS ---------
main: function () {
@ -23,8 +23,8 @@ module.exports = Backbone.Router.extend({
model: me
}));
},
info: function (jid) {
var View = require('pages/info');
chat: function (jid) {
var View = require('pages/chat');
var contact = me.contacts.get(jid);
if (contact) {
app.renderPage(new View({

View File

@ -20,7 +20,7 @@ module.exports = StrictView.extend({
avatar: '.avatar img'
},
events: {
'click': 'getInfo'
'click': 'goChat'
},
initialize: function (opts) {
this.containerEl = opts.containerEl;
@ -34,7 +34,7 @@ module.exports = StrictView.extend({
this.handleBindings();
return this;
},
getInfo: function () {
app.navigate('info/' + this.model.jid);
goChat: function () {
app.navigate('chat/' + this.model.jid);
}
});

View File

@ -50,11 +50,11 @@ exports.layout = function anonymous(locals) {
return buf.join("");
};
// info.jade compiled template
exports.pages.info = function anonymous(locals) {
// chat.jade compiled template
exports.pages.chat = function anonymous(locals) {
var buf = [];
with (locals || {}) {
buf.push('<section class="page info"><nav id="contactList"></nav><header class="contactInfo"><img width="30" height="30" class="avatar"/><h1 class="name"></h1></header><ul id="conversation"></ul></section>');
buf.push('<section class="page chat"><nav id="contactList"></nav><header class="contactInfo"><img width="30" height="30" class="avatar"/><h1 class="name"></h1></header><ul id="conversation"></ul></section>');
}
return buf.join("");
};

View File

@ -1,4 +1,4 @@
section.page.info
section.page.chat
nav#contactList
header.contactInfo
img.avatar(width=30, height=30)