Sha256: 8e4c7f3d437440da9b6e6b2b550d7cf8f3d681bde50cb94d47d4f463de18c7da

Contents?: true

Size: 1021 Bytes

Versions: 84

Compression:

Stored size: 1021 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.close_me = l(<<-JS)
    function() {
      // assume we're embedded in a window
      this.netzkeGetParentComponent().close();
    }
    JS
  end

  action :apply do |a|
    a.text    = I18n.t("create_posting")
    a.tooltip = I18n.t("create_posting")
    a.icon    = :time_add
  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

84 entries across 84 versions & 1 rubygems

Version Path
marty-2.1.5 app/components/marty/new_posting_form.rb
marty-2.1.4 app/components/marty/new_posting_form.rb
marty-2.1.3 app/components/marty/new_posting_form.rb
marty-2.1.2 app/components/marty/new_posting_form.rb
marty-2.1.1 app/components/marty/new_posting_form.rb
marty-2.1.0 app/components/marty/new_posting_form.rb
marty-2.0.9 app/components/marty/new_posting_form.rb
marty-2.0.8 app/components/marty/new_posting_form.rb
marty-2.0.7 app/components/marty/new_posting_form.rb
marty-2.0.6 app/components/marty/new_posting_form.rb
marty-2.0.5 app/components/marty/new_posting_form.rb
marty-2.0.4 app/components/marty/new_posting_form.rb
marty-2.0.3 app/components/marty/new_posting_form.rb
marty-2.0.2 app/components/marty/new_posting_form.rb
marty-2.0.1 app/components/marty/new_posting_form.rb
marty-2.0.0 app/components/marty/new_posting_form.rb
marty-1.2.9 app/components/marty/new_posting_form.rb
marty-1.2.8 app/components/marty/new_posting_form.rb
marty-1.2.7 app/components/marty/new_posting_form.rb
marty-1.2.6 app/components/marty/new_posting_form.rb