Class: Marty::ScriptForm

Inherits:
Form
  • Object
show all
Defined in:
app/components/marty/script_form.rb

Constant Summary collapse

DASH =
0x2012.chr('utf-8')

Constants included from Permissions

Permissions::ALL_ROLES, Permissions::REQ_ROLES

Instance Method Summary collapse

Methods included from Permissions

#can_perform_action?, #can_perform_actions, #current_user_roles, #has_any_perm?, #has_marty_permissions

Instance Method Details

#can_save?(script) ⇒ Boolean

Returns:

  • (Boolean)


103
104
105
# File 'app/components/marty/script_form.rb', line 103

def can_save?(script)
  script && self.class.has_dev_perm? && Mcfly.is_infinity(script.obsoleted_dt)
end

#configure(c) ⇒ Object



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'app/components/marty/script_form.rb', line 210

def configure(c)
  super

  c.title = "Script Form"
  c.model = "Marty::Script"
  c.items =
    [
     {
       mode:           "text/x-delorean",
       line_numbers:   true,
       indent_unit:    4,
       tab_mode:       "shift",
       match_brackets: true,
       hide_label:     true,
       xtype:          :codemirror,
       name:           :body,
       empty_text:     "No script selected.",
       getter:         lambda { |r| r.body },
     },
    ]
end

#default_bbarObject



201
202
203
204
205
206
# File 'app/components/marty/script_form.rb', line 201

def default_bbar
  [
    :apply,
    :do_print,
  ]
end