diff --git a/app/views/admin/application/_connections.html.erb b/app/views/admin/application/_connections.html.erb deleted file mode 100644 index d8bc0bbc261e941e392c715ae634f61bc3260faf..0000000000000000000000000000000000000000 --- a/app/views/admin/application/_connections.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<%= osuny_panel Communication::Website::Connection.model_name.human(count: 2) do %> - <% about.websites.each do |website| %> - <div class="mb-4"> - <p class="mb-0"><b><%= link_to website, [:admin, website] %></b></p> - <ul class="list-unstyled small"> - <% Communication::Website::Connection.for_object(about).in_website(website).each do |connection| %> - <% - source = connection.source - begin - path = url_for [:admin, source] - rescue - end - path = edit_admin_communication_block_path(source) if source.is_a?(Communication::Block) - path = admin_communication_website_page_path( website_id: website.id, - lang: website.default_language, - id: source) if source.is_special_page? - %> - <li><%= link_to_if path, source, path %></li> - <% end %> - </ul> - </tr> - <% end %> -<% end if about.websites.any? %> \ No newline at end of file diff --git a/app/views/admin/application/connections/_list.html.erb b/app/views/admin/application/connections/_list.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..fa6604e82b38f84f2fed1889509264eab2fdb406 --- /dev/null +++ b/app/views/admin/application/connections/_list.html.erb @@ -0,0 +1,12 @@ +<%= osuny_panel Communication::Website::Connection.model_name.human(count: 2) do %> + <% about.websites.each do |website| %> + <div class="mb-4"> + <p class="mb-0"><b><%= link_to website, [:admin, website] %></b></p> + <ul class="list-unstyled small"> + <% Communication::Website::Connection.for_object(about).in_website(website).each do |connection| %> + <li><%= render 'admin/application/connections/source', connection: connection %></li> + <% end %> + </ul> + </tr> + <% end %> +<% end if about.websites.any? %> \ No newline at end of file diff --git a/app/views/admin/application/connections/_source.html.erb b/app/views/admin/application/connections/_source.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..6259885df187029196c6ce2dc50c85229b81393e --- /dev/null +++ b/app/views/admin/application/connections/_source.html.erb @@ -0,0 +1,13 @@ +<% +source = connection.source +website = connection.website +begin + path = url_for [:admin, source] +rescue +end +path = edit_admin_communication_block_path(source) if source.is_a?(Communication::Block) +path = admin_communication_website_page_path( website_id: website.id, + lang: website.default_language, + id: source) if source.is_special_page? +%> +<%= link_to_if path, source, path %> \ No newline at end of file diff --git a/app/views/admin/university/organizations/show.html.erb b/app/views/admin/university/organizations/show.html.erb index 52be2c05d3363640485278eeb0bda7fad9c16980..3bdbd88e6761a57d777c876a123747e46a99d7ac 100644 --- a/app/views/admin/university/organizations/show.html.erb +++ b/app/views/admin/university/organizations/show.html.erb @@ -88,7 +88,7 @@ <%= render 'admin/application/meta_description/show', about: @organization %> - <%= render 'admin/application/connections', about: @organization %> + <%= render 'admin/application/connections/list', about: @organization %> </div> </div>