Sha256: b3ac976e0a55b6dad95ecbfb9bddb84ccfe796e78214da0578d06435896a14e6

Contents?: true

Size: 1.41 KB

Versions: 1

Compression:

Stored size: 1.41 KB

Contents

<% if user_signed_in? && current_subject.can_comment?(activity) %>
  <div class="activity_new_comment">
 <%= form_for Comment.new(:text => t('comment.input'),
                          :_contact_id =>
                            current_subject.contact_to!(activity.receiver).id,
                          :_activity_parent_id => activity.id
              ),
          :html => { :class => "new_comment", :id => "new_comment"+dom_id(activity)  },
          :remote => true do |f| %>

   <%= f.hidden_field :_contact_id %>
   <%= f.hidden_field :_activity_parent_id %>

   <%= f.text_field :text, :class =>"input_new_comments", :id => "comment_text_"+dom_id(activity) %>

   <div class="activities_comment_btn">
     <div class="activities_security"></div>
     <%= f.submit t('share'), :class =>"myButtonBlue submitActivity", :id => "comment_submit_"+dom_id(activity) %>
   </div>
 <% end %>
    </div>
<% end %>

<%= javascript_tag do %>
$(document).ready(function() {
  $('#new_comment<%= dom_id(activity) %>').submit(function() {
    $('#comment_text_<%= dom_id(activity) %>').blur();
    $('#comment_submit_<%= dom_id(activity) %>').val("<%= I18n.t('activity.sending') %>...");
    $('#new_comment<%= dom_id(activity) %>').attr("disabled", true);   
    $('#comment_submit_<%= dom_id(activity) %>').attr("disabled", true);   
    $('#comment_text_<%= dom_id(activity) %>').attr('readonly', true); 
    return true;
  });
});
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
social_stream-base-0.9.1 app/views/comments/_new.html.erb