Skip to content
Snippets Groups Projects
Commit 4381fbbe authored by alexisben's avatar alexisben
Browse files

Fix static data and backward compatibility

parent af44efdc
No related branches found
No related tags found
No related merge requests found
<a class="<%= button_classes('mb-4 me-1') %>"
v-on:click="data.elements.push({name: '', url: '', logo: {}})">
v-on:click="data.elements.push({id:'', name: '', url: '', logo: {}})">
<%= t '.add_partner' %>
</a>
<draggable :list="data.elements" class="list-group" handle=".partnerHandle">
......@@ -16,7 +16,7 @@
<select :id="'organization-' + index + '-id'"
class="form-select select"
v-model="partner.id">
<option value="" :selected="!partner.id"><%= t '.unregistered_organization' %></option>
<option value="" :selected="true"><%= t '.unregistered_organization' %></option>
<% current_university.organizations.ordered.each_with_index do |organization, index| %>
<option value="<%= organization.id %>"><%= organization.name %></option>
<% end %>
......
<% if block.data.has_key?('elements') %>
<% block.data['elements'].each do |partner| %>
<% if partner['type'] == 'organization' %>
<% organization = block.university.organizations.find partner['id'] %>
<% if organization %>
- is_organization: true
id: <%= partner['id'] %>
<% block.data['elements'].each do |partner|
id = partner['id']
if id != ''
unless id.nil?
unless id.empty?
organization = block.university.organizations.find id %>
- id: "<%= id %>"
name: >
<%= prepare_text_for_static organization.name %>
<% if organization.url %>
url: >-
<%= prepare_text_for_static organization.url %>
<% end %>
url: <%= prepare_text_for_static organization.url %>
<% if organization.logo.attached? %>
logo: "<%= organization.logo.blob.id %>"
<% end %>
<% end %>
<% else %>
<% end
end
else %>
- name: >
<%= prepare_text_for_static partner['name'] %>
url: >-
......@@ -23,4 +22,4 @@
logo: "<%= prepare_media_for_static partner, 'logo' %>"
<% end %>
<% end %>
<% end %>
<% end %>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment