Class: Renalware::Letters::Lists::Form::AllLetters

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model, Virtus::Model
Defined in:
app/models/renalware/letters/lists/form.rb

Direct Known Subclasses

BatchPrintableLetters

Instance Method Summary collapse

Instance Method Details

#allow_blank_inputsObject



65
66
67
# File 'app/models/renalware/letters/lists/form.rb', line 65

def allow_blank_inputs
  [:state_eq, :page_count_in_array]
end

#author_optionsObject



45
46
47
# File 'app/models/renalware/letters/lists/form.rb', line 45

def author_options
  @author_options ||= User.author.ordered
end

#disabled_inputsObject



61
62
63
# File 'app/models/renalware/letters/lists/form.rb', line 61

def disabled_inputs
  []
end

#letter_state_options(states = Letters::Letter.states) ⇒ Object



38
39
40
41
42
43
# File 'app/models/renalware/letters/lists/form.rb', line 38

def letter_state_options(states = Letters::Letter.states)
  states.map do |state|
    label = I18n.t(state.to_sym, scope: "enums.letter.for_receptionists.state")
    [label, state]
  end
end

#letterhead_optionsObject



53
54
55
# File 'app/models/renalware/letters/lists/form.rb', line 53

def letterhead_options
  @letterhead_options ||= Letters::Letterhead.ordered
end

#page_count_optionsObject



57
58
59
# File 'app/models/renalware/letters/lists/form.rb', line 57

def page_count_options
  [["1 or 2", "[1,2]"], ["3 or 4", "[3,4]"], ["5 or 6", "[5,6]"]]
end

#typist_optionsObject



49
50
51
# File 'app/models/renalware/letters/lists/form.rb', line 49

def typist_options
  @typist_options ||= User.ordered
end