diff --git a/app/assets/stylesheets/dmpopidor.scss b/app/assets/stylesheets/dmpopidor.scss
index 20af897..5a6fb2c 100644
--- a/app/assets/stylesheets/dmpopidor.scss
+++ b/app/assets/stylesheets/dmpopidor.scss
@@ -1077,6 +1077,7 @@
padding-bottom: 15px;
legend {
color: $rust;
+ text-transform: none;
}
}
diff --git a/app/models/madmp_fragment.rb b/app/models/madmp_fragment.rb
index 04c3177..46b5f53 100644
--- a/app/models/madmp_fragment.rb
+++ b/app/models/madmp_fragment.rb
@@ -100,7 +100,7 @@
end
def get_dmp_fragments
- MadmpFragment.where(dmp_id: dmp_id).group_by(&:madmp_schema_id)
+ MadmpFragment.where(dmp_id: dmp_id)
end
# Returns a human readable version of the structured answer
diff --git a/app/views/branded/shared/dynamic_form/_form.html.erb b/app/views/branded/shared/dynamic_form/_form.html.erb
index 8ed8a61..b452435 100644
--- a/app/views/branded/shared/dynamic_form/_form.html.erb
+++ b/app/views/branded/shared/dynamic_form/_form.html.erb
@@ -43,7 +43,7 @@
<% if prop['items']['type'] == 'object' && prop['items']['schema_id'].present? %>
<% unless classname == "research_output" %>
<% sub_schema = @schemas.find_by(id: prop['items']['schema_id']) %>
- <% values = dmp_fragments[sub_schema.id] unless dmp_fragments.empty? %>
+ <% values = dmp_fragments.where(madmp_schema_id: sub_schema.id, parent_id: fragment.id) unless dmp_fragments.empty? %>
<%= render(partial: 'shared/dynamic_form/fields/complex_multiple_field', locals: {
field_values: values,
readonly: readonly,
@@ -80,7 +80,7 @@
<%
sub_schema = @schemas.find_by(id: prop["schema_id"])
- sub_fragment = dmp_fragments[sub_schema.id].first unless dmp_fragments[sub_schema.id].nil?
+ sub_fragment = dmp_fragments.find_by(madmp_schema_id: sub_schema.id, parent_id: fragment.id) unless dmp_fragments.empty?
# TODO : SINGLE SUB FRAGMENT SAVING
#sub_fragment = dmp_fragments[sub_schema.id].find { |f| f.id == value["dbid"] } unless value.nil?
%>
diff --git a/app/views/branded/shared/dynamic_form/fields/_complex_multiple_field.html.erb b/app/views/branded/shared/dynamic_form/fields/_complex_multiple_field.html.erb
index 3682b4b..85cd3e8 100644
--- a/app/views/branded/shared/dynamic_form/fields/_complex_multiple_field.html.erb
+++ b/app/views/branded/shared/dynamic_form/fields/_complex_multiple_field.html.erb
@@ -4,10 +4,10 @@
<% field_label = field_label || 'No label defined' %>