Commit ebede9d016868c661cbe7beb96938fc951cf2324
Committed by
Rodrigo Souto
1 parent
7eba5201
Exists in
master
and in
27 other branches
Use xmpp_chat to render new chat layout
Showing
3 changed files
with
81 additions
and
93 deletions
Show diff stats
app/views/chat/index.html.erb
| ... | ... | @@ -1,82 +0,0 @@ |
| 1 | - <%= javascript_include_tag 'strophejs-1.0.1/strophe', 'jquery.emoticon', '../designs/icons/pidgin/emoticons.js', 'ba-linkify', 'jquery.ba-hashchange', 'jquery.sound', 'chat', 'perfect-scrollbar.min.js', 'perfect-scrollbar.with-mousewheel.min.js', :cache => 'cache/chat' %> | |
| 2 | - <%= stylesheet_link_tag 'perfect-scrollbar.min.css' %> | |
| 3 | - | |
| 4 | - <% extend ChatHelper %> | |
| 5 | - | |
| 6 | - <script type='text/javascript'> | |
| 7 | - var $presence_status_label = { | |
| 8 | - chat: '<%= _('Online') %>', | |
| 9 | - dnd: '<%= _('Busy') %>', | |
| 10 | - '': '<%= _('Offline') %>' | |
| 11 | - }; | |
| 12 | - var $own_name = '<%= user.name %>'; | |
| 13 | - var $starting_chat_notice = '<%= _("starting chat with %{name}") %>'; | |
| 14 | - var $muc_domain = '<%= "conference.#{environment.default_hostname}" %>'; | |
| 15 | - var $user_unavailable_error = '<%= _("<strong>ooops!</strong> The message could not be sent because the user is not online") %>'; | |
| 16 | - var $update_presence_status_every = <%= User.expires_chat_status_every.minutes %>; | |
| 17 | - </script> | |
| 18 | - | |
| 19 | - | |
| 20 | - <% presence = current_user.last_chat_status %> | |
| 21 | - <script> | |
| 22 | - jQuery(function($) { | |
| 23 | - <% if presence.blank? or presence == 'chat' %> | |
| 24 | - $('#chat-connect').trigger('click'); | |
| 25 | - <% else %> | |
| 26 | - $('#chat-busy').trigger('click'); | |
| 27 | - <% end %> | |
| 28 | - }); | |
| 29 | - </script> | |
| 30 | - | |
| 31 | - <div id='chat'> | |
| 32 | - <div id='title-bar'> | |
| 33 | - <h1 class='title'><%= _("Online") % h(page_title) %> (<span id='friends-online'>0</span>)</h1> | |
| 34 | - </div> | |
| 35 | - <div id='buddy-list'> | |
| 36 | - <div class='toolbar'> | |
| 37 | - <div id='user-status'><%= user_status_menu('icon-menu-offline', _('Offline')) %></div> | |
| 38 | - <div class='dialog-error' style='display: none'></div> | |
| 39 | - </div> | |
| 40 | - <ul class='buddy-list'> | |
| 41 | - </ul> | |
| 42 | - </div> | |
| 43 | - <div id='chat-window' class='tabs-bottom'> | |
| 44 | - <div id='tabs'> | |
| 45 | - <ul> | |
| 46 | - </ul> | |
| 47 | - </div> | |
| 48 | - </div> | |
| 49 | - | |
| 50 | - <div id="chat-templates"> | |
| 51 | - <div class='conversation'> | |
| 52 | - <a href="#" class="back"><%= _('Back') %></a> | |
| 53 | - <div class='history'></div> | |
| 54 | - <div class='input-div'> | |
| 55 | - <div class='icon-chat'></div> | |
| 56 | - <textarea class='input'></textarea> | |
| 57 | - </div> | |
| 58 | - </div> | |
| 59 | - | |
| 60 | - <div class="buddy-item"> | |
| 61 | - <li class='%{presence_status}'> | |
| 62 | - <a id='%{jid_id}' class='icon-menu-%{presence_status}-11' href='#'> | |
| 63 | - <img class="avatar" src="%{avatar_url}"/> | |
| 64 | - <span class="name">%{name}<span> | |
| 65 | - </a> | |
| 66 | - </li> | |
| 67 | - </div> | |
| 68 | - | |
| 69 | - <div class="message"> | |
| 70 | - <div data-who="%{who}" class="message %{who}"> | |
| 71 | - <div class="author"> | |
| 72 | - <img class="avatar" src="%{avatar_url}"/> | |
| 73 | - <h5 class="%{who}-name">%{name}</h5> | |
| 74 | - </div> | |
| 75 | - <div class="content"> | |
| 76 | - <span class="time">%{time}</span> | |
| 77 | - <p>%{message}</p> | |
| 78 | - </div> | |
| 79 | - </div> | |
| 80 | - </div> | |
| 81 | - </div> | |
| 82 | - </div> |
app/views/layouts/application-ng.html.erb
| ... | ... | @@ -76,7 +76,7 @@ |
| 76 | 76 | </div><!-- end id="content" --> |
| 77 | 77 | </div><!-- end id="wrap-2" --> |
| 78 | 78 | </div><!-- end id="wrap-1" --> |
| 79 | - <%= render_environment_features(:logged_in) %> | |
| 79 | + <%= render_environment_features(:logged_in) if logged_in? %> | |
| 80 | 80 | <div id="theme-footer"> |
| 81 | 81 | <%= theme_footer %> |
| 82 | 82 | </div><!-- end id="theme-footer" --> |
| ... | ... | @@ -88,6 +88,5 @@ |
| 88 | 88 | if content.respond_to?(:call) then instance_exec(&content).html_safe else content.html_safe end |
| 89 | 89 | end.join("\n") |
| 90 | 90 | %> |
| 91 | - <%= render :file => 'chat/index' if logged_in? %> | |
| 92 | 91 | </body> |
| 93 | 92 | </html> | ... | ... |
app/views/shared/logged_in/xmpp_chat.html.erb
| 1 | -<div id='chat-online-users' style='display: none'> | |
| 2 | - <div id='chat-online-users-content' style='display: none;'> | |
| 3 | - <div id='chat-online-users-hidden-content'> | |
| 4 | - <ul></ul> | |
| 5 | - <span id='anyone-online' style='display: none'><%= _('None of your friends is online at the moment') %></span> | |
| 1 | + <%= javascript_include_tag 'strophejs-1.0.1/strophe', 'jquery.emoticon', '../designs/icons/pidgin/emoticons.js', 'ba-linkify', 'jquery.ba-hashchange', 'jquery.sound', 'chat', 'perfect-scrollbar.min.js', 'perfect-scrollbar.with-mousewheel.min.js', :cache => 'cache/chat' %> | |
| 2 | + <%= stylesheet_link_tag 'perfect-scrollbar.min.css' %> | |
| 3 | + | |
| 4 | + <% extend ChatHelper %> | |
| 5 | + | |
| 6 | + <script type='text/javascript'> | |
| 7 | + var $presence_status_label = { | |
| 8 | + chat: '<%= _('Online') %>', | |
| 9 | + dnd: '<%= _('Busy') %>', | |
| 10 | + '': '<%= _('Offline') %>' | |
| 11 | + }; | |
| 12 | + var $own_name = '<%= user.name %>'; | |
| 13 | + var $starting_chat_notice = '<%= _("starting chat with %{name}") %>'; | |
| 14 | + var $muc_domain = '<%= "conference.#{environment.default_hostname}" %>'; | |
| 15 | + var $user_unavailable_error = '<%= _("<strong>ooops!</strong> The message could not be sent because the user is not online") %>'; | |
| 16 | + var $update_presence_status_every = <%= User.expires_chat_status_every.minutes %>; | |
| 17 | + </script> | |
| 18 | + | |
| 19 | + | |
| 20 | + <% presence = current_user.last_chat_status %> | |
| 21 | + <script> | |
| 22 | + jQuery(function($) { | |
| 23 | + <% if presence.blank? or presence == 'chat' %> | |
| 24 | + $('#chat-connect').trigger('click'); | |
| 25 | + <% else %> | |
| 26 | + $('#chat-busy').trigger('click'); | |
| 27 | + <% end %> | |
| 28 | + }); | |
| 29 | + </script> | |
| 30 | + | |
| 31 | + <div id='chat'> | |
| 32 | + <div id='title-bar'> | |
| 33 | + <h1 class='title'><%= _("Online") % h(page_title) %> (<span id='friends-online'>0</span>)</h1> | |
| 34 | + </div> | |
| 35 | + <div id='buddy-list'> | |
| 36 | + <div class='toolbar'> | |
| 37 | + <div id='user-status'><%= user_status_menu('icon-menu-offline', _('Offline')) %></div> | |
| 38 | + <div class='dialog-error' style='display: none'></div> | |
| 39 | + </div> | |
| 40 | + <ul class='buddy-list'> | |
| 41 | + </ul> | |
| 42 | + </div> | |
| 43 | + <div id='chat-window' class='tabs-bottom'> | |
| 44 | + <div id='tabs'> | |
| 45 | + <ul> | |
| 46 | + </ul> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + | |
| 50 | + <div id="chat-templates"> | |
| 51 | + <div class='conversation'> | |
| 52 | + <a href="#" class="back"><%= _('Back') %></a> | |
| 53 | + <div class='history'></div> | |
| 54 | + <div class='input-div'> | |
| 55 | + <div class='icon-chat'></div> | |
| 56 | + <textarea class='input'></textarea> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + | |
| 60 | + <div class="buddy-item"> | |
| 61 | + <li class='%{presence_status}'> | |
| 62 | + <a id='%{jid_id}' class='icon-menu-%{presence_status}-11' href='#'> | |
| 63 | + <img class="avatar" src="%{avatar_url}"/> | |
| 64 | + <span class="name">%{name}<span> | |
| 65 | + </a> | |
| 66 | + </li> | |
| 67 | + </div> | |
| 68 | + | |
| 69 | + <div class="message"> | |
| 70 | + <div data-who="%{who}" class="message %{who}"> | |
| 71 | + <div class="author"> | |
| 72 | + <img class="avatar" src="%{avatar_url}"/> | |
| 73 | + <h5 class="%{who}-name">%{name}</h5> | |
| 74 | + </div> | |
| 75 | + <div class="content"> | |
| 76 | + <span class="time">%{time}</span> | |
| 77 | + <p>%{message}</p> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + </div> | |
| 6 | 81 | </div> |
| 7 | 82 | </div> |
| 8 | - <a href='#' id='chat-online-users-title' onclick='return false;'> | |
| 9 | - <div class='header'><i class='icon-chat'></i><span><%= _("Friends in chat (<span class='amount_of_friends'>%{amount}</span>)") %></span></div> | |
| 10 | - </a> | |
| 11 | -</div> | ... | ... |