changes to chats tpl

main
barisusakli 9 years ago
parent 93e504502c
commit e612aa10c6

@ -2,12 +2,12 @@ define('persona/chats', ['components', 'forum/chats'], function(components, core
var Chats = {}; var Chats = {};
Chats.init = function() { Chats.init = function() {
components.get('chat/recent').off('click').on('click', 'li', function(e) { components.get('chat/recent').off('click').on('click', '[component="chat/recent/room"]', function(e) {
var env = utils.findBootstrapEnvironment(); var env = utils.findBootstrapEnvironment();
if (env === 'xs' || env === 'sm') { if (env === 'xs' || env === 'sm') {
app.openChat($(this).attr('data-username'), $(this).attr('data-uid')); app.openChat($(this).attr('data-roomid'));
} else { } else {
coreChats.switchChat(parseInt($(this).attr('data-uid'), 10), $(this).attr('data-username')); coreChats.switchChat($(this).attr('data-roomid'));
} }
}); });
}; };

@ -4,12 +4,13 @@
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<ul component="chat/recent" class="chats-list" data-nextstart="{nextStart}"> <ul component="chat/recent" class="chats-list" data-nextstart="{nextStart}">
<!-- BEGIN chats --> <!-- BEGIN rooms -->
<div component="chat/recent/room" data-roomid="{rooms.roomId}">
<!-- BEGIN rooms.users -->
<!-- IMPORT partials/chat_contact.tpl --> <!-- IMPORT partials/chat_contact.tpl -->
<!-- END chats --> <!-- END rooms.users -->
<!-- BEGIN contacts --> </div>
<!-- IMPORT partials/chat_contact.tpl --> <!-- END rooms -->
<!-- END contacts -->
</ul> </ul>
</div> </div>
@ -19,11 +20,11 @@
[[error:chat-restricted]] [[error:chat-restricted]]
</div> </div>
<!-- ENDIF !allowed --> <!-- ENDIF !allowed -->
<!-- IF meta --> <!-- IF roomId -->
<div component="chat/messages" class="expanded-chat" data-uid="{meta.uid}" data-username="{meta.username}"> <div component="chat/messages" class="expanded-chat" data-roomid="{roomId}">
<button type="button" class="close" data-action="pop-out"><span aria-hidden="true"><i class="fa fa-compress"></i></span><span class="sr-only">[[modules:chat.pop-out]]</span></button> <button type="button" class="close" data-action="pop-out"><span aria-hidden="true"><i class="fa fa-compress"></i></span><span class="sr-only">[[modules:chat.pop-out]]</span></button>
<h1 component="chat/title">{meta.username}</h1> <h1 component="chat/title">{usernames}</h1>
<span class="since-bar"><a href="#" class="selected" data-since="recent">[[recent:title]]</a> &bull; <a href="#" data-since="week">[[modules:chat.seven_days]]</a> &bull; <a href="#" data-since="month">[[modules:chat.thirty_days]]</a> &bull; <a href="#" data-since="threemonths">[[modules:chat.three_months]]</a></span> <span class="since-bar"><a href="#" class="selected" data-since="recent">[[recent:title]]</a> &bull; <a href="#" data-since="week">[[modules:chat.seven_days]]</a> &bull; <a href="#" data-since="month">[[modules:chat.thirty_days]]</a> &bull; <a href="#" data-since="threemonths">[[modules:chat.three_months]]</a></span>
@ -41,6 +42,6 @@
<div class="alert alert-info"> <div class="alert alert-info">
[[modules:chat.no-messages]] [[modules:chat.no-messages]]
</div> </div>
<!-- ENDIF meta --> <!-- ENDIF roomId -->
</div> </div>
</div> </div>

Loading…
Cancel
Save