public
Description: El Dorado is a full-stack community web application written in Ruby/Rails.
Homepage: http://almosteffortless.com/eldorado/
Clone URL: git://github.com/trevorturk/el-dorado.git
el-dorado / app / views / messages / index.html.erb
100644 31 lines (27 sloc) 1.254 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<div class="info-left">
  <span class="title">Chat</span>
  <span class="detail" id="chatters"><%= render :partial => 'chatters' %></span>
</div>
<div style="clear:both;"> </div>
 
<% if logged_in? %>
  <div class="info-left" style="width:100%;">
    <% @message = Message.new unless @message %>
    <% remote_form_for @message, :loading => "$('message_body').clear();" do |f| -%>
      <%= f.text_field :body, :value => '', :style => "width:70%;" %>&nbsp;
      <%= submit_tag "Send" %>&nbsp;
      <%= link_to('Upload a New File', new_upload_path, :popup => ['height=530,width=820,status=1']) %>
    <% end %>
  </div>
  <div style="clear:both;"> </div>
<% end %>
 
<table cellspacing="0" class="messages-index">
  <tbody id="messages-index">
    <%= render :partial => 'messages' %>
  </tbody>
</table>
 
<p id="messages-more" class="center">
  <%= render :partial => 'more', :object => @last_message unless @messages.size < 50 %>
</p>
 
<%= periodically_call_remote :url => refresh_messages_path, :method => 'get', :frequency => 3 %>
<%= periodically_call_remote :url => refresh_chatters_path, :method => 'get', :frequency => 10 %>
<%= javascript_tag "$('message_body').focus();$('message_body').writeAttribute('autocomplete', 'off');" if logged_in? %>