Sha256: 5fcc4661979e1e5379081435b15594eea3983f39909ff9b786fb3681ed074431

Contents?: true

Size: 1.62 KB

Versions: 9

Compression:

Stored size: 1.62 KB

Contents

<%
  # Views that use this partial must provide the following variable:
  # comment
  #

  new_record = comment.new_record?

  # Optionally, they can also supply the following variables:
  thread ||= new_record ? comment.thread : nil
  no_remote ||= false
%>

<% config = comment.thread.config %>

<% if comment.errors.any? %>
  <div class="error-explanation">
    <h3><%= t "commontator.comment.errors.#{new_record ? '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| %>
  <%= form.hidden_field :parent_id %>

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

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

  <div class="submit">
    <%= form.submit t("commontator.comment.actions.#{new_record ? 'create' : 'update'}") %>
    <%=
      form.submit(
        t('commontator.comment.actions.cancel'), name: 'cancel'
      ) unless config.new_comment_style == :t && new_record && comment.parent.nil?
    %>
  </div>
<% end %>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
commontator-7.0.1 app/views/commontator/comments/_form.html.erb
commontator-7.0.0 app/views/commontator/comments/_form.html.erb
commontator-6.3.2 app/views/commontator/comments/_form.html.erb
commontator-6.3.1 app/views/commontator/comments/_form.html.erb
commontator-6.3.0 app/views/commontator/comments/_form.html.erb
commontator-6.2.1 app/views/commontator/comments/_form.html.erb
commontator-6.2.0 app/views/commontator/comments/_form.html.erb
commontator-6.1.1 app/views/commontator/comments/_form.html.erb
commontator-6.1.0 app/views/commontator/comments/_form.html.erb