diff --git a/app/assets/stylesheets/dmpopidor.scss b/app/assets/stylesheets/dmpopidor.scss index 117f063..d7d2bc3 100644 --- a/app/assets/stylesheets/dmpopidor.scss +++ b/app/assets/stylesheets/dmpopidor.scss @@ -702,7 +702,6 @@ .research-output-element { display: flex; - flex-direction: row; margin: 5px 0; .research-output-fields { @@ -738,4 +737,26 @@ } } } -} +} + + +#show-research-outputs { + display: flex; + flex-direction: column; + .research-output-element { + margin: 5px 0; + padding: 5px; + + border: 0.5px groove $color-border-light; + box-shadow: 0px 0px 0px 0px $color-shadow-dark; + .research-output-names { + display: flex; + .research-output-fullname { + flex: 8; + } + .research-output-abbreviation { + flex: 3; + } + } + } +} \ No newline at end of file diff --git a/app/views/branded/plans/_edit_research_outputs.html.erb b/app/views/branded/plans/_edit_research_outputs.html.erb new file mode 100644 index 0000000..67e284b --- /dev/null +++ b/app/views/branded/plans/_edit_research_outputs.html.erb @@ -0,0 +1,18 @@ +<%# locals: { plan, research_outputs, research_output_types } %> +
+

<%= d_('dmpopidor', 'Research outputs') %>

+ <%= form_for plan, html: {method: :put, class: 'form-horizontal edit_plan' } do |f| %> +
+ <% @research_outputs.each do |research_output|%> + <%= f.fields_for :research_outputs, research_output do |d| %> + <%= render 'plans/research_output_fields', f: d, plan: plan, + research_output: research_output, research_output_types: research_output_types %> + <% end %> + <% end %> +
+ + <%= f.button(_('Submit'), class: "btn btn-default", type: "submit") %> + <% end %> +
\ No newline at end of file diff --git a/app/views/branded/plans/_research_outputs_form.html.erb b/app/views/branded/plans/_research_outputs_form.html.erb deleted file mode 100644 index 67e284b..0000000 --- a/app/views/branded/plans/_research_outputs_form.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<%# locals: { plan, research_outputs, research_output_types } %> -
-

<%= d_('dmpopidor', 'Research outputs') %>

- <%= form_for plan, html: {method: :put, class: 'form-horizontal edit_plan' } do |f| %> -
- <% @research_outputs.each do |research_output|%> - <%= f.fields_for :research_outputs, research_output do |d| %> - <%= render 'plans/research_output_fields', f: d, plan: plan, - research_output: research_output, research_output_types: research_output_types %> - <% end %> - <% end %> -
- - <%= f.button(_('Submit'), class: "btn btn-default", type: "submit") %> - <% end %> -
\ No newline at end of file diff --git a/app/views/branded/plans/_show_research_outputs.html.erb b/app/views/branded/plans/_show_research_outputs.html.erb new file mode 100644 index 0000000..8c2aa0a --- /dev/null +++ b/app/views/branded/plans/_show_research_outputs.html.erb @@ -0,0 +1,34 @@ +<%# locals: { plan, research_outputs, research_output_types } %> +

<%= d_('dmpopidor', 'Research outputs') %>

+
+ <% @research_outputs.each do |research_output|%> + <% other_type_displayed = research_output.research_output_type && research_output.research_output_type.is_other ? '' : 'display:none;' %> +
+
+
+ <%= d_('dmpopidor', 'Abbreviated Name') %> + <%= research_output.abbreviation ? research_output.abbreviation : _('None') %> +
+
+ <%= d_('dmpopidor', 'Fullname') %> + <%= research_output.fullname ? research_output.fullname : _('None') %> +
+
+
+ <%= d_('dmpopidor', 'Type') %> + + + + <%= research_output.research_output_type ? research_output.research_output_type.label : _('None') %> +
+
+ <%= d_('dmpopidor', 'Other Type') %> + <%= research_output.other_type_label %> +
+
+ <%= d_('dmpopidor', 'Persistent Identifier') %> + <%= research_output.pid ? research_output.pid : _('None') %> +
+
+ <% end %> +
\ No newline at end of file diff --git a/app/views/branded/plans/research_outputs.html.erb b/app/views/branded/plans/research_outputs.html.erb index 9db68ae..c196695 100644 --- a/app/views/branded/plans/research_outputs.html.erb +++ b/app/views/branded/plans/research_outputs.html.erb @@ -9,6 +9,10 @@
- <%= render partial: 'plans/research_outputs_form', layout: 'plans/navigation', locals: local_assigns %> + <% if @plan.editable_by?(current_user) %> + <%= render partial: 'plans/edit_research_outputs', layout: 'plans/navigation', locals: local_assigns %> + <% else %> + <%= render partial: 'plans/show_research_outputs', layout: 'plans/navigation', locals: local_assigns %> + <% end %>
\ No newline at end of file