AyuntamientoMadrid/participacion

View on GitHub
app/views/proposals/_info.html.erb

Summary

Maintainability
Test Coverage
<div class="proposal-info">
  <%= render "/shared/author_info", resource: @proposal %>

  <span class="bullet">&nbsp;&bull;&nbsp;</span>
  <%= l @proposal.created_at.to_date %>

  <% unless @proposal.selected? %>
    <span class="bullet">&nbsp;&bull;&nbsp;</span>
    <%= render Shared::CommentsCountComponent.new(@proposal.comments_count, url: "#comments") %>
  <% end %>

  <% if current_user %>
    <span class="bullet">&nbsp;&bull;&nbsp;</span>
    <span class="js-flag-actions">
      <%= render "shared/flag_actions", flaggable: @proposal %>
    </span>
  <% end %>

</div>

<%= render_image(@proposal.image, :large, true) if @proposal.image.present? %>

<br>
<% unless @proposal.selected? %>
  <p>
    <%= t("proposals.show.code") %>
    <strong><%= @proposal.code %></strong>
  </p>
<% end %>

<blockquote><%= @proposal.summary %></blockquote>

<%= render Shared::EmbeddedVideoComponent.new(@proposal) %>

<%= auto_link_already_sanitized_html wysiwyg(@proposal.description) %>

<% if feature?(:map) && map_location_available?(@proposal.map_location) %>
  <div class="margin">
    <%= render_map(@proposal.map_location) %>
  </div>
<% end %>

<% if @proposal.video_url.present? %>
  <div class="video-link">
    <p>
      <span class="icon-video"></span>&nbsp;
      <strong><%= t("proposals.show.title_video_url") %></strong>
    </p>
    <%= sanitize_and_auto_link @proposal.video_url %>
  </div>
<% end %>

<% if @proposal.retired? %>
  <div id="retired_explanation" class="callout">
    <h2>
      <%= t("proposals.show.retired") %>:
      <%= t("proposals.retire_options.#{@proposal.retired_reason}") unless @proposal.retired_reason == "other" %>
    </h2>
    <%= simple_format sanitize_and_auto_link(@proposal.retired_explanation), {}, sanitize: false %>
  </div>
<% end %>

<% if feature?(:allow_attached_documents) %>
  <%= render Documents::DocumentsComponent.new(@proposal.documents) %>
<% end %>

<%= render "shared/tags", taggable: @proposal %>