Sha256: 57c2707212a316277129fb8a663ae2e6b9c8a872fc3927ade96c5df6d2bc053f

Contents?: true

Size: 1.43 KB

Versions: 1

Compression:

Stored size: 1.43 KB

Contents

<%
  # Views that use this partial must provide the following variables:
  # comment
  #
  # Optionally, they can also supply the following variables:
  per_page ||= nil
  thread ||= nil
  no_remote ||= false
%>

<% config = comment.thread.config %>

<% if comment.errors.any? %>
  <div class="error-explanation">
    <h3><%= t "commontator.comment.errors.#{comment.id.blank? ? 'create' : 'update'}" %></h3>

    <ul>
      <% comment.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
    </ul>
  </div>
<% end %>

<%= form_for([commontator, thread, comment], remote: !no_remote) do |form| %>
  <%= hidden_field_tag :per_page, per_page %>

  <%= form.hidden_field :parent_id %>

  <% unless comment.parent.nil? %>
    <div class="replying">
      <%= t('commontator.comment.replying',
            creator_name: Commontator.commontator_name(comment.parent.creator)) %>
    </div>
  <% end %>

  <div class="field">
    <%=
      form.text_area :body, rows: '7', id: comment.id.blank? ?
        "commontator-thread-#{@commontator_thread.id}-new-comment-body" :
        "commontator-comment-#{comment.id}-edit-body"
    %>
    <%= javascript_tag('Commontator.initMentions();') if config.mentions_enabled %>
  </div>

  <div class="submit">
    <%= form.submit t("commontator.comment.actions.#{comment.id.blank? ? 'create' : 'update'}") %>
    <%= form.submit t('commontator.comment.actions.cancel'), name: 'cancel' %>
  </div>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
commontator-6.0.0.pre.1 app/views/commontator/comments/_form.html.erb