Skip to content
Snippets Groups Projects
Commit 8862dce5 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

list

parent d4c88352
No related branches found
No related tags found
No related merge requests found
<%= osuny_panel Communication::Website::Connection.model_name.human(count: 2) do %>
<ul class="list-unstyled">
<% about.websites.each do |website| %>
<li><%= link_to website, [:admin, website] %></li>
<% end %>
</ul>
<table class="table">
<thead>
<tr>
<th><%= Communication::Website.model_name.human %></th>
<th><%= Communication::Website::Connection.human_attribute_name('direct_source_type') %></th>
<th><%= Communication::Website::Connection.human_attribute_name('direct_source') %></th>
</tr>
</thead>
<tbody>
<% about.connections.each do |connection| %>
<tr>
<td><%= link_to connection.website, [:admin, connection.website] %></td>
<td><%= connection.direct_source_type %><%= connection.direct_source_type.constantize.model_name.human unless connection.direct_source_type.nil? %></td>
<td><%= render 'admin/communication/websites/connections/direct_source', connection: connection %></td>
</tr>
<% end %>
</tbody>
</table>
<% end if about.websites.any? %>
\ No newline at end of file
<%
source = connection.direct_source
source_name = source.to_s
begin
case connection.direct_source_type
when 'Communication::Website::Page'
source_link = admin_communication_website_page_path(website_id: source.website.id, id: source.id, lang: current_language)
when 'Communication::Website::Post'
source_link = admin_communication_website_post_path(website_id: source.website.id, id: source.id, lang: current_language)
else
source_link = url_for [:admin, source]
end
rescue
end
%>
<%= link_to_if source_link, source_name, source_link %>
<%
object = connection.indirect_object
object_name = object.to_s
object_name = object.id if object.is_a?(ActiveStorage::Blob)
begin
object_link = url_for [:admin, object]
rescue
end
%>
<%= link_to_if object_link, object_name, object_link %>
\ No newline at end of file
......@@ -10,30 +10,15 @@
</thead>
<tbody>
<% connections.each do |connection| %>
<%
object = connection.indirect_object
object_name = object.to_s
object_name = object.id if object.is_a?(ActiveStorage::Blob)
begin
object_link = url_for [:admin, object]
rescue
end
source = connection.direct_source
source_name = source.to_s
begin
source_link = url_for [:admin, source]
rescue
end
%>
<tr>
<td><%= link_to connection, [:admin, connection] %></td>
<td>
<%= link_to_if object_link, object_name, object_link %><br>
<span class="small"><%= connection.indirect_object_type %></span>
<%= render 'admin/communication/websites/connections/indirect_object', connection: connection %>
<br><span class="small"><%= connection.indirect_object_type %></span>
</td>
<td>
<%= link_to_if source_link, source_name, source_link %><br>
<span class="small"><%= connection.direct_source_type %></span>
<%= render 'admin/communication/websites/connections/direct_source', connection: connection %>
<br><span class="small"><%= connection.direct_source_type %></span>
</td>
<td><%= l connection.updated_at %></td>
</tr>
......
......@@ -82,6 +82,8 @@
<% end %>
<%= render 'admin/communication/blocks/list', about: @organization %>
<%= render 'admin/application/connections/list', about: @organization %>
</div>
<div class="col-md-4">
......@@ -118,8 +120,6 @@
<% end if @organization.logo.attached? || @organization.logo_on_dark_background.attached? %>
<%= render 'admin/application/meta_description/show', about: @organization %>
<%= render 'admin/application/connections/list', about: @organization %>
</div>
</div>
......
......@@ -31,6 +31,8 @@ action += link_to t('university.manage_experiences'),
<%= render 'admin/university/people/experiences/list', experiences: @person.experiences.ordered %>
<% end %>
<%= render 'admin/application/connections/list', about: @person %>
<% content_for :action_bar_left do %>
<%= destroy_link @person %>
<%= static_link static_admin_university_person_path(@person) %>
......
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