Sha256: ab88778d105eee71361575a3cd3db80c0f5a5d2d2759e89e30f41ba4cb77d361

Contents?: true

Size: 1.67 KB

Versions: 1

Compression:

Stored size: 1.67 KB

Contents

#rails_admin_comments_wrapper
  = stylesheet_link_tag 'rails_admin/rails_admin_comments'
  = javascript_include_tag 'rails_admin/rails_admin_comments'

  #rails_admin_comments

    - url = comments_path(model_name: @abstract_model, id: @object.id)
    .controls
      - @comments.each do |c|
        .comment_block
          - edit_form_id = "comment_#{c.id}_edit" 
          p
            - creator = c.creator
            - if creator
              - model_name = creator.class.to_param.gsub("::", "~").underscore
              = link_to creator.name_for_rails_admin, show_path(model_name: model_name, id: creator._id), class: "creator_link"
            span.created_at= Russian::strftime c.c_at, "%d.%m.%Y в %H:%M:%S"
            span.updated_at= " (изм. #{Russian::strftime c.u_at, "%d.%m.%Y в %H:%M:%S"})" if Russian::strftime c.u_at
            = link_to 'изменить', "##{edit_form_id}", class: 'comment_edit_form_link' if creator == current_user
            p.content_block= c.content
          p
            .comment_edit_form.hidden{id="#{edit_form_id}"}
              - if @comment and @comment._id == c._id
                - c = @comment
                - unless @message.blank?
                  p== @message
                  - @comment = @message = nil
                
              = form_for c, url: url, method: :post do |f|
                p= f.hidden_field :id
                p= f.text_area :content
                p= f.submit
          br

    hr
    - @comment ||= RailsAdminComments::Comment.new
    p
      = form_for @comment, url: url, method: :post do |f|
        - unless @message.blank?
          p== @message
        p= f.text_area :content
        p= f.submit

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_admin_comments-0.1.0 app/views/rails_admin/main/comments.html.slim