Class: UtilsController
Instance Method Summary
collapse
#archivesspace, can_access?, permission_mappings, set_access_control
Instance Method Details
#generate_sequence ⇒ Object
7
8
9
|
# File 'frontend/app/controllers/utils_controller.rb', line 7
def generate_sequence
render :json => SequenceGenerator.from_params(params)
end
|
#list_properties ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'frontend/app/controllers/utils_controller.rb', line 12
def list_properties
resource_type = params[:resource_type]
list = []
JSONModel(resource_type).schema['properties'].each do |name, defn|
next if params['editable'] && defn.has_key?('dynamic_enum')
next if params['editable'] && %w(uri jsonmodel_type).include?(name)
next if params['editable'] && defn['readonly']
next if params['type'] && defn['type'] != params['type']
list << [name, t("#{resource_type}.#{name}")]
end
render :json => list
end
|
#note_order ⇒ Object
35
36
37
38
39
40
41
|
# File 'frontend/app/controllers/utils_controller.rb', line 35
def note_order
prefs = user_prefs
if prefs['note_order'].empty?
prefs['note_order'] = view_context.note_types_for(:resource).keys
end
render :json => prefs['note_order']
end
|
#shortcuts ⇒ Object
31
32
33
|
# File 'frontend/app/controllers/utils_controller.rb', line 31
def shortcuts
render_aspace_partial :partial => "shared/modal", :locals => {:title => t("shortcuts.quick_reference_window"), :partial => "shared/shortcuts", :large => true}
end
|