Sha256: 70b3d2ae4431cd8540702e276ae0983dcd52ffff9638b1dc4c7e7315c993c04c

Contents?: true

Size: 847 Bytes

Versions: 47

Compression:

Stored size: 847 Bytes

Contents

class Marty::NewPostingForm < Marty::Form
  extend ::Marty::Permissions

  # override this to set permissions for posting types
  has_marty_permissions read: :any

  client_class do |c|
    c.include :new_posting_form
  end

  action :apply do |a|
    a.text     = I18n.t('create_posting')
    a.tooltip  = I18n.t('create_posting')
    a.icon_cls = 'fa fa-clock glyph'
  end

  ######################################################################

  endpoint :submit do |params|
    res = super(params)
    client.close_me
    res
  end

  def configure(c)
    super

    c.model = 'Marty::Posting'
    c.items = [
      {
        name: :posting_type__name,
        scope: lambda { |r|
          r.where(name: Marty::NewPostingForm.can_perform_actions)
        },
      },
      :comment,
    ]
  end
end

NewPostingForm = Marty::NewPostingForm

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
marty-10.0.3 app/components/marty/new_posting_form.rb
marty-10.0.2 app/components/marty/new_posting_form.rb
marty-10.0.0 app/components/marty/new_posting_form.rb
marty-9.5.1 app/components/marty/new_posting_form.rb
marty-9.5.0 app/components/marty/new_posting_form.rb
marty-9.3.3 app/components/marty/new_posting_form.rb
marty-9.3.2 app/components/marty/new_posting_form.rb
marty-9.3.0 app/components/marty/new_posting_form.rb
marty-8.5.0 app/components/marty/new_posting_form.rb
marty-8.4.1 app/components/marty/new_posting_form.rb
marty-8.3.1 app/components/marty/new_posting_form.rb
marty-8.2.0 app/components/marty/new_posting_form.rb
marty-8.0.0 app/components/marty/new_posting_form.rb
marty-6.1.0 app/components/marty/new_posting_form.rb
marty-5.2.0 app/components/marty/new_posting_form.rb
marty-5.1.4 app/components/marty/new_posting_form.rb
marty-5.1.3 app/components/marty/new_posting_form.rb
marty-5.1.2 app/components/marty/new_posting_form.rb
marty-5.1.1 app/components/marty/new_posting_form.rb
marty-5.1.0 app/components/marty/new_posting_form.rb