<% add_decidim_page_title(t("responses", scope: "decidim.admin.titles")) %>

<%= t "decidim.admin.titles.responses" %> <%= link_to t("actions.new_response", scope: "decidim.admin"), new_response_path(current_question), class: "button tiny button--title" if allowed_to? :create, :response %> <%= link_to t("actions.response_groups", scope: "decidim.admin"), response_groups_path(current_question), class: "button tiny button--title" if allowed_to? :create, :response_group, question: current_question %>

<% if allowed_to? :create, :response_group, question: current_question %> <% end %> <% current_question.sorted_responses.each do |response| %> <% if allowed_to? :create, :response_group, question: current_question %> <% end %> <% end %>
<%= t("models.response.fields.title", scope: "decidim.admin") %><%= t("models.response.fields.response_group", scope: "decidim.admin") %><%= t("models.response.fields.created_at", scope: "decidim.admin") %>
<% if allowed_to? :update, :response, response: response %> <%= link_to translated_attribute(response.title), edit_response_path(current_question, response) %> <% else %> <%= translated_attribute(response.title) %> <% end %> <%= translated_attribute(response&.response_group&.title) %> <%= l response.created_at, format: :short %> <% if allowed_to? :update, :response, response: response %> <%= icon_link_to "pencil", edit_response_path(current_question, response), t("actions.configure", scope: "decidim.admin"), class: "action-icon--edit" %> <% else %> <% end %>