diff --git a/frontend/plugin_init.rb b/frontend/plugin_init.rb new file mode 100644 index 0000000..1ca3371 --- /dev/null +++ b/frontend/plugin_init.rb @@ -0,0 +1,32 @@ +Rails.application.config.after_initialize do + + AppConfig[:large_index_notes_threshold] = 100 unless AppConfig.has_key?(:large_index_notes_threshold) + + unless AppConfig[:large_index_notes_threshold].is_a?(Integer) + raise "large_index_notes plugin configuration error: AppConfig[:large_index_notes_threshold] must be an integer!" + end + + module AspaceFormHelper + def define_final_template(name, definition = nil, &block) + @templates ||= {} + + @templates[name] = { + :final => true, + :block => block, + :definition => (definition || BaseDefinition.new), + } + end + + def define_template(name, definition = nil, &block) + @templates ||= {} + + return if @templates[name] && @templates[name][:final] + + @templates[name] = { + :final => false, + :block => block, + :definition => (definition || BaseDefinition.new), + } + end + end +end diff --git a/frontend/views/_top_of_basic_information_resource.html.erb b/frontend/views/_top_of_basic_information_resource.html.erb new file mode 100644 index 0000000..93c1fd1 --- /dev/null +++ b/frontend/views/_top_of_basic_information_resource.html.erb @@ -0,0 +1,64 @@ +<% define_final_template "note_index", jsonmodel_definition(:note_index) do |form| %> +
<%= t('note_index_item.value') %> | +<%= t('note_index_item.type') %> | +<%= t('note_index_item.reference') %> | +<%= t('note_index_item.reference_text') %> | +
---|