Merge with master
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div class="admin-sidebar" data-equalizer-watch>
|
||||
<ul id="admin_menu" data-accordion-menu>
|
||||
<ul id="admin_menu" data-accordion-menu data-multi-open="false">
|
||||
|
||||
<li class="section-title">
|
||||
<a href="#">
|
||||
@@ -60,12 +60,12 @@
|
||||
<span class="icon-checkmark-circle"></span>
|
||||
<strong><%= t("admin.menu.title_polls") %></strong>
|
||||
</a>
|
||||
<ul id="polls_menu" <%= "class=is-active" if menu_polls? && controller.class.parent == Admin::Poll::QuestionsController %>>
|
||||
<ul id="polls_menu" <%= "class=is-active" if menu_polls? && controller.class.parent == Admin::Poll %>>
|
||||
<li <%= "class=active" if ["polls", "officer_assignments", "booth_assignments", "recounts", "results"].include? controller_name %>>
|
||||
<%= link_to t('admin.menu.polls'), admin_polls_path %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=active" if controller_name == "questions" && controller.class.parent == Admin::Poll::QuestionsController %>>
|
||||
<li <%= "class=active" if current_page?(admin_questions_path) %>>
|
||||
<%= link_to t("admin.menu.poll_questions"), admin_questions_path %>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -1,99 +1,9 @@
|
||||
<%= link_to admin_settings_path, class: "button float-right" do %>
|
||||
<span class="icon-settings"></span>
|
||||
<%= t("admin.menu.settings") %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to admin_stats_path, class: "button float-right" do %>
|
||||
<span class="icon-stats"></span>
|
||||
<%= t("admin.menu.stats") %>
|
||||
<% end %>
|
||||
|
||||
<h2 class="inline-block"><%= t("admin.dashboard.index.title") %></h2>
|
||||
|
||||
<p>Desde aquí puedes administrar el sistema, a través de las siguientes acciones:</p>
|
||||
|
||||
<div class="small-12 medium-9">
|
||||
<ul class="accordion" data-accordion data-multi-expand="true" data-allow-all-closed="true">
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Temas de debate</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>Los temas (también llamadas tags, o etiquetas) de debate son palabras que definen los usuarios al crear debates, para catalogarlos (ej: sanidad, movilidad, arganzuela, ...). Aquí se pueden eliminar temas inapropiados, o <strong>marcarlos para ser propuestos al crear debates</strong> (cada usuario puede definir los que quiera, pero se le sugieren algunos que nos parecen útiles como catalogación por defecto; aquí se puede cambiar cuáles se sugieren)</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Propuestas/Debates/Comentarios ocultos</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>Cuando un moderador o un administrador oculta una Propuesta/Debate/Comentario aparecerá en esta lista. De esta forma los administradores pueden revisar que se ha ocultado el elemento adecuado.</p>
|
||||
|
||||
<ul>
|
||||
<li>Al pulsar <strong>Confirmar</strong> se acepta el que se haya ocultado, se considera que se ha hecho correctamente.</li>
|
||||
<li>Al pulsar <strong>Volver a mostrar</strong> se revierte la acción de ocultar y vuelve a ser una Propuesta/Debate/Comentario visible, en el caso de que se considere
|
||||
que ha sido una acción errónea el haberlo ocultado.</li>
|
||||
</ul>
|
||||
|
||||
<p>Para facilitar la gestión, arriba encontramos un <strong>filtro</strong> con las secciones: "pendientes" (los elementos sobre los que todavía no se ha pulsado "confirmar" o "volver a mostrar", que deberían ser revisados todavía), "confirmados" y "todos".</p>
|
||||
|
||||
<p><em>Es recomendable revisar regularmente la sección "pendientes".</em></p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Usuarios bloqueados</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>Cuando un moderador o un administrador bloquea a un usuario aparecerá en esta lista. Al <strong>bloquear a un usuario, éste deja de poder utilizarlo para ninguna acción de la web</strong>. Los administradores pueden desbloquearlos pulsando el botón al lado del nombre del usuario en la lista.</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Organizaciones</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>En la web hay dos tipos de usuarios: individuales y organizaciones. Cualquier persona puede crear usuarios de un tipo o de otro en la propia web. Los usuarios de organizaciones pueden ser verificados por parte de los administradores, confirmando que quien gestiona el usuario efectivamente representa a esa organización. Una vez se haya realizado el proceso de verificación, por el proceso externo a la web que se haya definido para ello, se pulsa el botón <strong>"Verificar"</strong> para confimarlo; lo que hará que al lado del nombre de la organización aparezca una etiqueta señalando que es una organización verificada.</p>
|
||||
|
||||
<p>En caso de que el proceso de verificación haya sido negativo, se pulsa el botón <strong>"Rechazar"</strong>. Para editar alguno de los datos de la organización, se pulsa el botón <strong>"Editar"</strong>.</p>
|
||||
|
||||
<p>En caso de que el proceso de verificación haya sido negativo, se pulsa el botón <strong>"Rechazar"</strong>. Para editar alguno de los datos de la organización, se pulsa el botón <strong>"Editar"</strong>.</p>
|
||||
|
||||
<p>Las organizaciones que no aparecen en la lista pueden ser encontradas para actuar sobre ellas por medio del buscador en la parte superior. Para facilitar la gestión, arriba
|
||||
encontramos un <strong>filtro</strong> con las secciones: "pendientes" (las organizaciones que todavía no han sido verificadas o rechazadas), "verificadas", "rechazadas" y "todas".</p>
|
||||
<p><em>Es recomendable revisar regularmente la sección "pendientes".</em></p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Cargos Públicos</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>En la web, los usuarios individuales pueden ser usuarios normales, o cargos públicos. Estos últimos se diferencian de los primeros únicamente en que al lado de sus nombres aparece una <strong>etiqueta que les identifica</strong>, y cambia ligeramente el estilo de sus comentarios. Esto permite que los usuarios les identifiquen más fácilmente. Al lado de cada usuario vemos la identificación que aparece en su etiqueta, y <strong>su nivel</strong> (la manera que internamente usa la web para diferenciar entre un tipo de cargos y otros). Pulsando el botón <strong>"Editar"</strong> al lado del usuario, se puede modificar su información. Los cargos públicos que no aparecen en la lista pueden ser encontrados para actuar sobre ellos por medio del buscador en la parte superior.</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Moderadores</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>Mediante el buscador de la parte superior se pueden buscar usuarios, para activarlos o desactivarlos como moderadores de la web. Los moderadores al acceder a la web con su usuario ven en la parte superior una nueva sección llamada <strong>"Moderar"</strong></p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Actividad de moderadores</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>En esta sección se va guardando <strong>todas las acciones que realizan los moderadores o los administradores respecto a la moderación</strong>: ocultar/mostrar Propuestas/Debates/Comentarios y bloquear usuarios. En la columna <strong>"Acción"</strong> comprobamos si la acción corresponde con ocultar o con volver a mostrar (restaurar) elementos o con bloquear usuarios. En las demás columnas tenemos el tipo de elemento, el contenido del elemento y el moderador o administrador que ha realizado la acción. Esta sección permite que los administradores detecten comportamientos irregulares por parte de moderadores específicos y que por lo tanto puedan corregirlos.</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Configuración Global</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>Opciones generales de configuración del sistema.</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="accordion-item" data-accordion-item>
|
||||
<a href="#" class="accordion-title">Estadísticas</a>
|
||||
<div class="accordion-content" data-tab-content>
|
||||
<p>Estadísticas generales del sistema.</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="float-right">
|
||||
<%= link_to root_path do %>
|
||||
<%= t("admin.dashboard.index.back", org: setting['org_name']) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<h2 class="title inline-block"><%= t("admin.dashboard.index.title") %></h2>
|
||||
|
||||
<p><%= t("admin.dashboard.index.description", org: setting['org_name']) %></p>
|
||||
|
||||
@@ -45,25 +45,34 @@
|
||||
|
||||
<div class="tabs-panel" id="tab-recounts">
|
||||
<h3><%= t("admin.poll_booth_assignments.show.recounts_list") %></h3>
|
||||
|
||||
<table id="totals">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><%= t("admin.poll_booth_assignments.show.count_final") %></th>
|
||||
<th class="text-center"><%= t("admin.poll_booth_assignments.show.total_system") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center" id="total_final"><%= total_recounts_by_booth(@booth_assignment) || '-' %></td>
|
||||
<td class="text-center" id="total_system"><%= @booth_assignment.voters.count %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="recounts_list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("admin.poll_booth_assignments.show.date") %></th>
|
||||
<th class="text-center"><%= t("admin.poll_booth_assignments.show.count_final") %></th>
|
||||
<th class="text-center"><%= t("admin.poll_booth_assignments.show.count_by_system") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% (@poll.starts_at.to_date..@poll.ends_at.to_date).each do |voting_date| %>
|
||||
<% final_recount = final_recount_for_date(@booth_assignment.final_recounts, voting_date) %>
|
||||
<% system_count = @voters_by_date[voting_date].present? ? @voters_by_date[voting_date].size : 0 %>
|
||||
<tr id="recounting_<%= voting_date.strftime('%Y%m%d') %>">
|
||||
<td><%= l voting_date %></td>
|
||||
<% if final_recount.present? %>
|
||||
<td class="text-center <%= 'count-error' if final_recount.count != system_count %>" title="<%= final_recount.officer_assignment.officer.name %>"><%= final_recount.count %></td>
|
||||
<% else %>
|
||||
<td class="text-center" title=""> - </td>
|
||||
<% end %>
|
||||
<td class="text-center"><%= system_count %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -27,27 +27,24 @@
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<% final_officer_assignments = @officer_assignments.select{|oa| oa.final == true} %>
|
||||
<% if final_officer_assignments.any? %>
|
||||
<h3><%= t("admin.poll_officer_assignments.by_officer.final_recounts") %></h3>
|
||||
<table id="final_recount_list" class="fixed">
|
||||
<h3><%= t("admin.poll_officer_assignments.by_officer.total_recounts") %></h3>
|
||||
<table id="total_recount_list" class="fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("admin.poll_officer_assignments.by_officer.date") %></th>
|
||||
<th><%= t("admin.poll_officer_assignments.by_officer.booth") %></th>
|
||||
<th class="text-right"><%= t("admin.poll_officer_assignments.by_officer.final_recount") %></th>
|
||||
<th class="text-right"><%= t("admin.poll_officer_assignments.by_officer.total_recount") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% final_officer_assignments.each do |officer_assignment| %>
|
||||
<tr id="final_recount_<%= officer_assignment.date.to_date.strftime('%Y%m%d') %>">
|
||||
<% @officer_assignments.each do |officer_assignment| %>
|
||||
<tr id="total_recount_<%= officer_assignment.date.to_date.strftime('%Y%m%d') %>">
|
||||
<td><%= l(officer_assignment.date.to_date) %></td>
|
||||
<td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
|
||||
<td class="text-right">
|
||||
<% if officer_assignment.final_recounts.any? %>
|
||||
<%= officer_assignment.final_recounts.to_a.sum(&:count) %>
|
||||
<% if officer_assignment.total_results.any? %>
|
||||
<%= officer_assignment.total_results.to_a.sum(&:amount) %>
|
||||
<% else %>
|
||||
<span>-</span>
|
||||
<% end %>
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
ckeditor: { language: I18n.locale } %>
|
||||
</div>
|
||||
|
||||
<div class="documents small-12" data-max-documents="<%= Poll::Question.max_documents_allowed %>">
|
||||
<%= render 'documents/nested_documents', documentable: @question %>
|
||||
<div class="documents small-12">
|
||||
<%= render 'documents/nested_documents', documentable: @question, f: f %>
|
||||
</div>
|
||||
|
||||
<div class="small-12">
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
<table class="fixed margin">
|
||||
<thead>
|
||||
<th><%= t("admin.recounts.index.table_booth_name") %></th>
|
||||
<th class="text-center"><%= t("admin.recounts.index.table_final_recount") %></th>
|
||||
<th class="text-center"><%= t("admin.recounts.index.table_total_recount") %></th>
|
||||
<th class="text-center"><%= t("admin.recounts.index.table_system_count") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @booth_assignments.each do |booth_assignment| %>
|
||||
<% final_recount = booth_assignment_sum_final_recounts(booth_assignment) %>
|
||||
<% total_recounts = total_recounts_by_booth(booth_assignment) %>
|
||||
<% system_count = booth_assignment.voters.size %>
|
||||
<tr id="<%= dom_id(booth_assignment) %>_recounts" class="booth_recounts">
|
||||
<td>
|
||||
@@ -25,9 +25,9 @@
|
||||
<%= link_to booth_assignment.booth.name, admin_poll_booth_assignment_path(@poll, booth_assignment, anchor: 'tab-recounts') %>
|
||||
</strong>
|
||||
</td>
|
||||
<td class="text-center <%= 'count-error' if final_recount.to_i != system_count %>">
|
||||
<% if final_recount.present? %>
|
||||
<strong><%= final_recount %></strong>
|
||||
<td class="text-center <%= 'count-error' if total_recounts.to_i != system_count %>">
|
||||
<% if total_recounts.present? %>
|
||||
<strong><%= total_recounts %></strong>
|
||||
<% else %>
|
||||
<span>-</span>
|
||||
<% end %>
|
||||
|
||||
10
app/views/admin/shared/_admin_shortcuts.html.erb
Normal file
10
app/views/admin/shared/_admin_shortcuts.html.erb
Normal file
@@ -0,0 +1,10 @@
|
||||
<li>
|
||||
<%= link_to admin_stats_path, title: t("admin.menu.stats") do %>
|
||||
<span class="icon-stats"></span>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to admin_settings_path, title: t("admin.menu.settings") do %>
|
||||
<span class="icon-settings"></span>
|
||||
<% end %>
|
||||
</li>
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= form_for(@investment, url: form_url, method: :post) do |f| %>
|
||||
<%= form_for(@investment, url: form_url, method: :post, html: { multipart: true }) do |f| %>
|
||||
<%= render 'shared/errors', resource: @investment %>
|
||||
|
||||
<div class="row">
|
||||
@@ -21,8 +21,12 @@
|
||||
<%= f.text_field :external_url %>
|
||||
</div>
|
||||
|
||||
<div class="documents small-12 column" data-max-documents="<%= Budget::Investment.max_documents_allowed %>">
|
||||
<%= render 'documents/nested_documents', documentable: @investment %>
|
||||
<div class="images small-12 column">
|
||||
<%= render 'images/nested_image', imageable: @investment, f: f %>
|
||||
</div>
|
||||
|
||||
<div class="documents small-12 column">
|
||||
<%= render 'documents/nested_documents', documentable: @investment, f: f %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
@@ -49,10 +53,10 @@
|
||||
label: false,
|
||||
placeholder: t("budgets.investments.form.tags_placeholder"),
|
||||
aria: {describedby: "tags-list-help-text"},
|
||||
class: 'js-tag-list' %>
|
||||
class: 'js-tag-list tag-autocomplete',
|
||||
data: {js_url: suggest_tags_path} %>
|
||||
</div>
|
||||
|
||||
|
||||
<% unless current_user.manager? %>
|
||||
|
||||
<div class="small-12 column">
|
||||
|
||||
@@ -2,13 +2,21 @@
|
||||
<div class="panel">
|
||||
<div class="row">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<div class="small-12 medium-3 large-2 column">
|
||||
<% if investment.image.present? %>
|
||||
<%= image_tag investment.image_url(:thumb), alt: investment.image.title %>
|
||||
<% else %>
|
||||
<div class="no-image"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 large-7 column">
|
||||
<div class="budget-investment-content">
|
||||
|
||||
<% cache [locale_and_user_status(investment), 'index', investment, investment.author] do %>
|
||||
<h3><%= link_to investment.title, namespaced_budget_investment_path(investment) %></h3>
|
||||
<p class="investment-project-info">
|
||||
|
||||
<p class="investment-project-info">
|
||||
<%= l investment.created_at.to_date %>
|
||||
|
||||
<% if investment.author.hidden? || investment.author.erased? %>
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= back_link_to budget_investments_path(investment.budget, heading_id: investment.heading) %>
|
||||
|
||||
<% if can?(:create, @document) && investment.documents.size < Budget::Investment.max_documents_allowed %>
|
||||
<%= link_to t("documents.upload_document"),
|
||||
new_document_path(documentable_id:investment, documentable_type: investment.class.name, from: request.url),
|
||||
<% if can_destroy_image?(investment) %>
|
||||
<%= link_to t("images.remove_image"),
|
||||
image_path(investment.image, from: request.url),
|
||||
method: :delete,
|
||||
class: 'button hollow float-right' %>
|
||||
<% end %>
|
||||
|
||||
<h1><%= investment.title %></h1>
|
||||
|
||||
<div class="budget-investment-info">
|
||||
<%= render '/shared/author_info', resource: investment %>
|
||||
|
||||
@@ -20,7 +20,11 @@
|
||||
<span class="bullet"> • </span>
|
||||
<%= investment.heading.name %>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<%= render_image(investment.image, :large, true) if investment.image.present? %>
|
||||
|
||||
<p id="investment_code">
|
||||
<%= t("budgets.investments.show.code_html", code: investment.id) %>
|
||||
</p>
|
||||
@@ -116,6 +120,7 @@
|
||||
<%= render partial: 'shared/social_share', locals: {
|
||||
share_title: t("budgets.investments.show.share"),
|
||||
title: investment.title,
|
||||
image_url: image_absolute_url(investment.image, :thumb),
|
||||
url: budget_investment_url(budget_id: investment.budget_id, id: investment.id)
|
||||
} %>
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
<div class="comment-info">
|
||||
|
||||
<% if comment.as_administrator? %>
|
||||
<span class="user-name"><%= t("comments.comment.admin") %> #<%= comment.administrator_id%></span>
|
||||
<span class="user-name"><%= t("comments.comment.admin") %> #<%= comment.administrator_id %></span>
|
||||
<% elsif comment.as_moderator? %>
|
||||
<span class="user-name"><%= t("comments.comment.moderator") %> #<%= comment.moderator_id%></span>
|
||||
<span class="user-name"><%= t("comments.comment.moderator") %> #<%= comment.moderator_id %></span>
|
||||
<% else %>
|
||||
|
||||
<% if comment.user.hidden? || comment.user.erased? %>
|
||||
@@ -72,7 +72,7 @@
|
||||
</div>
|
||||
|
||||
<% if comment.children.size > 0 %>
|
||||
<%= link_to "#{dom_id(comment)}", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %>
|
||||
<%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %>
|
||||
<span class="show-for-sr js-child-toggle" style="display: none;"><%= t("shared.show") %></span>
|
||||
<span class="show-for-sr js-child-toggle"><%= t("shared.hide") %></span>
|
||||
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span> <%= t("comments.comment.responses", count: comment.children.size) %>
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
<%= f.text_field :tag_list, value: @debate.tag_list.to_s,
|
||||
label: false,
|
||||
placeholder: t("debates.form.tags_placeholder"),
|
||||
aria: {describedby: "tag-list-help-text"} %>
|
||||
aria: {describedby: "tag-list-help-text"},
|
||||
data: {js_url: suggest_tags_path},
|
||||
class: 'tag-autocomplete'%>
|
||||
</div>
|
||||
<div class="small-12 column">
|
||||
<% if @debate.new_record? %>
|
||||
|
||||
0
app/views/direct_uploads/_attachment.html.erb
Normal file
0
app/views/direct_uploads/_attachment.html.erb
Normal file
31
app/views/documents/_document_fields.html.erb
Normal file
31
app/views/documents/_document_fields.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<div id="<%= dom_id(f.object) %>" class="document direct-upload document-fields nested-fields">
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.hidden_field :user_id, value: current_user.id %>
|
||||
<%= f.hidden_field :cached_attachment %>
|
||||
|
||||
<div class="small-12 column title">
|
||||
<%= f.text_field :title, placeholder: t("documents.form.title_placeholder") %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column attachment-actions">
|
||||
<div class="small-9 column action-add attachment-errors document-attachment">
|
||||
<%= render_attachment(f, f.object) %>
|
||||
</div>
|
||||
<div class="small-3 column action-remove text-right">
|
||||
<%= render_destroy_document_link(f, f.object) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-6 column">
|
||||
<p class="file-name">
|
||||
<%= document_attachment_file_name(f.object) %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<div class="progress-bar-placeholder"><div class="loading-bar"></div></div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
@@ -1,6 +1,6 @@
|
||||
<% if documents.any? %>
|
||||
|
||||
<% if documents.size == max_documents_allowed && can?(:create, Document) %>
|
||||
<% if documents.size == max_documents_allowed && can?(:destroy, Document) %>
|
||||
<div class="row documents-list">
|
||||
<div class="small-12 column">
|
||||
<div class="callout warning text-center">
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<%= form_for @document,
|
||||
url: documents_path(
|
||||
documentable_type: @document.documentable_type,
|
||||
documentable_id: @document.documentable_id,
|
||||
from: params[:from]
|
||||
),
|
||||
html: { multipart: true, class: "documentable"},
|
||||
data: { direct_upload_url: upload_documents_url(documentable_type: @document.documentable_type, documentable_id: @document.documentable_id) } do |f| %>
|
||||
|
||||
<%= render 'shared/errors', resource: @document %>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<%= render 'plain_fields', document: @document %>
|
||||
|
||||
<div class="actions small-12 medium-6 large-4 end column">
|
||||
<%= f.submit(t("documents.form.submit_button"), class: "button expanded") %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,22 +1,26 @@
|
||||
<div class="documents-list">
|
||||
<%= label_tag :documents, t("documents.form.title") %>
|
||||
<%= f.label :documents, t("documents.form.title") %>
|
||||
<p class="help-text"><%= documentables_note(documentable) %></p>
|
||||
|
||||
<% documentable.documents.each_with_index do |document, index| %>
|
||||
<%= render 'documents/nested_fields', document: document, index: index, documentable: documentable %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="nested-documents" data-max-documents-allowed="<%= documentable.class.max_documents_allowed%>">
|
||||
<%= f.fields_for :documents do |documents_builder| %>
|
||||
<%= render 'documents/document_fields', f: documents_builder %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% unless max_documents_allowed?(documentable) %>
|
||||
<%= link_to t("documents.form.add_new_document"),
|
||||
new_nested_documents_path(documentable_type: documentable.class.name, index: documentable.documents.size),
|
||||
remote: true,
|
||||
id: "new_document_link",
|
||||
class: "button hollow" %>
|
||||
<% end %>
|
||||
<%= link_to_add_association t('documents.form.add_new_document'), f, :documents,
|
||||
partial: "documents/document_fields",
|
||||
id: "new_document_link",
|
||||
class: "button hollow #{"hide" if documentable.documents.count >= documentable.class.max_documents_allowed}",
|
||||
data: {
|
||||
association_insertion_node: "#nested-documents",
|
||||
association_insertion_method: "append"
|
||||
} %>
|
||||
|
||||
<div class="max-documents-notice callout warning text-center <%= "hide" unless max_documents_allowed?(documentable) %>">
|
||||
<%= t "documents.max_documents_allowed_reached_html" %>
|
||||
</div>
|
||||
<div id="max-documents-notice" class="max-documents-notice callout warning text-center <%= "hide" unless max_documents_allowed?(documentable) %>">
|
||||
<%= t "documents.max_documents_allowed_reached_html" %>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr>
|
||||
|
||||
</div>
|
||||
@@ -1,31 +0,0 @@
|
||||
<div id="<%= document_nested_field_wrapper_id(index) %>" class="document">
|
||||
<%= hidden_field_tag :id,
|
||||
document.id,
|
||||
name: document_nested_field_name(document, index, :id),
|
||||
id: document_nested_field_id(document, index, :id) if document.persisted? %>
|
||||
<%= hidden_field_tag :user_id,
|
||||
current_user.id,
|
||||
name: document_nested_field_name(document, index, :user_id),
|
||||
id: document_nested_field_id(document, index, :user_id) %>
|
||||
<%= hidden_field_tag :cached_attachment,
|
||||
document.cached_attachment,
|
||||
name: document_nested_field_name(document, index, :cached_attachment),
|
||||
id: document_nested_field_id(document, index, :cached_attachment) %>
|
||||
|
||||
<%= label_tag :title, t("activerecord.attributes.document.title") %>
|
||||
<%= text_field_tag :title,
|
||||
document.title,
|
||||
name: document_nested_field_name(document, index, :title),
|
||||
id: document_nested_field_id(document, index, :title),
|
||||
class: "document-title" %>
|
||||
<% if document.errors[:title].any? %>
|
||||
<small class="error"><%= document.errors[:title].join(", ") %></small>
|
||||
<% end %>
|
||||
|
||||
<%= render_attachment(document, index) %>
|
||||
|
||||
<%= render_destroy_document_link(document, index) %>
|
||||
<p class="file-name"><%= document_attachment_file_name(document) %></p>
|
||||
<div class="progress-bar-placeholder"><div class="loading-bar"></div></div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -1,50 +0,0 @@
|
||||
<div id="plain_document_fields" class="document">
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= label_tag :document_title, t("activerecord.attributes.document.title") %>
|
||||
<%= text_field_tag :document_title, document.title, name: "document[title]", class: "document-title" %>
|
||||
<% if document.errors.has_key?(:title) %>
|
||||
<small class="error"><%= document.errors[:title].join(", ") %></small>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= hidden_field_tag :cached_attachment, document.cached_attachment, name: "document[cached_attachment]" %>
|
||||
<%= file_field_tag :attachment,
|
||||
accept: accepted_content_types_extensions(document.documentable.class),
|
||||
label: false,
|
||||
class: 'document_ajax_attachment',
|
||||
data: {
|
||||
url: upload_documents_url(documentable_type: document.documentable_type, documentable_id: document.documentable_id),
|
||||
cached_attachment_input_field: "document_cached_attachment",
|
||||
multiple: false,
|
||||
nested_document: false
|
||||
},
|
||||
id: "document_attachment",
|
||||
name: "document[attachment]" %>
|
||||
|
||||
<% if document.cached_attachment.blank? %>
|
||||
<%= label_tag :document_attachment, t("documents.form.attachment_label"), class: 'button hollow' %>
|
||||
<% else %>
|
||||
<%= link_to t('documents.form.delete_button'),
|
||||
destroy_upload_documents_path(path: document.cached_attachment,
|
||||
nested_document: false,
|
||||
documentable_type: document.documentable_type,
|
||||
documentable_id: document.documentable_id),
|
||||
method: :delete,
|
||||
remote: true,
|
||||
class: "delete float-right" %>
|
||||
<% end %>
|
||||
|
||||
<% if document.errors.has_key?(:attachment) %>
|
||||
<div class="small-12 column source-option-file">
|
||||
<div class="attachment-errors">
|
||||
<small class="error"><%= errors_on_attachment(document) %></small>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<p class="file-name"><%= document_attachment_file_name(document) %></p>
|
||||
<div class="progress-bar-placeholder"><div class="loading-bar"></div></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -1,17 +1 @@
|
||||
<% if params[:nested_document] == "true" %>
|
||||
|
||||
App.Documentable.destroyNestedDocument("<%= document_nested_field_wrapper_id(params[:index]) %>", "<%= j render('layouts/flash') %>")
|
||||
<% new_document_link = link_to t("documents.form.add_new_document"),
|
||||
new_nested_documents_path(documentable_type: @document.documentable_type, index: params[:index]),
|
||||
remote: true,
|
||||
id: "new_document_link",
|
||||
class: "button hollow" %>
|
||||
App.Documentable.updateNewDocumentButton("<%= j new_document_link %>")
|
||||
|
||||
<% else %>
|
||||
|
||||
App.Documentable.replacePlainDocument("plain_document_fields",
|
||||
"<%= j render('layouts/flash') %>",
|
||||
"<%= j render('plain_fields', document: @document) %>")
|
||||
|
||||
<% end %>
|
||||
App.Documentable.removeDocument("<%= dom_id(@document) %>")
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
<div class="document-form <%= documentable_class(@document.documentable) %> row">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= back_link_to params[:from] %>
|
||||
<h1><%= t("documents.new.title") %></h1>
|
||||
<%= render "documents/form", form_url: documents_url %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<span class="icon-documents float-right"></span>
|
||||
<h2><%= t("documents.recommendations_title") %></h2>
|
||||
<ul class="recommendations">
|
||||
<li>
|
||||
<%= t "documents.recommendation_one_html",
|
||||
max_documents_allowed: max_documents_allowed(@document.documentable) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= t "documents.recommendation_two_html",
|
||||
accepted_content_types: humanized_accepted_content_types(@document.documentable) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= t "documents.recommendation_three_html",
|
||||
max_file_size: max_file_size(@document.documentable) %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,9 +0,0 @@
|
||||
<%
|
||||
new_document_link = link_to t("documents.form.add_new_document"),
|
||||
new_nested_documents_path(documentable_type: params[:documentable_type], index: params[:index].to_i + 1),
|
||||
remote: true,
|
||||
id: "new_document_link",
|
||||
class: "button hollow"
|
||||
%>
|
||||
App.Documentable.new("<%= j render('documents/nested_fields', document: @document, index: params[:index]) %>")
|
||||
App.Documentable.updateNewDocumentButton("<%= j new_document_link %>")
|
||||
@@ -1,12 +0,0 @@
|
||||
<% if params[:nested_document] == "true" %>
|
||||
|
||||
App.Documentable.uploadNestedDocument("<%= document_nested_field_wrapper_id(params[:index]) %>",
|
||||
"<%= j render('documents/nested_fields', document: @document, index: params[:index]) %>",
|
||||
<%= @document.cached_attachment.present? %>)
|
||||
<% else %>
|
||||
|
||||
App.Documentable.uploadPlainDocument("plain_document_fields",
|
||||
"<%= j render('documents/plain_fields', document: @document) %>",
|
||||
<%= @document.cached_attachment.present? %>)
|
||||
|
||||
<% end %>
|
||||
18
app/views/images/_image.html.erb
Normal file
18
app/views/images/_image.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<div class="small-12 column text-center image-preview">
|
||||
<figure>
|
||||
<%= image_tag image.attachment.url(version),
|
||||
class: image_class(image),
|
||||
alt: image.title,
|
||||
title: image.title %>
|
||||
<% if show_caption %>
|
||||
<figcaption class="text-right">
|
||||
<em><%= image.title %></em>
|
||||
</figcaption>
|
||||
<% end %>
|
||||
</figure>
|
||||
|
||||
<% if show_caption %>
|
||||
<hr>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
31
app/views/images/_image_fields.html.erb
Normal file
31
app/views/images/_image_fields.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<div id="<%= dom_id(f.object) %>" class="image direct-upload nested-fields">
|
||||
<%= f.hidden_field :id %>
|
||||
<%= f.hidden_field :user_id, value: current_user.id %>
|
||||
<%= f.hidden_field :cached_attachment %>
|
||||
|
||||
<div class="small-12 column title">
|
||||
<%= f.text_field :title, placeholder: t("images.form.title_placeholder") %>
|
||||
</div>
|
||||
|
||||
<%= render_image(f.object, :thumb, false) if f.object.attachment.exists? %>
|
||||
|
||||
<div class="small-12 column attachment-actions">
|
||||
<div class="small-9 column action-add attachment-errors image-attachment">
|
||||
<%= render_image_attachment(f, imageable, f.object) %>
|
||||
</div>
|
||||
<div class="small-3 column action-remove text-right">
|
||||
<%= render_destroy_image_link(f, f.object) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-6 column">
|
||||
<p class="file-name">
|
||||
<%= image_attachment_file_name(f.object) %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<div class="progress-bar-placeholder"><div class="loading-bar"></div></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
25
app/views/images/_nested_image.html.erb
Normal file
25
app/views/images/_nested_image.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<div>
|
||||
<%= f.label :image, t("images.form.title") %>
|
||||
<p class="help-text"><%= imageables_note(imageable) %></p>
|
||||
|
||||
<div id="nested-image">
|
||||
<%= f.fields_for :image do |image_builder| %>
|
||||
<%= render 'images/image_fields', f: image_builder, imageable: imageable %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= link_to_add_association t('images.form.add_new_image'), f, :image,
|
||||
force_non_association_create: true,
|
||||
partial: "images/image_fields",
|
||||
id: "new_image_link",
|
||||
class: "button hollow #{"hide" if imageable.image.present?}",
|
||||
render_options: {
|
||||
locals: { imageable: imageable }
|
||||
},
|
||||
data: {
|
||||
association_insertion_node: "#nested-image",
|
||||
association_insertion_method: "append"
|
||||
} %>
|
||||
|
||||
<hr>
|
||||
1
app/views/images/destroy.js.erb
Normal file
1
app/views/images/destroy.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
App.Imageable.removeImage("<%= dom_id(@image) %>")
|
||||
@@ -2,34 +2,31 @@
|
||||
<div class="top-links">
|
||||
<div class="expanded row">
|
||||
<%= render 'shared/locale_switcher' %>
|
||||
<%= link_to t("admin.dashboard.index.back") + " " + setting['org_name'],
|
||||
root_path, class: "float-right back-web" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="expanded row">
|
||||
<div class="top-bar">
|
||||
|
||||
<%= link_to setting['org_name'], namespaced_root_path, class: "logo show-for-small-only" %>
|
||||
|
||||
<span data-responsive-toggle="responsive-menu" data-hide-for="medium" class="float-right">
|
||||
<span class="menu-icon dark" data-toggle></span>
|
||||
<%= t("application.menu")%>
|
||||
</span>
|
||||
|
||||
<div id="responsive-menu">
|
||||
|
||||
<div class="top-bar-title">
|
||||
<h1>
|
||||
<%= link_to namespaced_root_path, class: "hide-for-small-only" do %>
|
||||
<%= image_tag(image_path_for('logo_header.png'), class: 'hide-for-small-only float-left', size: '80x80', alt: t("layouts.header.logo")) %>
|
||||
<%= link_to namespaced_root_path do %>
|
||||
<%= setting['org_name'] %>
|
||||
| <%= namespaced_header_title %>
|
||||
<br><small><%= namespaced_header_title %></small>
|
||||
<% end %>
|
||||
</h1>
|
||||
</div>
|
||||
<div id="responsive-menu">
|
||||
|
||||
<div class="top-bar-right">
|
||||
<ul class="dropdown menu" data-dropdown-menu>
|
||||
<%= render "admin/shared/admin_shortcuts" %>
|
||||
<%= render "shared/admin_login_items" %>
|
||||
<%= render "devise/menu/login_items" %>
|
||||
</ul>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<div class="off-canvas-content" data-off-canvas-content>
|
||||
<%= render 'layouts/admin_header' %>
|
||||
|
||||
<div class="no-margin-top row no-max-width collapse" data-equalizer>
|
||||
<div class="no-margin-top row expanded collapse" data-equalizer>
|
||||
<div class="small-12 medium-3 column" data-equalizer-watch>
|
||||
|
||||
<div class="show-for-small-only">
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="no-margin-top row no-max-width collapse">
|
||||
<main class="no-margin-top row expanded collapse">
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= render "/management/menu" %>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<%= submit_tag t('.select_version_submit'), class: "button" %>
|
||||
<% end %>
|
||||
<% if @draft_version.changelog.present? %>
|
||||
<span><%= link_to t('.see_changes'), legislation_process_draft_version_changes_path(@process, @draft_version) %></span>
|
||||
<span><%= link_to t('.see_changes'), legislation_process_draft_version_changes_path(@process, @draft_version), class: "see-changes" %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<span><%= t('.updated_at', date: format_date(@draft_version.updated_at)) %></span>
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<li <%= "class=active" if ["final_recounts", "results"].include?(controller_name) || (controller_name == "polls" && action_name == "final") %>>
|
||||
<li <%= "class=active" if ["results"].include?(controller_name) || (controller_name == "polls" && action_name == "final") %>>
|
||||
<%= link_to final_officing_polls_path do %>
|
||||
<span class="icon-user"></span>
|
||||
<%= t("officing.menu.final_recounts") %>
|
||||
<%= t("officing.menu.total_recounts") %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
<span class="js-flag-actions">
|
||||
<span class="flag-content">
|
||||
<% if show_flag_action? proposal %>
|
||||
<a id="flag-expand-proposal-<%= proposal.id %>" data-toggle="flag-drop-proposal-<%= proposal.id %>" title="<%= t('shared.flag') %>">
|
||||
<span class="icon-flag flag-disable"></span>
|
||||
</a>
|
||||
<span class="dropdown-pane" id="flag-drop-proposal-<%= proposal.id %>" data-dropdown data-auto-focus="true">
|
||||
<%= link_to t('shared.flag'), flag_proposal_path(proposal), method: :put, remote: true, id: "flag-proposal-#{ proposal.id }" %>
|
||||
</span>
|
||||
<% end %>
|
||||
<span class="flag-content">
|
||||
<% if show_flag_action? proposal %>
|
||||
<a id="flag-expand-proposal-<%= proposal.id %>" data-toggle="flag-drop-proposal-<%= proposal.id %>" title="<%= t('shared.flag') %>">
|
||||
<span class="icon-flag flag-disable"></span>
|
||||
</a>
|
||||
<span class="dropdown-pane" id="flag-drop-proposal-<%= proposal.id %>" data-dropdown data-auto-focus="true">
|
||||
<%= link_to t('shared.flag'), flag_proposal_path(proposal), method: :put, remote: true, id: "flag-proposal-#{ proposal.id }" %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<% if show_unflag_action? proposal %>
|
||||
<a id="unflag-expand-proposal-<%= proposal.id %>" data-toggle="unflag-drop-proposal-<%= proposal.id %>" title="<%= t('shared.unflag') %>">
|
||||
<span class="icon-flag flag-active"></span>
|
||||
</a>
|
||||
<span class="dropdown-pane" id="unflag-drop-proposal-<%= proposal.id %>" data-dropdown data-auto-focus="true">
|
||||
<%= link_to t('shared.unflag'), unflag_proposal_path(proposal), method: :put, remote: true, id: "unflag-proposal-#{ proposal.id }" %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<% if show_unflag_action? proposal %>
|
||||
<a id="unflag-expand-proposal-<%= proposal.id %>" data-toggle="unflag-drop-proposal-<%= proposal.id %>" title="<%= t('shared.unflag') %>">
|
||||
<span class="icon-flag flag-active"></span>
|
||||
</a>
|
||||
<span class="dropdown-pane" id="unflag-drop-proposal-<%= proposal.id %>" data-dropdown data-auto-focus="true">
|
||||
<%= link_to t('shared.unflag'), unflag_proposal_path(proposal), method: :put, remote: true, id: "unflag-proposal-#{ proposal.id }" %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
|
||||
@@ -46,8 +46,12 @@
|
||||
<%= f.text_field :external_url, placeholder: t("proposals.form.proposal_external_url"), label: false %>
|
||||
</div>
|
||||
|
||||
<div class="documents small-12 column" data-max-documents="<%= Proposal.max_documents_allowed %>">
|
||||
<%= render 'documents/nested_documents', documentable: @proposal %>
|
||||
<div class="images small-12 column">
|
||||
<%= render 'images/nested_image', imageable: @proposal, f: f %>
|
||||
</div>
|
||||
|
||||
<div class="documents small-12 column">
|
||||
<%= render 'documents/nested_documents', documentable: @proposal, f: f %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
@@ -70,8 +74,9 @@
|
||||
<%= f.text_field :tag_list, value: @proposal.tag_list.to_s,
|
||||
label: false,
|
||||
placeholder: t("proposals.form.tags_placeholder"),
|
||||
class: 'js-tag-list',
|
||||
aria: {describedby: "tag-list-help-text"} %>
|
||||
class: 'js-tag-list tag-autocomplete',
|
||||
aria: {describedby: "tag-list-help-text"},
|
||||
data: {js_url: suggest_tags_path} %>
|
||||
</div>
|
||||
|
||||
<% if current_user.unverified? %>
|
||||
|
||||
@@ -5,7 +5,15 @@
|
||||
<div class="icon-successful"></div>
|
||||
<div class="row">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<div class="small-12 medium-3 large-2 column">
|
||||
<% if proposal.image.present? %>
|
||||
<%= image_tag proposal.image_url(:thumb), alt: proposal.image.title %>
|
||||
<% else %>
|
||||
<div class="no-image"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 large-7 column">
|
||||
<div class="proposal-content">
|
||||
<% cache [locale_and_user_status(proposal), 'index', proposal, proposal.author] do %>
|
||||
<h3><%= link_to proposal.title, namespaced_proposal_path(proposal) %></h3>
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
$("#<%= dom_id(@proposal) %> .js-flag-actions").html('<%= j render("proposals/flag_actions", proposal: @proposal) %>');
|
||||
App.Flaggable.update("<%= dom_id(@proposal) %>",
|
||||
"<%= j render("proposals/flag_actions", proposal: @proposal) %>")
|
||||
|
||||
@@ -41,11 +41,15 @@
|
||||
|
||||
<% if current_user %>
|
||||
<span class="bullet"> • </span>
|
||||
<%= render 'proposals/flag_actions', proposal: @proposal %>
|
||||
<span class="js-flag-actions">
|
||||
<%= render 'proposals/flag_actions', proposal: @proposal %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<%= render_image(@proposal.image, :large, true) if @proposal.image.present? %>
|
||||
|
||||
<br>
|
||||
<p>
|
||||
<%= t("proposals.show.code") %>
|
||||
@@ -104,17 +108,10 @@
|
||||
</div>
|
||||
|
||||
<aside class="small-12 medium-3 column">
|
||||
<% if can_create_document?(@document, @proposal) || author_of_proposal?(@proposal) || current_editable?(@proposal) %>
|
||||
<% if author_of_proposal?(@proposal) || current_editable?(@proposal) || can_destroy_image?(@proposal) %>
|
||||
<div class="sidebar-divider"></div>
|
||||
<h2><%= t("proposals.show.author") %></h2>
|
||||
<div class="show-actions-menu">
|
||||
<% if can_create_document?(@document, @proposal) %>
|
||||
<%= link_to new_document_path(documentable_id: @proposal, documentable_type: @proposal.class.name, from: request.url),
|
||||
class: 'button hollow expanded' do %>
|
||||
<span class="icon-document"></span>
|
||||
<%= t("documents.upload_document") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if author_of_proposal?(@proposal) %>
|
||||
<%= link_to new_proposal_notification_path(proposal_id: @proposal.id),
|
||||
@@ -124,12 +121,23 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if current_editable?(@proposal) %>
|
||||
<%= link_to edit_proposal_path(@proposal), class: 'edit-proposal button hollow expanded' do %>
|
||||
<span class="icon-edit"></span>
|
||||
<%= t("proposals.show.edit_proposal_link") %>
|
||||
<% if can_destroy_image?(@proposal) %>
|
||||
<%= link_to image_path(@proposal.image, from: request.url),
|
||||
method: :delete,
|
||||
class: 'button hollow expanded',
|
||||
data: { confirm: t('images.actions.destroy.confirm') } do %>
|
||||
<span class="icon-document"></span>
|
||||
<%= t("images.remove_image") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if current_editable?(@proposal) %>
|
||||
<%= link_to edit_proposal_path(@proposal), class: 'edit-proposal button hollow expanded' do %>
|
||||
<span class="icon-edit"></span>
|
||||
<%= t("proposals.show.edit_proposal_link") %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<% @valid_filters.each do |filter| %>
|
||||
<% if @current_filter == filter %>
|
||||
<li class="active"><%= t("#{i18n_namespace}.filters.#{filter}") %></li>
|
||||
<li class="active"><h2><%= t("#{i18n_namespace}.filters.#{filter}") %></h2></li>
|
||||
<% else %>
|
||||
<li><%= link_to t("#{i18n_namespace}.filters.#{filter}"),
|
||||
current_path_with_query_params(filter: filter, page: 1) %></li>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<% if local_assigns[:share_title].present? %>
|
||||
<div id="social-share" class="sidebar-divider"></div>
|
||||
<p class="sidebar-title"><%= share_title %></p>
|
||||
<div id="social-share" class="sidebar-divider"></div>
|
||||
<p class="sidebar-title"><%= share_title %></p>
|
||||
<% end %>
|
||||
<div class="social-share-full">
|
||||
<%= social_share_button_tag("#{title} #{setting['twitter_hashtag']}") %>
|
||||
<%= social_share_button_tag("#{title} #{setting['twitter_hashtag']}",
|
||||
:url => local_assigns[:url],
|
||||
:image => local_assigns[:image_url].present? ? local_assigns[:image_url] : '' ) %>
|
||||
<a href="whatsapp://send?text=<%= CGI.escape(title) %> <%= url %>"
|
||||
class="show-for-small-only" data-action="share/whatsapp/share">
|
||||
<span class="icon-whatsapp whatsapp"></span>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<li>
|
||||
<%= layout_menu_link_to t("layouts.header.poll_questions"),
|
||||
polls_path,
|
||||
controller_name == "polls" || controller_name == "questions",
|
||||
controller_name == "polls" || (controller_name == "questions" && controller.class.parent == Polls),
|
||||
accesskey: "3",
|
||||
title: t("shared.go_to_page") + t("layouts.header.poll_questions") %>
|
||||
</li>
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
<% carousel_size = calculate_carousel_size(recommended_debates, recommended_proposals, false) %>
|
||||
<%= render "recommended_carousel", recommendeds: recommended_proposals,
|
||||
key: "proposals",
|
||||
image_field: nil,
|
||||
image_version: nil,
|
||||
image_field: :attachment,
|
||||
image_version: :thumb,
|
||||
image_default: nil,
|
||||
carousel_size: carousel_size,
|
||||
btn_text_link: t("welcome.recommended.proposals.btn_text_link"),
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<li class="orbit-slide <%= active_class(index) %>" data-slide="<%= index %>" style="position: relative; <%= slide_display(index) %>" aria-live="polite">
|
||||
<div class="card">
|
||||
<%= render_image(recommended, image_field, image_version, image_default) %>
|
||||
<%= render_recommendation_image(recommended, image_default) %>
|
||||
<div class="card-section">
|
||||
<%= link_to recommended_path(recommended) do %>
|
||||
<h5 class="truncate-horizontal-text"><%= recommended.title %></h5>
|
||||
|
||||
Reference in New Issue
Block a user